/* Working Set — desktop mockup. System colours, materials and AppKit-like controls. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --accent: #007AFF;
  --accent-fill: #0064D2;          /* accent behind white text (AA) */
  --accent-text: #0062CC;          /* accent as text on light surfaces (AA) */
  --accent-tint: rgba(0, 122, 255, .10);
  --accent-tint-2: rgba(0, 122, 255, .18);
  --accent-ring: rgba(0, 122, 255, .5);

  --window: #FFFFFF;
  --window-2: #F5F5F7;
  --titlebar: #F6F6F7;
  --page: #FFFFFF;
  --canvas: #ECECEE;
  --label: rgba(0, 0, 0, .85);
  --label-2: rgba(0, 0, 0, .56);   /* secondary, nudged from .5 to keep AA on white */
  --label-3: rgba(0, 0, 0, .26);
  --label-4: rgba(0, 0, 0, .1);
  --sep: rgba(0, 0, 0, .1);
  --sep-strong: rgba(0, 0, 0, .16);
  --fill: rgba(0, 0, 0, .04);
  --fill-2: rgba(0, 0, 0, .07);
  --fill-3: rgba(0, 0, 0, .11);
  --control: #FFFFFF;
  --control-pressed: #EDEDED;
  --control-ring: rgba(0, 0, 0, .14);
  --grid-line: rgba(0, 0, 0, .09);

  --material: rgba(244, 244, 246, .74);
  --material-strong: rgba(250, 250, 251, .88);
  --menubar-bg: rgba(246, 246, 248, .62);
  --menu-bg: rgba(240, 240, 242, .82);
  --popover-bg: rgba(250, 250, 251, .92);
  --dock-bg: rgba(246, 246, 248, .42);
  --hud-bg: rgba(246, 246, 248, .86);
  --mb-active: rgba(0, 0, 0, .1);

  --red: #FF3B30; --red-strong: #D70015; --orange: #FF9500; --yellow: #FFCC00;
  --green: #34C759; --green-strong: #248A3D; --teal: #30B0C7; --blue: #007AFF;
  --indigo: #5856D6; --purple: #AF52DE; --pink: #FF2D55; --gray: #8E8E93;

  --shadow-win: 0 0 0 .5px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.06), 0 8px 18px rgba(0,0,0,.12), 0 24px 54px rgba(0,0,0,.2);
  --shadow-win-dim: 0 0 0 .5px rgba(0,0,0,.16), 0 1px 2px rgba(0,0,0,.05), 0 6px 14px rgba(0,0,0,.07), 0 16px 36px rgba(0,0,0,.11);
  --shadow-panel: 0 0 0 .5px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06), 0 14px 36px rgba(0,0,0,.16);
  --shadow-menu: 0 0 0 .5px rgba(0,0,0,.14), 0 4px 10px rgba(0,0,0,.1), 0 14px 32px rgba(0,0,0,.18);
  --shadow-sheet: 0 0 0 .5px rgba(0,0,0,.16), 0 10px 24px rgba(0,0,0,.14), 0 30px 70px rgba(0,0,0,.24);
  --edge-hi: rgba(255, 255, 255, .5);

  --zone-strong: rgba(0, 122, 255, .16);
  --zone-faint: rgba(0, 122, 255, .05);
  --zone-line: rgba(0, 122, 255, .45);

  --wallpaper:
    radial-gradient(1100px 760px at 18% 8%, #F1F3F6 0%, rgba(241,243,246,0) 62%),
    radial-gradient(900px 700px at 88% 96%, #CFD5DD 0%, rgba(207,213,221,0) 60%),
    linear-gradient(162deg, #E4E8ED 0%, #D7DCE3 52%, #C9CFD7 100%);

  --menubar-h: 24px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease: cubic-bezier(.25, .8, .25, 1);
  --dur: 200ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0A84FF;
    --accent-fill: #0B6BD6;
    --accent-text: #3B9BFF;
    --accent-tint: rgba(10, 132, 255, .16);
    --accent-tint-2: rgba(10, 132, 255, .28);
    --accent-ring: rgba(10, 132, 255, .6);

    --window: #1E1E1E;
    --window-2: #2A2A2A;
    --titlebar: #2C2C2C;
    --page: #1E1E1E;
    --canvas: #161616;
    --label: rgba(255, 255, 255, .86);
    --label-2: rgba(255, 255, 255, .56);
    --label-3: rgba(255, 255, 255, .26);
    --label-4: rgba(255, 255, 255, .1);
    --sep: rgba(255, 255, 255, .1);
    --sep-strong: rgba(255, 255, 255, .16);
    --fill: rgba(255, 255, 255, .05);
    --fill-2: rgba(255, 255, 255, .09);
    --fill-3: rgba(255, 255, 255, .16);
    --control: rgba(255, 255, 255, .14);
    --control-pressed: rgba(255, 255, 255, .22);
    --control-ring: rgba(0, 0, 0, .5);
    --grid-line: rgba(255, 255, 255, .09);

    --material: rgba(40, 40, 42, .72);
    --material-strong: rgba(46, 46, 48, .9);
    --menubar-bg: rgba(28, 28, 30, .5);
    --menu-bg: rgba(42, 42, 44, .84);
    --popover-bg: rgba(48, 48, 50, .94);
    --dock-bg: rgba(40, 40, 42, .45);
    --hud-bg: rgba(44, 44, 46, .88);
    --mb-active: rgba(255, 255, 255, .16);

    --red: #FF453A; --red-strong: #D70015; --orange: #FF9F0A; --yellow: #FFD60A;
    --green: #30D158; --green-strong: #30D158; --teal: #40C8E0; --blue: #0A84FF;
    --indigo: #5E5CE6; --purple: #BF5AF2; --pink: #FF375F; --gray: #98989D;

    --shadow-win: 0 0 0 .5px rgba(0,0,0,.7), 0 1px 2px rgba(0,0,0,.3), 0 8px 18px rgba(0,0,0,.3), 0 24px 54px rgba(0,0,0,.45);
    --shadow-win-dim: 0 0 0 .5px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.24), 0 6px 14px rgba(0,0,0,.22), 0 16px 36px rgba(0,0,0,.3);
    --shadow-panel: 0 0 0 .5px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.2), 0 14px 36px rgba(0,0,0,.4);
    --shadow-menu: 0 0 0 .5px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.25), 0 14px 32px rgba(0,0,0,.4);
    --shadow-sheet: 0 0 0 .5px rgba(0,0,0,.6), 0 10px 24px rgba(0,0,0,.3), 0 30px 70px rgba(0,0,0,.5);
    --edge-hi: rgba(255, 255, 255, .12);

    --zone-strong: rgba(10, 132, 255, .22);
    --zone-faint: rgba(10, 132, 255, .07);
    --zone-line: rgba(10, 132, 255, .55);

    --wallpaper:
      radial-gradient(1100px 760px at 18% 8%, #3A3F47 0%, rgba(58,63,71,0) 62%),
      radial-gradient(900px 700px at 88% 96%, #15171B 0%, rgba(21,23,27,0) 60%),
      linear-gradient(162deg, #2D3138 0%, #23262B 52%, #1A1C20 100%);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.3 var(--font);
  color: var(--label);
  background: #000;
  overflow: clip;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: default; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
kbd { font: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; border-radius: 5px; }
* { scrollbar-width: thin; scrollbar-color: var(--label-3) transparent; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum, time { font-variant-numeric: tabular-nums; }

.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i-12 { width: 12px; height: 12px; }
.i-14 { width: 14px; height: 14px; }
.i-16 { width: 16px; height: 16px; }
.i-18 { width: 18px; height: 18px; }
.i-22 { width: 22px; height: 22px; }
.i-28 { width: 28px; height: 28px; stroke-width: 1.25; }
.i.inline { vertical-align: -2px; }

/* ---------- Desktop ---------- */
.desktop {
  position: fixed; inset: 0; overflow: clip;
  background: var(--wallpaper);
}
.windows { position: absolute; inset: 0; }

/* ---------- Menu bar ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--menubar-h); z-index: 1300;
  display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 8px;
  background: var(--menubar-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 .5px 0 var(--sep);
}
.mb-left, .mb-right { display: flex; align-items: center; height: 100%; gap: 0; }
.mb-item {
  height: 22px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent;
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--label); white-space: nowrap;
}
.mb-item[aria-expanded="true"] { background: var(--mb-active); }
.mb-item:focus-visible { outline-offset: -2px; }
.mb-logo { padding: 0 11px 0 9px; }
.mb-app { font-weight: 700; }
.mb-status { position: relative; padding: 0 8px; gap: 3px; }
.rec-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.is-paused .rec-dot { background: var(--gray); }
.mb-clock { padding: 0 8px 0 6px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Menus (NSMenu) ---------- */
.menu-layer, .popover-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1400; }
.menu {
  position: fixed; min-width: 232px; padding: 5px; border-radius: 8px; pointer-events: auto;
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(40px) saturate(1.8); backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: var(--shadow-menu); font-size: 13px; color: var(--label);
  animation: menu-in 150ms var(--ease-out);
}
@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%;
  height: 22px; padding: 0 10px 0 24px; border: 0; border-radius: 4px; background: transparent; text-align: left; white-space: nowrap;
}
.menu-item .mi-check { position: absolute; left: 6px; top: 4px; width: 14px; height: 14px; stroke-width: 1.75; }
.menu-item .mi-key { margin-left: auto; padding-left: 28px; color: var(--label-2); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.menu-item:focus-visible { outline: none; }
.menu-item.is-active:not([aria-disabled="true"]) { background: var(--accent-fill); color: #fff; }
.menu-item.is-active:not([aria-disabled="true"]) .mi-key { color: rgba(255,255,255,.85); }
.menu-item[aria-disabled="true"] { color: var(--label-3); }
.menu-item[aria-disabled="true"] .mi-key { color: var(--label-3); }
.menu-sep { height: 1px; margin: 5px 10px; background: var(--sep); }
.menu-header { display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--label); }
.menu-header .rec-dot { width: 8px; height: 8px; }
.menu-note { padding: 0 10px 4px 25px; font-size: 11px; color: var(--label-2); white-space: normal; max-width: 240px; }

/* ---------- Edge zones ---------- */
.edge-zone {
  position: fixed; top: var(--menubar-h); bottom: 0; width: 220px; z-index: 900;
  pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease);
}
.edge-left { left: 0; background: linear-gradient(to right, var(--zone-strong), var(--zone-faint) 45%, transparent); box-shadow: inset 1px 0 0 var(--zone-line); }
.edge-right { left: var(--zone-right-x, auto); background: linear-gradient(to left, var(--zone-strong), var(--zone-faint) 45%, transparent); box-shadow: inset -1px 0 0 var(--zone-line); }
.desktop.is-dragging .edge-zone { opacity: .45; }
.desktop.is-dragging .edge-zone.is-hot { opacity: 1; }

/* ---------- Windows ---------- */
.win {
  --s: 1;
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column;
  border-radius: 10px; overflow: clip; background: var(--window);
  box-shadow: var(--shadow-win-dim);
  transform-origin: 0 0; transform: scale(var(--s));
}
.win::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 .5px var(--edge-hi); z-index: 20; }
.win.is-key { box-shadow: var(--shadow-win); }
.win.is-animating { transition: left 240ms var(--ease-out), top 240ms var(--ease-out), transform 240ms var(--ease-out), box-shadow 200ms; }
.win.is-dragging { transition: none; z-index: 950 !important; }
.win-body { flex: 1; min-height: 0; position: relative; }

.titlebar {
  position: relative; flex: none; height: 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 6px 0 9px; background: var(--titlebar); box-shadow: inset 0 -.5px 0 var(--sep);
  font-size: 13px; color: var(--label);
}
.titlebar.toolbar { height: 48px; padding: 0 10px 0 16px; }
.traffic { display: flex; gap: 8px; justify-self: start; align-items: center; }
.tl {
  position: relative; width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .14);
}
.tl-close { background: #FF5F57; }
.tl-min { background: #FEBC2E; }
.tl-zoom { background: #28C840; }
.tl:disabled { background: var(--fill-3); }
.win:not(.is-key) .tl { background: var(--fill-3); }
.tl::before, .tl::after { content: ""; position: absolute; opacity: 0; background: rgba(0, 0, 0, .55); }
.traffic:hover .tl:not(:disabled)::before, .traffic:hover .tl:not(:disabled)::after,
.traffic:focus-within .tl:not(:disabled)::before, .traffic:focus-within .tl:not(:disabled)::after { opacity: 1; }
.traffic:hover .tl:not(:disabled) { background-color: revert-layer; }
.win:not(.is-key) .traffic:hover .tl-close { background: #FF5F57; }
.win:not(.is-key) .traffic:hover .tl-min { background: #FEBC2E; }
.win:not(.is-key) .traffic:hover .tl-zoom { background: #28C840; }
.tl-close::before, .tl-close::after { left: 3px; top: 5.5px; width: 6px; height: 1px; transform: rotate(45deg); }
.tl-close::after { transform: rotate(-45deg); }
.tl-min::before { left: 3px; top: 5.5px; width: 6px; height: 1px; }
.tl-min::after { display: none; }
.tl-zoom::before { left: 3px; top: 3px; width: 4.5px; height: 4.5px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.tl-zoom::after { right: 3px; bottom: 3px; width: 4.5px; height: 4.5px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.tl:focus-visible { outline-offset: 2px; border-radius: 50%; }

.title { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-size: 13px; color: var(--label); white-space: nowrap; overflow: hidden; }
.win:not(.is-key) .title, .win:not(.is-key) .toolbar-title { color: var(--label-2); }
.title-icon { color: var(--label-2); }
.title-text { overflow: hidden; text-overflow: ellipsis; }
.title-sub { font-weight: 400; color: var(--label-2); }
.tb-right { justify-self: end; display: flex; align-items: center; gap: 4px; }
.tb-meta { font-size: 11px; color: var(--label-2); margin-right: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-btn {
  display: inline-grid; place-items: center; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 5px;
  background: transparent; color: var(--label-2);
}
.tb-btn:hover:not(:disabled) { background: var(--fill-2); color: var(--label); }
.tb-btn:active:not(:disabled) { background: var(--fill-3); }
.tb-btn:disabled { color: var(--label-3); }
.toolbar .tb-btn { height: 26px; width: 30px; }
.toolbar-title { justify-self: start; grid-column: 2; text-align: left; min-width: 0; }
.tt-main { margin: 0; font-size: 13px; font-weight: 600; }
.tt-sub { font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; }

/* Parked state: the window keeps working at a fraction of its size. */
.parked-bar {
  position: absolute; left: 0; top: 0; z-index: 6; display: none; align-items: center; gap: 5px;
  width: calc(100% * var(--s)); height: 24px; padding: 0 3px 0 6px;
  transform: scale(calc(1 / var(--s))); transform-origin: 0 0;
  background: var(--material-strong); box-shadow: inset 0 -.5px 0 var(--sep);
  font-size: 11px; font-weight: 600; color: var(--label); white-space: nowrap;
}
.win.is-small .parked-bar { display: flex; }
.pb-app { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; color: #fff; flex: none; }
.pb-app .i { width: 12px; height: 12px; stroke-width: 1.6; }
.pb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pb-badge { min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px; background: var(--red-strong); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pb-managed { display: grid; place-items: center; color: var(--accent); }
.pb-managed .i { width: 13px; height: 13px; }
.pb-restore { display: grid; place-items: center; width: 20px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--label-2); }
.pb-restore:hover { background: var(--fill-2); color: var(--label); }
.pb-restore .i { width: 13px; height: 13px; }
.win.is-parked { box-shadow: 0 0 0 calc(1.25px / var(--s)) var(--accent-ring), var(--shadow-win-dim); }
.win.is-parked.is-key { box-shadow: 0 0 0 calc(1.5px / var(--s)) var(--accent), var(--shadow-win); }
.win.is-small .titlebar .traffic, .win.is-small .titlebar .tb-right { visibility: hidden; }
.win.is-small.has-compact .win-body { visibility: hidden; }

.compact {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(24px / var(--s)); z-index: 5;
  display: none; font-size: calc(12px / var(--s)); padding: .55em .7em; background: var(--window);
}
.win.is-small .compact { display: flex; }
.compact-music { align-items: center; gap: .65em; }
.cm-play { flex: none; display: grid; place-items: center; width: 2.3em; height: 2.3em; padding: 0; border: 0; border-radius: 50%; background: var(--label); color: var(--window); }
.cm-play .i { width: 1.15em; height: 1.15em; }
.cm-text { min-width: 0; }
.cm-track { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-artist { font-size: .92em; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-bar { position: absolute; left: .7em; right: .7em; bottom: .5em; height: .2em; border-radius: 1em; background: var(--fill-3); overflow: hidden; }
.cm-fill { display: block; height: 100%; width: var(--p, 30%); background: var(--label-2); }
.compact-chat { flex-direction: column; gap: .3em; }
.cc-channel { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-unread { display: flex; align-items: center; gap: .4em; color: var(--label-2); }
.cc-count { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .4em; border-radius: .75em; background: var(--red-strong); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-last { font-size: .92em; color: var(--label-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.compact-chat.is-read .cc-count { display: none; }

/* Source highlight (Reveal Source) */
@keyframes flash {
  0%, 85% { background-color: var(--accent-tint-2); box-shadow: 0 0 0 5px var(--accent-tint-2); }
  100% { background-color: transparent; box-shadow: 0 0 0 5px transparent; }
}
.is-flash { animation: flash 1.6s var(--ease-out); border-radius: 3px; }
@keyframes win-flash { 0%, 83% { box-shadow: 0 0 0 3px var(--accent), var(--shadow-win); } 100% { box-shadow: var(--shadow-win); } }
.win.is-win-flash { animation: win-flash 1.4s var(--ease-out); }

/* ---------- Docs ---------- */
.docs-body { background: var(--canvas); }
.doc-scroll { position: absolute; inset: 0; overflow: auto; padding: 22px 0 56px; }
.doc-page {
  position: relative; width: min(560px, calc(100% - 44px)); margin: 0 auto; padding: 44px 52px 60px;
  background: var(--page); box-shadow: 0 0 0 .5px var(--sep), 0 1px 3px rgba(0,0,0,.08);
  font-family: var(--font-serif); font-size: 14px; line-height: 1.55; color: var(--label);
  user-select: text; -webkit-user-select: text; cursor: text;
}
.doc-title { margin: 0 0 6px; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.doc-byline { margin: 0 0 22px; font-family: var(--font); font-size: 11px; color: var(--label-2); }
.doc-page h2 { margin: 22px 0 6px; font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.doc-page p { margin: 0 0 10px; text-wrap: pretty; hyphens: auto; }
.doc-page ::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.doc-figure { margin: 16px 0 14px; padding: 0; user-select: none; }
.doc-figure .map-svg { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 .5px var(--sep-strong); }
.doc-figure figcaption { margin-top: 6px; font-family: var(--font); font-size: 11px; color: var(--label-2); }
.drop-caret { position: absolute; left: 40px; right: 40px; height: 2px; border-radius: 1px; background: var(--accent); pointer-events: none; }
.drop-caret::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Browser ---------- */
.nav-btns { display: flex; gap: 2px; margin-left: 14px; }
.titlebar.toolbar:has(.address) { grid-template-columns: auto auto 1fr auto; gap: 6px; }
.address {
  justify-self: stretch; display: flex; align-items: center; justify-content: center; gap: 6px; height: 28px; margin: 0 8px;
  min-width: 0; padding: 0 12px; border-radius: 7px; background: var(--fill-2); color: var(--label); font-size: 13px; font-weight: 400;
}
.address .i { color: var(--label-2); }
.address span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-body { display: grid; grid-template-columns: 1fr 232px; }
.web-page { overflow: auto; background: #FBF8F3; color: #23201B; user-select: text; -webkit-user-select: text; }
.side-panel { display: flex; flex-direction: column; min-height: 0; background: var(--window-2); box-shadow: inset .5px 0 0 var(--sep); }
.sp-head { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; font-size: 12px; font-weight: 600; color: var(--label-2); box-shadow: inset 0 -.5px 0 var(--sep); }
.results { list-style: none; padding: 6px; overflow: auto; flex: 1; }
.result {
  position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center;
  padding: 6px 6px 6px 8px; border-radius: 6px; cursor: grab;
}
.result + .result { margin-top: 2px; }
.result:hover { background: var(--fill); }
.result.is-current { background: var(--fill-2); }
.result:active { cursor: grabbing; }
.r-open { all: unset; display: block; min-width: 0; cursor: pointer; border-radius: 4px; }
.r-open:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.r-name { display: block; font-size: 13px; font-weight: 600; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { display: block; margin-top: 1px; font-size: 11px; color: var(--label-2); white-space: nowrap; }
.r-meta .tnum { color: var(--label); }
.r-add { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 11px; background: var(--control); color: var(--accent-text); box-shadow: 0 0 0 .5px var(--control-ring), 0 .5px 1px rgba(0,0,0,.08); opacity: 0; }
.result:hover .r-add, .result:focus-within .r-add, .r-add[aria-pressed="true"] { opacity: 1; }
.r-add[aria-pressed="true"] { color: var(--green-strong); background: transparent; box-shadow: none; }
.r-add .i { width: 13px; height: 13px; stroke-width: 1.75; }
.sp-foot { padding: 8px 12px 10px; font-size: 11px; line-height: 1.35; color: var(--label-2); box-shadow: inset 0 .5px 0 var(--sep); }

/* Hotel page (web content, the site's own styling) */
.site { min-height: 100%; display: flex; flex-direction: column; font-family: var(--font); }
.site-nav { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 20px; border-bottom: 1px solid rgba(35,32,27,.1); font-size: 12px; }
.site-brand { font-family: var(--font-serif); font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.site-links { display: flex; gap: 14px; color: rgba(35,32,27,.7); }
.site-hero { padding: 22px 20px 16px; }
.site-hero h1 { margin: 0; font-family: var(--font-serif); font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.site-loc { margin-top: 6px; font-size: 12px; color: rgba(35,32,27,.72); }
.site-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; }
.site-facts strong { font-variant-numeric: tabular-nums; }
.site-body { padding: 0 20px 16px; font-size: 13px; line-height: 1.5; color: rgba(35,32,27,.86); max-width: 62ch; user-select: text; }
.site-body p + p { margin-top: 8px; }
.site-amen { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 20px 18px; list-style: none; }
.site-amen li { padding: 3px 9px; border-radius: 99px; background: rgba(35,32,27,.07); font-size: 11px; }
.site-cta { margin: 0 20px 20px; align-self: flex-start; height: 30px; padding: 0 16px; border: 0; border-radius: 15px; background: #23201B; color: #FBF8F3; font-size: 12px; font-weight: 600; }
.site-foot { margin-top: auto; padding: 10px 20px; font-size: 11px; color: rgba(35,32,27,.62); border-top: 1px solid rgba(35,32,27,.08); }
@media (prefers-color-scheme: dark) {
  .web-page { background: #1B1A18; color: #EDE7DD; }
  .site-nav { border-bottom-color: rgba(237,231,221,.12); }
  .site-links, .site-loc { color: rgba(237,231,221,.7); }
  .site-body { color: rgba(237,231,221,.86); }
  .site-amen li { background: rgba(237,231,221,.1); }
  .site-cta { background: #EDE7DD; color: #1B1A18; }
  .site-foot { color: rgba(237,231,221,.6); border-top-color: rgba(237,231,221,.1); }
}

/* ---------- Sheets ---------- */
.sheets-body { display: flex; flex-direction: column; background: var(--window); }
.formula-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; font-size: 12px; box-shadow: inset 0 -.5px 0 var(--sep); }
.cell-ref { min-width: 44px; padding: 1px 6px; border-radius: 4px; background: var(--fill-2); text-align: center; font-variant-numeric: tabular-nums; }
.fx { font-family: var(--font-serif); font-style: italic; color: var(--label-2); }
.formula { font-family: var(--font-mono); font-size: 11px; color: var(--label); }
.grid-wrap { flex: 1; overflow: auto; }
.grid { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.grid th, .grid td { height: 22px; padding: 0 7px; border: .5px solid var(--grid-line); white-space: nowrap; text-align: left; font-weight: 400; }
.grid thead th { background: var(--window-2); color: var(--label-2); text-align: center; font-size: 11px; }
.grid .rh { width: 30px; background: var(--window-2); color: var(--label-2); text-align: center; font-size: 11px; }
.grid .num { text-align: right; }
.grid .strong { font-weight: 600; }
.grid .hdr td { font-weight: 600; background: var(--fill); }
.grid .total td { font-weight: 600; border-top: 1px solid var(--label-3); }
.grid .sel { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Chat ---------- */
.chat-body { display: grid; grid-template-columns: 136px minmax(0, 1fr); background: var(--window); }
.chat-side { padding: 10px 8px; background: var(--window-2); box-shadow: inset -.5px 0 0 var(--sep); font-size: 13px; overflow: hidden; }
.chat-ws { padding: 0 6px 8px; font-weight: 700; }
.chat-side ul { list-style: none; }
.chat-side li { display: flex; align-items: center; gap: 3px; height: 24px; padding: 0 6px; border-radius: 5px; color: var(--label-2); white-space: nowrap; }
.chat-side li.is-current { background: var(--fill-3); color: var(--label); font-weight: 600; }
.hash { opacity: .8; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { flex: none; display: flex; align-items: baseline; gap: 8px; height: 34px; padding: 9px 14px 0; box-shadow: inset 0 -.5px 0 var(--sep); }
.chat-head span { font-size: 11px; color: var(--label-2); }
.chat-msgs { flex: 1; min-height: 0; overflow: auto; list-style: none; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; user-select: text; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; line-height: 1.4; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.av-1 { background: #8E44AD; } .av-2 { background: #0F766E; } .av-3 { background: #B45309; }
.msg-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 1px; }
.msg-meta time { font-size: 11px; color: var(--label-2); }
.composer { flex: none; display: flex; align-items: center; height: 32px; margin: 0 12px 12px; padding: 0 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--sep-strong); color: var(--label-2); }

/* ---------- Music ---------- */
.music-body { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px 18px; background: var(--window); }
.artwork { width: 128px; height: 128px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 3px 10px rgba(0,0,0,.16); }
.artwork svg { display: block; }
.player { min-width: 0; }
.track { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist { margin-top: 2px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { margin-top: 14px; height: 4px; border-radius: 2px; background: var(--fill-3); overflow: hidden; }
.progress-fill { display: block; width: 31.6%; height: 100%; background: var(--label-2); }
.times { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 6px; }
.ctl { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--label); }
.ctl:hover { background: var(--fill-2); }
.ctl:active { background: var(--fill-3); }
.ctl-play { width: 40px; height: 40px; }

/* ---------- Timeline ---------- */
.titlebar.toolbar:has(.toolbar-title) { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 20px; }
.titlebar.toolbar:has(.toolbar-title) .toolbar-title { grid-column: auto; }
.rec-status { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; font-size: 12px; color: var(--label-2); white-space: nowrap; }
.desktop.is-paused .rec-dot { background: var(--gray); }
.tl-body { display: grid; grid-template-columns: minmax(0, 1fr) 268px; background: var(--window); }
.tl-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 18px 12px 16px; overflow: hidden; }
.tl-paused {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 8px 8px 12px; border-radius: 8px;
  background: var(--fill); box-shadow: inset 0 0 0 .5px var(--sep-strong); font-size: 12px; color: var(--label);
}
.tl-paused p { flex: 1; }
.tl-paused .i { color: var(--label-2); }
.tl-chart { display: grid; grid-template-columns: 82px minmax(0, 1fr); }
.tl-labels { display: flex; flex-direction: column; padding-top: 24px; }
.tl-label.is-off { color: var(--label-3); }
.tl-label.is-off .tl-swatch { opacity: .35; }
.tl-label { display: flex; align-items: center; gap: 7px; height: 50px; font-size: 12px; color: var(--label); white-space: nowrap; }
.tl-swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.tl-plot { position: relative; min-width: 0; }
.tl-lanes { position: relative; margin-top: 24px; }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 0; border-left: .5px solid var(--sep); pointer-events: none; }
.tl-grid.is-hour { border-left-color: var(--sep-strong); }
.tl-lane { position: relative; height: 50px; box-shadow: inset 0 -.5px 0 var(--sep); }
.tl-lane:first-child { box-shadow: inset 0 .5px 0 var(--sep), inset 0 -.5px 0 var(--sep); }
.tl-bar {
  position: absolute; top: 50%; height: var(--h); margin-top: calc(var(--h) / -2); min-width: 3px; padding: 0; border: 0; border-radius: 4px;
  background: var(--c); opacity: var(--o);
  transition: left 240ms var(--ease-out), width 240ms var(--ease-out), opacity 150ms var(--ease);
}
.tl-bar:hover, .tl-bar:focus-visible, .tl-bar.is-hot { opacity: 1; outline: none; box-shadow: 0 0 0 2px var(--window), 0 0 0 3.5px var(--c); }
.tl-bar.is-minor { border-radius: 2px; }
.tl-chart.is-collapsed .tl-bar.is-minor { opacity: 0; pointer-events: none; }
.tl-band {
  position: absolute; top: 4px; bottom: 4px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 0 4px; border: 0; border-radius: 7px; background: var(--fill-2); box-shadow: inset 0 0 0 .5px var(--sep-strong);
  color: var(--label-2); font-size: 11px; line-height: 1.25; text-align: center; font-variant-numeric: tabular-nums;
  transition: left 240ms var(--ease-out), width 240ms var(--ease-out), background-color 150ms;
}
.tl-band strong { color: var(--label); font-weight: 600; font-size: 12px; }
.tl-band:hover { background: var(--fill-3); }
.tl-band .i { width: 12px; height: 12px; margin-top: 2px; }
.tl-band.is-expanded {
  top: auto; bottom: calc(100% + 2px); height: 20px; flex-direction: row; gap: 4px; background: transparent; box-shadow: none; border-radius: 5px; font-size: 11px;
}
.tl-band.is-expanded:hover { background: var(--fill-2); }
.tl-span { position: absolute; top: 0; bottom: 0; z-index: 0; background: var(--fill); pointer-events: none; transition: left 240ms var(--ease-out), width 240ms var(--ease-out); }
.tl-axis { position: relative; height: 26px; font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.tl-tick { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; transition: left 240ms var(--ease-out), opacity 150ms var(--ease-out); }
.tl-tick:first-child { transform: none; }
.tl-tick:last-child { transform: translateX(-100%); }
.tl-tick.is-hidden { opacity: 0; }
.tl-legend { margin-top: 6px; font-size: 11px; color: var(--label-2); }
.tl-chart.is-paused-dim .tl-lanes { opacity: .55; }
.tl-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--window); color: var(--label-2); text-align: center; }
.tl-empty .i { color: var(--label-3); margin-bottom: 6px; }
.tl-empty-title { font-size: 15px; font-weight: 600; color: var(--label); }

.trail { display: flex; flex-direction: column; min-height: 0; background: var(--window-2); box-shadow: inset .5px 0 0 var(--sep); }
.trail-head { flex: none; padding: 14px 16px 8px; }
.trail-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.trail-sum { margin-top: 2px; font-size: 12px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.trail-list { flex: 1; min-height: 0; overflow: auto; list-style: none; padding: 2px 8px 10px; }
.trail-list li { position: relative; }
.trail-list li + li::before { content: ""; position: absolute; left: 17.25px; top: -9px; height: 18px; border-left: 1.5px solid var(--sep-strong); }
.trail-node {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; align-items: start; width: 100%;
  margin: 0; padding: 5px 6px 5px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left;
}
.trail-node:hover, .trail-node:focus-visible, .trail-node.is-hot { background: var(--fill-2); }
.trail-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--window); box-shadow: inset 0 0 0 1.5px var(--c); color: var(--c); }
.trail-dot .i { width: 11px; height: 11px; stroke-width: 1.75; }
.trail-title { display: block; font-size: 12px; font-weight: 600; color: var(--label); line-height: 1.3; }
.trail-meta { display: block; margin-top: 1px; font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.trail-empty { padding: 10px; font-size: 12px; color: var(--label-2); }
.why { flex: none; padding: 10px 16px 12px; box-shadow: inset 0 .5px 0 var(--sep); font-size: 12px; }
.why summary { display: flex; align-items: center; gap: 5px; list-style: none; font-weight: 600; border-radius: 4px; }
.why summary::-webkit-details-marker { display: none; }
.why .disclosure { color: var(--label-2); transition: transform 150ms var(--ease-out); }
.why[open] .disclosure { transform: rotate(90deg); }
.why ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.why li { display: flex; align-items: center; gap: 7px; }
.why li .i { color: var(--label-2); }
.why p { margin-top: 8px; font-size: 11px; color: var(--label-2); }

/* ---------- Signals settings ---------- */
.settings-body { overflow: auto; background: var(--window-2); }
.form { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 20px; }
.group-title { margin: 0 0 6px 10px; font-size: 13px; font-weight: 600; }
.group-foot { margin: 6px 10px 0; font-size: 11px; color: var(--label-2); }
.rows { border-radius: 10px; background: var(--window); box-shadow: 0 0 0 .5px var(--sep); }
.row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 44px; right: 0; height: .5px; background: var(--sep); }
.row-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; flex: none; }
.row-icon .i { width: 13px; height: 13px; stroke-width: 1.6; }
.ic-red { background: #E5352B; } .ic-blue { background: #0A6FE0; } .ic-teal { background: #0E8FA6; } .ic-orange { background: #D97706; }
.ic-gray { background: #7C7C82; } .ic-green { background: #248A3D; } .ic-indigo { background: #5856D6; } .ic-pink { background: #D6245A; }
.row-text { flex: 1; min-width: 0; }
.row-label { font-size: 13px; }
.row-help { margin-top: 1px; font-size: 11px; color: var(--label-2); line-height: 1.35; }
.row-value { font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--label-2); white-space: nowrap; }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.status-pill.ok .pdot { background: var(--green); }
.privacy-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 10px; font-size: 12px; color: var(--label-2); line-height: 1.4; }
.privacy-note .i { margin-top: 1px; }
@media (prefers-color-scheme: dark) {
  .settings-body { background: var(--window); }
  .rows { background: var(--window-2); }
  .trail-dot { background: var(--window-2); }
}

/* ---------- AppKit-style controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 22px; padding: 0 10px;
  border: 0; border-radius: 6px; background: var(--control); color: var(--label); font-size: 13px; white-space: nowrap;
  box-shadow: 0 0 0 .5px var(--control-ring), 0 .5px 1px rgba(0, 0, 0, .1);
}
.btn:active:not(:disabled) { background: var(--control-pressed); }
.btn:disabled { color: var(--label-3); box-shadow: 0 0 0 .5px var(--sep); }
.btn .i { width: 14px; height: 14px; }
.btn-small { height: 20px; padding: 0 8px; font-size: 12px; border-radius: 5px; }
.btn-primary { background: var(--accent-fill); color: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 .5px 1px rgba(0,0,0,.18); }
.btn-primary:active:not(:disabled) { background: color-mix(in srgb, var(--accent-fill) 85%, #000); }
.btn-destructive { color: var(--destructive, #D70015); }
.btn-plain { background: transparent; box-shadow: none; color: var(--accent-text); }
.btn-plain:hover { background: var(--fill); }
@media (prefers-color-scheme: dark) { :root { --destructive: #FF6B62; } }

.segmented { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--fill-2); }
.segmented button { min-width: 66px; height: 20px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; font-size: 12px; color: var(--label); }
.segmented button[aria-checked="true"] { background: var(--seg-sel, #fff); font-weight: 500; box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.12); }
.segmented button:focus-visible { outline-offset: 0; }
@media (prefers-color-scheme: dark) { :root { --seg-sel: rgba(255, 255, 255, .22); } }

.switch {
  position: relative; flex: none; width: 32px; height: 18px; padding: 0; border: 0; border-radius: 9px;
  background: var(--fill-3); box-shadow: inset 0 0 0 .5px var(--sep-strong); transition: background-color 180ms var(--ease-out);
}
.switch .knob {
  position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.22); transition: transform 180ms var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--accent); box-shadow: none; }
.switch[aria-checked="true"] .knob { transform: translateX(14px); }
.switch:focus-visible { border-radius: 9px; }

.checkbox {
  display: grid; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 4px;
  background: var(--control); color: #fff; box-shadow: inset 0 0 0 .5px var(--label-3), 0 .5px 1px rgba(0,0,0,.08);
}
.checkbox .i { width: 11px; height: 11px; stroke-width: 2.25; opacity: 0; }
.checkbox[aria-checked="true"] { background: var(--accent-fill); box-shadow: none; }
.checkbox[aria-checked="true"] .i { opacity: 1; }
.checkbox:focus-visible { border-radius: 4px; outline-offset: 1px; }

kbd { display: inline-block; padding: 0 4px; border-radius: 4px; background: var(--fill); box-shadow: inset 0 0 0 .5px var(--sep-strong); font-size: 11px; line-height: 16px; letter-spacing: .04em; }

/* ---------- Scrapbook (NSPanel, utility) ---------- */
.scrapbook {
  position: fixed; top: 32px; right: 8px; bottom: 8px; width: 300px; z-index: 1000;
  display: flex; flex-direction: column; border-radius: 12px; overflow: clip;
  background: var(--material);
  -webkit-backdrop-filter: blur(40px) saturate(1.8); backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: var(--shadow-panel);
  transition: transform 240ms var(--ease-out), opacity 200ms var(--ease), visibility 0s linear 0s;
}
.scrapbook::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 .5px var(--edge-hi); }
.scrapbook.is-collapsed { transform: translateX(calc(100% + 16px)); opacity: 0; visibility: hidden; transition: transform 240ms var(--ease-out), opacity 200ms var(--ease), visibility 0s linear 240ms; }
.sb-head { flex: none; display: flex; align-items: center; gap: 9px; padding: 10px 8px 8px 14px; }
.sb-glyph { color: var(--accent); }
.sb-titles { flex: 1; min-width: 0; }
.sb-title { margin: 0; font-size: 13px; font-weight: 600; }
.sb-doc { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11px; color: var(--label-2); white-space: nowrap; overflow: hidden; }
.sb-doc span { overflow: hidden; text-overflow: ellipsis; }
.sb-toolbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 9px; }
.sb-count { font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 8px 8px 12px; box-shadow: inset 0 .5px 0 var(--sep); }
.sb-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  position: relative; display: grid; grid-template-columns: 14px 28px minmax(0, 1fr) 22px; column-gap: 8px; align-items: center;
  padding: 6px 4px 6px 6px; border-radius: 8px;
}
.sb-item:hover { background: var(--fill); }
.sb-item.is-selected { background: var(--accent-tint); }
.sb-item:focus-visible { outline-offset: -1px; border-radius: 8px; }
.sb-item.is-new { animation: item-in 240ms var(--ease-out); }
@keyframes item-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sb-item .checkbox { opacity: 0; transition: opacity 150ms var(--ease-out); }
.sb-item:hover .checkbox, .sb-item:focus-within .checkbox, .sb-list.has-selection .checkbox, .sb-item .checkbox[aria-checked="true"] { opacity: 1; }
.sb-type { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: color-mix(in srgb, var(--tc) 13%, transparent); color: var(--tc); }
.t-text { --tc: #636366; } .t-file { --tc: #248A3D; } .t-web { --tc: #0B7A90; } .t-map { --tc: #5856D6; }
@media (prefers-color-scheme: dark) { .t-text { --tc: #AEAEB2; } .t-file { --tc: #30D158; } .t-web { --tc: #40C8E0; } .t-map { --tc: #8E8CFF; } }
.sb-text { min-width: 0; }
.sb-name { font-size: 13px; font-weight: 500; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-src { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11px; color: var(--label-2); white-space: nowrap; overflow: hidden; }
.sb-src span { overflow: hidden; text-overflow: ellipsis; }
.sb-more { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--label-2); opacity: 0; }
.sb-item:hover .sb-more, .sb-item:focus-within .sb-more, .sb-more[aria-expanded="true"] { opacity: 1; }
.sb-more:hover { background: var(--fill-2); color: var(--label); }
.sb-preview { grid-column: 2 / -1; margin-top: 7px; }
.sb-quote { font-family: var(--font-serif); font-size: 12px; line-height: 1.45; color: var(--label); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sb-map { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 .5px var(--sep-strong); cursor: grab; }
.sb-map-hint { margin-top: 4px; font-size: 11px; color: var(--label-2); }
.sb-prov { display: none; grid-column: 2 / -1; margin-top: 8px; padding-top: 8px; box-shadow: inset 0 .5px 0 var(--sep); }
.scrapbook.is-sources .sb-prov { display: block; }
.sb-prov dl { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 3px 8px; margin: 0; font-size: 11px; line-height: 1.35; }
.sb-prov dt { color: var(--label-2); }
.sb-prov dd { margin: 0; color: var(--label); overflow-wrap: anywhere; }
.sb-prov .mono { font-family: var(--font-mono); font-size: 10.5px; }
.sb-prov .btn { margin-top: 8px; }
.sb-item[draggable="true"] { cursor: grab; }

.suggestion {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; grid-template-areas: "icon title dismiss" ". sub sub" ". actions actions"; column-gap: 8px; align-items: center; margin: 0 0 8px; padding: 9px 10px 10px;
  border-radius: 9px; background: var(--accent-tint); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: item-in 240ms var(--ease-out);
}
.suggestion > .i { grid-area: icon; color: var(--accent-text); }
.sg-dismiss { grid-area: dismiss; margin: -2px -4px 0 0; }
.sg-title { grid-area: title; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sg-sub { grid-area: sub; margin-top: 1px; font-size: 11px; color: var(--label-2); }
.sg-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.sb-empty { padding: 30px 16px 20px; text-align: center; color: var(--label-2); }
.sb-empty > .i { color: var(--label-2); opacity: .7; }
.sb-empty-title { margin: 8px 0 14px; font-size: 13px; font-weight: 600; color: var(--label); }
.sb-empty ul { list-style: none; display: inline-flex; flex-direction: column; gap: 9px; text-align: left; font-size: 12px; line-height: 1.4; }
.sb-empty li { display: flex; align-items: flex-start; gap: 8px; }
.sb-empty li .i { margin-top: 1px; }
.sb-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px 14px; box-shadow: inset 0 .5px 0 var(--sep); }
.sb-sel { min-width: 0; font-size: 11px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-drop {
  position: absolute; inset: 6px; z-index: 5; display: grid; place-items: center; padding: 20px; border-radius: 9px; text-align: center;
  background: color-mix(in srgb, var(--accent) 10%, var(--material-strong)); box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent-text); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 150ms var(--ease);
}
.scrapbook.is-drop-target .sb-drop { opacity: 1; }
.sb-tab {
  position: fixed; right: 0; top: 50%; z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 30px; padding: 10px 0; border: 0; border-radius: 8px 0 0 8px; transform: translateY(-50%);
  background: var(--material); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: var(--shadow-panel); color: var(--label);
}
.sb-tab-count { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 6px; z-index: 1100; transform: translateX(-50%); padding: 5px 6px 4px; border-radius: 18px;
  background: var(--dock-bg); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.14), inset 0 0 0 .5px var(--edge-hi), 0 10px 30px rgba(0,0,0,.14);
}
.dock ul { list-style: none; display: flex; align-items: flex-end; gap: 4px; }
.dock-btn { position: relative; display: block; width: 54px; height: 58px; padding: 0 3px 8px; border: 0; border-radius: 12px; background: transparent; }
.dock-btn:focus-visible { outline-offset: -2px; border-radius: 12px; }
.dock-icon { display: block; width: 48px; height: 48px; border-radius: 11px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.2), inset 0 0 0 .5px rgba(0,0,0,.1); transition: transform 150ms var(--ease-out); }
.dock-btn:active .dock-icon { filter: brightness(.85); }
.dock-icon svg { display: block; width: 100%; height: 100%; }
.di-docs { background: linear-gradient(180deg, #8381F2, #4E4BCB); }
.di-browser { background: linear-gradient(180deg, #4FC6DD, #1F92AE); }
.di-sheets { background: linear-gradient(180deg, #5BD27A, #26954A); }
.di-chat { background: linear-gradient(180deg, #FFB347, #F0841A); }
.di-music { background: linear-gradient(180deg, #FF6B88, #E0284F); }
.di-mail { background: linear-gradient(180deg, #4AA3FF, #1569E0); }
.di-calendar { background: #fff; }
.dock-dot { position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--label); opacity: 0; }
.dock-btn.is-running .dock-dot { opacity: .75; }
.dock-badge { position: absolute; top: -3px; right: -1px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red-strong); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.dock-label {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); padding: 3px 10px; border-radius: 6px;
  background: var(--popover-bg); box-shadow: var(--shadow-menu); font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms var(--ease-out);
}
.dock-btn:hover .dock-label, .dock-btn:focus-visible .dock-label { opacity: 1; }

/* ---------- Overlays: leader lines, send button, popovers, sheets, HUD ---------- */
.leader-layer { position: fixed; inset: 0; z-index: 1200; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.leader-path { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: leader-draw 220ms cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes leader-draw { to { stroke-dashoffset: 0; } }
.leader-mark { fill: var(--accent); }
.leader-mark.is-hollow { fill: var(--window); stroke: var(--accent); stroke-width: 1; }
.leader-target { fill: none; stroke: var(--accent); stroke-width: 1; }
.leader-target.is-occluded { stroke-dasharray: 3 3; }
.leader-layer.is-instant .leader-path { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }

.send-btn {
  position: fixed; z-index: 1350; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 5px 0 8px; border: 0; border-radius: 7px;
  background: var(--popover-bg); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--shadow-menu); font-size: 12px; font-weight: 500; color: var(--label); animation: menu-in 150ms var(--ease-out);
}
.send-btn .i { color: var(--accent-text); }
.send-btn:hover { background: var(--accent-fill); color: #fff; }
.send-btn:hover .i { color: #fff; }
.send-btn:hover kbd { background: rgba(255,255,255,.18); box-shadow: none; color: #fff; }
.send-btn kbd { margin-left: 2px; color: var(--label-2); }

.popover {
  position: fixed; z-index: 1450; max-width: 300px; padding: 8px 11px 9px; border-radius: 9px; pointer-events: none;
  background: var(--popover-bg); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: var(--shadow-menu); font-size: 12px; line-height: 1.4; color: var(--label); animation: pop-in 150ms var(--ease-out);
}
.popover::after { content: ""; position: absolute; left: calc(var(--ax, 50%) - 9px); width: 18px; height: 9px; background: var(--popover-bg); }
.popover.is-above::after { top: 100%; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.popover.is-below::after { bottom: 100%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@keyframes pop-in { from { opacity: 0; } to { opacity: 1; } }
.pv-line { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-line .pv-app { color: var(--pc); }
.pv-sub { margin-top: 2px; color: var(--label-2); }
.pv-hint { margin-top: 5px; font-size: 11px; color: var(--label-2); }

.sheet-layer { position: fixed; inset: 0; z-index: 1500; pointer-events: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .14); pointer-events: auto; animation: pop-in 200ms var(--ease-out); }
.sheet {
  position: absolute; left: 50%; top: 56px; display: flex; flex-direction: column; width: min(680px, calc(100vw - 48px)); max-height: calc(100vh - 150px);
  border-radius: 12px; background: var(--window); box-shadow: var(--shadow-sheet); pointer-events: auto; transform: translateX(-50%);
  animation: sheet-in 220ms var(--ease-out);
}
.sheet::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 .5px var(--edge-hi); }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sheet-head { flex: none; padding: 16px 20px 10px; }
.sheet-title { margin: 0; font-size: 13px; font-weight: 700; }
.sheet-sub { margin-top: 2px; font-size: 11px; color: var(--label-2); }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 20px 8px; }
.sheet-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }
.sheet-foot .note { margin-right: auto; font-size: 11px; color: var(--label-2); }
.sheet.alert { width: 280px; padding: 20px 16px 16px; text-align: center; }
.alert-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 12px; background: var(--fill-2); color: var(--label-2); }
.alert-icon .i { width: 26px; height: 26px; }
.alert-title { margin: 0; font-size: 13px; font-weight: 700; }
.alert-text { margin-top: 6px; font-size: 11px; line-height: 1.4; color: var(--label-2); }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.alert-actions .btn { height: 26px; }

.sheet.sheet-wide { width: min(780px, calc(100vw - 48px)); }
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 240px; border-radius: 9px; background: var(--window-2); box-shadow: 0 0 0 .5px var(--sep); overflow: hidden; }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px; box-shadow: inset 0 -.5px 0 var(--sep); }
.pane-head .sb-type { width: 24px; height: 24px; border-radius: 6px; }
.pane-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-src { font-size: 11px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-body { flex: 1; padding: 12px; font-size: 13px; line-height: 1.45; user-select: text; }
.pane-body .doc-quote { font-family: var(--font-serif); font-size: 14px; line-height: 1.55; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--label-2); }
.facts dd { margin: 0; }
.mini-grid { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.mini-grid td { padding: 3px 5px; border: .5px solid var(--grid-line); white-space: nowrap; }
.mini-grid .num { text-align: right; }
.mini-grid .total td { font-weight: 600; }

.cmp { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cmp th { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--label-2); text-align: left; border-bottom: .5px solid var(--sep-strong); }
.cmp td { padding: 8px; border-bottom: .5px solid var(--sep); }
.cmp .num { text-align: right; }
.cmp .tag { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--fill-2); font-size: 11px; color: var(--label-2); }

.hud {
  position: fixed; left: 50%; bottom: 92px; z-index: 1600; display: flex; align-items: center; gap: 14px; min-height: 36px; max-width: 520px;
  padding: 6px 6px 6px 14px; border-radius: 11px; transform: translateX(-50%);
  background: var(--hud-bg); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: var(--shadow-menu); font-size: 13px; font-weight: 500; animation: hud-in 200ms var(--ease-out);
}
.hud.no-action { padding-right: 14px; }
.hud .i { color: var(--accent-text); }
@keyframes hud-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Schematic map ---------- */
.map-svg { background: #F2F0EB; }
.map-svg .m-block { fill: #E8E5DE; }
.map-svg .m-park { fill: #DCE7D3; }
.map-svg .m-road { fill: none; stroke: #FFFFFF; stroke-width: 4; stroke-linecap: round; }
.map-svg .m-street { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; }
.map-svg .m-river { fill: none; stroke: #A9CBE8; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.map-svg .m-district { font: 600 8.5px var(--font); fill: rgba(0, 0, 0, .5); letter-spacing: .06em; paint-order: stroke; stroke: #F2F0EB; stroke-width: 3px; stroke-linejoin: round; }
.map-svg .m-pin { fill: var(--accent-fill); stroke: #fff; stroke-width: 1.5; }
.map-svg .m-label { font: 600 10px var(--font); fill: #1D1D1F; paint-order: stroke; stroke: #F2F0EB; stroke-width: 3px; stroke-linejoin: round; }
.map-svg .m-river-label { font: italic 8px var(--font-serif); fill: #4F7FA8; }
@media (prefers-color-scheme: dark) {
  .map-svg { background: #2A2C30; }
  .map-svg .m-block { fill: #313338; }
  .map-svg .m-park { fill: #2E3A2C; }
  .map-svg .m-road { stroke: #4A4D55; }
  .map-svg .m-street { stroke: #3D4047; }
  .map-svg .m-river { stroke: #2E5A82; }
  .map-svg .m-district { fill: rgba(255, 255, 255, .55); stroke: #2A2C30; }
  .map-svg .m-pin { stroke: #1E1E1E; }
  .map-svg .m-label { fill: #F2F2F7; stroke: #2A2C30; }
  .map-svg .m-river-label { fill: #8FB8DD; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .leader-path { animation: none !important; stroke-dasharray: none; stroke-dashoffset: 0; }
  .is-flash { animation: none !important; background-color: var(--accent-tint-2); box-shadow: 0 0 0 5px var(--accent-tint-2); }
  .win.is-win-flash { animation: none !important; box-shadow: 0 0 0 3px var(--accent), var(--shadow-win); }
}
