/* Hallmark · redesign (audit-led) · genre: modern-minimal · tone: utilitarian
 * theme: custom (warm neutral paper · ink primary · rust accent for links only)
 * display: Schibsted Grotesk · body: Instrument Sans · mono: JetBrains Mono
 * removed tells: one-colour headline word, highlighter marks, pill-everything, uppercase
 *   accent eyebrows, colour gradient icons, side-stripe cards, accent glow wallpaper */
/* ==========================================================
   Mail7 desktop — warm neutral desk, quiet chrome, ink primary.
   Not Windows, not macOS, not Linux: its own chrome.
   ========================================================== */
:root {
  --font: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Schibsted Grotesk", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --accent: #c2410c;
  --accent-hover: #ad3a0b;
  --accent-press: #93310a;
  --accent-light: #c2410c;
  --accent-text: #9a3412;
  --accent-soft: #fbeee6;
  --accent-2: #2f6f5e;

  --text: #1d1a16;
  --text-2: #5a544b;
  --text-3: #8b8478;
  --text-on-accent: #ffffff;

  --paper: #ebe8e2;
  --mica: #f8f7f4;
  --layer: #ffffff;
  --card: #ffffff;
  --card-2: #f8f7f4;
  --subtle-hover: rgba(29, 26, 22, 0.06);
  --subtle-press: rgba(29, 26, 22, 0.04);
  --stroke: rgba(29, 26, 22, 0.12);
  --stroke-strong: rgba(29, 26, 22, 0.26);
  --divider: rgba(29, 26, 22, 0.1);
  --acrylic: rgba(255, 255, 255, 0.86);
  --flyout: #ffffff;
  --line: rgba(29, 26, 22, 0.16);
  --shade: 29, 26, 22;

  --success: #2f7a3a;
  --success-bg: #e2f0dc;
  --warning: #8a5a00;
  --warning-bg: #fbefc9;
  --danger: #b8321f;
  --danger-bg: #fbe0da;
  --info-bg: #f7f3ec;

  --r-ctrl: 6px;
  --r-card: 8px;
  --r-win: 10px;

  --shadow-win: 0 0 0 1px rgba(var(--shade), 0.06), 0 1px 1px rgba(var(--shade), 0.05), 0 14px 28px -10px rgba(var(--shade), 0.16), 0 44px 88px -28px rgba(var(--shade), 0.42);
  --shadow-win-back: 0 0 0 1px rgba(var(--shade), 0.03), 0 6px 18px -10px rgba(var(--shade), 0.18);
  --shadow-flyout: 0 0 0 1px rgba(var(--shade), 0.03), 0 12px 32px -8px rgba(var(--shade), 0.22);
  --shadow-bar: 0 1px 2px rgba(var(--shade), 0.05), 0 8px 24px -10px rgba(var(--shade), 0.18);
  --shadow-card: none;

  --bar-h: 44px;
  --taskbar-h: 74px;
  --win-x: 150px;
  --win-top: 72px;
  --win-bottom: 88px;
  --col: 980px;

  /* the desk: a pool of light top-left, a warm corner bottom-right */
  --paper: #e9e4da;
  --glow: #f8f4ec;
  --glow-2: #f0d9c6;
  --dot: rgba(var(--shade), 0.075);
  --desk-ink: var(--text);
  --desk-hover: rgba(var(--shade), 0.07);
  --wall: radial-gradient(1100px 680px at 10% -8%, var(--glow), transparent 62%),
    radial-gradient(900px 620px at 104% 108%, var(--glow-2), transparent 60%);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  color-scheme: light;
}

html[data-wall="2"] { --paper: #dde3e8; --glow: #f3f6f8; --glow-2: #cfdbe6; }
html[data-wall="3"] { --paper: #dfe5d7; --glow: #f3f6ee; --glow-2: #cbdcc2; }
/* night desk: the wallpaper goes dark, the windows stay paper */
html[data-wall="4"] { --paper: #1b1917; --glow: #2c2823; --glow-2: #4a2a18; --dot: rgba(255, 255, 255, 0.07); --desk-ink: #f3eee5; --desk-hover: rgba(255, 255, 255, 0.1); --acrylic: rgba(250, 248, 244, 0.97); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  background: var(--wall);
  background-color: var(--paper);
  transition: background-color 0.5s ease;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
.icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 20px; height: 20px; }
.icon svg { width: 100%; height: 100%; fill: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.menubar {
  position: fixed; z-index: 50; top: 12px; left: 12px; right: 12px; height: var(--bar-h);
  display: flex; align-items: center; gap: 2px; padding: 0 8px 0 10px;
  background: var(--acrylic); border: 1px solid var(--line); border-radius: var(--r-win); box-shadow: var(--shadow-bar);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.menubar .logo { border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.menubar .logo:hover { background: var(--subtle-hover); text-decoration: none; }
.menubar .logo .chev { display: none; }
.menu-item {
  height: 30px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--r-ctrl);
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 14px; color: var(--text);
}
a.menu-item:hover { text-decoration: none; }
.menu-item:hover { background: var(--subtle-hover); }
.menu-item[aria-expanded="true"], .menu-item[aria-current="page"] { background: var(--subtle-hover); }
.menu-item .icon { display: none; }
.menubar .spacer { flex: 1; }
.menubar .app-name { padding: 0 10px 0 6px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.menubar .cta.btn { background: transparent; color: var(--text); border-color: transparent; box-shadow: none; font-weight: 500; }
.menubar .cta.btn:hover { background: var(--subtle-hover); opacity: 1; }
.menu-item { font-weight: 400; }
.bar-icon { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer; }
.bar-icon:hover { background: var(--subtle-hover); }
.bar-icon .icon { width: 20px; height: 20px; }

/* menus */
.flyout {
  position: fixed; z-index: 80; min-width: 240px; padding: 6px;
  background: var(--flyout); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-flyout);
  opacity: 0; transform: translateY(-4px) scale(0.97); transform-origin: top left; pointer-events: none; transition: opacity 0.12s ease, transform 0.18s var(--ease-out);
}
.flyout.open { opacity: 1; transform: none; pointer-events: auto; }
.flyout .fi {
  display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 6px 10px; border-radius: var(--r-ctrl); line-height: 20px;
  color: var(--text); font-size: 14px; white-space: nowrap; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer;
}
.flyout .fi:hover, .flyout .fi:focus-visible { background: var(--subtle-hover); text-decoration: none; outline: none; }
.flyout .fi > .icon { width: 18px; height: 18px; align-self: flex-start; margin-top: 1px; }
.flyout .fi .hint { margin-left: auto; color: var(--text-3); font-family: var(--mono); font-size: 11px; padding-left: 24px; }
.flyout .fi .desc { display: inline-block; color: var(--text-3); font-size: 12px; line-height: 16px; }
.flyout .sep { height: 0; border-top: 1px solid var(--divider); margin: 6px 4px; }
.flyout .fh { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px 10px 4px; }
.flyout.wide { min-width: 520px; }
.flyout.wide .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; }
.ctx { min-width: 220px; }

/* ---------- app icons: neutral tile, ink glyph ---------- */
.app-ic { width: var(--s); height: var(--s); border-radius: 22%; background: linear-gradient(180deg, var(--card), var(--card-2)); color: var(--text); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(var(--shade), 0.06); }
/* ponytail: !important beats the many ".x .icon { width }" rules that would otherwise size the inner glyph */
.app-ic > .icon { width: 58% !important; height: 58% !important; }

/* ---------- desktop icons ---------- */
.desk-icons { position: fixed; top: 0; bottom: var(--taskbar-h); width: 120px; z-index: 1; padding: 4px 0; }
.desk-icons.left { left: 0; }
.desk-icons.right { right: 0; }
.desk-icons > nav { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 76px 4px 0; }
.desk-icon { width: 96px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--desk-ink); font-size: 12px; line-height: 16px; text-align: center; border-radius: 12px; font-weight: 500; transition: background 0.15s ease; }
.desk-icon .app-ic { box-shadow: var(--shadow-bar); transition: transform 0.28s var(--ease-spring); }
.desk-icon:hover { text-decoration: none; }
.desk-icon:active .app-ic { transform: scale(0.92); transition-duration: 0.1s; }
.desk-icon.sel { background: var(--desk-hover); }
@media (hover: hover) and (pointer: fine) {
  .desk-icon:hover { background: var(--desk-hover); }
  .desk-icon:hover .app-ic { transform: translateY(-3px) scale(1.06); }
}

/* ---------- windows ---------- */
.window {
  position: fixed; z-index: 10; top: var(--win-top); bottom: var(--win-bottom); left: var(--win-x); right: var(--win-x);
  display: flex; flex-direction: column; background: var(--mica); border: 1px solid var(--line); border-radius: var(--r-win);
  box-shadow: var(--shadow-win-back); overflow: hidden; min-width: 380px; min-height: 260px; max-width: calc(100vw - 16px);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
/* depth: the front window is crisp and casts the long shadow; the others sit back under a thin veil */
.window.focused { box-shadow: var(--shadow-win); border-color: rgba(var(--shade), 0.24); }
.window::after { content: ""; position: absolute; inset: 0; z-index: 6; background: var(--paper); opacity: 0.3; pointer-events: none; transition: opacity 0.25s ease; }
.window.focused::after, body.overview .window::after { opacity: 0; }
.window.min { visibility: hidden; pointer-events: none; }
.window.closed { display: none; }
/* snapped frames are CSS, so they follow the screen when it resizes */
.window.max { left: 12px !important; top: 64px !important; width: calc(100vw - 24px) !important; height: calc(100vh - 144px) !important; }
.window.snap-l, .window.snap-r { top: 64px !important; width: calc(50vw - 18px) !important; height: calc(100vh - 144px) !important; }
.window.snap-l { left: 12px !important; }
.window.snap-r { left: calc(50vw + 6px) !important; }
.window.arranging { transition: left 0.32s var(--ease-out), top 0.32s var(--ease-out), width 0.32s var(--ease-out), height 0.32s var(--ease-out), transform 0.36s var(--ease-out), box-shadow 0.25s ease; }
.window.dragging { transition: none; user-select: none; -webkit-user-select: none; box-shadow: 0 0 0 1px rgba(var(--shade), 0.08), 0 30px 60px -18px rgba(var(--shade), 0.3), 0 70px 120px -30px rgba(var(--shade), 0.46); }
.wm-busy, .wm-busy * { user-select: none !important; -webkit-user-select: none !important; }
.wm-busy iframe { pointer-events: none; }
.desk-loading, .desk-loading a { cursor: progress; }

.titlebar { position: relative; height: 42px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; cursor: default; touch-action: none; user-select: none; -webkit-user-select: none; transition: opacity 0.25s ease; }
.titlebar > .app-ic { border: 0; background: none; box-shadow: none; width: 18px; height: 18px; transition: color 0.25s ease; }
.titlebar > .app-ic > .icon { width: 100% !important; height: 100% !important; }
.window:not(.focused) .titlebar > .app-ic { color: var(--text-3); }
.window:not(.focused) .wtitle { color: var(--text-3); }
.titlebar .wtitle { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.25s ease; }
.caption { display: flex; align-items: center; gap: 4px; }
.caption button { width: 30px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer; transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease; }
.caption button:hover { background: var(--subtle-hover); color: var(--text); }
.caption button:active { transform: scale(0.92); }
.caption button.close:hover { background: #d4351c; color: #fff; }
.caption .icon { width: 12px; height: 12px; }
.wbody { position: relative; flex: 1; min-height: 0; overflow: auto; background: var(--layer); border-top: 1px solid var(--divider); scroll-behavior: smooth; }
.wbody:focus { outline: none; }
.wbody::-webkit-scrollbar { width: 12px; }
.wbody::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 6px; border: 4px solid transparent; background-clip: padding-box; }
.wstatus { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 14px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--divider); }
.wstatus .ws-right { display: flex; gap: 16px; }

/* resize from any edge or corner */
.rz { position: absolute; z-index: 7; }
.rz[data-rz="n"], .rz[data-rz="s"] { left: 12px; right: 12px; height: 5px; cursor: ns-resize; }
.rz[data-rz="e"], .rz[data-rz="w"] { top: 12px; bottom: 12px; width: 4px; cursor: ew-resize; }
.rz[data-rz="n"] { top: 0; } .rz[data-rz="s"] { bottom: 0; } .rz[data-rz="e"] { right: 0; } .rz[data-rz="w"] { left: 0; }
.rz[data-rz="nw"], .rz[data-rz="ne"], .rz[data-rz="sw"], .rz[data-rz="se"] { width: 14px; height: 14px; }
.rz[data-rz="nw"] { top: 0; left: 0; cursor: nwse-resize; } .rz[data-rz="se"] { bottom: 0; right: 0; cursor: nwse-resize; }
.rz[data-rz="ne"] { top: 0; right: 0; cursor: nesw-resize; } .rz[data-rz="sw"] { bottom: 0; left: 0; cursor: nesw-resize; }
.window.max .rz, .window.snap-l .rz, .window.snap-r .rz { display: none; }

/* where a dragged window will land */
.snap-ghost { position: fixed; z-index: 9; border-radius: var(--r-win); border: 1.5px solid rgba(var(--shade), 0.3); background: rgba(255, 255, 255, 0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transform: scale(0.96); pointer-events: none; transition: opacity 0.16s ease, transform 0.22s var(--ease-out), left 0.22s var(--ease-out), top 0.22s var(--ease-out), width 0.22s var(--ease-out), height 0.22s var(--ease-out); left: 50vw; top: 64px; width: 0; height: calc(100vh - 144px); }
.snap-ghost.on { opacity: 1; transform: none; }
.snap-ghost.max { left: 12px; width: calc(100vw - 24px); }
.snap-ghost.snap-l { left: 12px; width: calc(50vw - 18px); }
.snap-ghost.snap-r { left: calc(50vw + 6px); width: calc(50vw - 18px); }

/* layout picker under the maximize button */
.snap-pop { position: fixed; z-index: 85; display: flex; gap: 6px; padding: 8px; background: var(--flyout); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-flyout); opacity: 0; transform: translateY(-4px) scale(0.96); transform-origin: top right; pointer-events: none; transition: opacity 0.12s ease, transform 0.18s var(--ease-out); }
.snap-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.snap-pop button { position: relative; width: 54px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--card-2); cursor: pointer; transition: border-color 0.12s ease, transform 0.12s ease; }
.snap-pop button::after { content: ""; position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--text-3); transition: background 0.12s ease; }
.snap-pop button[data-snap="snap-l"]::after { left: 3px; width: calc(50% - 4px); }
.snap-pop button[data-snap="snap-r"]::after { right: 3px; width: calc(50% - 4px); }
.snap-pop button[data-snap="max"]::after { left: 3px; right: 3px; }
.snap-pop button[data-snap="tile"]::after { left: 3px; width: calc(50% - 4px); box-shadow: 25px 0 0 var(--text-3); }
.snap-pop button:hover { border-color: var(--text); }
.snap-pop button:hover::after { background: var(--accent); }
.snap-pop button[data-snap="tile"]:hover::after { box-shadow: 25px 0 0 var(--accent); }
.snap-pop button:active { transform: scale(0.95); }

/* overview: every window at once, pick one */
.overview-veil { position: fixed; inset: 0; z-index: 8; background: rgba(var(--shade), 0.34); backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); opacity: 0; pointer-events: none; transition: opacity 0.28s ease; }
body.overview .overview-veil { opacity: 1; pointer-events: auto; }
body.overview .window { cursor: pointer; transform-origin: top left; box-shadow: var(--shadow-win); }
body.overview .window > * { pointer-events: none; }
body.overview .window:hover { outline: 3px solid var(--accent); outline-offset: 4px; }
body.overview .window.min { visibility: visible; }
body.overview .desk-icons { opacity: 0; pointer-events: none; }
.desk-icons { transition: opacity 0.25s ease; }

/* ---------- shelf (bottom) ---------- */
.taskbar {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: 12px; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none;
}
.tb-center, .tb-tray {
  pointer-events: auto; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 7px;
  background: var(--acrylic); border: 1px solid var(--line); border-radius: var(--r-win); box-shadow: var(--shadow-bar);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); min-width: 0;
}
.tb-btn { position: relative; flex: none; width: 42px; height: 42px; border: 0; background: transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); transition: background 0.15s ease; }
.tb-btn:hover { text-decoration: none; }
.tb-btn > .icon { transition: transform 0.3s var(--ease-spring); }
.tb-btn:active > .icon { transform: scale(0.9) !important; transition-duration: 0.1s; }
/* running: a dot. in front: the dot stretches into a rust bar */
.tb-btn::after { content: ""; position: absolute; bottom: 1px; left: 50%; width: 14px; height: 4px; margin-left: -7px; border-radius: 2px; background: var(--text); opacity: 0; transform: scaleX(0.28); transition: transform 0.3s var(--ease-spring), background 0.2s ease, opacity 0.2s ease; }
.tb-btn.running::after { opacity: 1; }
.tb-btn.active { background: rgba(var(--shade), 0.07); }
.tb-btn.active::after { background: var(--accent); transform: none; }
.tb-btn.launching > .icon { animation: dock-hop 0.55s var(--ease-out); }
@keyframes dock-hop { 30% { transform: translateY(-9px); } 60% { transform: translateY(0); } 78% { transform: translateY(-3px); } }
/* name tag above a shelf icon */
.tb-btn[aria-label]::before { content: attr(aria-label); position: absolute; bottom: calc(100% + 12px); left: 50%; padding: 4px 9px; border-radius: 7px; background: var(--text); color: var(--layer); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity 0.12s ease, transform 0.16s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .tb-btn:hover { background: var(--subtle-hover); }
  .tb-btn[data-app]:hover > .icon { transform: translateY(-4px) scale(1.14); }
  .tb-btn:hover::before { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.35s; }
}
.tb-btn.launcher { width: 42px; border-radius: 50%; margin-right: 2px; }
.tb-btn.launcher .icon { width: 30px; height: 30px; }
.tb-btn.launcher:hover, .tb-btn.launcher.open { background: var(--subtle-hover); }
.tb-search { flex: none; height: 38px; width: 180px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; margin: 0 6px 0 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text-3); font-size: 14px; cursor: text; }
.tb-search .icon { width: 18px; height: 18px; }
.tb-search kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.tray-btn { height: 42px; padding: 0 10px; border: 0; background: transparent; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.tray-btn:hover { background: var(--subtle-hover); }
.tray-btn:active { transform: scale(0.96); }
.tray-btn .icon { width: 18px; height: 18px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
.clock [data-clock-time] { font-size: 13px; font-weight: 600; color: var(--text); }
.clock [data-clock-date] { color: var(--text-2); }

/* launcher */
.start {
  position: fixed; z-index: 90; left: 12px; bottom: 82px; width: 620px; max-width: calc(100vw - 24px); max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: var(--flyout); border: 1px solid var(--line); border-radius: var(--r-win); box-shadow: var(--shadow-win);
  opacity: 0; transform: translateY(10px) scale(0.97); transform-origin: bottom left; pointer-events: none; transition: opacity 0.14s ease, transform 0.22s var(--ease-out);
}
.start.open { opacity: 1; transform: none; pointer-events: auto; }
.start-inner { padding: 20px 20px 12px; overflow: auto; }
.start-search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); }
.start-search:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.start-search input { flex: 1; border: 0; background: transparent; outline: none; font: inherit; font-size: 15px; color: var(--text); }
.start-search .icon { width: 18px; height: 18px; color: var(--text-2); }
.start-sec { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.start-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.start-app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 2px 10px; border-radius: 12px; color: var(--text); font-size: 12px; line-height: 15px; text-align: center; }
.start-app:hover { background: var(--subtle-hover); text-decoration: none; }
.start-app .app-ic { transition: transform 0.28s var(--ease-spring); }
.start-app:hover .app-ic { transform: scale(1.1); }
.start-app:active .app-ic { transform: scale(0.94); }
.start-reco { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.reco { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; color: var(--text); }
.reco:hover { background: var(--subtle-hover); text-decoration: none; }
.reco small { display: block; color: var(--text-3); font-size: 12px; }
.start-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--stroke-strong); }
.user { display: flex; gap: 10px; align-items: center; padding: 4px 8px; border-radius: var(--r-ctrl); }
.user:hover { background: var(--subtle-hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-2); color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.start .empty { padding: 24px 6px; color: var(--text-2); }

/* toast (cookie notice) */
.toast {
  position: fixed; z-index: 70; right: 12px; bottom: 82px; width: 340px; max-width: calc(100vw - 24px); padding: 14px 16px 16px;
  background: var(--flyout); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-flyout);
  transform: translateX(calc(100% + 24px)); opacity: 0; transition: transform 0.4s var(--ease-out), opacity 0.25s ease;
}
.toast.show { transform: none; opacity: 1; }
.toast-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.toast-head .icon { width: 18px; height: 18px; }
.toast-head .x { margin-left: auto; width: 26px; height: 26px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); }
.toast-head .x:hover { background: var(--subtle-hover); }
.toast-head .x .icon { width: 12px; height: 12px; }
.toast h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.toast p { margin: 0 0 8px; color: var(--text-2); }
.toast .btn { width: 100%; margin-top: 8px; }

/* ==========================================================
   Page content building blocks
   ========================================================== */
.page { max-width: calc(var(--col) + 48px); margin: 0 auto; padding: 48px 24px 64px; }
.page.wide { max-width: 1200px; }
.page.flush { max-width: none; padding: 0; }
.section { margin-top: 56px; }
.section:first-child { margin-top: 0; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.hero.single { grid-template-columns: 1fr; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gap-lg { gap: 24px; }

.display { font-family: var(--font-display); font-size: 56px; line-height: 60px; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.title-lg { font-family: var(--font-display); font-size: 38px; line-height: 44px; font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.title { font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.subtitle { font-size: 18px; line-height: 26px; font-weight: 600; margin: 0; }
.body-strong { font-weight: 600; }
.body-lg { font-size: 17px; line-height: 27px; color: var(--text-2); margin: 0; }
.body { font-size: 14px; line-height: 20px; margin: 0; }
.caption { font-size: 12px; line-height: 16px; color: var(--text-2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.eyebrow { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); }
.hl { color: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mark { color: var(--text); font-weight: 500; }
.mono { font-family: var(--mono); }
p { margin: 0 0 12px; }

.card { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow-card); }
.card.tight { padding: 12px 16px; }
.card.flat { box-shadow: none; background: var(--card-2); }
a.card { display: block; color: var(--text); transition: box-shadow 0.2s ease, border-color 0.15s, transform 0.25s var(--ease-out); }
a.card:hover, .card.hover:hover { text-decoration: none; border-color: var(--text-3); transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(var(--shade), 0.35); }
.card h3, .card h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; line-height: 20px; }
.card-head { display: flex; gap: 12px; align-items: flex-start; }
.card-head .icon { width: 32px; height: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 5px 12px 6px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; line-height: 20px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.05); transition: background 0.12s, border-color 0.12s, opacity 0.12s, transform 0.14s var(--ease-out); white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--card-2); border-color: var(--stroke-strong); text-decoration: none; }
.btn:active { background: var(--subtle-hover); transform: scale(0.97); }
.btn.accent { background: var(--text); color: var(--layer); border-color: var(--text); }
.btn.accent:hover { background: var(--text); border-color: var(--text); opacity: 0.86; }
.btn.accent:active { background: var(--text); opacity: 0.76; }
.btn.subtle { background: transparent; border-color: transparent; box-shadow: none; }
.btn.subtle:hover { background: var(--subtle-hover); }
.btn.lg { min-height: 40px; padding: 9px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.btn.lg .icon { width: 18px; height: 18px; }
.btn.sm { min-height: 24px; padding: 2px 8px; font-size: 12px; }
.hyperlink { color: var(--accent-text); display: inline-flex; align-items: center; gap: 4px; }
.hyperlink .icon { width: 14px; height: 14px; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.grey { background: var(--subtle-hover); color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-ctrl); border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--text-3); text-decoration: none; }
.chip.on, .chip[aria-pressed="true"] { background: var(--text); color: var(--paper); border-color: var(--text); }
.chip .icon { width: 14px; height: 14px; }

.infobar { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-ctrl); border: 1px solid var(--stroke); background: var(--info-bg); }
.infobar .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.infobar.ok { background: var(--success-bg); } .infobar.ok .icon { color: var(--success); }
.infobar.warn { background: var(--warning-bg); } .infobar.warn .icon { color: var(--warning); }
.infobar.bad { background: var(--danger-bg); } .infobar.bad .icon { color: var(--danger); }

/* expander */
details.expander { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-card); }
details.expander + details.expander { margin-top: 4px; }
details.expander summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 52px; cursor: pointer; font-weight: 600; }
details.expander summary::-webkit-details-marker { display: none; }
details.expander summary:hover { background: var(--card-2); border-radius: var(--r-card); }
details.expander summary .chev { margin-left: auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-ctrl); transition: transform 0.25s var(--ease-out); }
details.expander[open] .exp-body { animation: fadein 0.25s var(--ease-out) both; }
details.expander summary .chev .icon { width: 12px; height: 12px; }
details.expander[open] summary .chev { transform: rotate(180deg); }
details.expander summary .icon.lead { width: 20px; height: 20px; }
details.expander .exp-body { padding: 12px 16px 16px 16px; border-top: 1px solid var(--divider); color: var(--text-2); }

/* settings-style list rows */
.list { display: flex; flex-direction: column; gap: 4px; }
.list-item { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 16px; background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-ctrl); color: var(--text); }
a.list-item:hover { background: var(--card-2); text-decoration: none; }
.list-item > .icon { width: 24px; height: 24px; }
.list-item .li-text { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14px; line-height: 20px; }
.list-item .li-desc { font-size: 12px; line-height: 16px; color: var(--text-2); }
.list-item .li-end { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.list-item .li-end > .icon { width: 12px; height: 12px; }

/* toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 11px; border: 1px solid var(--stroke-strong); background: transparent; position: relative; margin: 0; cursor: pointer; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: left 0.15s, background 0.15s; }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { left: 21px; background: var(--text-on-accent); }
.toggle .tlabel { min-width: 24px; font-size: 14px; }

/* slider */
input[type="range"].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 0; }
input[type="range"].slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 50%) 100% no-repeat, var(--stroke-strong); }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--card); border: 5px solid var(--card); box-shadow: 0 0 0 1px var(--stroke-strong), inset 0 0 0 6px var(--accent); }
input[type="range"].slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--stroke-strong); }
input[type="range"].slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"].slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 4px solid var(--card); box-shadow: 0 0 0 1px var(--stroke-strong); }

/* text inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; }
.textbox, .select, textarea.textbox {
  width: 100%; min-height: 32px; padding: 5px 11px 6px; font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.textbox:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.textbox { min-height: 96px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: inline-flex; align-items: center; gap: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.field .err { color: var(--danger); font-size: 12px; display: none; }
.field.invalid .err { display: block; }
.field.invalid .textbox { border-color: var(--danger); }

/* pivot / tabs */
.pivot { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.pivot::-webkit-scrollbar { display: none; }
.pivot [role="tab"] { position: relative; height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; border-radius: var(--r-ctrl) var(--r-ctrl) 0 0; display: inline-flex; align-items: center; gap: 8px; }
.pivot [role="tab"] .icon { width: 16px; height: 16px; }
.pivot [role="tab"]:hover { color: var(--text); background: var(--subtle-hover); }
.pivot [role="tab"][aria-selected="true"] { color: var(--text); font-weight: 600; }
.pivot [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); }
.pivot.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--card-2); }
.pivot.seg [role="tab"] { height: 30px; border-radius: var(--r-ctrl); }
.pivot.seg [role="tab"][aria-selected="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(var(--shade), 0.12); }
.pivot.seg [role="tab"][aria-selected="true"]::after { display: none; }
[role="tabpanel"][hidden] { display: none !important; }

/* the cookie notice (injected by Zaraz). Its "Cookie Policy" tab stayed on screen after a choice and sat on the shelf;
   it is hidden, and "Cookie settings" in the account menu clicks it instead. The first-visit notice sits above the shelf. */
.cc-revoke { display: none !important; }
html body div.cc-window.cc-floating[role="dialog"] { bottom: 82px !important; }
@media (max-width: 767px) { html body div.cc-window.cc-floating[role="dialog"] { bottom: 70px !important; left: 6px !important; right: 6px !important; max-width: none !important; } }
.tab-progress { height: 2px; background: var(--divider); position: relative; overflow: hidden; border-radius: 1px; }
.tab-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }

/* code / command box */
.cmd { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: var(--r-ctrl); background: var(--card-2); border: 1px solid var(--stroke); font-family: var(--mono); font-size: 13px; min-height: 40px; }
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; color: var(--text); }
.cmd code .k { color: var(--accent-2); } .cmd code .s { color: var(--accent-text); }
.cmd .btn { min-height: 30px; padding: 4px 8px; }

/* terminal block */
.terminal { border-radius: var(--r-card); overflow: hidden; background: #1b1a18; color: #e7e4de; font-family: var(--mono); font-size: 13px; line-height: 20px; border: 1px solid rgba(0, 0, 0, 0.2); box-shadow: var(--shadow-flyout); }
.terminal .t-tabs { display: flex; align-items: center; height: 36px; background: #2a2620; padding-left: 8px; gap: 4px; font-family: var(--font); font-size: 12px; color: #fff; }
.terminal .t-tab { display: inline-flex; align-items: center; gap: 8px; height: 30px; margin-top: 6px; padding: 0 12px; background: #1d1a16; border-radius: 8px 8px 0 0; }
.terminal .t-tab .icon { width: 14px; height: 14px; }
.terminal .t-caps { margin-left: auto; display: flex; height: 100%; }
.terminal .t-caps span { width: 40px; display: inline-flex; align-items: center; justify-content: center; }
.terminal .t-caps .icon { width: 12px; height: 12px; color: #fff; }
.terminal pre { margin: 0; padding: 14px 16px; white-space: pre-wrap; word-break: break-word; }
.terminal .p { color: #ff8c5c; } .terminal .c { color: #7cc8b2; } .terminal .y { color: #f2c14e; } .terminal .m { color: #e7a1c8; } .terminal .d { color: #857d70; } .terminal .b { color: #9db8e6; }
.caret { display: inline-block; width: 8px; height: 16px; background: #ff8c5c; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--stroke-strong); border-radius: var(--r-card); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--divider); vertical-align: top; }
table.table th { font-weight: 600; font-size: 12px; color: var(--text-2); background: var(--card-2); }
table.table tr:last-child td { border-bottom: 0; }
table.table tr:hover td { background: var(--subtle-press); }

/* progress */
.progress { height: 4px; border-radius: 2px; background: var(--stroke-strong); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.ring { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--stroke-strong); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* icon tiles & placeholders */
.tile { width: 48px; height: 48px; border-radius: 22%; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); border: 1px solid var(--line); flex: none; }
.tile .icon { width: 28px; height: 28px; }
.tile.sm { width: 36px; height: 36px; } .tile.sm .icon { width: 20px; height: 20px; }
.ph { border-radius: var(--r-card); background: linear-gradient(135deg, #f3e7de, #dcb59c 55%, #b5774f); position: relative; overflow: hidden; }
.ph::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 70% 30%, rgba(255, 255, 255, 0.55), transparent 70%); }
.ph.v2 { background: linear-gradient(135deg, #e6d9ff, #b394f0 55%, #6f45c9); }
.ph.v3 { background: linear-gradient(135deg, #d6f5e6, #86d7b0 55%, #2f9a6a); }
.ph.v4 { background: linear-gradient(135deg, #dbe4ee, #9fb3c8 55%, #5a7590); }
.ph.v5 { background: linear-gradient(135deg, #ffd9e1, #f497ad 55%, #c9456b); }
.ph.v6 { background: linear-gradient(135deg, #e0e0e0, #b5b5b5 55%, #7a7a7a); }
.logo-ph { height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.logo-ph i { width: 18px; height: 18px; border-radius: 5px; background: currentColor; opacity: 0.7; }
.logo-ph i.c { border-radius: 50%; } .logo-ph i.t { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }

hr.div { border: 0; border-top: 1px solid var(--divider); margin: 32px 0; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--stroke-strong); border-bottom-width: 2px; background: var(--card); }
.num-step { width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: var(--paper); font-family: var(--mono); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; }
.checklist li .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--success); }

/* app-like split (explorer / settings) */
.split { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100%; }
.navpane { padding: 12px 8px; border-right: 1px solid var(--divider); }
.navpane .nv { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--text); position: relative; font-size: 14px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
.navpane .nv:hover { background: var(--subtle-hover); text-decoration: none; }
.navpane .nv.on { background: var(--subtle-hover); font-weight: 600; }
.navpane .nv .icon { width: 18px; height: 18px; }
.navpane .nh { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 12px 12px 4px; }
.split-main { padding: 24px 32px 48px; min-width: 0; }
.cmdbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
.cmdbar .btn { min-height: 32px; }
.addr { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.addr .icon { width: 16px; height: 16px; }

/* charts (simple svg) */
.chart { width: 100%; height: auto; }
.chart .grid line { stroke: var(--divider); }
.bar-anim rect { transform-origin: bottom; transform-box: fill-box; animation: grow 0.8s cubic-bezier(0.1, 0.9, 0.2, 1) both; }
@keyframes grow { from { transform: scaleY(0); } }
.fade-in { animation: fadein 0.35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
[data-hidden="1"] { display: none !important; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1279px) {
  :root { --win-x: 120px; }
}
@media (max-width: 1023px) {
  :root { --win-x: 12px; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .display { font-size: 44px; line-height: 52px; }
  .title-lg { font-size: 30px; line-height: 38px; }
  .tb-search { width: 42px; padding: 0; justify-content: center; }
  .tb-search > :not(.icon) { display: none; }
  .menubar .logo .name { display: none; }
  .menu-item { padding: 0 8px; }
  .menubar .cta .long { display: none; }
  .split { grid-template-columns: 200px minmax(0, 1fr); }
  .flyout.wide { min-width: 0; width: 360px; }
  .flyout.wide .cols { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  :root { --win-x: 6px; --win-top: 58px; --win-bottom: 70px; }
  /* a phone has no room for icons beside a window, so they become the home screen: a grid you see when no window is open */
  .desk-icons { display: none; }
  body[data-page="desktop"] .desk-icons { display: block; position: fixed; left: 0; right: 0; bottom: auto; width: auto; padding: 0 12px; }
  body[data-page="desktop"] .desk-icons.left { top: 72px; }
  /* ponytail: assumes the left group fills two rows of three (six icons); change this offset if that list changes */
  body[data-page="desktop"] .desk-icons.right { top: 288px; }
  .desk-icons > nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 4px; padding: 0; justify-items: center; }
  .desk-icon { width: 100%; max-width: 112px; font-size: 13px; }
  .desk-icon .app-ic { --s: 56px; }
  /* bigger targets for thumbs; zoom means nothing when every window is full size */
  .caption button { width: 40px; height: 36px; }
  .caption [data-action="max"], .wstatus { display: none; }
  .btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
  .bar-icon { width: 40px; height: 40px; }
  .flyout .fi { min-height: 44px; }
  /* phones: one window at a time, always full size, whatever was dragged on a bigger screen */
  .window, .window.max, .window.snap-l, .window.snap-r { top: 58px !important; bottom: 70px !important; left: 6px !important; right: 6px !important; width: auto !important; height: auto !important; min-width: 0; min-height: 0; max-width: none; border-radius: 12px; transform: none !important; }
  .window:not(.focused) { display: none; }
  .rz, .desk-widget, [data-action="overview"] { display: none !important; }
  .tb-center { overflow-x: auto; scrollbar-width: none; }
  .tb-center::-webkit-scrollbar { display: none; }
  .titlebar { height: 38px; }
  .menubar { top: 6px; left: 6px; right: 6px; }
  .taskbar { left: 6px; right: 6px; bottom: 6px; height: 54px; gap: 6px; }
  .tb-center, .tb-tray { height: 54px; }
  .menubar .menu-item.top { display: none; }
  .menubar .logo .chev { display: inline-flex; width: 12px; height: 12px; }
  .menubar .logo .name { display: none; }
  .menubar .cta { padding: 4px 10px; font-size: 13px; }
  .page { padding: 32px 16px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .display { font-size: 36px; line-height: 44px; }
  .title-lg { font-size: 30px; line-height: 38px; }
  .title { font-size: 24px; line-height: 32px; }
  .hero { text-align: left; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .navpane { display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--divider); padding: 8px; }
  .navpane .nv { width: auto; flex: none; }
  .navpane .nh { display: none; }
  .split-main { padding: 20px 16px 40px; }
  .tb-tray .hide-sm { display: none; }
  .tb-pinned:not(.running) { display: none; }
  .start { left: 6px; right: 6px; width: auto; bottom: 70px; max-height: calc(100vh - 140px); }
  .start-inner { padding: 16px 12px 8px; }
  .start-grid { grid-template-columns: repeat(4, 1fr); }
  .start-reco { grid-template-columns: 1fr; }
  .start-foot { padding: 10px 16px; }
  .flyout { left: 6px !important; right: 6px; min-width: 0; max-height: calc(100vh - 120px); overflow: auto; }
  .flyout.wide { width: auto; }
  .toast { bottom: 70px; right: 6px; }
  .table-wrap table.table th, .table-wrap table.table td { padding: 8px 10px; }
  .wstatus .ws-right span + span { display: none; }
}
@media (max-width: 420px) {
  .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .display { font-size: 32px; line-height: 40px; }
  .menubar .bar-icon.hide-xs { display: none; }
}

[hidden] { display: none !important; }
.menubar .cta { gap: 0; }

.window[data-page="docs"] footer.wstatus { display: none; }

.window[data-page="docs"] h1 { font-size: 36px; line-height: 44px; }
@media (max-width: 1023px) { .window[data-page="docs"] h1 { font-size: 30px; line-height: 38px; } }

/* ==========================================================
   The desk itself: the clock, start-up
   ========================================================== */
/* behind the windows: you see it when the desk is clear */
.desk-widget { position: fixed; z-index: 1; left: 0; right: 0; top: 50%; transform: translateY(-58%); text-align: center; color: var(--desk-ink); pointer-events: none; }
body:not([data-page="desktop"]) .desk-widget { opacity: 0; }
.desk-widget { transition: opacity 0.4s ease; }
.desk-widget .dw-time { font-family: var(--font-display); font-size: clamp(64px, 11vw, 148px); line-height: 1; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; opacity: 0.86; }
.desk-widget .dw-greet { margin-top: 10px; font-size: 18px; line-height: 26px; font-weight: 500; opacity: 0.72; }
.desk-widget .dw-hint { margin-top: 18px; font-size: 13px; opacity: 0.5; }
.desk-widget .kbd { color: var(--text); }

/* a page is on its way */
.menubar::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent) 40%, var(--accent) 60%, transparent) 0 0 / 40% 100% no-repeat; opacity: 0; transition: opacity 0.2s ease 0.15s; }
.desk-loading .menubar::after { opacity: 1; animation: load-run 0.9s linear infinite; }
@keyframes load-run { from { background-position: -70% 0; } to { background-position: 170% 0; } }

/* first paint of a visit: the desk assembles itself */
.boot .menubar { animation: boot-drop 0.6s var(--ease-out) both; }
.boot .taskbar { animation: boot-rise 0.6s var(--ease-out) 0.05s both; }
.boot .desk-icon { animation: boot-pop 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 0.18s); }
.boot .window { animation: boot-win 0.55s var(--ease-out) 0.22s both; }
@keyframes boot-drop { from { opacity: 0; transform: translateY(-24px); } }
@keyframes boot-rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes boot-pop { from { opacity: 0; transform: translateY(8px) scale(0.9); } }
@keyframes boot-win { from { opacity: 0; transform: translateY(14px) scale(0.975); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; animation-delay: 0s !important; }
}

/* ==========================================================
   Mail client, laid out the way Gmail is: a folding sidebar with a big compose button, a search
   bar on top, and the mail in a white rounded sheet. Rows are one line each; the message opens
   in place of the list, or beside it when the reading pane is on.
   index.tsx measures the window and sets .stack (rows on several lines) and .pane (side by side).
   ========================================================== */
.mail-root { height: 100%; }
.wbody:has(> .mail-root) { overflow: hidden; }
.mail { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100%; background: var(--card-2); }
.mail.rail { grid-template-columns: 68px minmax(0, 1fr); }
.mail kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--stroke-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--card); font-family: var(--mono); font-size: 11px; line-height: 17px; text-align: center; color: var(--text-2); }
.m-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(var(--shade), 0.1); color: var(--text-2); font-size: 17px; font-weight: 500; }
.m-spacer { flex: 1; }
.spin { animation: spin 0.7s linear infinite; }

/* ---------- sidebar ---------- */
.m-side { display: flex; flex-direction: column; gap: 14px; padding: 8px 12px 12px 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.m-compose {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 22px 0 16px; margin-left: 8px; align-self: flex-start;
  border: 0; border-radius: 16px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.12), 0 2px 6px rgba(var(--shade), 0.08); transition: box-shadow 0.15s ease;
}
.m-compose:hover { box-shadow: 0 1px 3px rgba(var(--shade), 0.16), 0 6px 14px -2px rgba(var(--shade), 0.18); }
.m-compose .icon { width: 22px; height: 22px; }
.m-side nav { display: flex; flex-direction: column; }
/* a nav item is a pill that starts at the window edge */
.m-nav { display: flex; align-items: center; gap: 16px; width: 100%; height: 32px; padding: 0 12px 0 24px; border: 0; border-radius: 0 16px 16px 0; background: transparent; color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
.m-nav:hover { background: var(--subtle-hover); }
.m-nav.on { background: rgba(var(--shade), 0.12); font-weight: 700; }
.m-nav .icon { flex: none; width: 20px; height: 20px; color: var(--text-2); }
.m-nav.on .icon { color: var(--text); }
.m-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-count { font-size: 12px; font-variant-numeric: tabular-nums; }
.m-nav-head { padding: 18px 12px 6px 24px; font-size: 14px; font-weight: 500; color: var(--text); }
.m-nav-empty { margin: 0; padding: 2px 12px 4px 24px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.m-side-foot { margin: auto 0 0 12px; padding: 12px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--card); }
.m-side-foot p { margin: 0 0 10px; font-size: 12px; line-height: 17px; color: var(--text-2); }
.m-side-foot b { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
/* folded: icons only */
.mail.rail .m-side { padding-right: 0; align-items: center; }
.mail.rail .m-compose { width: 48px; height: 48px; padding: 0; margin: 4px 0 0; justify-content: center; align-self: center; }
.mail.rail .m-compose span:not(.icon), .mail.rail .m-nav-label, .mail.rail .m-count, .mail.rail .m-nav-head, .mail.rail .m-nav-empty, .mail.rail .m-side-foot { display: none; }
.mail.rail .m-side nav { align-items: center; gap: 2px; }
.mail.rail .m-nav { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }

/* ---------- top bar: menu, search, status ---------- */
.m-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.m-top { flex: none; display: flex; align-items: center; gap: 4px; height: 60px; padding: 0 12px 0 0; }
.m-search { flex: 1; min-width: 0; max-width: 720px; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 18px; margin: 0 8px 0 4px; border-radius: 23px; background: rgba(var(--shade), 0.07); transition: background 0.15s ease, box-shadow 0.15s ease; }
.m-search:focus-within { background: var(--card); box-shadow: 0 1px 2px rgba(var(--shade), 0.16), 0 3px 10px rgba(var(--shade), 0.12); }
.m-search .icon { width: 20px; height: 20px; color: var(--text-2); }
.m-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text); }
.m-search input::-webkit-search-cancel-button { cursor: pointer; }
.m-ib { width: 40px; height: 40px; padding: 0; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.12s ease; }
.m-ib:hover { background: var(--subtle-hover); color: var(--text); }
.m-ib:active { background: rgba(var(--shade), 0.12); }
.m-ib.on { background: rgba(var(--shade), 0.1); color: var(--text); }
.m-ib:disabled { opacity: 0.35; cursor: default; background: transparent; }
.m-ib .icon { width: 20px; height: 20px; }
.m-ib.copied { color: var(--success); }
.m-live { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.m-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.m-live.up { color: var(--text-2); }
.m-live.up i { background: var(--success); }

/* ---------- the sheet ---------- */
.m-card { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 12px 12px 0; border-radius: 16px; background: var(--layer); overflow: hidden; }
.m-address { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--divider); }
.m-address-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.m-address-label { font-size: 12px; line-height: 16px; color: var(--text-2); }
.m-expiry { color: var(--text-3); }
.m-address-value { font-family: var(--mono); font-size: 18px; line-height: 26px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.m-address-value.small { font-size: 14px; line-height: 22px; font-weight: 500; }
.m-address .btn { border-radius: 18px; min-height: 36px; padding: 6px 16px; }
.btn.copied { background: var(--success-bg); border-color: transparent; color: var(--success); opacity: 1; }

.m-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.mail.pane .m-panes { grid-template-columns: minmax(340px, 42%) minmax(0, 1fr); }
.mail.pane .m-readcol { border-left: 1px solid var(--divider); }
.m-listcol, .m-readcol { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.m-toolbar { flex: none; display: flex; align-items: center; gap: 0; height: 48px; padding: 0 12px 0 0; }
.m-check { flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer; }
.m-check:hover { background: var(--subtle-hover); }
.m-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--text); cursor: pointer; }
.m-picked { margin-left: 10px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.m-pos { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; margin: 0 6px; white-space: nowrap; }
.m-chips { flex: none; display: flex; gap: 8px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.m-chips::-webkit-scrollbar { display: none; }
.m-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--stroke-strong); border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m-chip:hover { background: var(--subtle-hover); }
.m-chip.on { background: rgba(var(--shade), 0.12); border-color: transparent; color: var(--text); }
.m-chip .icon { width: 15px; height: 15px; }
.m-error { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px 10px; padding: 10px 12px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.m-error .icon { width: 16px; height: 16px; margin-top: 2px; }
.m-dialog .m-error { margin: 12px 0 0; }

/* ---------- list: one line per message ---------- */
.m-list { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--divider); }
.m-row { position: relative; display: flex; align-items: center; height: 40px; padding: 0 16px 0 4px; border-bottom: 1px solid var(--divider); background: rgba(var(--shade), 0.035); cursor: pointer; }
.m-row.unread { background: var(--layer); }
.m-row.picked { background: var(--accent-soft); }
.m-row.on { background: rgba(var(--shade), 0.11); }
/* hover lifts the row, like a sheet of paper on the pile */
.m-row:hover { z-index: 1; box-shadow: inset 1px 0 0 var(--stroke), inset -1px 0 0 var(--stroke), 0 1px 2px rgba(var(--shade), 0.18), 0 2px 6px rgba(var(--shade), 0.1); }
/* keyboard cursor (j / k): a thin ink mark at the left edge */
.m-row.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--text); }
.m-row.fresh { animation: m-glow 4s ease-out; }
@keyframes m-glow { 0%, 35% { background: var(--accent-soft); } }
.m-row .m-check { width: 32px; height: 32px; }
.m-star { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); display: inline-grid; place-items: center; cursor: pointer; }
.m-star:hover { background: var(--subtle-hover); color: var(--text); }
.m-star.on { color: #d99a00; }
.m-star .icon { width: 18px; height: 18px; }
.m-row-main { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 0; padding: 0 0 0 8px; border: 0; background: transparent; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.m-from { flex: none; width: 184px; padding-right: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.m-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-subj { color: var(--text); }
.m-preview { color: var(--text-2); }
.m-preview::before { content: " - "; }
.m-row.unread .m-from, .m-row.unread .m-subj { font-weight: 700; }
.m-tag { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 4px; background: rgba(var(--shade), 0.1); color: var(--text-2); font-size: 12px; line-height: 18px; font-weight: 500; vertical-align: 1px; }
.m-otp { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; margin-left: 12px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--stroke-strong); background: var(--layer); color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; }
.m-otp:hover { background: var(--card-2); border-color: var(--text-3); }
.m-otp .icon { width: 13px; height: 13px; color: var(--text-2); }
.m-otp.copied { background: var(--success-bg); border-color: transparent; color: var(--success); font-family: var(--font); letter-spacing: 0; }
.m-otp.copied .icon { color: inherit; }
.m-clip { flex: none; width: 16px; height: 16px; margin-left: 10px; color: var(--text-2); }
.m-date { flex: none; width: 76px; text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-row.unread .m-date { color: var(--text); font-weight: 700; }
/* on hover the date gives way to quick actions */
.m-row-actions { display: none; flex: none; width: 76px; justify-content: flex-end; margin-right: -8px; }
.m-row-actions .m-ib { width: 36px; height: 36px; }
.m-row:hover .m-row-actions, .m-row:focus-within .m-row-actions { display: flex; }
.m-row:hover .m-date, .m-row:focus-within .m-date { display: none; }
.m-more { display: flex; margin: 16px auto; }

/* rows on several lines: narrow windows and the reading pane */
.mail.stack .m-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main clip date" "main otp star"; align-items: center; gap: 0 4px; height: auto; padding: 8px 12px 8px 16px; }
.mail.stack .m-row .m-check { display: none; }
.mail.stack .m-row-main { grid-area: main; flex-direction: column; align-items: stretch; height: auto; padding: 0; }
.mail.stack .m-from { width: auto; padding: 0; line-height: 20px; }
.mail.stack .m-line { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 19px; font-size: 13px; }
.mail.stack .m-subj { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail.stack .m-preview::before { content: none; }
.mail.stack .m-date { grid-area: date; width: auto; align-self: start; line-height: 20px; }
.mail.stack .m-star { grid-area: star; justify-self: end; margin-right: -6px; }
.mail.stack .m-otp { grid-area: otp; margin: 0; }
.mail.stack .m-clip { grid-area: clip; margin: 2px 0 0; align-self: start; }
.mail.stack .m-row-actions, .mail.stack .m-row:hover .m-row-actions { display: none; }
.mail.stack .m-row:hover .m-date { display: block; }

.m-skel > div { display: flex; gap: 24px; align-items: center; height: 40px; padding: 0 16px 0 80px; border-bottom: 1px solid var(--divider); animation: m-skel 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * 0.1s); }
.m-skel span { height: 10px; border-radius: 5px; background: var(--subtle-hover); }
.m-skel span:nth-of-type(1) { width: 140px; flex: none; }
.m-skel span:nth-of-type(2) { flex: 1; max-width: 60%; }
@keyframes m-skel { 50% { opacity: 0.45; } }

.m-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 24px; text-align: center; color: var(--text-2); }
.m-empty h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text); }
.m-empty p { margin: 0 0 8px; max-width: 44ch; text-wrap: pretty; }
.m-empty b { color: var(--text); font-family: var(--mono); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.m-empty-ic { width: 44px; height: 44px; color: var(--text-3); margin-bottom: 4px; }

/* ---------- the open message ---------- */
.m-reader { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.m-reader .m-toolbar { padding-left: 8px; border-bottom: 1px solid var(--divider); }
.mail.pane .m-reader .m-toolbar > [aria-label="Back to list"] { display: none; }
.m-reader-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.m-head { padding: 20px 20px 12px 72px; }
.m-head h2 { margin: 0 0 18px; font-size: 22px; line-height: 28px; font-weight: 400; overflow-wrap: anywhere; }
.m-head h2 .m-tag { margin: 0 0 0 10px; vertical-align: 3px; }
.m-meta { display: flex; align-items: center; gap: 12px; margin-left: -52px; }
.m-meta-text { flex: 1; min-width: 0; line-height: 20px; }
.m-meta-text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-addr { color: var(--text-2); font-size: 12px; }
.m-to { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.m-to:hover { color: var(--text); }
.m-to .icon { width: 14px; height: 14px; }
.m-meta time { flex: none; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.m-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 10px 0 0; padding: 12px 16px; border: 1px solid var(--stroke); border-radius: 8px; box-shadow: 0 2px 8px rgba(var(--shade), 0.1); font-size: 13px; }
.m-details dt { color: var(--text-3); text-align: right; }
.m-details dd { margin: 0; overflow-wrap: anywhere; }

/* what Mail7 pulled out of the message */
.m-found { display: flex; flex-direction: column; margin: 4px 20px 16px 72px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--card-2); }
.m-found-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 8px 8px 16px; }
.m-found-item + .m-found-item { border-top: 1px solid var(--divider); }
.m-found-item .btn { border-radius: 18px; }
.m-found-label { flex: none; width: 76px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.m-code { flex: 1; font-family: var(--mono); font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: 0.08em; user-select: all; -webkit-user-select: all; }
.m-found-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 13px; }

.m-tabs { display: flex; align-items: center; gap: 2px; margin: 0 20px 0 72px; border-bottom: 1px solid var(--divider); }
.m-tabs > button { position: relative; flex: none; white-space: nowrap; height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m-tabs > button:hover { color: var(--text); background: var(--subtle-hover); }
.m-tabs > button.on { color: var(--text); font-weight: 600; }
.m-tabs > button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--text); }
.m-device { display: inline-flex; gap: 2px; padding: 2px; margin-right: 10px; border-radius: 8px; background: var(--subtle-hover); }
.m-device button { width: 28px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.m-device button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(var(--shade), 0.14); }
.m-device .icon { width: 15px; height: 15px; }
.m-size { font-size: 12px; color: var(--text-3); }
.m-body { padding-left: 48px; }
.m-frame { display: block; width: 100%; max-width: 100%; margin: 0 auto; border: 0; background: #fff; transition: max-width 0.3s var(--ease-out); }
.m-frame-wrap.phone { padding: 20px 12px 28px; }
.m-frame-wrap.phone .m-frame { max-width: 390px; border-radius: 22px; box-shadow: 0 0 0 1px var(--line), 0 0 0 7px var(--card), 0 0 0 8px var(--line), 0 24px 48px -20px rgba(var(--shade), 0.4); }
.m-pre { margin: 0; padding: 20px 24px; font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.m-none { padding: 20px 24px; color: var(--text-2); }
.m-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.m-table th, .m-table td { padding: 8px 12px; border-bottom: 1px solid var(--divider); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.m-table th:first-child, .m-table td:first-child { padding-left: 24px; }
.m-table thead th { font-size: 12px; font-weight: 600; color: var(--text-2); }
.m-table thead th:first-child { width: 30%; }
.m-table thead th:last-child, .m-table td:last-child:has(.m-ib) { width: 56px; padding: 0 8px; }
.m-table td a { font-family: var(--mono); font-size: 12px; }
.m-headers th { width: 200px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-2); }
.m-headers td { font-family: var(--mono); font-size: 12px; }

/* attachments sit under the message, as tiles */
.m-attach { margin: 16px 20px 24px 72px; padding-top: 16px; border-top: 1px solid var(--divider); }
.m-attach h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.m-attach ul { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; }
.m-file { position: relative; display: flex; flex-direction: column; width: 180px; height: 120px; padding: 0; border: 1px solid var(--stroke); border-radius: 8px; background: var(--card-2); color: var(--text); font: inherit; text-align: left; overflow: hidden; cursor: pointer; }
.m-file-top { flex: 1; display: grid; place-items: center; color: var(--text-3); }
.m-file-top .icon { width: 36px; height: 36px; }
.m-file-foot { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; background: var(--layer); border-top: 1px solid var(--divider); font-size: 12px; }
.m-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.m-file-size { flex: none; color: var(--text-3); }
.m-file-get { position: absolute; inset: 0 0 38px; display: grid; place-items: center; background: rgba(var(--shade), 0.5); color: #fff; opacity: 0; transition: opacity 0.15s ease; }
.m-file-get .icon { width: 28px; height: 28px; }
.m-file:hover .m-file-get, .m-file:focus-visible .m-file-get { opacity: 1; }

.m-reader-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 32px 24px; text-align: center; color: var(--text-3); }
.m-reader-empty h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text-2); }
.m-reader-empty p { margin: 0 0 10px; }
.m-reader-empty .btn { gap: 10px; }

/* undo bar, bottom left */
.m-snack { position: absolute; left: 20px; bottom: 20px; z-index: 5; display: flex; align-items: center; gap: 20px; min-width: 280px; padding: 6px 8px 6px 20px; border-radius: 6px; background: #2b2926; color: #f1ede6; font-size: 14px; box-shadow: 0 6px 18px rgba(var(--shade), 0.35); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.15s ease, transform 0.22s var(--ease-out); white-space: nowrap; }
.m-snack.show { opacity: 1; transform: none; pointer-events: auto; }
.m-snack span { flex: 1; }
.m-snack button { height: 36px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: #f6a57f; font: inherit; font-weight: 600; cursor: pointer; }
.m-snack button:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- dialogs & forms ---------- */
.m-dialog { padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--flyout); color: var(--text); box-shadow: var(--shadow-win); }
.m-dialog::backdrop { background: rgba(var(--shade), 0.32); }
.m-dialog[open] { animation: m-pop 0.2s var(--ease-out) both; }
@keyframes m-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.m-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 20px; }
.m-dialog h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.m-dialog-body { padding: 12px 20px 20px; }
.m-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.m-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.m-field + .m-field { margin-top: 14px; }
.m-input-suffix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 400; }
.m-input-suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.m-input-suffix .textbox { border: 0; background: transparent; box-shadow: none; min-width: 0; }
.m-input-suffix > span { flex: none; padding: 0 12px 0 4px; color: var(--text-2); font-family: var(--mono); font-size: 13px; }
.m-hint { margin: 8px 0 0; font-size: 12px; line-height: 17px; color: var(--text-2); }
.m-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.m-choice label { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.m-choice label.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.m-choice input { position: absolute; opacity: 0; pointer-events: none; }
.m-choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.m-choice .icon { width: 20px; height: 20px; margin-top: 1px; }
.m-choice span { font-size: 12px; line-height: 16px; color: var(--text-2); }
.m-choice b { display: block; font-size: 14px; line-height: 20px; color: var(--text); }
.m-kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 0; margin: 12px 0 0; border: 1px solid var(--stroke); border-radius: var(--r-card); background: var(--card-2); }
.m-kv dt, .m-kv dd { margin: 0; padding: 4px 6px 4px 14px; min-height: 40px; display: flex; align-items: center; border-bottom: 1px solid var(--divider); }
.m-kv dt { font-size: 12px; font-weight: 600; color: var(--text-2); }
.m-kv dd { justify-content: space-between; gap: 8px; padding-left: 0; }
.m-kv dt:nth-last-of-type(1), .m-kv dd:last-child { border-bottom: 0; }
.m-kv code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.m-keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 4px 0 0; align-items: center; }
.m-keys dt { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.m-keys dd { margin: 0; font-size: 14px; }
.m-keys kbd, .m-reader-empty kbd { min-width: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; line-height: 19px; color: var(--text); }

/* ---------- narrow windows and phones (.stack without .pane): the sidebar becomes a strip ---------- */
.mail.stack:not(.pane) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.mail.stack:not(.pane) .m-side { flex-direction: row; align-items: center; gap: 8px; padding: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.mail.stack:not(.pane) .m-side::-webkit-scrollbar { display: none; }
.mail.stack:not(.pane) .m-compose { flex: none; width: auto; height: 40px; padding: 0 14px; margin: 0; border-radius: 12px; gap: 8px; align-self: center; }
.mail.stack:not(.pane) .m-compose span:not(.icon) { display: inline; }
.mail.stack:not(.pane) .m-side nav { flex-direction: row; gap: 4px; }
.mail.stack:not(.pane) .m-nav { width: auto; height: 36px; flex: none; max-width: 180px; padding: 0 14px; gap: 8px; border-radius: 18px; }
.mail.stack:not(.pane) .m-nav-label, .mail.stack:not(.pane) .m-count { display: inline; }
.mail.stack:not(.pane) .m-nav-head, .mail.stack:not(.pane) .m-nav-empty, .mail.stack:not(.pane) .m-side-foot, .mail.stack:not(.pane) .m-top > [aria-label="Main menu"] { display: none; }
.mail.stack:not(.pane) .m-top { height: 52px; padding: 0 8px; }
.mail.stack:not(.pane) .m-search { height: 40px; margin: 0 4px 0 0; }
.mail.stack:not(.pane) .m-live { font-size: 0; gap: 0; padding: 0 6px; }
.mail.stack:not(.pane) .m-card { margin: 0 8px 8px; border-radius: 12px; }
.mail.stack:not(.pane) .m-address { padding: 10px 12px; }
.mail.stack:not(.pane) .m-address-value { font-size: 16px; }
.mail.stack .m-head { padding: 16px 16px 12px; }
.mail.stack .m-meta { margin-left: 0; }
.mail.stack .m-meta time { display: none; }
.mail.stack .m-found, .mail.stack .m-attach, .mail.stack .m-tabs { margin-left: 16px; margin-right: 16px; }
.mail.stack .m-body { padding-left: 0; }
.mail.stack:not(.pane) .m-size { display: none; }
.mail.stack .m-tabs { overflow-x: auto; scrollbar-width: none; }
.mail.stack:not(.pane) .m-found-item { flex-wrap: wrap; }
.mail.stack:not(.pane) .m-choice { grid-template-columns: 1fr; }
.mail.stack:not(.pane) .m-found-link { flex-basis: 100%; order: 3; }
.mail.stack:not(.pane) .m-found-label { flex: 1; }
.mail.stack .m-headers th { width: 104px; }
.mail.stack .m-table th:first-child, .mail.stack .m-table td:first-child { padding-left: 16px; }
.mail.stack .m-pre, .mail.stack .m-none { padding: 16px; }

/* styles used only by the public website's pages */

/* pages */
.doc { max-width: 860px; }
.doc h1 { font-family: var(--font-display); font-size: 36px; line-height: 44px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 12px; }
.doc h2 { font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 56px 0 12px; padding-top: 8px; scroll-margin-top: 12px; }
.doc h3 { font-size: 16px; line-height: 24px; font-weight: 600; margin: 28px 0 8px; scroll-margin-top: 12px; }
.doc p, .doc li { font-size: 15px; line-height: 24px; max-width: 72ch; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li + li { margin-top: 4px; }
.doc .lead { font-size: 17px; line-height: 27px; color: var(--text-2); }
.doc :not(pre) > code, .ep code { font-family: var(--mono); font-size: 13px; padding: 1px 5px; border-radius: 5px; background: var(--card-2); border: 1px solid var(--stroke); white-space: nowrap; }
.doc td code { white-space: normal; word-break: break-word; }
.doc .table-wrap, .doc .infobar { margin: 12px 0 16px; }
.doc .infobar p { margin: 0; font-size: 14px; line-height: 20px; }
.doc .pivot { margin-bottom: 0; }

.codebox { margin: 12px 0 16px; border-radius: var(--r-card); overflow: hidden; background: #1b1a18; color: #e7e4de; border: 1px solid rgba(0, 0, 0, 0.2); }
.codebox .cb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 4px 6px 4px 14px; background: #2a2620; color: #b8b1a4; font-size: 12px; }
.codebox .cb-head .btn { background: transparent; color: #e7e4de; border-color: rgba(255, 255, 255, 0.2); box-shadow: none; }
.codebox .cb-head .btn:hover { background: rgba(255, 255, 255, 0.08); }
.codebox .cb-head .btn.accent { background: #e7e4de; color: #1b1a18; border-color: #e7e4de; opacity: 1; }
.codebox pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre; tab-size: 2; }
.codebox pre:focus-visible { outline-offset: -2px; }

.ep { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--divider); }
.ep .verb { flex: none; width: 58px; font-family: var(--mono); font-size: 12px; font-weight: 600; text-align: center; padding: 2px 0; border-radius: 5px; background: var(--subtle-hover); color: var(--text-2); }
.ep .verb.get { background: var(--success-bg); color: var(--success); }
.ep .verb.post { background: var(--accent-soft); color: var(--accent-text); }
.ep .verb.patch { background: var(--warning-bg); color: var(--warning); }
.ep .verb.delete { background: var(--danger-bg); color: var(--danger); }
.ep .ep-desc { flex: 1 1 260px; color: var(--text-2); font-size: 14px; line-height: 20px; }

/* docs: the section list stays put while the page scrolls */
.docs-nav { position: sticky; top: 0; align-self: start; background: var(--layer); z-index: 2; }
.docs-nav .nv[aria-current="true"] { background: var(--subtle-hover); font-weight: 600; }

/* settings sheet: label left, value right (SMTP settings, limits) */
.sheet { border: 1px solid var(--stroke); border-radius: var(--r-card); background: var(--card); overflow: hidden; }
.sheet .srow { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 48px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--divider); }
.sheet .srow:first-child { border-top: 0; }
.sheet .srow .k { color: var(--text-2); font-size: 14px; }
.sheet .srow .v { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.sheet .srow .v.plain { font-family: var(--font); }
.sheet .srow .n { color: var(--text-3); font-size: 13px; padding-right: 8px; text-align: right; }
@media (max-width: 767px) {
  .doc h1 { font-size: 30px; line-height: 38px; }
  .sheet .srow { grid-template-columns: minmax(0, 1fr) auto; }
  .sheet .srow .k { grid-column: 1 / -1; }
  .sheet .srow .n { grid-column: 1 / -1; text-align: left; padding: 0; }
}

/* agents page: numbered steps */
.ag-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ag-step { display: flex; gap: 14px; align-items: flex-start; }
.ag-step b { display: block; font-size: 15px; line-height: 22px; }
.ag-step p { margin: 2px 0 0; color: var(--text-2); }

/* endpoint lines never push the page sideways */
.doc .ep code, .ep code { white-space: normal; overflow-wrap: anywhere; }
.ep .ep-desc { min-width: 0; }
@media (max-width: 767px) { .ep .ep-desc { flex-basis: 100%; } }

/* Blog: a reader app in a window. A sidebar (the library, or a post's outline), a toolbar, one scrolling pane.
   The worker in apps/blog renders the markup; client/reader.ts adds what you have read and saved. */
.window[data-page="blog"] .wbody { overflow: hidden; container: rd / inline-size; background: var(--mica); }
.rd { --side: 236px; position: relative; height: 100%; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "side bar" "side main"; transition: grid-template-columns 0.3s var(--ease-out); }

/* ---------- toolbar ---------- */
.rd-bar { grid-area: bar; position: relative; z-index: 3; display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 10px; background: var(--layer); border-bottom: 1px solid var(--divider); }
.rd-bar .bar-icon { flex: none; border-radius: 8px; color: var(--text-2); transition: background 0.12s ease, transform 0.14s var(--ease-out); }
.rd-bar .bar-icon:hover { color: var(--text); }
.rd-bar .bar-icon:active { transform: scale(0.94); }
.rd-bar .bar-icon[aria-disabled="true"] { opacity: 0.3; pointer-events: none; }
.rd-bar .bar-icon[aria-expanded="true"], .rd-bar .bar-icon[aria-pressed="true"] { color: var(--text); }
.rd-bar .bar-icon[aria-expanded="true"] { background: var(--subtle-hover); }
.rd-heading { flex: none; margin: 0 10px 0 6px; font-family: var(--font-display); font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.rd-search { margin-left: auto; flex: 0 1 280px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border-radius: 8px; background: rgba(var(--shade), 0.06); box-shadow: 0 0 0 1px transparent; transition: background 0.15s ease, box-shadow 0.15s ease; }
.rd-search:focus-within { background: var(--card); box-shadow: 0 0 0 1px var(--stroke-strong), 0 2px 8px rgba(var(--shade), 0.1); }
.rd-search .icon { width: 16px; height: 16px; color: var(--text-3); }
.rd-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--text); }
.rd-search .kbd { font-size: 11px; color: var(--text-3); }
.rd-search:focus-within .kbd { display: none; }
.rd-bar-title { flex: 1; min-width: 0; margin: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.26s var(--ease-out); }
.rd.scrolled .rd-bar-title { opacity: 1; transform: none; }
/* how far down the post you are: a hairline under the toolbar and a ring that closes into a tick */
.rd-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); transform-origin: left; transform: scaleX(0); pointer-events: none; }
.rd-ring { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.rd-ring svg { width: 20px; height: 20px; fill: none; overflow: visible; }
.rd-ring .t { stroke: rgba(var(--shade), 0.16); stroke-width: 2; transition: fill 0.25s ease, stroke 0.25s ease; }
.rd-ring .p { stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 10px 10px; }
.rd-ring .c { stroke: var(--layer); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.32s var(--ease-out) 0.12s; }
.rd.done .rd-ring .t { fill: var(--text); stroke: var(--text); }
.rd.done .rd-ring .c { stroke-dashoffset: 0; }
.rd.done .rd-ring svg { animation: rd-pop 0.4s var(--ease-spring); }
@keyframes rd-pop { 40% { transform: scale(1.22); } }

/* save: an outline bookmark that fills */
.rd-save .icon:last-child, .rd-save[aria-pressed="true"] .icon:first-child { display: none; }
.rd-save[aria-pressed="true"] .icon:last-child { display: inline-flex; }
.rd-save.pop .icon { animation: rd-pop 0.36s var(--ease-spring); }

/* text settings */
.rd-pop { position: absolute; top: 44px; right: 92px; z-index: 5; width: 208px; padding: 10px; border-radius: 10px; background: var(--flyout); border: 1px solid var(--stroke); box-shadow: var(--shadow-flyout); transform-origin: top right; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(0.96); transition: opacity 0.12s ease, transform 0.18s var(--ease-out), visibility 0s 0.18s; }
.rd-pop.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.rd-pop-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
.rd-pop-row span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }
.rd-pop button { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: background 0.12s ease, transform 0.14s var(--ease-out); }
.rd-pop button:hover { background: var(--card-2); }
.rd-pop button:active { transform: scale(0.97); }
.rd-pop button.big { font-size: 19px; }
.rd-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rd-seg button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--layer); }
.rd-seg [data-rd="serif"] { font-family: var(--rd-serif); font-size: 15px; }

/* ---------- sidebar ---------- */
.rd { --rd-serif: "Iowan Old Style", "Palatino Linotype", Charter, "Bitstream Charter", Georgia, serif; }
.rd-side { grid-area: side; min-width: 0; overflow: hidden; border-right: 1px solid var(--divider); }
.rd-side-in { position: relative; width: 236px; height: 100%; overflow-y: auto; padding: 8px 10px 16px; scrollbar-width: thin; transition: opacity 0.2s ease; }
.rd-sh { padding: 14px 10px 5px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-3); }
.rd-nav { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.rd-nav:hover { background: var(--subtle-hover); text-decoration: none; }
.rd-nav .icon { width: 18px; height: 18px; color: var(--text-2); }
.rd-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rd-nav[aria-current="true"] { font-weight: 600; }
.rd-nav[aria-current="true"] .icon { color: var(--text); }
.rd-side:not(.ind) .rd-nav[aria-current="true"] { background: rgba(var(--shade), 0.09); }
/* one highlight that slides to whatever is current */
.rd-ind { position: absolute; left: 10px; right: 10px; top: 0; height: 32px; border-radius: 7px; background: rgba(var(--shade), 0.09); opacity: 0; pointer-events: none; }
.rd-side.ind .rd-ind { opacity: 1; transition: transform 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.2s ease; }
.rd-toc { min-height: 28px; font-size: 13px; color: var(--text-2); }
.rd-toc.d3 { padding-left: 22px; }
.rd-toc[aria-current="true"] { color: var(--text); }
.rd-up { padding: 6px 10px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.rd-up .rd-nav-label { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@container rd (min-width: 821px) {
  .rd.no-side { --side: 0px; }
  .rd.no-side .rd-side { border-right-color: transparent; }
  .rd.no-side .rd-side-in { opacity: 0; }
}

/* ---------- the library: a dense list, grouped by month ---------- */
.rd-main { grid-area: main; min-width: 0; background: var(--layer); overflow-y: auto; overscroll-behavior: contain; }
.rd-month { position: sticky; top: 0; z-index: 2; margin: 0; padding: 6px 20px 6px 52px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-3); background: color-mix(in srgb, var(--layer) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--divider); }
.rd-row { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 28px; gap: 12px; align-items: center; min-height: 62px; padding: 9px 12px 9px 20px; border-bottom: 1px solid var(--divider); transition: background 0.1s ease; }
.rd-row:hover { background: var(--card-2); }
.rd-row.cur { background: rgba(var(--shade), 0.07); }
.rd-row-link { min-width: 0; color: var(--text); }
.rd-row-link:hover { text-decoration: none; }
.rd-row-link::after { content: ""; position: absolute; inset: 0; }
.rd-row-link:focus-visible { outline: none; }
.rd-row:has(.rd-row-link:focus-visible) { outline: 2px solid var(--text); outline-offset: -2px; }
.rd-row-title { display: block; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 22px; font-weight: 600; }
.rd-row-excerpt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 20px; color: var(--text-2); }
.rd-row time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-row .rd-save { position: relative; z-index: 1; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.12s ease, background 0.12s ease; }
.rd-row .rd-save .icon { width: 18px; height: 18px; }
.rd-row:hover .rd-save, .rd-row.cur .rd-save, .rd-row .rd-save:focus-visible, .rd-row .rd-save[aria-pressed="true"] { opacity: 1; }
.rd-row .rd-save:hover { background: var(--subtle-hover); color: var(--text); }
.rd-row .rd-save[aria-pressed="true"] { color: var(--text); }
@media (hover: none) { .rd-row .rd-save { opacity: 0.45; } }
/* read state, like a download pie: empty, part way, done */
.rd-state { justify-self: center; width: 14px; height: 14px; border-radius: 50%; }
.rd-row[data-state="part"] .rd-state { padding: 2px; border: 1.5px solid var(--text-2); background: conic-gradient(var(--text-2) calc(var(--p) * 1%), transparent 0) content-box; }
.rd-row[data-state="done"] .rd-state { background: var(--text-3); }
.rd-row[data-state="done"] .rd-state::after { content: ""; display: block; width: 3px; height: 6px; border: solid var(--layer); border-width: 0 1.5px 1.5px 0; transform: translate(5px, 2.5px) rotate(45deg); }
.rd-row[data-state="done"] .rd-row-title { font-weight: 500; color: var(--text-2); }
.rd-none { margin: 0; padding: 56px 24px; text-align: center; color: var(--text-2); }
/* the first screenful deals itself in when the list opens or the filter changes */
.rd-list.deal .rd-row[style] { animation: rd-deal 0.42s var(--ease-out) both; animation-delay: calc(var(--i) * 24ms); }
@keyframes rd-deal { from { opacity: 0; transform: translateY(10px); } }

/* ---------- a post ---------- */
.rd-scroll { scroll-behavior: smooth; }
.post { max-width: 736px; margin: 0 auto; padding: 44px 32px 96px; }
.post-head { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--divider); }
.post-head::after { content: ""; display: block; clear: both; }
.post-kicker { display: flex; flex-wrap: wrap; margin: 0 0 14px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.post-kicker > :not(:last-child)::after { content: "·"; margin: 0 8px; font-weight: 400; color: var(--text-3); }
.post-kicker > span:first-child { font-weight: 600; color: var(--text-2); }
.post h1 { margin: 0; font-family: var(--font-display); font-size: 38px; line-height: 44px; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.post-lede { margin: 14px 0 0; font-size: 19px; line-height: 29px; color: var(--text-2); text-wrap: pretty; }
/* the postmark: stamped on when the post opens, then the cancellation lines run out from it */
.rd-postmark { float: right; width: 150px; margin: -16px -10px 6px 18px; color: var(--text-3); opacity: 0.7; transform: rotate(-7deg); pointer-events: none; shape-outside: margin-box; }
.rd-postmark text { fill: currentColor; font-family: var(--mono); }
.rd-postmark .pm-arc { font-size: 8px; font-weight: 600; letter-spacing: 0.2em; }
.rd-postmark .pm-day { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.rd-postmark .pm-year { font-size: 10px; font-weight: 500; letter-spacing: 0.24em; }
.rd-postmark .pm-ring { transform-origin: 55px 55px; animation: pm-stamp 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.28s both; }
.rd-postmark .pm-waves path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pm-wave 0.7s var(--ease-out) 0.6s forwards; }
.rd-postmark .pm-waves path:nth-child(2) { animation-delay: 0.67s; }
.rd-postmark .pm-waves path:nth-child(3) { animation-delay: 0.74s; }
.rd-postmark .pm-waves path:nth-child(4) { animation-delay: 0.81s; }
@keyframes pm-stamp { from { opacity: 0; transform: scale(1.5) rotate(9deg); } 55% { opacity: 1; } }
@keyframes pm-wave { to { stroke-dashoffset: 0; } }

.prose { --fs: 17px; font-family: var(--rd-font, inherit); font-size: var(--fs); line-height: 1.65; overflow-wrap: break-word; transition: font-size 0.2s var(--ease-out); }
.rd[data-size="0"] .prose { --fs: 15px; }
.rd[data-size="2"] .prose { --fs: 19px; }
.rd[data-size="3"] .prose { --fs: 21px; }
.rd.serif .prose { --rd-font: var(--rd-serif); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .codebox { margin: 0 0 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 600; scroll-margin-top: 20px; text-wrap: balance; }
.prose h1 { font-size: 1.65em; line-height: 1.25; letter-spacing: -0.02em; margin: 1.6em 0 0.5em; }
.prose h2 { font-size: 1.45em; line-height: 1.3; letter-spacing: -0.02em; margin: 1.9em 0 0.55em; }
.prose h3 { font-family: var(--font); font-size: 1.08em; line-height: 1.4; margin: 1.6em 0 0.4em; }
.prose h4 { font-family: var(--font); font-size: 1em; margin: 1.4em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose a { text-decoration: underline; text-decoration-color: rgba(var(--shade), 0.3); text-underline-offset: 3px; transition: text-decoration-color 0.15s ease; }
.prose a:hover { text-decoration-color: currentColor; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.6em auto; border-radius: var(--r-card); border: 1px solid var(--stroke); cursor: zoom-in; transition: box-shadow 0.2s ease, transform 0.2s var(--ease-out); }
@media (hover: hover) { .prose img:hover { box-shadow: 0 10px 28px -12px rgba(var(--shade), 0.4); transform: translateY(-2px); } }
.prose blockquote { padding: 12px 16px; border-radius: var(--r-card); background: var(--card-2); border: 1px solid var(--stroke); color: var(--text-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose :not(pre) > code { font-family: var(--mono); font-size: 0.86em; padding: 1px 5px; border-radius: 5px; background: var(--card-2); border: 1px solid var(--stroke); }
.prose .codebox pre code { font: inherit; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-family: var(--font); font-size: 14px; line-height: 20px; margin: 0 0 1.2em; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border: 1px solid var(--divider); vertical-align: top; }
.prose th { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--card-2); }
.prose hr { border: 0; border-top: 1px solid var(--divider); margin: 2em 0; }

.post-foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--divider); }
.post-up { display: block; margin-bottom: 20px; padding: 16px 18px; border: 1px solid var(--stroke); border-radius: 10px; color: var(--text); transition: border-color 0.15s ease, background 0.15s ease, transform 0.14s var(--ease-out); }
.post-up:hover { border-color: var(--stroke-strong); background: var(--card-2); text-decoration: none; }
.post-up:active { transform: scale(0.99); }
.post-up-k { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.post-up b { display: block; font-family: var(--font-display); font-size: 19px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.post-up span:last-child { display: block; margin-top: 4px; font-size: 14px; line-height: 21px; color: var(--text-2); }

/* pick up where you stopped */
.rd-resume { position: absolute; z-index: 4; left: calc(50% + var(--side) / 2); bottom: 20px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 18px; background: var(--text); color: var(--layer); font: inherit; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-flyout); transform: translateX(-50%); transition: opacity 0.25s ease, transform 0.35s var(--ease-out); }
.rd-resume[hidden] { display: none; }
.rd-resume .icon { width: 16px; height: 16px; }
.rd-resume.off { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
@starting-style { .rd-resume { opacity: 0; transform: translate(-50%, 12px); } }

/* quick look: a picture lifts out of the page to fill the window */
.rd-ql { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(var(--shade), 0.55); cursor: zoom-out; }
.rd-ql img { max-width: calc(100% - 40px); max-height: calc(100% - 40px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); background: var(--layer); }

/* ---------- moving between the list and a post: the pane slides like a navigation stack, the title travels ---------- */
.rd-bar { view-transition-name: rd-bar; }
.rd-side { view-transition-name: rd-side; }
.rd-main { view-transition-name: rd-main; }
.post h1 { view-transition-name: rd-title; }
::view-transition-group(rd-main) { overflow: clip; }
::view-transition-old(rd-main), ::view-transition-new(rd-main) { mix-blend-mode: normal; animation-duration: 0.38s; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); animation-fill-mode: both; }
:root[data-nav="fwd"]::view-transition-old(rd-main) { animation-name: rd-out-l; }
:root[data-nav="fwd"]::view-transition-new(rd-main) { animation-name: rd-in-r; }
:root[data-nav="back"]::view-transition-old(rd-main) { animation-name: rd-out-r; z-index: 1; }
:root[data-nav="back"]::view-transition-new(rd-main) { animation-name: rd-in-l; }
:root[data-nav="same"]::view-transition-old(rd-main) { animation-name: rd-fade; animation-duration: 0.16s; }
:root[data-nav="same"]::view-transition-new(rd-main) { animation-name: rd-rise; }
@keyframes rd-in-r { from { transform: translateX(100%); } }
@keyframes rd-out-l { to { transform: translateX(-26%); opacity: 0; } }
@keyframes rd-in-l { from { transform: translateX(-26%); opacity: 0; } }
@keyframes rd-out-r { to { transform: translateX(100%); } }
@keyframes rd-fade { to { opacity: 0; } }
@keyframes rd-rise { from { opacity: 0; transform: translateY(28px); } }
::view-transition-group(rd-title) { animation-duration: 0.38s; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); }
::view-transition-old(rd-title), ::view-transition-new(rd-title) { width: 100%; height: 100%; object-fit: contain; object-position: left top; }

/* ---------- narrow windows and phones ---------- */
@container rd (max-width: 820px) {
  .rd { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "bar" "side" "main"; --side: 0px; }
  .rd-ind, .rd[data-reader="list"] :is(.rd-sh, [data-rd="side"]) { display: none; }
  /* the library's sidebar becomes a row of chips */
  .rd[data-reader="list"] .rd-side { border-right: 0; border-bottom: 1px solid var(--divider); background: var(--layer); }
  .rd[data-reader="list"] .rd-side-in { width: auto; height: auto; display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .rd[data-reader="list"] .rd-side-in::-webkit-scrollbar { display: none; }
  .rd[data-reader="list"] .rd-nav { flex: none; width: auto; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); font-size: 13px; }
  .rd[data-reader="list"] .rd-nav .icon { width: 16px; height: 16px; }
  .rd[data-reader="list"] .rd-nav-label { overflow: visible; }
  .rd[data-reader="list"] .rd-nav[aria-current="true"] { background: var(--text); border-color: var(--text); color: var(--layer); font-weight: 500; }
  .rd[data-reader="list"] .rd-nav[aria-current="true"] :is(.icon, .rd-count) { color: inherit; }
  .rd-heading { display: none; }
  .rd-search { flex: 1; margin-left: 0; }
  /* a post's outline becomes a drawer */
  .rd[data-reader="post"] .rd-side { grid-area: auto; position: absolute; z-index: 6; top: 49px; bottom: 0; left: 0; width: 264px; background: var(--mica); box-shadow: var(--shadow-flyout); visibility: hidden; transform: translateX(-104%); transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.32s; }
  .rd[data-reader="post"] .rd-side-in { width: 100%; }
  .rd[data-reader="post"] .rd-nav[aria-current="true"] { background: rgba(var(--shade), 0.09); }
  .rd[data-reader="post"].side-open .rd-side { visibility: visible; transform: none; transition-delay: 0s; }
  .rd-resume { left: 50%; }
}
@container rd (max-width: 560px) {
  .rd-bar { padding: 0 6px; }
  .rd-bar a[target="_blank"] { display: none; }
  .rd-bar-title { margin: 0 4px; visibility: hidden; }
  .rd-pop { right: 8px; }
  .rd-month { padding-left: 44px; }
  .rd-row { grid-template-columns: 16px minmax(0, 1fr) 28px; gap: 10px; padding: 10px 8px 10px 14px; }
  .rd-row time { display: none; }
  .rd-row-title { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .rd-row-excerpt { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .post { padding: 28px 18px 72px; }
  .post h1 { font-size: 29px; line-height: 35px; }
  .post-lede { font-size: 17px; line-height: 26px; }
  .rd-postmark { width: 112px; margin: -8px -6px 4px 12px; }
  .rd-search .kbd { display: none; }
}

/* ==========================================================
   Account apps: sign in, My sandboxes, API keys, Account
   ========================================================== */
.d-scroll { height: 100%; overflow-y: auto; background: var(--layer); }
.d-page { max-width: 860px; margin: 0 auto; padding: 32px 24px 56px; }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.d-head h1 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; }
.d-head p { margin: 4px 0 0; color: var(--text-2); max-width: 60ch; }
.d-card { border: 1px solid var(--stroke); border-radius: var(--r-card); background: var(--card); margin-bottom: 12px; }
.d-card-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; }
.d-card-head h2 { flex: 1; margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-card-head .count { color: var(--text-2); font-size: 13px; font-weight: 400; white-space: nowrap; }
.d-card-body { padding: 0 16px 16px; }
.d-card .m-kv { margin-top: 0; }
.d-muted { color: var(--text-3); }
.d-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-ctrl); background: var(--warning-bg); color: var(--warning); font-size: 13px; }
.d-note .icon { width: 16px; height: 16px; margin-top: 2px; }
.d-tabs { flex-wrap: wrap; }
.d-code { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--r-card); background: #1b1a18; color: #e7e4de; font-family: var(--mono); font-size: 12.5px; line-height: 19px; overflow-x: auto; white-space: pre; }
.d-tabs { display: flex; gap: 4px; margin-top: 14px; align-items: center; }
.d-tabs button { height: 28px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.d-tabs button:hover { background: var(--subtle-hover); }
.d-tabs button.on { background: var(--text); color: var(--layer); }
.d-empty { padding: 40px 24px; border: 1px dashed var(--stroke-strong); border-radius: var(--r-card); text-align: center; color: var(--text-2); }
.d-empty h2 { margin: 0 0 4px; font-size: 17px; color: var(--text); }
.d-empty p { margin: 0 auto 16px; max-width: 48ch; }
.d-new { display: flex; gap: 8px; align-items: center; }
.d-new .textbox { width: 220px; }
.d-secret { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--r-card); background: var(--success-bg); border: 1px solid rgba(47, 122, 58, 0.25); }
.d-secret b { color: var(--success); }
.d-secret-row { display: flex; align-items: center; gap: 8px; }
.d-secret code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.d-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--stroke); border-radius: var(--r-card); background: var(--card); }
.d-rows li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--divider); }
.d-rows li:last-child { border-bottom: 0; }
.d-rows .main { flex: 1; min-width: 0; }
.d-rows .main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-rows .main span { font-size: 12px; color: var(--text-2); }
.d-rows code { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.d-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; padding: 12px 16px; border: 1px solid var(--stroke); border-radius: var(--r-card); background: var(--card-2); }
.d-plan b { display: block; }
.d-plan span:not(.badge) { font-size: 12px; color: var(--text-2); }
.d-section { margin-top: 32px; }
.d-section h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.d-danger { color: var(--danger); border-color: rgba(184, 50, 31, 0.35); }
.d-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* sign in: a small card on the window, like a lock screen prompt */
.d-auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background: var(--card-2); }
.d-auth-card { width: min(380px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-bar); }
.d-auth-card .icon.logo { width: 40px; height: 40px; margin-bottom: 16px; }
.d-auth-card h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.d-auth-card > p { margin: 0 0 20px; color: var(--text-2); }
.d-auth-card .btn { margin-top: 18px; }
.d-auth-card .m-error { margin: 0; }
.d-auth-switch { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--text-2); }
.d-auth-switch button { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; font-weight: 500; cursor: pointer; }
.d-auth-switch button:hover { text-decoration: underline; }
.d-claim { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 10px 12px; border-radius: var(--r-ctrl); background: var(--info-bg); border: 1px solid var(--stroke); font-size: 13px; }
.d-claim .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }

@media (max-width: 767px) {
  .d-page { padding: 20px 16px 40px; }
  .d-head { flex-direction: column; }
  .d-new { width: 100%; }
  .d-new { flex-wrap: wrap; }
  .d-new .textbox { flex: 1 1 140px; width: auto; min-width: 0; }
  .d-new .btn { flex: 1 1 auto; }
  .d-empty { padding: 28px 16px; }
  .d-rows li { flex-wrap: wrap; }
  .d-card-head { flex-wrap: wrap; }
}
