
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {

  --white: #ffffff;
  --black: #000000;

  --green-25: #edfbf2;
  --green-55: #daf4e4;
  --green-110: #bae7cc;
  --green-190: #8ed3ab;
  --green-300: #58b483;
  --green-400: #309564;
  --green-500: #1d754c;
  --green-570: #165e3c;
  --green-640: #13482e;
  --green-710: #0e3321;
  --green-810: #07180f;

  --stone-20: #f9f8f5;
  --stone-40: #f4f2ed;
  --stone-55: #efece6;
  --stone-70: #ebe8e1;

  --grey-55: #eaeeeb;
  --grey-90: #dee2e0;
  --grey-140: #cbd3ce;
  --grey-200: #b8c0bb;
  --grey-300: #99a19c;
  --grey-335: #8e9691;
  --grey-470: #666e69;
  --grey-515: #5a615c;
  --grey-565: #4c534f;
  --grey-630: #3a423d;
  --grey-675: #2e3631;
  --grey-705: #272f2a;
  --grey-735: #202723;
  --grey-760: #1a211d;
  --grey-780: #151d18;
  --grey-815: #0d1510;

  --blue-45: #e8f1fd;
  --blue-175: #a3c8ff;
  --blue-260: #79b0e8;
  --blue-335: #5b90f5;
  --blue-455: #2563eb;
  --blue-500: #2266a4;
  --blue-565: #14538f;
  --blue-645: #1e3b66;

  --red-45: #fdecec;
  --red-150: #ffb9b0;
  --red-315: #ef6b5e;
  --red-455: #c0392b;
  --red-540: #a02020;
  --red-650: #5e2622;
  --red-795: #2a0d0a;

  --amber-30: #fff4d6;
  --amber-35: #fdf3e2;
  --amber-140: #f6cb6d;
  --amber-240: #e0a54e;
  --amber-455: #a05f00;
  --amber-510: #7a5b00;
  --amber-640: #4d3a0d;

  --purple-50: #f1ebfb;
  --purple-155: #d4bfff;
  --purple-575: #5b2d9e;
  --purple-670: #3b2860;

  --teal-45: #e3f5f4;
  --teal-160: #86ddd5;
  --teal-560: #0e5f5a;
  --teal-665: #123f3c;

  --pink-45: #fcebf3;
  --pink-150: #ffb3d6;
  --pink-535: #9a1f5c;
  --pink-655: #5a2140;

  --whatsapp: #25d366;
  --whatsapp-deep: #128c4a;
  --whatsapp-bright: #3ddc84;

  --bg: var(--stone-40);
  --bg-deep: var(--stone-70);
  --surface: var(--white);
  --surface-2: var(--stone-20);
  --surface-3: var(--stone-55);
  --text: var(--grey-780);
  --text-2: var(--grey-565);
  --muted: var(--grey-515);
  --text-3: var(--grey-300);
  --border: var(--grey-90);
  --border-2: var(--grey-140);

  --accent: var(--green-500);
  --accent-strong: var(--green-570);
  --accent-ink: var(--white);
  --link: var(--blue-500);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --selection: color-mix(in srgb, var(--accent) 35%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 32%, var(--border));

  --good: var(--accent);
  --warn: var(--amber-455);
  --warn-soft: var(--amber-35);
  --danger: var(--red-455);
  --danger-soft: var(--red-45);
  --info: var(--blue-455);
  --info-soft: var(--blue-45);

  --sheet-hl-red: var(--red-45);
  --sheet-hl-red-ink: var(--red-540);
  --sheet-hl-amber: var(--amber-30);
  --sheet-hl-amber-ink: var(--amber-510);
  --sheet-hl-green: var(--green-55);
  --sheet-hl-green-ink: var(--green-570);
  --sheet-hl-blue: var(--blue-45);
  --sheet-hl-blue-ink: var(--blue-565);
  --sheet-hl-purple: var(--purple-50);
  --sheet-hl-purple-ink: var(--purple-575);
  --sheet-hl-teal: var(--teal-45);
  --sheet-hl-teal-ink: var(--teal-560);
  --sheet-hl-pink: var(--pink-45);
  --sheet-hl-pink-ink: var(--pink-535);

  --danger-ink: var(--white);

  --knob: var(--white);

  --deep: var(--green-810);

  --mark-from: var(--accent-strong);
  --mark-to: color-mix(in srgb, var(--accent) 70%, var(--deep));

  --scrim: color-mix(in srgb, var(--green-810) 42%, transparent);
  --scroll-edge: color-mix(in srgb, var(--text) 26%, transparent);

  --lens-bed: var(--black);
  --lens-reticle: color-mix(in srgb, var(--white) 85%, transparent);
  --lens-veil: color-mix(in srgb, var(--black) 25%, transparent);

  --hero-ink: var(--green-25);
  --hero: var(--green-500);
  --hero-strong: var(--green-570);
  --hero-deep: var(--green-810);

  --frame-green: var(--green-710);
  --frame-plain: var(--bg);
  --bar: var(--frame-green);
  --bar-ink: var(--white);
  --bar-on: var(--white);
  --bar-on-ink: var(--bar);
  --bar-ink-2: color-mix(in srgb, var(--bar-ink) 78%, var(--bar));
  --bar-fill: color-mix(in srgb, var(--bar-ink) 12%, transparent);
  --bar-fill-hover: color-mix(in srgb, var(--bar-ink) 22%, transparent);
  --bar-line: color-mix(in srgb, var(--bar-ink) 24%, transparent);
  --tabs: var(--sunk);
  --chat-side: var(--frame-plain);
  --chat-side-ink: var(--text);
  --chat-side-ink-2: var(--text-2);
  --chat-side-line: var(--border);
  --chat-side-fill: color-mix(in srgb, var(--text) 6%, transparent);
  --chat-side-here: color-mix(in srgb, var(--accent) 12%, transparent);
  --chat-side-here-ink: var(--accent-strong);
  --chat-side-on: var(--accent);
  --chat-side-on-ink: var(--accent-ink);
  --chat-online: var(--good);
  --chat-mention-you: color-mix(in srgb, var(--amber-140) 50%, transparent);
  --chat-mention-you-ink: var(--link);
  --chat-working: var(--accent);
  --sunk: color-mix(in srgb, var(--text) 6%, var(--bg));

  --brand-whatsapp: var(--whatsapp-deep);
  --brand-whatsapp-soft: color-mix(in srgb, var(--whatsapp) 16%, transparent);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xs: 2px;
  --radius-xs: 4px;
  --radius-pill: 999px;

  --stroke-1: 1px;
  --stroke-2: 2px;
  --stroke-3: 3px;

  --size-2: 2px;
  --size-4: 4px;
  --size-6: 6px;
  --size-8: 8px;
  --size-10: 10px;
  --size-12: 12px;
  --size-14: 14px;
  --size-16: 16px;
  --size-20: 20px;
  --size-24: 24px;
  --size-28: 28px;
  --size-32: 32px;
  --size-36: 36px;
  --size-40: 40px;
  --size-44: 44px;
  --size-48: 48px;
  --size-56: 56px;
  --size-64: 64px;
  --size-72: 72px;
  --size-80: 80px;
  --size-96: 96px;
  --size-112: 112px;
  --size-128: 128px;
  --size-144: 144px;
  --size-160: 160px;
  --size-200: 200px;
  --size-240: 240px;
  --size-280: 280px;
  --size-320: 320px;
  --size-350: 350px;
  --size-360: 360px;
  --size-400: 400px;
  --size-440: 440px;
  --size-480: 480px;
  --size-560: 560px;
  --size-640: 640px;
  --size-720: 720px;
  --size-960: 960px;
  --size-1180: 1180px;

  --icon-sm: var(--size-12);
  --icon-md: var(--size-16);
  --icon-lg: var(--size-20);
  --icon-xl: var(--size-24);
  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--green-810) 5%, transparent);
  --shadow: 0 1px 2px color-mix(in srgb, var(--green-810) 5%, transparent), 0 6px 20px color-mix(in srgb, var(--green-810) 7%, transparent);
  --shadow-lg: 0 12px 40px color-mix(in srgb, var(--green-810) 16%, transparent);

  --panel-pad: 18px;
  --record-inset: calc(var(--panel-pad) + var(--stroke-1));

  --clip-w: 20ch;

  --note-w: 32ch;
  --sidebar-w: 244px;
  --chat-measure: 760px;
  --topbar-h: 44px;
  --traffic-light-w: 14px;
  --traffic-light-pitch: 20px;
  --traffic-light-drop: 1.5px;
  --window-control-w: 46px;
  --sheet-tabs-lead: 96px;
  --sheet-tab-w: 130px;
  --sheet-strip-h: 36px;


  --enters-in: 0.18s;
  --leaves-in: 0.14s;
  --hover-intent: 0.3s;

  --ease-panel: cubic-bezier(0.2, 0, 0, 1);

  --paper: var(--white);
  --ink: #1a1a1a;
  --ink-2: #555555;
  --ink-muted: #666666;
  --ink-3: #999999;
  --ink-rule: #dddddd;
  --ink-rule-soft: #eeeeee;
  --ink-accent: var(--green-500);

  --fs-micro: 10px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;

  --fs-3xl: 25px;
  --fs-4xl: 32px;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  --fw-bold: 700;
  --fw-black: 800;

  --lh-none: 1;
  --lh-tight: 1.2;
  --lh-snug: 1.45;
  --lh-normal: 1.55;
  --lh-loose: 1.7;

  --ls-tighter: -0.02em;
  --ls-tight: -0.01em;
  --ls-none: 0;
  --ls-wide: 0.04em;
  --ls-wider: 0.06em;

  --ls-code: 0.34em;

  --font: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;

  --dir: 1;
  --slide: 100%;

  color-scheme: light;
}

:root[data-frame="classic"] {
  --chat-side: var(--bar);
  --chat-side-ink: var(--bar-ink);
  --chat-side-ink-2: var(--bar-ink-2);
  --chat-side-line: var(--bar-line);
  --chat-side-fill: var(--bar-fill);
  --chat-side-here: var(--bar-fill-hover);
  --chat-side-here-ink: var(--bar-ink);
  --chat-side-on: var(--bar-on);
  --chat-side-on-ink: var(--bar-on-ink);
  --chat-online: var(--green-190);
  --chat-working: color-mix(in srgb, var(--white) 60%, transparent);
}

:root[data-frame="light"] {
  --bar: var(--frame-plain);
  --bar-ink: var(--text);
  --bar-on: var(--accent);
  --bar-on-ink: var(--accent-ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--grey-760);
    --bg-deep: var(--grey-815);
    --surface: var(--grey-780);
    --surface-2: var(--grey-735);
    --surface-3: var(--grey-705);
    --text: var(--grey-55);
    --text-2: var(--grey-200);
    --muted: var(--grey-335);
    --text-3: var(--grey-470);
    --border: var(--grey-675);
    --border-2: var(--grey-630);
    --accent: var(--green-300);
    --accent-strong: var(--green-190);
    --accent-ink: var(--deep);
    --link: var(--blue-260);
    --accent-line: color-mix(in srgb, var(--accent) 40%, var(--border));
    --warn: var(--amber-240);
    --warn-soft: color-mix(in srgb, var(--amber-240) 16%, transparent);
    --danger: var(--red-315);
    --danger-soft: color-mix(in srgb, var(--red-315) 16%, transparent);
    --info: var(--blue-335);
    --info-soft: color-mix(in srgb, var(--blue-335) 16%, transparent);

    --danger-ink: var(--red-795);

    --frame-plain: var(--tabs);
    --bar: var(--frame-green);
    --bar-ink: var(--text);
    --bar-on: var(--accent);
    --bar-on-ink: var(--accent-ink);
    --sunk: color-mix(in srgb, var(--lens-bed) 45%, var(--bg));
    --chat-side: var(--frame-plain);
    --chat-side-ink: var(--bar-ink); --chat-side-ink-2: var(--bar-ink-2); --chat-side-line: var(--bar-line); --chat-side-fill: var(--bar-fill);
    --chat-side-here: var(--bar-fill-hover); --chat-side-here-ink: var(--bar-ink); --chat-side-on: var(--bar-on); --chat-side-on-ink: var(--bar-on-ink);
    --chat-working: color-mix(in srgb, var(--white) 60%, transparent);
    --chat-online: var(--good);
    --chat-mention-you: var(--warn-soft);
    --chat-mention-you-ink: var(--warn);

    --sheet-hl-red: var(--red-650);
    --sheet-hl-red-ink: var(--red-150);
    --sheet-hl-amber: var(--amber-640);
    --sheet-hl-amber-ink: var(--amber-140);
    --sheet-hl-green: var(--green-640);
    --sheet-hl-green-ink: var(--green-190);
    --sheet-hl-blue: var(--blue-645);
    --sheet-hl-blue-ink: var(--blue-175);
    --sheet-hl-purple: var(--purple-670);
    --sheet-hl-purple-ink: var(--purple-155);
    --sheet-hl-teal: var(--teal-665);
    --sheet-hl-teal-ink: var(--teal-160);
    --sheet-hl-pink: var(--pink-655);
    --sheet-hl-pink-ink: var(--pink-150);
    --brand-whatsapp: var(--whatsapp-bright);
    --brand-whatsapp-soft: color-mix(in srgb, var(--whatsapp) 22%, transparent);
    --scrim: color-mix(in srgb, var(--black) 58%, transparent);
    --shadow-sm: 0 1px 2px color-mix(in srgb, var(--black) 35%, transparent);
    --shadow: 0 1px 2px color-mix(in srgb, var(--black) 35%, transparent), 0 8px 24px color-mix(in srgb, var(--black) 40%, transparent);
    --shadow-lg: 0 16px 48px color-mix(in srgb, var(--black) 55%, transparent);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: var(--grey-760); --bg-deep: var(--grey-815); --surface: var(--grey-780); --surface-2: var(--grey-735); --surface-3: var(--grey-705);
  --text: var(--grey-55); --text-2: var(--grey-200); --muted: var(--grey-335); --text-3: var(--grey-470); --border: var(--grey-675); --border-2: var(--grey-630);
  --accent: var(--green-300); --accent-strong: var(--green-190); --accent-ink: var(--deep); --link: var(--blue-260);
  --accent-line: color-mix(in srgb, var(--accent) 40%, var(--border));
  --warn: var(--amber-240); --warn-soft: color-mix(in srgb, var(--amber-240) 16%, transparent);
  --danger: var(--red-315); --danger-soft: color-mix(in srgb, var(--red-315) 16%, transparent);
  --info: var(--blue-335); --info-soft: color-mix(in srgb, var(--blue-335) 16%, transparent);
  --danger-ink: var(--red-795);
  --frame-plain: var(--tabs); --bar: var(--frame-green); --bar-ink: var(--text); --bar-on: var(--accent); --bar-on-ink: var(--accent-ink);
  --sunk: color-mix(in srgb, var(--lens-bed) 45%, var(--bg));
  --chat-side: var(--frame-plain); --chat-online: var(--good);
  --chat-side-ink: var(--bar-ink); --chat-side-ink-2: var(--bar-ink-2); --chat-side-line: var(--bar-line); --chat-side-fill: var(--bar-fill);
  --chat-side-here: var(--bar-fill-hover); --chat-side-here-ink: var(--bar-ink); --chat-side-on: var(--bar-on); --chat-side-on-ink: var(--bar-on-ink);
  --chat-working: color-mix(in srgb, var(--white) 60%, transparent);
  --chat-mention-you: var(--warn-soft); --chat-mention-you-ink: var(--warn);
  --sheet-hl-red: var(--red-650); --sheet-hl-red-ink: var(--red-150);
  --sheet-hl-amber: var(--amber-640); --sheet-hl-amber-ink: var(--amber-140);
  --sheet-hl-green: var(--green-640); --sheet-hl-green-ink: var(--green-190);
  --sheet-hl-blue: var(--blue-645); --sheet-hl-blue-ink: var(--blue-175);
  --sheet-hl-purple: var(--purple-670); --sheet-hl-purple-ink: var(--purple-155);
  --sheet-hl-teal: var(--teal-665); --sheet-hl-teal-ink: var(--teal-160);
  --sheet-hl-pink: var(--pink-655); --sheet-hl-pink-ink: var(--pink-150);
  --brand-whatsapp: var(--whatsapp-bright); --brand-whatsapp-soft: color-mix(in srgb, var(--whatsapp) 22%, transparent);
  --scrim: color-mix(in srgb, var(--black) 58%, transparent);
  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--black) 35%, transparent);
  --shadow: 0 1px 2px color-mix(in srgb, var(--black) 35%, transparent), 0 8px 24px color-mix(in srgb, var(--black) 40%, transparent);
  --shadow-lg: 0 16px 48px color-mix(in srgb, var(--black) 55%, transparent);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-frame="classic"] { --chat-side: var(--bar); }
  :root:not([data-theme="light"])[data-frame="light"] { --bar: var(--frame-plain); }
}

:root[data-theme="dark"][data-frame="classic"] { --chat-side: var(--bar); }
:root[data-theme="dark"][data-frame="light"] { --bar: var(--frame-plain); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-snug);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); text-wrap: balance; }
button { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--selection); }

:focus-visible { outline: var(--stroke-2) solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: var(--stroke-1); border-radius: var(--radius-xs); }
[data-quiet-focus]:focus-visible { outline: none; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.app.collapsed { grid-template-columns: var(--size-64) 1fr; }

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-inline-end: var(--stroke-1) solid var(--border);
  min-width: 0;
  overflow: hidden;
}
.brand-mark {
  width: var(--size-36); height: var(--size-36); flex: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: var(--fw-black); font-size: var(--fs-xl);
  box-shadow: 0 var(--stroke-2) var(--size-6) color-mix(in srgb, var(--accent) 40%, transparent);
  position: relative; overflow: hidden;
}

.brand-mark:has(> .brand-mark__img) {
  background: var(--surface);
  box-shadow: inset 0 0 0 var(--stroke-1) var(--border);
}

.brand-mark svg { width: 56%; height: 56%; fill: currentColor; }

.nav {
  flex: 1; overflow-y: auto; padding: var(--size-4) var(--size-10) var(--size-14);
  scrollbar-width: thin;
}
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.5; } 100% { transform: scale(2.2); opacity: 0; } }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; position: relative; }

.topbar, .sheet-topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: var(--size-14);
  padding: var(--stroke-1) var(--size-20) 0;
  background: var(--bar); color: var(--bar-ink);
  border-bottom: var(--stroke-1) solid var(--bar-line);
  position: relative; z-index: 5;
}
:is(.topbar, .sheet-topbar) .page-title small { color: var(--bar-ink-2); }
:is(.topbar, .sheet-topbar, .sheet-tools, .sheet-topbar__acts) > .icon-btn { width: var(--size-32); height: var(--size-32); color: var(--bar-ink-2); }
:is(.topbar, .sheet-topbar, .sheet-tools, .sheet-topbar__acts) > .icon-btn:hover { background: var(--bar-fill); color: var(--bar-ink); }
.sheet-topbar__lead .icon-btn { width: var(--size-32); height: var(--size-32); color: var(--bar-ink); }
.sheet-topbar__lead .icon-btn:hover { background: var(--bar-fill); color: var(--bar-ink); }
.sheet-topbar__lead .icon-btn:disabled { opacity: 0.5; cursor: default; background: none; color: var(--bar-ink-2); }
.sheet-topbar > .icon-btn.on { background: var(--bar-fill-hover); color: var(--bar-ink); }
:is(.topbar, .sheet-topbar__acts) > .cmd-trigger { height: var(--size-32); background: var(--bar-fill); border-color: var(--bar-line); color: var(--bar-ink-2); }
:is(.topbar, .sheet-topbar__acts) > .cmd-trigger:hover { background: var(--bar-fill-hover); border-color: var(--bar-line); }
:is(.topbar, .sheet-topbar__acts) > .cmd-trigger .kbd { background: none; border-color: var(--bar-line); box-shadow: none; color: var(--bar-ink-2); }
.sheet-topbar__acts > .cmd-trigger { width: var(--size-32); padding: 0; justify-content: center; background: none; border-color: transparent; }
.sheet-topbar__acts > .cmd-trigger:hover { background: var(--bar-fill); border-color: transparent; color: var(--bar-ink); }
.sheet-topbar__acts > .cmd-trigger :is(span, .kbd) { display: none; }
:is(.topbar, .sheet-topbar__acts) > .usermenu-wrap > .avatar { width: var(--size-32); height: var(--size-32); font-size: var(--fs-sm); background: var(--bar-on); color: var(--bar-on-ink); border-color: var(--bar-line); }
:is(.topbar, .sheet-topbar) .sheet-search { height: var(--size-32); }
@media (max-width: 720px) {
  :is(.topbar, .sheet-topbar, .sheet-tools) > .icon-btn, .sheet-topbar__lead .icon-btn { width: var(--size-36); height: var(--size-36); }
}
.titlebar-drag { display: none; }
:root[data-titlebar="overlay"] { --topbar-h: calc((var(--traffic-lights-y, 0px) + var(--traffic-light-drop)) * 2); }
:root[data-titlebar="overlay"] :is(.topbar, .sheet-topbar) {
  padding-inline-start: calc(var(--traffic-lights-x, 0px) * 2 + var(--traffic-light-pitch) * 2 + var(--traffic-light-w));
}
:root[data-titlebar="custom"] :is(.topbar, .sheet-topbar) { padding-inline-end: calc(var(--window-control-w) * 3 + var(--size-20)); }
.window-controls { position: fixed; inset-block-start: 0; inset-inline-end: 0; z-index: 101; display: flex; height: var(--topbar-h); }
.window-controls__btn {
  width: var(--window-control-w); height: 100%; display: grid; place-items: center;
  border: 0; background: none; color: var(--text); cursor: default;
}
.window-controls__btn:hover { background: var(--surface-3); }
:where(body:has(.topbar, .sheet-topbar)) .window-controls__btn { color: var(--bar-ink-2); }
:where(body:has(.topbar, .sheet-topbar)) .window-controls__btn:hover { background: var(--bar-fill); color: var(--bar-ink); }
.window-controls__btn--close:hover { background: var(--danger); color: var(--danger-ink); }
:where(body:has(.topbar, .sheet-topbar)) .window-controls::before { content: ""; align-self: center; width: var(--stroke-1); height: var(--size-20); margin-inline-end: var(--size-10); background: var(--bar-line); }
:root[data-titlebar] body:not(:has(.topbar, .sheet-topbar)) .titlebar-drag {
  display: block; position: fixed; inset: 0 0 auto; height: var(--topbar-h); z-index: 100;
}
.ref-copy { display: inline-flex; align-items: center; gap: var(--size-4); }
.ref-copy .ref-copy__btn { width: var(--size-24); height: var(--size-24); color: var(--muted); }
.ref-copy .ref-copy__btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn {
  width: var(--size-36); height: var(--size-36); flex: none;
  display: grid; place-items: center;
  border: var(--stroke-1) solid transparent; background: none; color: var(--text-2);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn--field { width: var(--size-40); height: var(--size-40); background: var(--surface); border-color: var(--border); }

.page-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); min-height: var(--size-40); white-space: nowrap; }
.page-title small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); letter-spacing: var(--ls-none); }

.cmd-trigger {
  display: flex; align-items: center; gap: var(--size-8);

  max-width: 34vw; flex: 0 1 auto;
  white-space: nowrap; overflow: hidden;
  height: var(--size-36); padding-block: 0; padding-inline: var(--size-12) var(--size-10);
  background: var(--surface-2); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-size: var(--fs-base); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.cmd-trigger > span:not(.kbd) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cmd-trigger:hover { border-color: var(--border-2); background: var(--surface-3); }

.shell-search .cmd-trigger { display: none; }
.cmd-trigger .kbd { margin-inline-start: var(--size-4); }
.view:has(> .home) { height: 100%; }
.home {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--size-6); height: 100%; text-align: center;
}
.home h1 { font-size: var(--fs-2xl); }
.home p { margin: 0 0 var(--size-16); color: var(--muted); font-size: var(--fs-base); }
.home__starts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--size-8); }
.home__starts .btn { justify-content: center; }
.view:has(> .chat-app) { max-width: none; margin: 0; padding: 0; height: 100%; }
.chat-app {
  --chat-gutter: max(var(--panel-pad), (100% - var(--chat-measure)) / 2);
  --chat-hover: color-mix(in srgb, var(--text) 3%, var(--surface));
  --surface-2: color-mix(in srgb, var(--text) 5%, var(--surface));
  --surface-3: color-mix(in srgb, var(--text) 8%, var(--surface));
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100%; min-height: 0;
  background: var(--surface);
  overflow: hidden;
}
.chat-side {
  display: flex; flex-direction: column; gap: var(--size-14); min-height: 0; overflow-y: auto;
  padding: var(--size-12) var(--size-8); background: var(--chat-side); color: var(--bar-ink); border-block-start: var(--stroke-1) solid var(--bar-line);
  --bar-ink: var(--chat-side-ink); --bar-ink-2: var(--chat-side-ink-2); --bar-line: var(--chat-side-line); --bar-fill: var(--chat-side-fill);
  --bar-fill-hover: var(--chat-side-here); --bar-on: var(--chat-side-on); --bar-on-ink: var(--chat-side-on-ink);
}
.chat-sec { position: relative; display: flex; flex-direction: column; gap: var(--size-4); }
.chat-sec__head { display: flex; align-items: center; gap: var(--size-2); padding-inline-start: var(--size-8); }
.chat-sec__head h3 { flex: 1; margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--muted); }
.chat-sec__head .icon-btn { width: var(--size-28); height: var(--size-28); }
.chat-sec__icon { flex: none; margin-inline-end: var(--size-6); color: var(--muted); }
.chat-sec__list, .chat-find__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chat-side__tops { padding-block-end: var(--size-14); border-block-end: var(--stroke-1) solid var(--bar-line); }
.chat-sec > .chat-sec__list { padding-inline-start: var(--size-12); }
.chat-sec--merged { display: none; }
.chat-room__tile { display: none; }
.chat-room {
  display: flex; align-items: center; gap: var(--size-8); width: 100%;
  padding: var(--size-6) var(--size-8); border: none; border-radius: var(--radius-sm); background: none;
  color: var(--text); font: inherit; font-size: var(--fs-base); text-align: start; cursor: pointer;
}
.chat-room:hover { background: var(--border-2); color: var(--text); }
.chat-room--head { gap: var(--size-2); font-weight: var(--fw-semibold); color: var(--muted); }
.chat-room.here { background: var(--accent-soft); color: var(--accent-strong); }
.chat-room.unread { color: var(--text); font-weight: var(--fw-semibold); }
.chat-room__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room__huddle { flex: none; color: var(--good); }
.chat-side .chat-room__huddle { color: var(--chat-online); }
.chat-room__dot { width: var(--size-8); height: var(--size-8); border-radius: 50%; background: var(--accent); flex: none; position: relative; }
.chat-room__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse 1.4s ease-out infinite; }
.chat-room__count {
  min-width: var(--size-20); padding: 0 var(--size-6); border-radius: var(--radius-lg); flex: none;
  background: var(--accent); color: var(--accent-ink); font-size: var(--fs-micro);
  font-weight: var(--fw-bold); line-height: var(--lh-loose); text-align: center;
}
.chat-room__count.mention-count { background: var(--danger); }
.chat-side :is(.chat-sec__head h3, .chat-sec__icon, .chat-bot-mark) { color: var(--bar-ink-2); }
.chat-side .chat-sec__head .icon-btn { color: var(--bar-ink-2); }
.chat-side .chat-sec__head .icon-btn:hover { background: var(--bar-fill); color: var(--bar-ink); }
.chat-side .chat-sec__list .chat-room { color: var(--bar-ink-2); }
.chat-side .chat-sec__list .chat-room:hover { background: var(--bar-fill); color: var(--bar-ink); }
.chat-side .chat-sec__list .chat-room.unread { color: var(--bar-ink); }
.chat-side .chat-sec__list .chat-room.here { background: var(--bar-fill-hover); color: var(--chat-side-here-ink); }
.chat-side .chat-sec__list .chat-room.here .chat-sec__icon { color: inherit; }
.chat-side .chat-room__count:not(.mention-count) { background: var(--bar-on); color: var(--bar-on-ink); }
.chat-side .chat-room__dot { background: var(--chat-working); }
.chat-room .chat-room__dot--idle { background: none; box-shadow: inset 0 0 0 var(--stroke-1) var(--muted); }
.chat-side .chat-room .chat-room__dot--idle { background: none; box-shadow: inset 0 0 0 var(--stroke-1) var(--bar-ink-2); }
.chat-room__dot--idle::after { content: none; }
.chat-bot-mark { flex: none; color: var(--muted); font-size: var(--fs-micro); font-weight: var(--fw-bold); }
.chat-visitor-mark { flex: none; display: inline-flex; gap: var(--size-6); color: var(--accent); font-size: var(--fs-micro); font-weight: var(--fw-bold); }
.chat-msg__email { flex-basis: 100%; min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.chat-find {
  position: absolute; inset-block-start: var(--size-28); inset-inline: 0; z-index: 6;
  display: flex; flex-direction: column; gap: var(--size-6); padding: var(--size-8);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
}
.chat-find__box { position: relative; display: flex; align-items: center; gap: var(--size-6); }
:is(.chat-find__box, .free-picker__search):has(> .search-clear) input[type="search"] { padding-inline-end: var(--size-32); }
:is(.chat-find__box, .free-picker__search) > .search-clear { position: absolute; inset-inline-end: var(--size-4); top: 50%; translate: 0 -50%; }
.chat-find__box .icon-btn { width: var(--size-28); height: var(--size-28); }
.chat-find__list { max-height: var(--size-240); overflow-y: auto; }
.chat-find--messages { inset-block-start: calc(100% + var(--size-6)); inset-inline: auto 0; width: min(var(--size-400), calc(100vw - var(--size-32))); }
.chat-find--messages .chat-find__list { max-height: var(--size-360); }
.chat-hit {
  display: flex; flex-direction: column; gap: var(--size-2); width: 100%; padding: var(--size-6) var(--size-8); border: none; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; text-align: start; text-decoration: none; cursor: pointer;
}
.chat-hit:hover, .chat-hit:focus-visible { background: var(--surface-2); }
.chat-hit__by { display: flex; align-items: baseline; gap: var(--size-8); font-size: var(--fs-base); }
.chat-hit__by time { color: var(--muted); }
.chat-hit__body {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text-2); font-size: var(--fs-sm); white-space: pre-wrap;
}
.chat-hit--page {
  gap: var(--size-4); padding: var(--size-12) var(--size-8); border-radius: var(--radius-sm);
  border-block-end: var(--stroke-1) solid var(--border);
}
.chat-hit--page .chat-hit__by { flex-wrap: wrap; column-gap: var(--size-8); row-gap: var(--size-2); font-size: var(--fs-md); }
.chat-hit--page .chat-hit__by > * { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-hit--page .chat-hit__by b { font-weight: var(--fw-semibold); }
.chat-hit--page .chat-hit__by > span { color: var(--text-2); }
.chat-hit--page .chat-hit__by time { margin-inline-start: auto; font-size: var(--fs-sm); }
.chat-hit--page .chat-hit__body { font-size: var(--fs-md); line-height: var(--lh-normal); }
.chat-hit--new { background: var(--warn-soft); }
.search-mark { border-radius: var(--radius-xs); background: var(--chat-mention-you); color: var(--chat-mention-you-ink); font-weight: var(--fw-semibold); }
.chat-hit--tiled { flex-direction: row; align-items: flex-start; gap: var(--size-12); border-block-end: none; }
.chat-hit--tiled .chat-face { width: var(--size-40); height: var(--size-40); font-size: var(--fs-sm); }
.chat-hit__text { display: flex; flex-direction: column; gap: var(--size-2); flex: 1; min-width: 0; }
.chat-hit--tiled .chat-hit__by { flex-wrap: nowrap; }
.chat-hit__who { overflow: hidden; color: var(--text-2); font-size: var(--fs-base); text-overflow: ellipsis; white-space: nowrap; }
.chat-hit__when { color: var(--muted); font-size: var(--fs-base); }
.chat-hit__tile {
  display: grid; place-items: center; flex: none; width: var(--size-40); height: var(--size-40); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 var(--stroke-1) color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: var(--fs-lg); font-weight: var(--fw-semibold);
}
.chat-hit__tile--assistant { background: var(--sheet-hl-purple); color: var(--sheet-hl-purple-ink); box-shadow: inset 0 0 0 var(--stroke-1) color-mix(in srgb, var(--sheet-hl-purple-ink) 22%, transparent); }
.chat-hit__tile--record { background: var(--sheet-hl-amber); color: var(--sheet-hl-amber-ink); box-shadow: inset 0 0 0 var(--stroke-1) color-mix(in srgb, var(--sheet-hl-amber-ink) 22%, transparent); }
.chat-hit__tile .ic { width: var(--icon-lg); height: var(--icon-lg); }
.chat-todo { position: relative; display: flex; border-radius: var(--radius-sm); }
.chat-todo .chat-hit--page { flex: 1; min-width: 0; }
.chat-todo .chat-hit__by { padding-inline-end: var(--size-32); }
.chat-todo:is(:hover, :focus-within) { background: var(--surface-2); }
.chat-todo .chat-hit--page:is(:hover, :focus-visible) { background: none; }
.chat-todo > .icon-btn { position: absolute; inset-block-start: var(--size-6); inset-inline-end: var(--size-4); }
.chat-todo__by { color: var(--muted); font-size: var(--fs-sm); }
.chat-threads { display: flex; flex-direction: column; gap: var(--size-24); margin: 0; padding: 0; list-style: none; }
.chat-threaded { display: flex; flex-direction: column; gap: var(--size-6); }
.chat-threaded .chat-run { cursor: pointer; }
.chat-threaded .chat-run .chat-msg:hover { background: var(--chat-hover); }
.chat-threaded__place { align-self: flex-start; max-width: 100%; padding: 0; overflow: hidden; border: none; background: none; color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chat-threaded__place:hover { color: var(--text); }
.chat-scheduled .chat-hit__by { padding-inline-end: var(--size-96); }
.chat-scheduled__acts { position: absolute; inset-block-start: var(--size-6); inset-inline-end: var(--size-4); display: flex; gap: var(--size-2); }
.chat-scheduled__why { color: var(--danger); font-size: var(--fs-sm); }
.chat-scheduled__edit { display: flex; flex: 1; gap: var(--size-10); padding: var(--size-8); }
.chat-scheduled__form { display: flex; flex: 1; flex-direction: column; gap: var(--size-8); min-width: 0; }
.chat-scheduled__form > .chat-when { padding: 0; }
.chat-scheduled__body { width: 100%; min-height: var(--size-80); padding: var(--size-8) var(--size-10); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: inherit; font: inherit; resize: vertical; }
.chat-scheduled__body:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.chat-pop.chat-compose__later { position: static; margin-inline-start: auto; }
.chat-compose__tools > .chat-compose__later ~ .tip:has(> .chat-compose__send), .chat-compose__later ~ .chat-compose__send { margin-inline-start: 0; }
.chat-find--later { inset-block: auto calc(100% + var(--size-6)); inset-inline: auto 0; width: min(var(--size-320), 100%); }
.chat-find__title { margin: 0; padding: var(--size-2) var(--size-6); color: var(--muted); font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.chat-later { display: flex; justify-content: space-between; gap: var(--size-10); padding: var(--size-6); border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.chat-later:hover { background: var(--surface-2); }
.chat-later time { color: var(--muted); font-size: var(--fs-sm); }
.chat-file-menu {
  position: fixed; z-index: 102; display: flex; flex-direction: column; min-width: var(--size-160); padding: var(--size-4);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
}
.chat-file-menu .chat-later { justify-content: flex-start; align-items: center; color: var(--text); text-decoration: none; }
.chat-file-menu .chat-later:focus-visible { background: var(--surface-2); }
.chat-file-menu .chat-later--danger { color: var(--danger); }
.chat-when { display: flex; flex-direction: column; gap: var(--size-6); padding: var(--size-6); }
.chat-when__zone { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.chat-when__pick { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--size-8); }
.chat-when__acts { display: flex; justify-content: flex-end; gap: var(--size-8); }
.chat-when__refused { margin: 0; color: var(--danger); font-size: var(--fs-sm); }
.chat-sec__scheduled { position: relative; }
.chat-sec__scheduled .chat-room__count { position: absolute; inset-block-start: calc(var(--size-6) * -1); inset-inline-end: calc(var(--size-6) * -1); }
.chat-search--desk { display: flex; }
.chat-search--phone { display: none; }
.chat-find__none { padding: var(--size-6) var(--size-8); color: var(--muted); font-size: var(--fs-base); }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-thread { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-split { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
.chat-split--thread { grid-template-columns: minmax(0, 1fr) auto; }
.chat-replies {
  --chat-gutter: var(--panel-pad);
  position: relative; display: flex; flex-direction: column; width: var(--chat-replies-width, var(--size-400)); min-width: 0; min-height: 0;
  background: var(--surface); border-inline-start: var(--stroke-1) solid var(--border);
}
.chat-replies__grip {
  position: absolute; inset-block: 0; inset-inline-start: calc(var(--size-4) * -1); z-index: 2; width: var(--size-8);
  cursor: col-resize; touch-action: none;
}
.chat-replies__grip::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: calc(50% - var(--stroke-1)); width: var(--stroke-2); background: var(--accent); opacity: 0; transition: opacity var(--leaves-in); }
.chat-replies__grip:hover::after { opacity: 1; transition: opacity var(--enters-in) var(--hover-intent); }
.chat-replies__grip:focus-visible::after, .chat-replies__grip:active::after { opacity: 1; transition: none; }
.chat-replies__grip:focus-visible { outline: none; }
.chat-replies .chat-log { padding-block-start: var(--size-24); }
.chat-replies__where { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); }
.chat-replies__count { display: flex; align-items: center; gap: var(--size-8); margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.chat-replies__count::after { content: ""; flex: 1; border-block-start: var(--stroke-1) solid var(--border); }
.chat-drop {
  position: absolute; inset: var(--size-8); z-index: 30; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--size-8);
  border: var(--stroke-2) dashed var(--accent); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-soft) 92%, transparent);
  color: var(--accent-strong); font-size: var(--fs-lg); font-weight: var(--fw-semibold);
}
.chat-head {
  display: flex; align-items: center; gap: var(--size-12); flex-wrap: wrap;
  min-height: var(--topbar-h); padding: var(--size-4) var(--panel-pad); border-block-end: var(--stroke-1) solid var(--border);
}
.chat-burger, .chat-head--bare, .chat-side__shell { display: none; }
.chat-head__what { display: flex; align-items: center; gap: var(--size-8); flex: 1; min-width: 0; }
.chat-head__what h2 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head__what .chat-head__edit { width: var(--size-28); height: var(--size-28); align-self: center; color: var(--muted); }
.chat-head__acts .chat-head__who { width: auto; display: inline-flex; align-items: center; gap: var(--size-4); padding-inline: var(--size-8); font: inherit; font-size: var(--fs-sm); }
.chat-head__who[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.chat-head__acts .chat-head__danger:hover { color: var(--danger); }
.chat-name { display: inline-flex; align-items: center; gap: var(--size-2); min-width: 0; min-height: var(--size-36); font-size: var(--fs-lg); font-weight: var(--fw-semibold); cursor: text; }
.chat-name input {
  min-width: 0; max-width: 100%; padding: 0; border: none; outline: none; background: none;
  color: var(--text); font: inherit; field-sizing: content;
}
.chat-name input::placeholder { color: var(--muted); font-weight: var(--fw-normal); }
.chat-name__pencil { flex: none; margin-inline-start: var(--size-6); color: var(--muted); }
.chat-pop { position: relative; }
.chat-more, .chat-more__menu { display: contents; }
.chat-more__btn, .chat-more__label { display: none; }
.chat-members {
  position: absolute; inset-block-start: calc(100% + var(--size-6)); inset-inline-end: 0; z-index: 6;
  list-style: none; margin: 0; padding: var(--size-6); display: flex; flex-direction: column; gap: var(--size-4);
  width: var(--size-320); max-width: calc(100vw - var(--size-32)); max-height: var(--size-320); overflow-y: auto;
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
}
.chat-members__one { display: flex; align-items: center; gap: var(--size-8); padding: var(--size-2) var(--size-4); font-size: var(--fs-sm); }
.chat-members__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-members__one .icon-btn { width: var(--size-24); height: var(--size-24); }
.chat-members__admin:has(.chat-members__unadmin) { padding-inline-end: var(--size-2); }
.chat-members__unadmin {
  display: inline-grid; place-items: center; width: var(--size-16); height: var(--size-16); padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.chat-members__unadmin:hover { background: var(--surface-2); color: var(--text); }
.chat-head__acts { display: flex; gap: var(--size-6); }
.chat-head__acts .chat-head__huddle--on { color: var(--good); }
.chat-huddle { display: flex; align-items: center; gap: var(--size-8); padding: var(--size-6) var(--size-16); border-bottom: var(--stroke-1) solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.chat-huddle__mark { flex: none; color: var(--good); }
.chat-huddle__faces { display: flex; padding: var(--size-2); border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer; }
.chat-huddle__faces:hover, .chat-huddle__faces[aria-expanded="true"] { background: var(--surface-3); }
.chat-huddle__faces > * + * { margin-inline-start: calc(var(--size-6) * -1); }
.chat-huddle__more { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 var(--stroke-1) var(--border); }
.chat-huddle__act { margin-inline-start: auto; }
.chat-members--start { inset-inline-end: auto; inset-inline-start: 0; }
.chat-sites {
  position: absolute; inset-block-start: calc(100% + var(--size-6)); inset-inline-end: 0; z-index: 6;
  display: flex; flex-direction: column; gap: var(--size-12); padding: var(--size-12);
  width: var(--size-360); max-width: calc(100vw - var(--size-32)); max-height: var(--size-480); overflow-y: auto;
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
}
.chat-sites__one { display: flex; flex-direction: column; gap: var(--size-6); padding-bottom: var(--size-12); border-bottom: var(--stroke-1) solid var(--line); font-size: var(--fs-sm); }
.chat-sites__one.off { color: var(--muted); }
.chat-sites__head { display: flex; align-items: center; gap: var(--size-8); }
.chat-sites__count { margin-inline-start: auto; color: var(--muted); font-size: var(--fs-micro); }
.chat-sites__origins { color: var(--muted); overflow-wrap: anywhere; }
.chat-sites__embed { display: block; padding: var(--size-6) var(--size-8); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-micro); overflow-wrap: anywhere; user-select: all; }
.chat-sites__acts { display: flex; gap: var(--size-6); }
.chat-sites__new .field { margin-bottom: var(--size-8); }
.chat-members__muted { flex: none; display: inline-grid; place-items: center; width: var(--size-24); height: var(--size-24); color: var(--muted); }
.chat-members__one--speaking .chat-face { box-shadow: 0 0 0 var(--stroke-2) var(--good); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--size-14); padding: var(--size-14) var(--chat-gutter); }
.chat-log--new { justify-content: flex-start; }
.chat-log__earlier { align-self: center; }
.chat-new { display: flex; align-items: center; gap: var(--size-8); margin-block: calc(var(--size-6) * -1); color: var(--danger); font-size: var(--fs-micro); font-weight: var(--fw-semibold); scroll-margin-block-start: var(--size-24); }
.chat-new::before { content: ""; flex: 1; border-block-start: var(--stroke-1) solid var(--danger); }
.chat-msg { position: relative; display: flex; align-items: flex-start; gap: var(--size-10); }
.chat-msg--found { animation: chat-found 1.6s ease-out; }
@keyframes chat-found { 0%, 40% { background: color-mix(in srgb, var(--accent) 18%, transparent); } }
.chat-msg__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--size-2); }
.chat-msg--sending .chat-msg__main { opacity: 0.6; }
.chat-msg--failed .chat-msg__main > :not(.chat-msg__by):not(.chat-msg__unsent) { color: var(--danger); }
.chat-msg__unsent { display: flex; align-items: center; gap: var(--size-8); margin-top: var(--size-4); color: var(--danger); font-size: var(--fs-sm); }
.chat-run { display: flex; flex-direction: column; gap: var(--size-8); }
.chat-run .chat-msg { margin: calc(var(--size-4) * -1) calc(var(--size-14) * -1); padding: var(--size-4) var(--size-14); border-radius: var(--radius-sm); }
.chat-msg__gutter {
  width: var(--size-32); flex: none; display: flex; justify-content: center; align-self: baseline; visibility: hidden;
  color: var(--muted); font-size: var(--fs-micro); white-space: nowrap;
}
.chat-msg__gutter + .chat-msg__main { align-self: baseline; }
.chat-msg__edited { color: var(--muted); font-size: var(--fs-sm); }
.chat-msg__todo {
  margin-inline-start: var(--size-6); padding: 0 var(--size-6); border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.chat-msg__by > .chat-msg__todo:first-child { margin-inline-start: 0; }
.chat-msg__todo--done { background: var(--surface-2); color: var(--muted); }
.chat-msg__acts .chat-msg__todo-on { color: var(--accent-strong); }
.chat-msg__gone { margin: 0; color: var(--muted); font-size: var(--fs-md); font-style: italic; }
.chat-run .chat-msg--threaded, .chat-run .chat-msg--threaded:hover { background: var(--accent-soft); }
.chat-thread-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: var(--size-8); max-width: 100%;
  margin-block-start: var(--size-4); margin-inline-start: calc(var(--size-6) * -1); padding: var(--size-2) var(--size-6);
  border: var(--stroke-1) solid transparent; border-radius: var(--radius-sm); background: none;
  color: var(--text-2); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.chat-thread-link:hover, .chat-thread-link--open { border-color: var(--border); background: var(--surface-2); }
.chat-thread-link__faces { display: inline-flex; gap: var(--size-2); }
.chat-thread-link__faces:empty { display: none; }
.chat-thread-link__count { color: var(--accent-strong); font-weight: var(--fw-semibold); white-space: nowrap; }
.chat-thread-link__new { display: inline-flex; align-items: center; gap: var(--size-4); padding: 0 var(--size-6); border-radius: var(--radius-pill); background: var(--danger-soft); color: var(--danger); font-weight: var(--fw-medium); white-space: nowrap; }
.chat-thread-link__new::before { content: ""; width: var(--size-6); height: var(--size-6); border-radius: 50%; background: var(--danger); }
.chat-thread-link__last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chat-msg__acts {
  position: absolute; inset-block-start: calc(var(--size-16) * -1); inset-inline-end: var(--size-14); display: none; gap: var(--size-2); padding: var(--size-2);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.chat-msg:has(:focus-visible) .chat-msg__acts, .chat-msg__acts--held { display: flex; }
@media (hover: hover) {
  .chat-run .chat-msg:hover { background: var(--chat-hover); }
  .chat-msg:hover .chat-msg__gutter { visibility: visible; }
  .chat-msg:hover .chat-msg__acts { display: flex; }
}
.chat-msg__acts .icon-btn { width: var(--size-32); height: var(--size-32); }
.chat-msg__quick { font-size: var(--fs-base); line-height: var(--lh-none); }
.chat-reacts { position: relative; display: flex; flex-wrap: wrap; gap: var(--size-4); margin-block-start: var(--size-4); }
.chat-react {
  display: inline-flex; align-items: center; gap: var(--size-4); padding: var(--stroke-1) var(--size-8); font: inherit; font-size: var(--fs-sm);
  background: var(--surface-2); border: var(--stroke-1) solid transparent; border-radius: var(--radius-pill); color: var(--text-2); cursor: pointer;
}
.chat-react:hover:not(:disabled) { background: var(--surface-3); }
.chat-react:disabled { cursor: default; }
.chat-react--mine { background: var(--accent-soft); color: var(--accent-strong); }
.chat-react__emoji { display: inline-grid; place-items: center; width: var(--size-16); height: var(--size-16); font-size: var(--fs-base); line-height: var(--lh-none); }
.chat-react__n { font-weight: var(--fw-semibold); }
.chat-react--add { gap: var(--size-2); color: var(--muted); }
.chat-react--add:hover { color: var(--text); }
.chat-emoji {
  position: absolute; z-index: 5; display: grid; grid-template-columns: repeat(8, var(--size-32)); gap: var(--size-2); padding: var(--size-6);
  max-height: var(--size-240); overflow-y: auto;
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.chat-emoji--compose { inset-block-end: calc(100% + var(--size-4)); inset-inline-end: 0; }
.chat-emoji--msg { inset-block-start: var(--size-24); inset-inline-end: var(--size-14); }
.chat-emoji--reacts { inset-block-start: calc(100% + var(--size-4)); inset-inline-start: 0; }
.chat-emoji--msg.chat-emoji--up { inset-block-start: auto; inset-block-end: calc(100% + var(--size-20)); }
.chat-emoji--reacts.chat-emoji--up { inset-block-start: auto; inset-block-end: calc(100% + var(--size-4)); }
.chat-emoji__one {
  width: var(--size-32); height: var(--size-32); padding: 0; font: inherit; font-size: var(--fs-xl); line-height: var(--lh-tight);
  background: none; border: none; border-radius: var(--radius-sm); cursor: pointer;
}
.chat-emoji__one:hover, .chat-emoji__one:focus-visible { background: var(--surface-3); outline: none; }
.emoji-animated { display: inline-block; width: var(--size-20); height: var(--size-20); vertical-align: text-bottom; object-fit: contain; }
.chat-react .emoji-animated { width: var(--size-16); height: var(--size-16); vertical-align: middle; }
.chat-emoji__one .emoji-animated { width: var(--size-24); height: var(--size-24); vertical-align: middle; }
.chat-msg__body--big .emoji-animated { width: var(--size-48); height: var(--size-48); }
@media (hover: none) {
  .chat-msg:focus { outline: none; }
  .chat-msg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .chat-msg [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
  .chat-msg--held .chat-msg__acts { display: flex; }
  .chat-msg__acts { inset-block-start: 0; max-width: calc(100% - var(--size-28)); box-sizing: border-box; }
  .chat-msg__acts .icon-btn { flex: 0 1 var(--size-36); width: var(--size-36); min-width: var(--size-32); height: var(--size-36); }
}
.chat-link { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.chat-link:hover { text-decoration: underline; }
.chat-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--size-8); margin-block-start: var(--size-4); }
.chat-pic {
  display: block; max-width: 100%; padding: 0; border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2); cursor: zoom-in;
}
.chat-pic img { display: block; max-width: var(--size-360); max-height: var(--size-280); }
.lightbox { grid-template-rows: auto minmax(0, 1fr); gap: var(--size-12); }
.lightbox__bar {
  justify-self: end; display: flex; align-items: center; gap: var(--size-4); max-width: 100%; box-shadow: var(--shadow-lg);
  padding: var(--size-4) var(--size-4) var(--size-4) var(--size-12); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: var(--fs-sm);
}
.lightbox__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); background: var(--surface); cursor: zoom-out;
}
.chat-file {
  display: inline-flex; align-items: center; gap: var(--size-8); max-width: var(--size-320); padding: var(--size-8) var(--size-12);
  border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text); font-size: var(--fs-sm); text-decoration: none;
}
.chat-file:hover { background: var(--surface-3); }
.chat-file--act { border: 0; cursor: pointer; font: inherit; font-size: var(--fs-sm); }
.chat-file--act:disabled { cursor: progress; color: var(--muted); }
.chat-file__name, .chat-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-voice {
  display: inline-flex; align-items: center; gap: var(--size-8); width: var(--size-320); max-width: 100%; padding: var(--size-4) var(--size-12) var(--size-4) var(--size-4);
  border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm);
}
.chat-voice[aria-busy="true"] { cursor: progress; }
.chat-voice__play { width: var(--size-32); height: var(--size-32); flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.chat-voice__play:hover { background: var(--accent-strong); color: var(--accent-ink); }
.chat-voice__bars { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--stroke-1); height: var(--size-24); cursor: pointer; }
.chat-voice__bars:focus-visible { outline: var(--stroke-2) solid var(--accent); outline-offset: var(--size-2); border-radius: var(--radius-xs); }
.chat-voice__bar { flex: 1; min-width: var(--stroke-1); border-radius: var(--radius-pill); background: var(--border-2); }
.chat-voice__bar--played { background: var(--accent); }
.chat-voice__time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-voice__speed {
  flex: none; min-width: var(--size-32); padding: var(--size-2) var(--size-4); border: 0; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text-2); font: inherit; font-size: var(--fs-micro); font-weight: var(--fw-semibold); cursor: pointer;
}
.chat-rec { display: flex; align-items: center; gap: var(--size-8); padding: var(--size-8) var(--size-12) 0; font-size: var(--fs-sm); color: var(--text-2); }
.chat-rec__dot { width: var(--size-8); height: var(--size-8); flex: none; border-radius: 50%; background: var(--danger); animation: chat-rec-pulse 1.2s ease-in-out infinite; }
.chat-rec__time { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.chat-rec .icon-btn { width: var(--size-24); height: var(--size-24); }
.chat-compose__tools .chat-rec__stop { color: var(--danger); }
@keyframes chat-rec-pulse { 50% { opacity: 0.3; } }
.chat-face {
  width: var(--size-32); height: var(--size-32); flex: none; border-radius: 50%; position: relative; overflow: hidden;
  display: grid; place-items: center; font-size: var(--fs-sm); font-weight: var(--fw-bold);
  background: linear-gradient(140deg, var(--mark-from), var(--mark-to)); color: var(--accent-ink);
}
.chat-face--sm { width: var(--size-24); height: var(--size-24); font-size: var(--fs-micro); }
.chat-face--hued { background: var(--hl-ground); color: var(--hl-ink); box-shadow: inset 0 0 0 var(--stroke-1) color-mix(in srgb, var(--hl-ink) 22%, transparent); }
.chat-side .chat-face:not(.chat-face--hued) { background: var(--bar-on); color: var(--bar-on-ink); }
.chat-online { position: relative; display: inline-flex; flex: none; }
.chat-online__dot {
  position: absolute; inset-block-end: calc(var(--stroke-1) * -1); inset-inline-end: calc(var(--stroke-1) * -1); width: var(--size-8); height: var(--size-8);
  border-radius: 50%; background: var(--good); box-shadow: 0 0 0 var(--stroke-2) var(--surface);
}
.sheet-topbar:has(~ .scroll .chat-side) { border-bottom-color: transparent; }
.chat-side .chat-online__dot { background: var(--chat-online); box-shadow: 0 0 0 var(--stroke-2) var(--chat-side); }
.chat-online__focus {
  position: absolute; inset-block-end: calc(var(--size-4) * -1); inset-inline-end: calc(var(--size-4) * -1); width: var(--size-14); height: var(--size-14);
  display: grid; place-items: center; border-radius: 50%; background: var(--warn); color: var(--surface); box-shadow: 0 0 0 var(--stroke-2) var(--surface);
}
.chat-side .chat-online__focus { box-shadow: 0 0 0 var(--stroke-2) var(--chat-side); }
.focus-btn.on, .focus-btn.on:hover { background: var(--sheet-hl-amber); color: var(--sheet-hl-amber-ink); }
.chat-msg__by { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--size-8); }
.chat-msg__by time { white-space: nowrap; }
.chat-msg__by b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.chat-msg__by time, .chat-event time { color: var(--muted); font-size: var(--fs-sm); }
.chat-msg__body { margin: 0; font-size: var(--fs-md); line-height: var(--lh-normal); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-mention, .chat-ref {
  padding: 0 var(--size-2); border-radius: var(--radius-xs); background: var(--accent-soft); color: var(--accent-strong);
  font-weight: var(--fw-medium);
}
.chat-ref { border: none; font: inherit; cursor: pointer; }
.chat-mention--you { background: var(--chat-mention-you); color: var(--chat-mention-you-ink); }
.chat-event { display: flex; align-items: baseline; gap: var(--size-8); margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.chat-event--working { font-style: italic; }
.chat-note { margin: 0; padding: var(--size-12) var(--panel-pad); color: var(--muted); font-size: var(--fs-sm); }
.chat-find__box input, .chat-compose__box {
  padding: var(--size-8) var(--size-12); font: inherit; font-size: var(--fs-base); font-weight: var(--fw-normal); line-height: var(--lh-normal);
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.chat-find__box input { flex: 1; min-width: 0; min-height: var(--size-32); padding: var(--size-6) var(--size-10); font-size: var(--fs-base); }
input[type="search"]::-webkit-search-cancel-button { display: none; }
.chat-find__box input:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.chat-search { flex: 1; min-width: 0; }
.chat-search input { padding: var(--size-8) var(--size-12); font-size: var(--fs-md); }
.chat-compose { padding: var(--size-10) var(--chat-gutter) var(--size-24); }
.chat-compose--inline { padding: 0; }
.chat-compose__box { position: relative; min-width: 0; display: flex; flex-direction: column; padding: 0; font-size: var(--fs-md); }
.chat-compose__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.chat-compose__box textarea, .chat-compose__box .rich__doc {
  display: block; width: 100%; min-height: calc(var(--lh-normal) * 1em + var(--size-16)); max-height: 40vh; overflow-y: auto; resize: none; padding: var(--size-8) var(--size-12);
  border: none; outline: none; background: none; color: inherit; font: inherit;
}
.chat-compose__tools {
  --tool: var(--size-28);
  --tool-ic: var(--icon-md);
  display: flex; gap: var(--size-2);
  padding: 0 calc(var(--size-12) - (var(--tool) - var(--tool-ic)) / 2) var(--size-6);
}
.chat-compose__send, .chat-compose__tools > .tip:has(> .chat-compose__send) { margin-inline-start: auto; }
.chat-compose__tools .icon-btn { width: var(--tool); height: var(--tool); }
.chat-compose__tools .icon-btn svg { width: var(--tool-ic); height: var(--tool-ic); }
.chat-compose__tools .icon-btn:disabled { opacity: 0.5; cursor: default; }
.chat-compose__files { list-style: none; margin: 0; padding: var(--size-8) var(--size-8) 0; display: flex; flex-wrap: wrap; gap: var(--size-6); }
.chat-compose__refused { list-style: none; margin: 0; padding: var(--size-8) var(--size-12) 0; font-size: var(--fs-sm); color: var(--danger); }
.chat-chip {
  display: inline-flex; align-items: center; gap: var(--size-4); max-width: var(--size-240); padding: var(--size-2) var(--size-4) var(--size-2) var(--size-10);
  background: var(--surface-3); border-radius: var(--radius-pill); font-size: var(--fs-sm);
}
.chat-chip[aria-busy="true"] { opacity: 0.6; }
.chat-chip .icon-btn { width: var(--size-24); height: var(--size-24); }
.chat-chip--voice { max-width: none; padding-inline-start: var(--size-4); }
.chat-compose__edit { display: flex; justify-content: flex-end; gap: var(--size-6); margin-block-start: var(--size-6); }
.kbd {
  font-family: var(--mono); font-size: var(--fs-sm);
  background: var(--surface); border: var(--stroke-1) solid var(--border-2);
  border-radius: var(--radius-xs); padding: var(--stroke-1) var(--size-6); color: var(--text-2);
  box-shadow: 0 var(--stroke-1) 0 var(--border-2);
}
.avatar {
  width: var(--size-36); height: var(--size-36); flex: none; border-radius: 50%;
  background: linear-gradient(140deg, var(--mark-from), var(--mark-to)); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: var(--fw-bold); font-size: var(--fs-base);
  cursor: pointer; border: var(--stroke-2) solid var(--surface); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}

.avatar__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

.scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.view { max-width: var(--size-1180); margin: 0 auto; padding: var(--size-24) var(--size-24) var(--size-56); }
.view[hidden] { display: none; }

.card {
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex; align-items: center; gap: var(--size-6);

  height: var(--size-36); padding: 0 var(--size-14); white-space: nowrap;
  border-radius: var(--radius-sm); border: var(--stroke-1) solid var(--border-2);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-base); font-weight: var(--fw-semibold); cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(var(--stroke-1)); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); }
.btn--primary:disabled:hover { background: var(--accent); }
.btn:disabled:active { transform: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn--primary:hover { background: var(--accent-strong); }
.btn--primary .kbd { background: transparent; border-color: currentColor; box-shadow: none; color: inherit; font-family: inherit; font-weight: var(--fw-normal); }
.btn--sm { height: var(--size-32); padding: 0 var(--size-10); font-size: var(--fs-sm); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn__face { display: contents; }
.btn[data-pending] { position: relative; }
.btn[data-pending]:disabled { opacity: 1; cursor: progress; }
.btn[data-pending] > .btn__face { visibility: hidden; }
.btn[data-pending="refused"], .btn[data-pending="refused"]:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn__mark { position: absolute; inset: 0; margin: auto; }
.btn__spin { width: var(--size-12); height: var(--size-12); border: var(--stroke-2) solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: btn-spin 0.7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.pill {
  display: inline-flex; align-items: center; gap: var(--size-4);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  padding: var(--size-2) var(--size-8); border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text-2);
  border: var(--stroke-1) solid var(--border);
  white-space: nowrap;
}
.pill::before { content: ""; width: var(--size-6); height: var(--size-6); border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill--none::before { display: none; }
.pill--good { background: var(--accent-soft); color: var(--good); border-color: transparent; }
.pill--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill--info { background: var(--info-soft); color: var(--info); border-color: transparent; }

.page-head { display: flex; align-items: flex-end; gap: var(--size-16); margin-bottom: var(--size-20); }
.page-head h1 { font-size: var(--fs-2xl); }
.page-head p { margin: var(--size-2) 0 0; color: var(--muted); font-size: var(--fs-base); }
.page-head .spacer { flex: 1; }

.muted { color: var(--muted); }
.wants { color: var(--warn); }
.mono { font-family: var(--mono); }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--size-14); margin-bottom: var(--size-16); }
@media (max-width: 860px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  padding: var(--size-14) var(--size-16); position: relative; overflow: hidden;
  cursor: pointer; transition: border-color 0.14s, box-shadow 0.14s, transform 0.1s;
}
.kpi:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(calc(var(--stroke-1) * -1)); }
.kpi__label { font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-medium); display: flex; align-items: center; gap: var(--size-6); }
.kpi__value { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: var(--ls-tighter); margin-top: var(--size-6); }
.kpi__value .cur { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--muted); margin-inline-end: var(--size-2); }
.kpi__foot { display: flex; align-items: center; gap: var(--size-4); font-size: var(--fs-sm); margin-top: var(--size-6); font-weight: var(--fw-semibold); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--size-16); margin-bottom: var(--size-16); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 > * { min-width: 0; }
.panel { padding: var(--panel-pad); }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-10); margin-bottom: var(--size-4); }
.panel__head h3 { font-size: var(--fs-base); }
.panel__head .spacer { flex: 1; }
.seg {
  display: inline-flex; background: var(--surface-2); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius-sm); padding: var(--size-2);
}
.seg button {
  border: none; background: none; color: var(--muted);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); padding: var(--size-4) var(--size-10); border-radius: var(--radius-sm); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg--frames button { display: inline-flex; flex-direction: column; align-items: center; gap: var(--size-4); padding-block: var(--size-6); }
.frame-thumb {
  display: inline-grid; grid-template: var(--size-6) 1fr / 35% 1fr; flex: none;
  width: var(--size-36); height: var(--size-24); overflow: hidden;
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-xs); background: var(--surface);
}
.frame-thumb::before { content: ""; grid-column: 1 / -1; background: var(--thumb-top); }
.frame-thumb::after { content: ""; background: var(--thumb-side); }
.frame-thumb--classic { --thumb-top: var(--frame-green); --thumb-side: var(--frame-green); }
.frame-thumb--balanced { --thumb-top: var(--frame-green); --thumb-side: var(--frame-plain); }
.frame-thumb--light { --thumb-top: var(--frame-plain); --thumb-side: var(--frame-plain); }

.aging { display: flex; flex-direction: column; gap: var(--size-12); margin-top: var(--size-14); }
.aging-row { display: grid; grid-template-columns: var(--size-80) 1fr auto; align-items: center; gap: var(--size-12); }
.aging-row__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.aging-track { height: var(--size-10); background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.aging-fill { height: 100%; border-radius: var(--radius-pill); transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart__band { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart__line {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart__now { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }

.chart__axis {
  display: flex; justify-content: space-between; gap: var(--size-12);
  margin-top: var(--size-6); font-size: var(--fs-sm); color: var(--muted);
}
.aging-row__val { font-size: var(--fs-sm); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; min-width: var(--size-80); text-align: end; }

.bars { display: flex; flex-direction: column; gap: var(--size-10); margin-top: var(--size-10); }
.bar-row { display: grid; grid-template-columns: minmax(0, var(--size-160)) 1fr auto; align-items: center; gap: var(--size-12); }
@media (max-width: 860px) { .bar-row { grid-template-columns: minmax(0, var(--size-96)) 1fr auto; } }
.bar-row__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: var(--size-10); background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.bar-row__val { font-size: var(--fs-sm); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; text-align: end; }

.dashboard { height: 100%; overflow-y: auto; }
.dashboard__blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--size-16); }
@media (max-width: 860px) { .dashboard__blocks { grid-template-columns: minmax(0, 1fr); } }
.dashboard-block { min-width: 0; }
.dashboard-block--wide { grid-column: 1 / -1; }
.dashboard-block__when { font-size: var(--fs-sm); color: var(--muted); }

.quick {
  display: flex; flex-direction: column; gap: var(--size-8); padding: var(--size-14);
  text-align: start; cursor: pointer;
  transition: border-color 0.14s, transform 0.1s, box-shadow 0.14s;
}
.quick:hover { border-color: var(--accent-line); transform: translateY(calc(var(--stroke-1) * -1)); box-shadow: var(--shadow); }
.quick .ic { color: var(--accent); }
.quick b { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.quick small { font-size: var(--fs-sm); color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--size-10); align-items: center; margin-bottom: var(--size-14); }

.toolbar .spacer, .topbar .spacer { flex: 1; }
.search {
  flex: 1; min-width: var(--size-200); height: var(--size-40); display: flex; align-items: center; gap: var(--size-8);
  padding: 0 var(--size-12); background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
}
.search input { border: none; background: none; outline: none; color: var(--text); font-size: var(--fs-base); width: 100%; font-family: inherit; }
.search > svg { flex: none; }
.picker {
  display: inline-flex; align-items: center; min-width: 0; max-width: 100%;
  padding-block: 0; padding-inline: var(--size-8) var(--size-24); font-family: inherit; text-align: start; cursor: pointer;
  color: var(--text); background-color: var(--surface);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371827a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--size-8) center; background-size: var(--size-14);
}
.picker__face { display: grid; min-width: 0; overflow: hidden; }
.picker__face > span { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__face > .picker__size { visibility: hidden; }
.picker:disabled { cursor: not-allowed; opacity: 0.6; }
.picker__blank { color: var(--muted); }
.line > .picker, .line-item .picker { padding-inline-end: var(--size-20); background-position: right var(--size-6) center; background-size: var(--size-12); }
.select {
  height: var(--size-40); padding-block: 0; padding-inline: var(--size-12) var(--size-32); background: var(--surface);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-medium); cursor: pointer; font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371827a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--size-10) center;
}

.toolbar .select { max-width: var(--size-240); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.tbl-wrap {
  overflow-x: auto; border-radius: var(--radius); border: var(--stroke-1) solid var(--border); box-shadow: var(--shadow-sm);
  background:
    linear-gradient(to right, var(--surface) 60%, transparent) 0 0 / var(--size-28) 100% no-repeat local,
    linear-gradient(to left, var(--surface) 60%, transparent) 100% 0 / var(--size-28) 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-edge), transparent) 0 0 / var(--size-12) 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-edge), transparent) 100% 0 / var(--size-12) 100% no-repeat,
    var(--surface);
}
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.tbl thead th {
  text-align: start; padding: var(--size-10) var(--size-16); font-size: var(--fs-sm); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wider); color: var(--muted);
  background: var(--surface-2); border-bottom: var(--stroke-1) solid var(--border); white-space: nowrap;
  position: sticky; top: 0;
}
.tbl tbody td { padding: var(--size-12) var(--size-16); border-bottom: var(--stroke-1) solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; transition: background 0.1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: end; font-variant-numeric: tabular-nums; }
.tbl .doc-no { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2); }
.tbl .name { font-weight: var(--fw-semibold); }

.tbl .clip {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 1; line-clamp: 1;
  overflow: hidden;

  height: calc(var(--lh-snug) * 1em);
  max-width: var(--clip-w);
}

.tbl .clip--note { max-width: var(--note-w); }

.tbl .clip--line {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 1; line-clamp: 1;
  overflow: hidden;
  min-height: calc(var(--lh-snug) * 1em);
  max-width: var(--clip-w);
}

.tbl .clip--two {
  -webkit-line-clamp: 2; line-clamp: 2;
  height: calc(var(--lh-snug) * 2em);
}

.tbl .clip-ref { overflow-wrap: anywhere; }
.tbl .sub { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--stroke-1); }
.tbl .amt { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tbl .date { white-space: nowrap; }
.row-actions { display: flex; gap: var(--size-4); justify-content: flex-end; opacity: 0; transition: opacity 0.12s; }
.tbl tbody tr:hover .row-actions { opacity: 1; }

.row-actions--now { opacity: 1; }

.chk-row {
  display: flex; align-items: flex-start; gap: var(--size-8); font-size: var(--fs-sm); line-height: var(--lh-normal);
  padding: var(--size-10) var(--size-12); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  cursor: pointer;
}
.chk-row input { margin-top: var(--stroke-1); flex: none; width: var(--size-16); height: var(--size-16); }
.msg { display: flex; gap: var(--size-10); align-items: flex-start; }

.gate {
  border: var(--stroke-1) solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--radius); padding: var(--size-14); margin-top: var(--size-10);
}

.tbl tbody tr.no-rows, .tbl tbody tr.no-rows:hover { background: transparent; cursor: default; }
.no-rows td { padding: var(--size-44) var(--size-20); text-align: center; }
.no-rows svg { color: var(--border-2); margin-bottom: var(--size-10); }
.no-rows b { display: block; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.no-rows p { margin: var(--size-4) 0 var(--size-14); font-size: var(--fs-sm); color: var(--muted); }

.tbl tbody tr.carried, .tbl tbody tr.carried:hover { background: var(--surface-2); cursor: default; }
.tbl tbody tr.carried td { color: var(--text-2); }

.tbl .sel-col { width: var(--size-44); padding-inline-end: 0; }
.chk {
  width: var(--size-16); height: var(--size-16); margin: 0; display: block; cursor: pointer;
  accent-color: var(--accent); flex: none;
}
.tbl tbody tr.sel, .tbl tbody tr.sel:hover { background: var(--accent-soft); }

.bulkbar {
  display: none; align-items: center; gap: var(--size-12); margin-bottom: var(--size-14); padding: var(--size-8) var(--size-14);
  background: var(--accent-soft); border: var(--stroke-1) solid var(--accent-line);
  border-radius: var(--radius); font-size: var(--fs-base);
}
.bulkbar.on { display: flex; }
.bulkbar b { font-weight: var(--fw-semibold); }
.bulkbar__actions { display: flex; gap: var(--size-8); margin-inline-start: auto; flex-wrap: wrap; }

.list-summary { display: flex; gap: var(--size-16); margin-bottom: var(--size-14); flex-wrap: wrap; }
.summ { display: flex; flex-direction: column; }
.summ b { font-size: var(--fs-xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; letter-spacing: var(--ls-tight); }
.summ small { font-size: var(--fs-sm); color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: var(--size-14); font-size: var(--fs-sm); color: var(--muted); }
.pager-btns { display: flex; gap: var(--size-6); }

.fin-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--size-16); padding: var(--size-8) 0; font-size: var(--fs-base);
}
.fin-row + .fin-row { border-top: var(--stroke-1) solid var(--border); }
.fin-row > :first-child { min-width: 0; }

.fin-row .r { text-align: end; flex: none; }
.fin-row .num { font-variant-numeric: tabular-nums; }
.fin-row--total { font-weight: var(--fw-bold); }

.fin-row + .fin-row--total { border-top: var(--stroke-2) solid var(--border-2); }

.placeholder { text-align: center; padding: var(--size-72) var(--size-20); }
.placeholder .ic { color: var(--accent); opacity: 0.85; margin-bottom: var(--size-14); }
.placeholder h3 { font-size: var(--fs-xl); margin-bottom: var(--size-6); }
.placeholder p { color: var(--muted); max-width: var(--size-400); margin: 0 auto var(--size-16); }
.rec-head { display: flex; align-items: stretch; gap: var(--size-14); margin-bottom: var(--size-16); flex-wrap: wrap; }
.rec-stat { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; padding: var(--size-12) var(--size-16); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: var(--size-128); }
.rec-stat small { font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; letter-spacing: var(--ls-wide); font-weight: var(--fw-semibold); }
.rec-stat b { font-size: var(--fs-xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; letter-spacing: var(--ls-tight); margin-top: var(--size-2); }
.rec-stat.diff b { color: var(--warn); }
.rec-stat.diff.zero b { color: var(--good); }

.milestones { display: flex; align-items: center; margin: 0 0 var(--size-16); padding: var(--size-4); list-style: none; }
.milestones > li { flex: 1 1 0; display: flex; align-items: center; gap: var(--size-4); }
.milestones > li:last-child { flex: 0 0 auto; }
.milestones > li:not(:last-child)::after { content: ""; flex: 1 1 auto; height: var(--stroke-2); border-radius: var(--radius-pill); background: var(--border); }
.milestones > li[data-done]:has(+ li[data-done])::after { background: var(--accent); }
.milestones__dot { display: block; width: var(--size-12); height: var(--size-12); border-radius: 50%; border: var(--stroke-2) solid var(--text-3); background: var(--surface); }
.milestones > li[data-done] .milestones__dot { border-color: var(--accent); background: var(--accent); }
.milestones > li[aria-current] .milestones__dot { box-shadow: 0 0 0 var(--size-4) var(--accent-soft); }
.milestones[data-lost] > li[data-done] .milestones__dot { border-color: var(--text-3); background: var(--text-3); }
.milestones[data-lost] > li[data-done]:has(+ li[data-done])::after { background: var(--text-3); }
.milestones > li[data-fresh] .milestones__dot { animation: milestone-reached 0.6s ease-out; }
@keyframes milestone-reached { 0% { transform: scale(0.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.rec-progress { display: flex; align-items: center; gap: var(--size-12); margin-bottom: var(--size-14); font-size: var(--fs-sm); color: var(--muted); }
.rec-progress__track { flex: 1; height: var(--size-8); background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.rec-progress__fill { height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width 0.4s ease; }
.amt-in { color: var(--good); }
.amt-out { color: var(--text); }

.pos-screen { container: pos-screen / inline-size; }
.pos-gate { max-width: var(--size-640); margin: 0 auto; display: flex; flex-direction: column; gap: var(--size-14); }

.pos-till {
  display: grid; grid-template-rows: auto auto; gap: var(--size-12);
  min-height: calc(100cqh - var(--size-80));
}
@media screen { .sheet-screen:has(.pos-till) { container: pos-screen / size; } }
.sheet-screen:has(.pos-till) .view { max-width: none; padding-bottom: var(--size-24); }

.pos-top { display: flex; align-items: center; gap: var(--size-10); flex-wrap: wrap; min-width: 0; }
.pos-register { width: var(--size-280); max-width: 100%; }
.pos-parked { display: flex; flex-wrap: wrap; gap: var(--size-6); align-items: center; min-width: 0; }

.pos { display: grid; grid-template-columns: minmax(0, 1fr) clamp(var(--size-560), 42%, var(--size-640)); gap: var(--size-16); align-items: start; }
.pos-pick {
  position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0;
  height: calc(100cqh - var(--size-144)); min-height: var(--size-400); background: var(--surface);
}

.pos-scanbar { display: flex; gap: var(--size-8); align-items: stretch; }
.pos-scanbar__input {
  flex: 1 1 auto; min-width: 0; height: var(--size-48); padding: 0 var(--size-14); font-size: var(--fs-lg);
  border: var(--stroke-1) solid var(--accent-line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: inherit; box-shadow: var(--shadow-sm);
}
.pos-scanbar .btn { flex: 0 0 auto; height: var(--size-48); white-space: nowrap; }
.pos-scan__note { min-height: var(--size-20); margin: var(--size-4) var(--size-2) var(--size-6); font-size: var(--fs-sm); color: var(--danger); }

.pos-cats { display: flex; gap: var(--size-8); overflow-x: auto; scrollbar-width: none; padding-bottom: var(--size-10); flex: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.pos-cat {
  flex: none; min-height: var(--size-36); padding: var(--size-6) var(--size-12); border-radius: var(--radius-pill); border: var(--stroke-1) solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.pos-cat:hover { border-color: var(--border-2); }
.pos-cat.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.pos-grid {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--size-144), 1fr)); gap: var(--size-10); padding: var(--size-2);
}
.pos-prod {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--size-4); min-height: var(--size-96); padding: var(--size-12);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: inherit; text-align: start; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, transform 0.08s, box-shadow 0.12s; position: relative;
}
.pos-prod:hover:not(:disabled) { border-color: var(--accent-line); box-shadow: var(--shadow); }
.pos-prod:active:not(:disabled) { transform: translateY(var(--stroke-1)); }
.pos-prod:disabled { cursor: not-allowed; opacity: 0.55; box-shadow: none; }
.pos-prod:disabled .pos-prod__price { color: var(--warn); font-weight: var(--fw-semibold); }
.pos-prod__name { font-size: var(--fs-base); font-weight: var(--fw-semibold); margin-top: auto; padding-inline-end: var(--size-28); }
.pos-prod__price { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.pos-prod__stock {
  position: absolute; top: var(--size-8); inset-inline-end: var(--size-8); padding: var(--stroke-1) var(--size-6); border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-bold);
}

.pos-cart { display: flex; flex-direction: column; min-width: 0; }
.pos-cart__summary {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: var(--stroke-1) solid var(--border);
}
.pos-cart__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-8); padding: var(--size-8) var(--size-12) var(--size-8) var(--size-16); border-bottom: var(--stroke-1) solid var(--border); }
.pos-cart__head b { font-size: var(--fs-base); }
.pos-cart__picks { display: flex; gap: var(--size-8); flex: 1 1 var(--size-240); min-width: 0; }
.pos-cart__tax { flex: 1 1 0; width: auto; min-width: 0; height: var(--size-32); font-size: var(--fs-sm); text-overflow: ellipsis; }
.pos-cart__close { display: none; }
.pos-cart__lines { min-height: var(--size-96); padding: var(--size-2) var(--size-8); }
.pos-cart__empty { text-align: center; color: var(--muted); font-size: var(--fs-base); padding: var(--size-32) var(--size-16); margin: 0; }
.pos-cart__done { display: flex; flex-direction: column; align-items: flex-start; gap: var(--size-6); margin: var(--size-8); padding: var(--size-14); border-radius: var(--radius-sm); background: var(--accent-soft); }
.pos-cart__change { display: flex; align-items: baseline; gap: var(--size-10); }
.pos-cart__change strong { font-size: var(--fs-2xl); font-variant-numeric: tabular-nums; }

.pos-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(var(--size-72), auto) var(--size-32);
  gap: var(--size-6) var(--size-8); align-items: center; padding: var(--size-8) var(--size-4) var(--size-8) var(--size-8);
}
.pos-line + .pos-line { border-top: var(--stroke-1) solid var(--border); }
.pos-line__what { min-width: 0; display: flex; flex-direction: column; gap: var(--size-2); }
.pos-line__name { font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.pos-line__unit { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.pos-line--discount { grid-template-columns: minmax(0, 3fr) auto minmax(var(--size-96), 2fr) minmax(var(--size-64), auto) auto; }
.pos-line__discount { width: 100%; min-width: 0; height: var(--size-32); padding-inline: var(--size-8) var(--size-24); font-size: var(--fs-sm); text-overflow: ellipsis; }
.pos-line__off { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--accent); }
.pos-line__price { display: flex; flex-direction: column; align-items: flex-end; gap: var(--size-2); font-size: var(--fs-base); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-line__remove {
  width: var(--size-32); height: var(--size-32); border: none; border-radius: var(--radius-sm);
  background: none; color: var(--muted); font: inherit; cursor: pointer;
}
.pos-line__remove:hover { background: var(--surface-2); color: var(--danger); }
.pos-qty { display: inline-flex; align-items: center; border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pos-qty button {
  width: var(--size-32); height: var(--size-32); border: none; background: var(--surface-2); color: var(--text-2);
  font: inherit; font-size: var(--fs-lg); line-height: var(--lh-none); cursor: pointer;
}
.pos-qty button:hover { background: var(--surface-3); color: var(--text); }
.pos-qty input {
  width: var(--size-36); height: var(--size-32); border: none; border-inline: var(--stroke-1) solid var(--border); padding: 0;
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-base);
  font-weight: var(--fw-semibold); text-align: center; font-variant-numeric: tabular-nums;
}
.is-stale { opacity: 0.6; }

.pos-cart__totals { border-top: var(--stroke-1) solid var(--border); padding: var(--size-8) var(--size-16) var(--size-6); }
.pos-tote { display: flex; justify-content: space-between; gap: var(--size-12); font-size: var(--fs-base); padding: var(--size-2) 0; }
.pos-tote.grand { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin-top: var(--size-2); }
.pos-tote--sub { flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.pos-tote--sub .num { color: var(--text-2); }
.pos-tote__off .num { color: var(--accent); font-weight: var(--fw-semibold); }

.pos-cart__pay { padding: 0 var(--size-16) var(--size-6); }
.pos-pay { display: grid; grid-template-columns: var(--size-128) minmax(0, 1fr) var(--size-28); gap: var(--size-6); align-items: center; margin-bottom: var(--size-6); }
.pos-pay .select { width: 100%; min-width: 0; }
.pos-pay input {
  min-width: 0; height: var(--size-40); padding: 0 var(--size-12); font: inherit; font-size: var(--fs-base); font-variant-numeric: tabular-nums;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); color: var(--text);
}
.pos-pay input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.pos-pay--one { grid-template-columns: var(--size-128) minmax(0, 1fr); }
.pos-pay__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--size-8); min-height: var(--size-28); margin-inline-start: calc(var(--size-10) * -1); }
.pos-pay__status { font-size: var(--fs-base); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.pos-cart .pos-cart__error { margin: 0 var(--size-16) var(--size-8); }

.pos-bar { display: flex; gap: var(--size-8); padding: var(--size-2) var(--size-16) var(--size-12); }
.pos-bar .btn { min-height: var(--size-48); }
.pos-charge { flex: 1 1 auto; display: flex; min-width: 0; }
.pos-charge .btn { flex: 1 1 auto; font-size: var(--fs-lg); }

.pos-dock { display: none; }

.pos-done { background: var(--accent-soft); border-color: transparent; }
.pos-find { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--size-8); align-items: end; margin-bottom: var(--size-16); }
.pos-find .field { margin-bottom: 0; }
.pos-find .btn { height: var(--size-40); }
.pos-return__sale {
  display: flex; align-items: center; justify-content: space-between; gap: var(--size-12);
  padding: var(--size-12) var(--size-14); border-radius: var(--radius-sm); background: var(--surface-2); border: var(--stroke-1) solid var(--border);
}
.pos-return { display: flex; flex-direction: column; margin: var(--size-6) 0 var(--size-4); }
.pos-return__line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--size-12); align-items: center; padding: var(--size-10) 0; }
.pos-return__line + .pos-return__line { border-top: var(--stroke-1) solid var(--border); }
.pos-return__line.is-done .pos-line__name { color: var(--muted); }
.pos-qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.pos-return__none { margin: var(--size-8) 0 0; }
.pos-return__totals { border-top: var(--stroke-1) solid var(--border); padding-top: var(--size-10); }
.pos-return__done {
  display: flex; flex-direction: column; align-items: center; gap: var(--size-6); text-align: center;
  padding: var(--size-28) var(--size-16); border-radius: var(--radius); background: var(--accent-soft);
}
.pos-return__done-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); }
.pos-return__done strong { font-size: var(--fs-4xl); font-weight: var(--fw-bold); line-height: var(--lh-none); }
.pos-z__outcome { display: flex; align-items: center; justify-content: space-between; gap: var(--size-10); margin: var(--size-10) 0 var(--size-16); }

.pos-camera__card { min-width: min(var(--size-360), 100%); }
.pos-camera {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-width: 100%;
  background: var(--lens-bed); border-radius: var(--radius-sm); overflow: hidden;
}
.pos-camera video { width: 100%; height: 100%; object-fit: cover; }
.pos-camera__reticle {
  position: absolute; inset: 22% 12%;
  border: var(--stroke-2) solid var(--lens-reticle); border-radius: var(--radius-sm);
  box-shadow: 0 0 0 100vmax var(--lens-veil);
}

@container pos-screen (max-width: 860px) {
  .pos { grid-template-columns: minmax(0, 1fr) var(--size-360); }
  .pos-charge .btn { font-size: var(--fs-base); }
  .pos-line { grid-template-columns: minmax(0, 1fr) auto minmax(var(--size-56), auto) var(--size-28); gap: var(--size-6); }
  .pos-qty button { width: var(--size-28); }
  .pos-qty input { width: var(--size-32); }
  .pos-line__remove { width: var(--size-28); }
  .pos-pay { grid-template-columns: var(--size-112) minmax(0, 1fr) var(--size-28); }
  .pos-pay--one { grid-template-columns: var(--size-112) minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .chat-split--thread { grid-template-columns: minmax(0, 1fr); }
  .chat-replies__grip { display: none; }
  .chat-replies {
    position: absolute; inset-block: 0; inset-inline-end: 0; z-index: 10;
    width: min(var(--size-400), 100%); box-shadow: var(--shadow-lg);
  }
  .pos-line--discount { grid-template-columns: minmax(0, 1fr) auto minmax(var(--size-56), auto) auto; }
  .pos-line__discount { grid-row: 2; grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 720px) {
  .home__starts { grid-auto-flow: row; }
  .chat-replies { width: 100%; border-inline-start: none; box-shadow: none; }
  .chat-msg__by { flex-wrap: wrap; row-gap: 0; }
  .chat-msg__by::before { content: ""; order: 1; flex-basis: 100%; }
  .chat-msg__by > :is(time, .chat-msg__edited, .chat-msg__todo) { order: 2; }
  .chat-msg__by b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-app { position: relative; grid-template-columns: minmax(0, 1fr); border-radius: 0; }
  .chat-side { display: none; }
  .chat-app--list .chat-side {
    display: flex;
    --bar: var(--bg); --bar-ink: var(--text); --bar-ink-2: var(--text-2); --bar-line: var(--border);
    --bar-fill: var(--surface-2); --bar-fill-hover: var(--surface-3); --bar-on: var(--accent); --bar-on-ink: var(--accent-ink);
    --chat-side: var(--bar); --chat-side-here-ink: var(--bar-ink);
  }
  .chat-app--list .chat-main { display: none; }
  .chat-side__shell .usermenu-wrap > .avatar { background: var(--bar-on); color: var(--bar-on-ink); border-color: var(--bar-line); }
  .chat-burger { display: grid; margin-inline-start: calc(var(--size-8) * -1); }
  .chat-head--bare { display: flex; }
  .sheet-menu > .sheet-menu__panel { inset-inline-start: var(--size-8); width: min(var(--size-280), calc(100vw - var(--size-32))); }
  .sheet-menu__group > .sheet-menu__sub {
    position: static; width: auto; overflow: visible; padding: 0 0 var(--size-4) var(--size-16);
    border: none; border-radius: 0; box-shadow: none; background: none;
  }
  .sheet-menu__group.on > .sheet-menu__module i { transform: rotate(90deg); }
  .chat-head { position: relative; }
  .chat-head__acts > .chat-pop { position: static; }
  .chat-find--messages { inset-inline: var(--size-8); width: auto; }
  .chat-more { display: block; position: relative; }
  .chat-more__btn { display: grid; }
  .chat-more__menu { display: none; }
  .chat-more[data-open] .chat-more__menu {
    display: flex; flex-direction: column; position: absolute; inset-block-start: calc(100% + var(--size-6)); inset-inline-end: 0; z-index: 30;
    min-width: var(--size-200); padding: var(--size-4); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  }
  .chat-more__menu > .icon-btn, .chat-more__menu > .chat-pop > .icon-btn {
    display: flex; align-items: center; justify-content: flex-start; gap: var(--size-8);
    width: 100%; height: auto; padding: var(--size-6) var(--size-8); font: inherit; font-size: var(--fs-base); color: var(--text);
  }
  .chat-app[data-pane="inbox"] .chat-head { display: none; }
  .chat-app[data-pane="new-channel"] .chat-name input { border-bottom: var(--stroke-1) solid var(--accent-line); }
  .chat-app[data-pane="search"] .chat-head { padding: var(--size-12) var(--size-16); border-block-end: none; }
  .chat-side .chat-sec__head > :is(h3, .chat-sec__icon) { display: none; }
  .chat-side .chat-sec__head { justify-content: flex-end; }
  .sheet-tools__shell { display: flex; align-items: center; gap: var(--size-8); padding-inline: var(--size-4); padding-block-end: var(--size-8); }
  .chat-side__shell .cmd-trigger { display: none; }
  .sheet-tools__shell .cmd-trigger {
    flex: 1; width: auto; max-width: none; justify-content: flex-start;
    padding-inline: var(--size-12); background: var(--surface); border-color: var(--border-2); color: var(--text-2);
  }
  .sheet-tools__shell .cmd-trigger span:not(.kbd) { display: inline; }
  :is(.chat-side__shell, .sheet-tools__shell) .usermenu-wrap { order: -1; }
  :is(.chat-side__shell, .sheet-tools__shell) .usermenu { inset-inline: 0 auto; width: min(var(--sidebar-w), calc(100vw - var(--size-48))); }
  .chat-more__menu .chat-more__label { display: inline; }
  .chat-more__menu .chat-head__who > span:not(.chat-more__label) { display: none; }
  .chat-more__menu .chat-members { position: static; width: auto; max-width: none; padding: 0 0 var(--size-4) var(--size-16); border: none; box-shadow: none; background: none; }
  .main:has(.chat-app:is([data-pane="room"], [data-pane="new-channel"], [data-pane="new-assistant"])) .sheet-topbar--home { display: none; }
  .main:has(.chat-app:is([data-pane="room"], [data-pane="new-channel"], [data-pane="new-assistant"])) { --sheet-strip-h: env(safe-area-inset-bottom); }
  .main:has(.chat-app:is([data-pane="room"], [data-pane="new-channel"], [data-pane="new-assistant"])) .phone-bar { display: none; }
  .sheet-topbar__acts > :not(.usermenu-wrap, [data-tool="feedback"], [data-tool="focus"], [data-tool="copy-link"]) { display: none; }
  .sheet-topbar .sheet-tools { display: none; }
  .page-title .page-title__desk { display: none; }
  .page-title .page-title__phone { display: inline; }
  .sheet-topbar--sheet { position: relative; backdrop-filter: none; }
  .sheet-topbar.sheet-topbar--sheet .sheet-topbar__lead { flex: 1; max-width: none; }
  .sheet-topbar--sheet:has(.sheet-tools__panel.open) { z-index: 61; }
  .sheet-tools__panel .sheet-tools__shell { display: flex; }
  .sheet-topbar--sheet .sheet-search {
    display: none; position: fixed; inset-block-end: calc(var(--sheet-strip-h) + var(--size-8)); inset-inline: var(--size-8); z-index: 60;
    height: var(--size-48);
    background: var(--surface); box-shadow: var(--shadow);
  }
  .sheet-topbar--sheet .sheet-search input { flex: 1 1 0; width: auto; min-width: 0; min-height: var(--size-32); }
  .sheet-topbar--sheet .sheet-search .kbd { display: none; }
  .sheet-topbar--sheet .sheet-search.open { display: flex; }
  .sheet-topbar--sheet .sheet-tools__panel {
    position: fixed; inset-block: 0; inset-inline-start: 0; top: 0; z-index: 61;
    display: flex; flex-direction: column; gap: var(--size-2); overflow-y: auto;
    width: var(--size-280); max-width: 84%; padding: var(--size-12) var(--size-8);
    border: none; border-inline-end: var(--stroke-1) solid var(--border); border-radius: 0; background: var(--bg-deep);
  }
  .sheet-topbar--sheet .sheet-tools__scrim { display: block; position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
  .pos-till { display: block; min-height: 0; padding-bottom: var(--size-72); }
  .pos-pick { position: static; height: auto; min-height: 0; }
  .pos-top { margin-bottom: var(--size-10); gap: var(--size-8); }
  .pos-top .spacer { display: none; }
  .pos-top .btn { flex: 1 1 0; min-height: var(--size-40); }
  .pos-register { width: 100%; }
  .pos-bar { padding-bottom: calc(var(--size-14) + env(safe-area-inset-bottom)); }
  .pos { display: block; }
  .pos-grid { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(var(--size-128), 1fr)); }
  .pos-prod { min-height: var(--size-80); }
  .pos-cart { display: none; }
  .pos-cart.is-open {
    display: flex; position: fixed; inset: 0; z-index: 44; border-radius: 0; border: none; overflow-y: auto;
  }
  .pos-cart__close { display: inline-block; width: var(--size-44); height: var(--size-44); margin-inline-start: auto; }
  .pos-cart__picks { order: 1; flex-basis: 100%; }
  .pos-cart__head { padding: var(--size-8) var(--size-8) var(--size-8) var(--size-16); }
  .pos-qty button, .pos-qty input { height: var(--size-40); }
  .pos-line__discount { height: var(--size-40); }
  .pos-qty button { width: var(--size-40); }
  .pos-line__remove { width: var(--size-40); height: var(--size-40); }
  .pos-line { grid-template-columns: minmax(0, 1fr) auto minmax(var(--size-64), auto) var(--size-40); gap: var(--size-8); }
  .pos-qty input { width: var(--size-36); }
  .pos-pay input { height: var(--size-44); }
  .pos-bar .btn { min-height: var(--size-56); }
  .pos-dock {
    display: block; position: fixed; inset-inline: 0; bottom: var(--sheet-tabs-h, 0); z-index: 43;
    padding: var(--size-10) var(--size-16) calc(var(--size-10) + env(safe-area-inset-bottom));
    background: var(--surface); border-top: var(--stroke-1) solid var(--border); box-shadow: var(--shadow);
  }
  .pos-dock[hidden] { display: none; }
  .pos-dock .btn { width: 100%; min-height: var(--size-56); justify-content: space-between; font-size: var(--fs-lg); }
  .pos-find .btn { height: var(--size-44); }
  .pos-return__line .pos-qty button, .pos-return__line .pos-qty input { height: var(--size-40); }
}
.till {
  text-align: start; padding: var(--size-12) var(--size-14); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: var(--size-2);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; font-family: inherit;
}
.till:hover:not(:disabled) { border-color: var(--border-2); }
.till.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 var(--stroke-2) var(--accent-soft); }
.till:disabled { cursor: not-allowed; background: var(--surface-2); }
.till b { font-size: var(--fs-base); color: var(--text); }
.till small { font-size: var(--fs-sm); color: var(--muted); }
.balanced { display: inline-flex; align-items: center; gap: var(--size-4); color: var(--good); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.subtabs {
  display: flex;
  gap: var(--size-4);
  margin-bottom: var(--size-20);
  border-bottom: var(--stroke-1) solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  background:
    linear-gradient(to right, var(--bg) 60%, transparent) 0 0 / var(--size-28) 100% no-repeat local,
    linear-gradient(to left, var(--bg) 60%, transparent) 100% 0 / var(--size-28) 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-edge), transparent) 0 0 / var(--size-12) 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-edge), transparent) 100% 0 / var(--size-12) 100%
      no-repeat;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtab { flex: none; border: none; background: none; color: var(--muted); font-weight: var(--fw-semibold); font-size: var(--fs-base); padding: var(--size-10) var(--size-14); cursor: pointer; position: relative; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.subtab:hover { color: var(--text); background: var(--surface-2); }
.subtab.on { color: var(--accent); }
.subtab.on::after { content: ""; position: absolute; inset-inline-start: var(--size-10); inset-inline-end: var(--size-10); bottom: calc(var(--stroke-1) * -1); height: var(--size-2); background: var(--accent); border-radius: var(--radius-2xs); }
.member { display: flex; align-items: center; gap: var(--size-10); }
.member b { font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.member small { display: block; font-size: var(--fs-sm); color: var(--muted); }

.role-layout { display: grid; grid-template-columns: var(--size-240) minmax(0, 1fr); gap: var(--size-16); align-items: start; }
@media (max-width: 860px) { .role-layout { grid-template-columns: minmax(0, 1fr); } }
.role-rail { display: flex; flex-direction: column; gap: var(--size-8); }
.role-card { display: flex; align-items: center; gap: var(--size-10); padding: var(--size-12) var(--size-12); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: start; transition: border-color 0.12s, background 0.12s; }
.role-card:hover { border-color: var(--border-2); }
.role-card.on { border-color: var(--accent); background: var(--accent-soft); }
.role-card__body { flex: 1; min-width: 0; }
.role-card__body b { font-size: var(--fs-base); font-weight: var(--fw-semibold); display: block; }
.role-card__body small { font-size: var(--fs-sm); color: var(--muted); }
.role-card .lock { color: var(--muted); }
.role-new { margin-top: var(--size-4); }

.role-detail { padding: var(--size-20); }
.role-detail__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-12); margin-bottom: var(--size-4); }
.role-detail__head h3 { font-size: var(--fs-xl); }
.role-detail__head .spacer { flex: 1; }

.perm-row { display: flex; align-items: center; gap: var(--size-12); padding: var(--size-8) 0; border-bottom: var(--stroke-1) solid var(--border); }
.perm-row:last-child { border-bottom: none; }
.perm-row__name { font-size: var(--fs-base); font-weight: var(--fw-medium); }
.perm-row__name small { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-normal); }
.perm-row .spacer { flex: 1; }

.switch-row { display: flex; align-items: center; gap: var(--size-12); padding: var(--size-10) 0; border-bottom: var(--stroke-1) solid var(--border); }
.switch-row:last-child { border-bottom: none; }
.switch-row__txt { flex: 1; }
.switch-row__txt b { font-size: var(--fs-base); font-weight: var(--fw-medium); }
.switch-row__txt small { display: block; font-size: var(--fs-sm); color: var(--muted); }
.switch-row__floor { width: var(--size-200); flex: none; }
@media (max-width: 560px) {
  .switch-row:has(> .switch-row__floor) { flex-wrap: wrap; }
  .switch-row:has(> .switch-row__floor) > .switch-row__txt { flex-basis: calc(100% - var(--size-64)); }
  .switch-row__floor { order: 1; flex: 1 1 0; width: auto; min-width: 0; }
}
.tbl tfoot td { padding: var(--size-12) var(--size-16); border-top: var(--stroke-2) solid var(--border-2); font-weight: var(--fw-bold); background: var(--surface-2); }
.code { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); }

.name-input {
  height: var(--size-32); width: 100%; max-width: var(--size-280); padding: 0 var(--size-8);
  font-size: var(--fs-base); font-family: inherit;
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
}
.name-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.name-input::placeholder { color: var(--muted); }
.banner-note { display: flex; align-items: center; gap: var(--size-10); padding: var(--size-12) var(--size-14); border-radius: var(--radius); font-size: var(--fs-base); margin-bottom: var(--size-16); }

.banner-note[hidden] { display: none; }
.banner-note > span:has(+ .icon-btn) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.banner-note.info { background: var(--info-soft); color: var(--info); }
.banner-note.ok { background: var(--accent-soft); color: var(--good); }
.banner-note.warn { background: var(--warn-soft); color: var(--warn); }

.banner-note.danger { background: var(--danger-soft); color: var(--danger); }
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--size-16); align-items: start; }

.split > * { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.meter { height: var(--size-8); background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }

.fy-card { display: flex; align-items: center; gap: var(--size-10); flex-wrap: wrap; margin-bottom: var(--size-10); }

.fy-card .btn { margin-inline-start: auto; }
.fy-switch {
  display: inline-flex; align-items: stretch; height: var(--size-36);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden;
}
.fy-switch__step {
  display: inline-flex; align-items: center; justify-content: center; width: var(--size-36);
  padding: 0; background: none; border: none; color: var(--text-2); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.fy-switch__step:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.fy-switch__step:disabled { color: var(--border-2); cursor: default; }
.fy-switch__step:focus-visible, .fy-switch .fy-switch__pick:focus-visible { outline: var(--stroke-2) solid var(--accent); outline-offset: calc(-1 * var(--stroke-2)); }
.fy-switch .fy-switch__pick {
  height: auto; border: none; border-radius: 0; border-inline: var(--stroke-1) solid var(--border);
  padding-inline: var(--size-12) var(--size-32); background-position: right var(--size-10) center;
  font-size: var(--fs-md); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
}
.fy-switch .fy-switch__pick:hover { background-color: var(--surface-2); }
.period-name { display: inline-flex; align-items: center; gap: var(--size-8); }

.ob-card { margin-bottom: var(--size-12); }
.ob-card:last-child { margin-bottom: 0; }

.ob-foot { display: flex; justify-content: flex-end; }

.act-panel__catch { background: transparent; }
.act-panel {
  position: fixed; z-index: 62; display: flex; flex-direction: column; overflow: hidden;
  width: min(var(--size-400), calc(100vw - var(--size-32)));
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.modal.act-panel__modal { z-index: 62; }
.act-panel--centred { position: relative; z-index: auto; max-height: calc(100dvh - var(--size-40)); }
.act-panel:has(.editlines) { width: min(var(--size-640), calc(100vw - var(--size-32))); }
.act-panel__head { padding: var(--size-14) var(--size-16) 0; }
.act-panel__head h3 { font-size: var(--fs-md); }
.act-panel__head small { display: block; margin-top: var(--size-2); color: var(--muted); font-size: var(--fs-sm); }
.act-panel__body { flex: 1 1 auto; overflow-y: auto; padding: var(--size-12) var(--size-16); }
.act-panel > .form-note { margin: 0 var(--size-16) var(--size-12); }
.act-panel__foot { display: flex; flex-wrap: wrap; gap: var(--size-8); justify-content: flex-end; align-items: center; padding: 0 var(--size-16) var(--size-14); }
.act-panel__foot .btn { flex: none; }
.act-panel__foot .btn[data-bare] .btn__label, .record-page__acts .btn[data-bare] .btn__label { display: none; }
.act-panel__foot .btn[data-bare], .record-page__acts .btn[data-bare] { padding: 0; aspect-ratio: 1; justify-content: center; }

.form-note {
  flex: none; margin: 0; padding: var(--size-10) var(--size-16);
  background: var(--danger-soft); color: var(--danger);
  border-top: var(--stroke-1) solid color-mix(in srgb, var(--danger) 26%, transparent);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh-normal);
}
.modal__card .form-note, .trail-compose > .form-note {
  margin: 0 0 var(--size-14); padding: var(--size-10) var(--size-12); border-radius: var(--radius-sm);
  border: var(--stroke-1) solid color-mix(in srgb, var(--danger) 26%, transparent);
}

.field { display: flex; flex-direction: column; gap: var(--size-6); margin-bottom: var(--size-16); }
.field label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); }

.field .fhint { font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-normal); margin-top: calc(var(--stroke-1) * -1); }

.fval { min-height: var(--size-36); display: flex; align-items: center; font-size: var(--fs-base); color: var(--text); }

.fset { border: none; padding: 0; margin: 0; min-inline-size: 0; }
.fset:disabled { opacity: 0.72; }
.fset.line-held:disabled { opacity: 1; }
.fset:disabled:has(.editlines) { opacity: 1; }
.fset:disabled :is(.add-line, .del) { display: none; }

.field input:not([type="checkbox"]), .field .picker, .field textarea, .field .rich__doc, .field .duration, .field .field-prefixed {
  height: var(--size-40); padding: 0 var(--size-12); font-size: var(--fs-base); font-family: inherit;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color 0.12s, box-shadow 0.12s; width: 100%;
}
.field .picker { cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371827a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--size-10) center; padding-inline-end: var(--size-32); }
.field input:focus, .field .picker:focus, .field textarea:focus, .field .rich__doc:focus, .field .duration:focus-within, .field .field-prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--size-12); }
.field-date { position: relative; display: block; min-width: 0; }
@supports selector(::-webkit-datetime-edit) {
  .trail-compose .field-date[data-empty]:not(:focus-within) input::-webkit-datetime-edit { color: transparent; }
  .trail-compose .field-date[data-empty]:not(:focus-within) input::-webkit-calendar-picker-indicator { display: none; }
  .trail-compose .field-date[data-empty]:not(:focus-within)::after {
    content: attr(data-ph); position: absolute; inset-inline-start: var(--size-8); top: 50%; translate: 0 -50%;
    color: var(--text-3); font-size: var(--fs-base); pointer-events: none;
  }
}
@supports (-webkit-touch-callout: none) {
  .field input:is([type="date"], [type="time"], [type="datetime-local"]) { -webkit-appearance: none; appearance: none; display: flex; align-items: center; min-width: 0; }
  .field input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-date-and-time-value { margin: 0; text-align: start; }
  .field-date[data-empty]::after {
    content: attr(data-ph); position: absolute; inset-inline-start: var(--size-12); top: 50%; translate: 0 -50%;
    color: var(--text-3); font-size: var(--fs-base); pointer-events: none;
  }
  .form-doc__props .field-date[data-empty]::after { inset-inline-start: var(--size-8); }
}

.form-doc > .field:last-child > label, .form-doc > .field:not(:has(> .convo)):has(:is(textarea, .rich__doc)) > label {
  position: absolute; width: var(--stroke-1); height: var(--stroke-1); overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.title-edit {
  width: 100%; margin: calc(-1 * var(--size-6)) 0; padding: var(--size-6) var(--record-inset); font: inherit; color: inherit; letter-spacing: inherit;
  background: transparent; border: none; border-radius: var(--radius-sm); outline: none; transition: background-color 0.12s;
}
.title-edit:hover, .title-edit:focus { background-color: var(--surface-2); }
.title-edit::placeholder { color: var(--text-3); }
.record-page__name:has(.title-edit) > p { padding-inline: var(--record-inset); }
.form-doc > .field:not(:has(> .convo)) :is(textarea, .rich__doc) {
  width: calc(100% + var(--size-24)); margin-inline: calc(-1 * var(--size-12)); padding: var(--size-6) var(--size-12);
  min-height: var(--size-56); max-height: none; font-size: var(--fs-base); line-height: var(--lh-normal);
  border: none; background: transparent; border-radius: var(--radius-sm); box-shadow: none; resize: none; overflow: hidden; field-sizing: content;
  transition: background-color 0.12s;
}
.form-doc > .field:not(:has(> .convo)) :is(textarea, .rich__doc):is(:hover, :focus) { box-shadow: none; background-color: var(--surface-2); }
.form-doc--prose-first > .field:first-child :is(textarea, .rich__doc) { min-height: 0; font-size: var(--fs-md); }
.form-doc--beside > .field:first-child :is(textarea, .rich__doc) { min-height: calc(8em * var(--lh-normal) + var(--size-12)); }
.form-doc__props { --field-reach: var(--size-8); padding-bottom: var(--size-8); margin-bottom: var(--size-12); border-bottom: var(--stroke-1) solid var(--border); }
.form-doc > .form-doc__props:last-child, .set-card > .form-doc__props:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.form-fold { margin-top: var(--size-16); padding-top: var(--size-12); border-top: var(--stroke-1) solid var(--border); }
.form-fold > summary { display: flex; align-items: center; gap: var(--size-6); min-height: var(--size-32); padding: 0 var(--size-6); margin-inline: calc(-1 * var(--size-6)); border-radius: var(--radius-sm); font-weight: var(--fw-semibold); cursor: pointer; list-style: none; }
.form-fold > summary::-webkit-details-marker { display: none; }
.form-fold > summary::before { content: "›"; width: var(--size-12); color: var(--muted); transition: transform 0.12s; }
.form-fold[open] > summary::before { transform: rotate(90deg); }
.form-fold > summary:hover { background: var(--surface-2); }
.form-fold[open] > .field { margin-top: var(--size-8); }
.form-fold > .field > label { position: absolute; width: var(--stroke-1); height: var(--stroke-1); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.record-page__section > .form-doc__props { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.form-doc__talk { margin-top: var(--size-16); padding-top: var(--size-16); border-top: var(--stroke-1) solid var(--border); }
.form-doc--prose-first > .form-doc__props { padding: var(--size-8) 0 0; margin: var(--size-12) 0 0; border-bottom: none; border-top: var(--stroke-1) solid var(--border); }
.form-doc--prose-first > .form-doc__props:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.form-doc--prose-first > .form-doc__props ~ .field { margin-top: var(--size-16); padding-top: var(--size-16); border-top: var(--stroke-1) solid var(--border); }
.form-doc--prose-first > .field:first-child > label { position: absolute; width: var(--stroke-1); height: var(--stroke-1); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-doc__props .field-row { display: contents; }
.form-doc__props .switch-row {
  display: grid; grid-template-columns: var(--size-144) minmax(0, 1fr); align-items: center; gap: var(--size-8);
  min-height: var(--size-32); padding: 0; margin-bottom: var(--size-2); border-bottom: none;
}
.form-doc__props .switch-row__txt b { font-weight: var(--fw-normal); color: var(--muted); }
.form-doc__props .switch-row__txt small { display: none; }
.form-doc__props .switch-row .switch { justify-self: start; margin-inline-start: var(--size-8); }
.hue { display: inline-block; padding: 0 var(--size-6); border-radius: var(--radius-xs); background: var(--hl-ground); color: var(--hl-ink); font-weight: var(--fw-medium); }
.hue--blue { --hl-ground: var(--sheet-hl-blue); --hl-ink: var(--sheet-hl-blue-ink); }
.hue--teal { --hl-ground: var(--sheet-hl-teal); --hl-ink: var(--sheet-hl-teal-ink); }
.hue--purple { --hl-ground: var(--sheet-hl-purple); --hl-ink: var(--sheet-hl-purple-ink); }
.hue--amber { --hl-ground: var(--sheet-hl-amber); --hl-ink: var(--sheet-hl-amber-ink); }
.hue--pink { --hl-ground: var(--sheet-hl-pink); --hl-ink: var(--sheet-hl-pink-ink); }
.hue--green { --hl-ground: var(--sheet-hl-green); --hl-ink: var(--sheet-hl-green-ink); }
.hue--red { --hl-ground: var(--sheet-hl-red); --hl-ink: var(--sheet-hl-red-ink); }
.hue--grey { --hl-ground: var(--surface-3); --hl-ink: var(--text-2); }
.field-prefixed { display: flex; align-items: center; gap: var(--size-4); min-width: 0; }
.field-prefixed > .picker { flex: none; width: auto; min-width: var(--size-48); }
.field-prefixed__unit { flex: none; min-width: var(--size-48); padding-inline: var(--size-8); color: var(--text); }
.field-prefixed > input { flex: 1 1 auto; min-width: 0; }
.field .field-prefixed { display: flex; gap: 0; padding: 0; }
.field .field-prefixed > :is(input:not([type="checkbox"]), .picker) {
  height: 100%; border-color: transparent; background-color: transparent; box-shadow: none;
}
.form-doc__props .field {
  display: grid; grid-template-columns: var(--size-144) minmax(0, 1fr); align-items: center; gap: var(--size-8); margin-bottom: var(--size-2);
}
.form-doc__props .field--bare { grid-template-columns: minmax(0, 1fr); margin-bottom: 0; }
.form-doc__props .field:has(> .people) { align-items: start; }
@media not (max-width: 720px) {
  .form-doc__props .field:has(> .people) { padding-block: calc((var(--size-32) - 1lh) / 2); }
}
.form-doc__props .field label { font-size: var(--fs-base); font-weight: var(--fw-normal); color: var(--muted); }
.form-doc__props .field label .muted { display: none; }
.form-doc__props .fval { min-height: var(--size-32); margin: 0; padding-inline: var(--field-reach) var(--size-8); min-width: 0; }
.form-doc__key { font-size: var(--fs-base); font-weight: var(--fw-normal); color: var(--muted); }
.form-doc__fact { display: flex; align-items: center; min-height: var(--size-32); padding-inline: var(--field-reach, var(--size-8)) var(--size-8); opacity: 0.7; }
.form-doc__fact:has(> .form-doc__fact-row), .form-doc__fact:has(a) { opacity: 1; }
.form-doc__fact-row { display: flex; align-items: center; gap: var(--size-12); }
.form-doc__props .fval > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-doc__props .field input:not([type="checkbox"]), .form-doc__props .field .picker, .form-doc__props .tagbox, .form-doc__props .field .duration, .form-doc__props .field .field-prefixed {
  height: var(--size-32); padding-inline: var(--field-reach) var(--size-8); border-color: transparent; background-color: transparent;
}
.form-doc__props .tagbox { height: auto; min-height: var(--size-32); }
.form-doc__props .tagbox:has(+ .pick-none) { display: none; }
.form-doc__props .pick-none { display: flex; align-items: center; min-height: var(--size-32); padding-inline: var(--field-reach) var(--size-8); font-size: var(--fs-base); color: var(--text-3); }
.form-doc__props .field .tagbox input:not([type="checkbox"]) { flex: 1 1 0; min-width: 0; height: var(--size-24); padding: 0; }
.form-doc__props .field .tagbox input.tagbox__typing { min-width: var(--size-80); padding: 0 var(--size-4); }
.act-panel .form-doc__props .field .tagbox input:not([type="checkbox"]) { flex-basis: var(--size-80); min-width: var(--size-80); padding: 0 var(--size-4); }
.form-doc__props .field input:not([type="checkbox"]):hover, .form-doc__props .field .picker:hover, .form-doc__props .tagbox:hover, .form-doc__props .field .duration:hover, .form-doc__props .field .field-prefixed:hover { background-color: var(--surface-2); }
.form-doc__props .field .picker { background-image: none; }
.form-doc__props .field .field-prefixed > :is(.picker, .field-prefixed__unit) { min-width: 0; padding-inline: 0; }
.form-doc__props .field .field-prefixed .picker__size { display: none; }
.form-doc__props .field .field-prefixed > input:not([type="checkbox"]) { padding-inline-start: var(--size-4); }
.form-doc__props .field input[type="date"]::-webkit-datetime-edit { flex: none; }
.form-doc__props .field input[type="date"]::-webkit-calendar-picker-indicator { order: -1; margin: 0; margin-inline-end: var(--size-8); }
.form-doc__props .field input:not([type="checkbox"]):focus, .form-doc__props .field .picker:focus, .form-doc__props .tagbox:focus-within, .form-doc__props .field .duration:focus-within, .form-doc__props .field .field-prefixed:focus-within {
  border-color: transparent; box-shadow: none; background-color: var(--surface-2);
}
.field .duration { display: flex; align-items: center; cursor: text; }
.field .duration--empty { color: var(--text-3); }
.field .duration > input.duration__part:not([type="checkbox"]) {
  width: auto; height: auto; padding: 0; border: none; border-radius: var(--radius-2xs); background: transparent; box-shadow: none; text-align: end; font-variant-numeric: tabular-nums; field-sizing: content;
}
.field .duration > input.duration__part:not([type="checkbox"]):last-child { text-align: start; }
.field .duration > input.duration__part:not([type="checkbox"]):focus { background: var(--accent-soft); }
.form-doc .field:has(> .convo) { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.form-doc .field:has(> .convo) > :not(.convo__post) { grid-column: 1 / -1; }
.form-doc .field:has(> .convo) .convo { gap: var(--size-10); margin-bottom: var(--size-16); }
.form-doc .field:has(> .convo) > .drop-box {
  grid-row: 3; padding: var(--size-8) var(--size-12); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.form-doc .field:has(> .convo) > .drop-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.form-doc .field:has(> .convo) textarea, .form-doc .field:has(> .convo) .rich__doc {
  min-height: var(--size-64); padding: 0; font-size: var(--fs-base); line-height: var(--lh-normal);
  border: none; background: transparent; border-radius: 0; box-shadow: none; resize: none; field-sizing: content;
}
.form-doc .field:has(> .convo) > .convo__post { grid-row: 3; grid-column: 2; align-self: end; margin: 0 var(--size-12) var(--size-8) 0; }
@media (max-width: 720px) {
  .form-doc__props :is(.form-doc__presets, .switch-row) { grid-template-columns: var(--size-96) minmax(0, 1fr); }
  .form-doc__props .field {
    grid-template-columns: minmax(0, 1fr); gap: var(--size-2); margin-bottom: var(--size-8);
    margin-inline: calc(-1 * var(--field-reach));
  }
  .form-doc__props .field > :is(label, .presets, .field__choices) { padding-inline-start: var(--field-reach); }
  .form-doc__props .field > .people { padding-inline: var(--field-reach); }
}

.convo { display: flex; flex-direction: column; gap: var(--size-12); margin-bottom: var(--size-12); }
.convo:empty { display: none; }
.convo__post { display: flex; justify-content: flex-end; margin-top: var(--size-8); }
.convo__changes { display: flex; flex-direction: column; gap: var(--size-2); margin: 0; font-size: var(--fs-sm); }
.convo__changes div { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--size-6); }
.convo__changes dt { color: var(--text-2); font-weight: var(--fw-semibold); }
.convo__changes dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--size-6); margin: 0; overflow-wrap: anywhere; }
.convo__changes del { color: var(--muted); }
.convo__changes ins { text-decoration: none; color: var(--text); }
.convo__changes ins::before { content: "→"; margin-right: var(--size-6); color: var(--muted); }

.linecount { border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: var(--size-6) var(--size-12) var(--size-10); }
.lc-row { display: grid; grid-template-columns: 1fr var(--size-80) var(--size-80); gap: var(--size-10); align-items: center; padding: var(--size-8) 0; }
.lc-row + .lc-row { border-top: var(--stroke-1) solid var(--border); }
.lc-row--head { padding: var(--size-2) 0 var(--size-6); font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--muted); border: none; }
.lc-row--head span:not(:first-child) { text-align: end; }
.lc-row b { font-size: var(--fs-base); font-weight: var(--fw-semibold); display: block; }
.lc-row small { font-size: var(--fs-sm); color: var(--muted); }
.lc-row .avail { text-align: end; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.lc-row input {
  height: var(--size-36); padding: 0 var(--size-8); width: 100%; text-align: end; font-family: inherit; font-size: var(--fs-base);
  font-variant-numeric: tabular-nums; background: var(--surface); border: var(--stroke-1) solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.lc-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.lc-row input.over { border-color: var(--danger); box-shadow: 0 0 0 var(--stroke-3) var(--danger-soft); }
.linecount--money .lc-row { grid-template-columns: 1fr var(--size-144) var(--size-200); }
.linecount--money .lc-row input { height: var(--size-40); }
.lc-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--size-6); padding-top: var(--size-8); border-top: var(--stroke-1) dashed var(--border-2); }
.lc-foot b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.lc-foot .muted { font-size: var(--fs-sm); }

.lc-group + .lc-group { border-top: var(--stroke-1) solid var(--border); }
.lc-group .lc-row + .lc-row { border-top: none; }
.lc-lot { display: grid; grid-template-columns: 1fr var(--size-144); gap: var(--size-10); padding: 0 0 var(--size-10); }
.lc-lot input {
  height: var(--size-36); padding: 0 var(--size-8); width: 100%; font-family: inherit; font-size: var(--fs-sm);
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.lc-lot input:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }

.line-head { display: grid; grid-template-columns: 1fr var(--size-72) var(--size-96) var(--size-56) var(--size-40); gap: var(--size-8); font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--muted); padding: 0 var(--size-2) var(--size-8); }
.line { display: grid; grid-template-columns: 1fr var(--size-72) var(--size-96) var(--size-56) var(--size-40); gap: var(--size-8); margin-bottom: var(--size-8); align-items: center; }
.line input { height: var(--size-36); font-size: var(--fs-base); padding: 0 var(--size-8); background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); color: var(--text); outline: none; width: 100%; }
.line input:focus { border-color: var(--accent); }
.line .del { color: var(--muted); background: none; border: none; cursor: pointer; height: var(--size-36); border-radius: var(--radius-sm); }
.line .del:hover { background: var(--danger-soft); color: var(--danger); }

.add-line { margin-top: var(--size-4); align-self: flex-start; }

.line-item { display: flex; flex-direction: column; gap: var(--size-4); }
.line-cell { display: contents; }
.line-cap { display: none; }

.line-item .picker { height: var(--size-36); font-size: var(--fs-micro); padding: 0 var(--size-20) 0 var(--size-6); background-color: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); color: var(--muted); outline: none; width: 100%; }
.line-item .picker:focus { border-color: var(--accent); }

.line-item .picker.line-u { width: auto; max-width: 100%; align-self: flex-start; }

.line-head--q, .editlines .line { grid-template-columns: 1fr var(--size-72) var(--size-80) var(--size-96) var(--size-80) var(--size-40); }
.line-head--unpriced, .editlines--unpriced .line { grid-template-columns: minmax(0, 1fr) var(--size-72) var(--size-80) var(--size-40); }
.line-head--tax, .editlines--tax .line { grid-template-columns: 1fr var(--size-80) var(--size-64) var(--size-80) var(--size-80) var(--size-80) var(--size-40); }
.line-head--disc, .editlines--disc .line { grid-template-columns: 1fr var(--size-64) var(--size-80) var(--size-80) var(--size-48) var(--size-80) var(--size-40); }
.line-head--disc-amt, .editlines--disc-amt .line { grid-template-columns: 1fr var(--size-64) var(--size-80) var(--size-80) var(--size-48) var(--size-72) var(--size-80) var(--size-40); }
.line-head--full, .editlines--full .line { grid-template-columns: 1fr var(--size-80) var(--size-56) var(--size-80) var(--size-72) var(--size-44) var(--size-80) var(--size-40); }
.line-head--full-amt, .editlines--full-amt .line { grid-template-columns: 1fr var(--size-80) var(--size-56) var(--size-80) var(--size-72) var(--size-44) var(--size-72) var(--size-80) var(--size-40); }
.line-head--priced, .editlines--priced .line { grid-template-columns: minmax(0, 1fr) var(--size-160) var(--size-96) var(--size-112) var(--size-32); }
.line-head--priced-disc, .editlines--priced-disc .line { grid-template-columns: minmax(0, 1fr) var(--size-128) var(--size-72) var(--size-72) var(--size-96) var(--size-112) var(--size-32); }
.line-head--account, .editlines--account .line { grid-template-columns: minmax(0, 1fr) var(--size-200) var(--size-80) var(--size-64) var(--size-96) var(--size-96) var(--size-40); }

.line input.line-d-row {
  grid-column: 1 / -1; height: var(--size-28); width: 100%; padding: 0 var(--size-2);
  font-size: var(--fs-sm); background: none; border: none;
  border-bottom: var(--stroke-1) solid transparent; border-radius: 0;
  color: var(--muted); outline: none;
}
.line input.line-d-row::placeholder { color: var(--text-3); }
.line input.line-d-row:hover { border-bottom-color: var(--border); }
.line input.line-d-row:focus { border-bottom-color: var(--accent); color: var(--text); }

span.line-u { align-self: center; font-size: var(--fs-sm); }

.line-amt { align-self: center; font-variant-numeric: tabular-nums; }

.form-doc .line-head { padding: 0 0 var(--size-6); margin-top: var(--size-8); border-bottom: var(--stroke-1) solid var(--border); }
.form-doc .line-head--tax, .form-doc .editlines--tax .line { grid-template-columns: minmax(0, 1fr) var(--size-80) var(--size-72) var(--size-80) var(--size-80) var(--size-96) var(--size-32); }
.form-doc .line-head--full, .form-doc .editlines--full .line { grid-template-columns: minmax(0, 1fr) var(--size-80) var(--size-64) var(--size-80) var(--size-80) var(--size-48) var(--size-96) var(--size-32); }
.form-doc .line-head--full-amt, .form-doc .editlines--full-amt .line { grid-template-columns: minmax(0, 1fr) var(--size-80) var(--size-64) var(--size-80) var(--size-80) var(--size-48) var(--size-80) var(--size-96) var(--size-32); }
.form-doc .linecount { border: none; background: none; padding: 0; }
.form-doc .lc-row { grid-template-columns: minmax(0, 1fr) var(--size-160) var(--size-112); gap: var(--size-8); padding: var(--size-6) 0; border-bottom: var(--stroke-1) solid var(--border); }
.form-doc .lc-row + .lc-row { border-top: none; }
.form-doc .linecount--money .lc-row { grid-template-columns: minmax(0, 1fr) var(--size-160) var(--size-160); }
.form-doc .lc-row--head { font-size: var(--fs-sm); padding: 0 0 var(--size-6); margin-top: var(--size-8); }
.form-doc .lc-row--head span:last-child { padding-inline: var(--size-8); }
.form-doc .lc-row input, .form-doc .linecount--money .lc-row input { height: var(--size-32); border-color: transparent; background-color: transparent; box-shadow: none; }
.form-doc .lc-row input:is(:hover, :focus) { border-color: transparent; box-shadow: none; background-color: var(--surface-2); }
.form-doc .lc-row input::placeholder { color: var(--text-3); }
.form-doc .lc-row input.over { border-color: var(--danger); box-shadow: 0 0 0 var(--stroke-3) var(--danger-soft); }
.form-doc .lc-foot { border-top: none; margin-top: 0; padding: var(--size-10) var(--size-8) 0 0; }
.form-doc .editlines .line { margin: 0; padding: var(--size-4) 0; border-bottom: var(--stroke-1) solid var(--border); row-gap: 0; }
.form-doc .line :is(input, .picker), .form-doc .line-item .picker, .form-doc .line-item .combo input {
  height: var(--size-32); padding-inline: var(--size-8); border-color: transparent; background-color: transparent; background-image: none; box-shadow: none;
  font-size: var(--fs-base); color: var(--text); transition: background-color 0.12s;
}
.form-doc .line :is(input, .picker):is(:hover, :focus), .form-doc .line-item .combo input:is(:hover, :focus) { border-color: transparent; box-shadow: none; background-color: var(--surface-2); }
.form-doc .line input::placeholder { color: var(--text-3); }
.form-doc .answers { gap: 0; }
.form-doc .answer { padding: var(--size-4) 0; border-bottom: var(--stroke-1) solid var(--border); }
.form-doc .answer--head { padding: 0 0 var(--size-6); }
.form-doc .answer--head > span { padding-inline: var(--size-8); }
.form-doc .answer input {
  height: var(--size-32); padding-inline: var(--size-8); border-color: transparent; background-color: transparent; box-shadow: none;
  transition: background-color 0.12s;
}
.form-doc .answer input:not([readonly]):is(:hover, :focus) { border-color: transparent; box-shadow: none; background-color: var(--surface-2); }
.form-doc .answer input::placeholder { color: var(--text-3); }
.form-doc .rowedit { gap: 0; }
.form-doc .rowedit__row { padding: var(--size-4) 0; border-bottom: var(--stroke-1) solid var(--border); }
.form-doc .rowedit__row--head { padding: 0 0 var(--size-6); }
.form-doc .rowedit__row--head > span { padding-inline: var(--size-8); }
.form-doc .rowedit input {
  height: var(--size-32); padding-inline: var(--size-8); border-color: transparent; background-color: transparent; box-shadow: none;
  transition: background-color 0.12s;
}
.form-doc .rowedit input:is(:hover, :focus) { border-color: transparent; box-shadow: none; background-color: var(--surface-2); }
.form-doc .rowedit input::placeholder { color: var(--text-3); }
.form-doc .line input.line-d-row { height: var(--size-28); padding-inline: var(--size-8); font-size: var(--fs-sm); color: var(--muted); border-bottom: none; }
.form-doc .line-head .num, .form-doc .line .num { text-align: end; }
.form-doc .line span.line-u, .form-doc .line .line-amt { padding-inline: var(--size-8); }
.form-doc .line .del { height: var(--size-32); opacity: 0; }
.form-doc .line:is(:hover, :focus-within) .del { opacity: 1; }
@media (hover: none) {
  .form-doc .line .del { opacity: 1; }
}
.form-doc .add-line { margin-top: var(--size-8); }
.people { display: flex; flex-direction: column; gap: var(--size-8); }
.person { --field-reach: var(--size-8); display: flex; flex-direction: column; gap: var(--size-4); padding: var(--size-8); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); }
.person .line { grid-template-columns: 1fr var(--size-40); margin-bottom: 0; }
.person .line--way { grid-template-columns: 1fr; }

.line > .picker {
  height: var(--size-36); font-size: var(--fs-sm); padding: 0 var(--size-20) 0 var(--size-6); background-color: var(--surface);
  border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); color: var(--text); outline: none; width: 100%;
}
.line > .picker:focus { border-color: var(--accent); }

.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-8); margin-bottom: var(--size-10); }
.week-who { flex: 0 1 var(--size-240); min-width: 0; }
.week-facts { margin-inline-start: auto; display: flex; align-items: center; gap: var(--size-10); font-size: var(--fs-sm); }
.week-nav .btn { width: var(--size-32); padding: 0; justify-content: center; }
.week-nav .btn svg { width: var(--icon-md); height: var(--icon-md); flex: none; }
.week-range { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text); }

.week-scroll {
  overflow-x: auto; border: var(--stroke-1) solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: var(--size-10);
}
.week { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.week th, .week td { border-bottom: var(--stroke-1) solid var(--border); padding: 0; text-align: center; }
.week tbody tr:last-child td { border-bottom: none; }
.week thead th {
  background: var(--surface-2); font-size: var(--fs-sm); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--muted); padding: var(--size-10) var(--size-4);
}
.week tfoot th, .week tfoot td {
  background: var(--surface-2); border-top: var(--stroke-1) solid var(--border); border-bottom: none;
  font-weight: var(--fw-bold); color: var(--text); padding: var(--size-12) var(--size-4); font-size: var(--fs-base);
}
.week .week-job {
  position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface);
  text-align: start; width: var(--size-160); min-width: var(--size-128); padding: var(--size-6) var(--size-8);
}
.week thead .week-job, .week tfoot .week-job { background: var(--surface-2); }
.week tfoot .week-job { text-transform: none; }
.week-day { min-width: var(--size-64); }
.week-day span, .week-day b { display: block; }
.week-day b { font-size: var(--fs-lg); color: var(--text); font-weight: var(--fw-semibold); letter-spacing: var(--ls-none); }
.week-day.weekend b, .week-day.weekend span { color: var(--text-3); }
.week .week-day.today { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 calc(var(--stroke-2) * -1) 0 var(--accent); }
.week .week-day.today b { color: var(--accent); }
.week .week-cell.today { background: var(--accent-soft); }
.week tfoot .week-cell.today { color: var(--accent); }
.week .week-cell input {
  width: var(--size-64); height: var(--size-36); margin: var(--size-4) 0; padding: 0; text-align: center; font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; color: var(--text); background: transparent;
  border: var(--stroke-1) solid transparent; border-radius: var(--radius-sm); outline: none;
}
.week .week-cell input:hover:not(:disabled) { border-color: var(--border); }
.week .week-cell input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.week .week-cell input::placeholder { color: var(--text-3); }
.week .week-cell input:disabled { cursor: not-allowed; opacity: 0.45; }
.week .week-cell input[aria-invalid="true"] { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.week .week-sum { min-width: var(--size-48); font-weight: var(--fw-bold); color: var(--text); padding-inline: var(--size-4); }
.week thead .week-sum { color: var(--muted); }
.week .week-del { width: var(--size-36); }
.week .combo input {
  height: var(--size-32); font-size: var(--fs-sm); padding: 0 var(--size-8); background-color: transparent;
  border: var(--stroke-1) solid transparent; border-radius: var(--radius-sm); color: var(--text);
  outline: none; width: 100%; min-width: 0;
}
.week .combo input:is(:hover, :focus) { border-color: transparent; box-shadow: none; background-color: var(--surface-2); }
.day-box { position: relative; display: inline-block; }
.day-box:has(.day-note.on)::after {
  content: ""; position: absolute; top: calc(var(--size-4) + var(--size-2)); right: var(--size-2); pointer-events: none;
  border-top: var(--size-6) solid var(--accent); border-left: var(--size-6) solid transparent;
}
.day-note {
  position: absolute; top: var(--size-4); right: var(--stroke-1); z-index: 2;
  display: inline-grid; place-items: center; width: var(--size-20); height: var(--size-36); padding: 0;
  border: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: none; color: var(--text-3); cursor: pointer; visibility: hidden; transition: color 0.12s;
}
.day-box:focus-within .day-note, .day-note[aria-expanded="true"] { visibility: visible; }
.week .week-cell .day-box:is(:focus-within, :has(.day-note[aria-expanded="true"])):has(.day-note) input { padding-right: var(--size-16); border-color: var(--border); background: var(--surface); }
.week .week-cell .day-box:focus-within:has(.day-note) input:focus { border-color: var(--accent); }
.day-box:is(:focus-within, :has(.day-note[aria-expanded="true"])):has(.day-note.on)::after { visibility: hidden; }
.day-note:hover, .day-note[aria-expanded="true"] { color: var(--text); }
.day-note.on { color: var(--accent); }
.day-note:disabled { cursor: default; }
.day-note:focus-visible { outline-offset: calc(var(--stroke-2) * -1); }
.week-name { display: block; padding: 0 var(--size-8); font-size: var(--fs-sm); color: var(--text-2); }
.note-panel {
  position: fixed; z-index: 62; display: flex; flex-direction: column; gap: var(--size-8); padding: var(--size-10);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.note-panel textarea {
  width: 100%; resize: vertical; padding: var(--size-8); font: inherit; font-size: var(--fs-sm); color: var(--text);
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); outline: none;
}
.note-panel textarea:focus { border-color: var(--accent); }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--size-8); }
.note-bill { display: inline-flex; align-items: center; gap: var(--size-8); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.week .del:focus-visible { outline-offset: calc(var(--stroke-2) * -1); }
.week .del {
  color: var(--muted); background: none; border: none; cursor: pointer;
  height: var(--size-32); width: var(--size-32); border-radius: var(--radius-sm);
}
.week .del:hover { background: var(--danger-soft); color: var(--danger); }

@media (hover: none) and (pointer: coarse) {
  .day-box { -webkit-touch-callout: none; }
  .day-box .day-note { display: none; }
  .week .week-cell .day-box:is(:focus-within, :has(.day-note[aria-expanded="true"])):has(.day-note) input { padding-right: 0; }
  .day-box:is(:focus-within, :has(.day-note[aria-expanded="true"])):has(.day-note.on)::after { visibility: visible; }
}

@media (max-width: 720px) {
  .note-panel {
    top: auto !important; right: 0; bottom: var(--sheet-strip-h); left: 0 !important; width: 100% !important;
    gap: var(--size-12); padding: var(--size-16); border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg), 0 0 0 100vmax var(--scrim); clip-path: inset(-100vmax -100vmax 0);
  }
  .week .week-job { min-width: var(--size-128); }
  .week .week-cell input { width: var(--size-64); }
}

.totes { margin-top: var(--size-16); border-top: var(--stroke-1) dashed var(--border-2); padding-top: var(--size-14); }
.tote { display: flex; justify-content: space-between; padding: var(--size-4) var(--size-2); font-size: var(--fs-base); }
.tote.grand { font-size: var(--fs-xl); font-weight: var(--fw-bold); border-top: var(--stroke-1) solid var(--border); margin-top: var(--size-8); padding-top: var(--size-12); }
.tote.grand:first-child { border-top: none; margin-top: 0; padding-top: var(--size-4); }
.tote .num { font-variant-numeric: tabular-nums; }

.modal {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: var(--size-20);
  overflow-y: auto; overscroll-behavior: contain; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 0.16s;
  backdrop-filter: blur(var(--stroke-1));
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal__card {
  width: var(--size-440); max-width: 100%; margin: auto; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--size-20);
  transform: scale(0.96); transition: transform 0.16s;
}
.modal.open .modal__card { transform: scale(1); }
.modal__card h3 { font-size: var(--fs-lg); margin-bottom: var(--size-4); }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--size-10); margin-top: var(--size-8); }

.cmdk {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 0.14s;
  backdrop-filter: blur(var(--size-2));
}
.cmdk.open { opacity: 1; pointer-events: auto; }
.cmdk__box {
  width: var(--size-560); max-width: 92vw; height: max-content; max-height: 62vh;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; transform: translateY(calc(var(--size-8) * -1)); transition: transform 0.16s;
}
.cmdk.open .cmdk__box { transform: translateY(0); }
.cmdk__input { display: flex; align-items: center; gap: var(--size-10); padding: var(--size-14) var(--size-16); border-bottom: var(--stroke-1) solid var(--border); }
.cmdk__input input { flex: 1; border: none; background: none; outline: none; font-size: var(--fs-lg); color: var(--text); font-family: inherit; }
.cmdk__list { overflow-y: auto; padding: var(--size-8); }
.cmdk__group { font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wider); color: var(--muted); padding: var(--size-8) var(--size-10) var(--size-4); }

.cmdk__item {
  display: flex; align-items: center; gap: var(--size-12); width: 100%; text-align: start;
  background: none; border: none; color: var(--text);
  padding: var(--size-8) var(--size-10); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-base);
}
.cmdk__item .ic { color: var(--text-2); width: var(--icon-lg); height: var(--icon-lg); flex: none; }
.cmdk__item .k { margin-inline-start: auto; font-size: var(--fs-sm); color: var(--muted); }
.cmdk__item.sel { background: var(--accent-soft); color: var(--accent); }
.cmdk__item.sel .ic { color: var(--accent); }
.cmdk__empty { padding: var(--size-24); text-align: center; color: var(--muted); font-size: var(--fs-base); }

.update-note {
  position: fixed; bottom: var(--size-48); inset-inline-start: var(--size-24); z-index: 70;
  display: flex; align-items: center; gap: var(--size-4); max-width: calc(100vw - var(--size-48));
  background: var(--surface); color: var(--text); border: var(--stroke-1) solid var(--border);
  padding: var(--size-6) var(--size-6) var(--size-6) var(--size-14); border-radius: var(--radius-sm);
  font-size: var(--fs-base); box-shadow: var(--shadow-lg);
}
.update-note__msg { font-weight: var(--fw-semibold); margin-inline-end: var(--size-6); }
.update-note .btn { padding: 0; aspect-ratio: 1; justify-content: center; }
.toast {
  position: fixed; bottom: var(--size-24); inset-inline-end: var(--size-24); transform: translateY(var(--size-20));
  display: flex; align-items: flex-start; gap: var(--size-10); width: max-content; max-width: min(var(--size-400), calc(100vw - var(--size-48)));
  background: var(--surface); color: var(--text); border: var(--stroke-1) solid var(--line); padding: var(--size-12) var(--size-14); border-radius: var(--radius-sm);
  font-size: var(--fs-base); box-shadow: var(--shadow-lg); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.huddle-dock {
  position: fixed; bottom: calc(var(--sheet-strip-h) + var(--size-12)); inset-inline-start: var(--size-24); z-index: 69;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--size-8); max-width: calc(100vw - var(--size-48));
}
.huddle-dock:empty { display: none; }
.huddle-bar, .huddle-call {
  display: flex; align-items: center; gap: var(--size-8); max-width: 100%;
  background: var(--surface); color: var(--text); border: var(--stroke-1) solid var(--line);
  padding: var(--size-8) var(--size-10); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: var(--fs-sm);
}
.huddle-bar--folded { gap: var(--size-2); padding: var(--size-8) var(--size-4); border-radius: var(--radius-lg); }
.huddle-bar__what { display: flex; align-items: center; gap: var(--size-6); min-width: 0; padding: 0; border: none; background: none; color: inherit; font: inherit; cursor: pointer; }
.huddle-bar__name { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.huddle-bar__count { flex: none; color: var(--muted); }
.huddle-bar__live { flex: none; color: var(--good); }
.huddle-bar__live--speaking { animation: huddle-speaking 1.2s ease-in-out infinite; }
.huddle-bar .huddle-bar__muted { color: var(--danger); }
.huddle-bar .huddle-bar__talking { color: var(--good); animation: huddle-talking 0.6s ease-in-out infinite alternate; }
.huddle-call__msg { font-weight: var(--fw-semibold); min-width: 0; }
@keyframes huddle-speaking { 50% { opacity: 0.4; } }
@keyframes huddle-talking { to { transform: scale(1.12); } }
.toast--failure { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.toast--success { border-color: color-mix(in srgb, var(--good) 35%, var(--border)); }
.toast__mark { flex: none; color: var(--danger); }
.toast--success .toast__mark { color: var(--good); }
.toast__body { display: flex; flex-direction: column; gap: var(--size-2); min-width: 0; }
.toast__msg { font-weight: var(--fw-semibold); }
.toast__detail { color: var(--text-2); font-size: var(--fs-sm); }

.toast__do {
  flex: none; align-self: center; padding: var(--size-4) var(--size-10);
  border: var(--stroke-1) solid var(--line); border-radius: var(--radius-xs); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer;
}
.toast__do:hover { background: var(--surface-3); }

.auth {
  position: fixed; inset: 0; z-index: 80; display: grid;
  grid-template-columns: 1.05fr 1fr; background: var(--bg);
}

.auth__brand {
  position: relative; overflow: hidden; padding: var(--size-48);
  display: flex; flex-direction: column; color: var(--hero-ink);
  background:
    radial-gradient(120% 90% at 15% 10%, color-mix(in srgb, var(--hero-strong) 92%, var(--hero-deep)) 0%, transparent 60%),
    linear-gradient(150deg, var(--hero-strong), color-mix(in srgb, var(--hero) 70%, var(--hero-deep)));
}
.auth__brand::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background: radial-gradient(60% 55% at 85% 90%, color-mix(in srgb, var(--hero) 55%, transparent), transparent 70%);
}
.auth__brand > * { position: relative; z-index: 1; }
.brand-lockup { --lockup: var(--size-28); display: inline-flex; align-items: flex-start; gap: var(--size-10); }
.brand-lockup .brand-mark { width: var(--lockup); height: var(--lockup); box-shadow: none; }
.brand-wordmark { height: var(--lockup, var(--size-24)); width: auto; overflow: visible; fill: currentColor; }
.auth__brand .brand-lockup .brand-mark { background: var(--hero-ink); color: var(--hero); }
.auth__pitch { margin-top: auto; }
.auth__pitch h2 { font-size: var(--fs-3xl); line-height: var(--lh-tight); font-weight: var(--fw-semibold); max-width: 15ch; letter-spacing: var(--ls-tighter); }
.auth__pitch p { margin: var(--size-14) 0 0; font-size: var(--fs-base); color: color-mix(in srgb, var(--hero-ink) 82%, transparent); max-width: 40ch; }
.auth-cues { display: flex; flex-direction: column; gap: var(--size-10); margin-top: var(--size-28); }

.auth-cue { display: flex; align-items: center; gap: var(--size-10); font-size: var(--fs-base); color: var(--text-2); }
.auth-cue svg { width: var(--icon-md); height: var(--icon-md); flex: none; color: var(--accent); }
.auth-cue b { color: var(--text); }
.auth__brand .auth-cue { color: color-mix(in srgb, var(--hero-ink) 92%, transparent); }
.auth__brand .auth-cue svg { color: currentColor; opacity: 0.9; }
.auth__brand .auth-cue b { color: inherit; }

.auth__panel {
  display: grid; grid-template-columns: minmax(0, var(--size-400));
  justify-content: center; align-content: center; align-content: safe center;
  padding: var(--size-40) var(--size-32); overflow-y: auto;
}
.auth__card { grid-area: 1 / 1; width: 100%; }
.auth__card[hidden] { display: block; visibility: hidden; }

#authInvite[hidden] { display: none; }
.auth__card h1 { font-size: var(--fs-2xl); letter-spacing: var(--ls-tighter); }
.auth__card > p.sub { color: var(--muted); font-size: var(--fs-base); margin: var(--size-6) 0 var(--size-24); }
.auth .field input, .auth .field .picker { height: var(--size-44); }

.auth__submit { width: 100%; height: var(--size-44); font-size: var(--fs-base); margin-top: var(--size-4); justify-content: center; }
.auth-alt { text-align: center; font-size: var(--fs-base); color: var(--muted); margin-top: var(--size-20); }

.auth-alt button {
  color: var(--link); font-weight: var(--fw-semibold); text-decoration: none; cursor: pointer;
  background: none; border: none; font: inherit; padding: var(--size-8) var(--size-6); min-height: var(--size-36);
}
.auth-alt button:hover { text-decoration: underline; }
.auth-invite {
  display: flex; gap: var(--size-12); align-items: flex-start; padding: var(--size-14);
  background: var(--accent-soft); border: var(--stroke-1) solid var(--accent-line); border-radius: var(--radius); margin-bottom: var(--size-20);
}
.auth-invite .av { width: var(--size-40); height: var(--size-40); border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: var(--fw-bold); flex: none; }
.auth-invite b { font-size: var(--fs-base); }
.auth-invite small { display: block; color: var(--text-2); font-size: var(--fs-sm); margin-top: var(--size-2); }

.auth-fine { font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--muted); margin: var(--size-12) 0 0; }

.delivery-sends { display: flex; flex-direction: column; gap: var(--size-12); }
.delivery-send { border: var(--stroke-1) solid var(--border); border-radius: var(--radius); padding: var(--size-12) var(--size-14); }
.delivery-send__head { display: flex; justify-content: space-between; align-items: center; gap: var(--size-8); font-size: var(--fs-base); font-weight: var(--fw-medium); }
.delivery-send__to { font-size: var(--fs-sm); color: var(--muted); margin: var(--size-4) 0 var(--size-12); overflow-wrap: anywhere; }
.delivery-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--size-144), 1fr)); gap: var(--size-8); }
.delivery-tile { background: var(--surface-2); border-radius: var(--radius); padding: var(--size-10) var(--size-12); display: flex; flex-direction: column; gap: var(--size-2); }
.delivery-tile__label { font-size: var(--fs-sm); color: var(--muted); }
.delivery-tile__figure { font-size: var(--fs-xl); font-weight: var(--fw-medium); }
.delivery-tile__sub { font-size: var(--fs-sm); color: var(--text-3); overflow-wrap: anywhere; }
.delivery-send__note { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--size-10); }
.delivery-send__note--good { color: var(--good); }
.delivery-recipients { display: flex; flex-direction: column; gap: var(--size-8); margin: var(--size-12) 0; }
.delivery-recipient { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--size-8); }
.delivery-recipient__who { display: flex; flex-direction: column; gap: var(--size-2); min-width: 0; }
.delivery-recipient__name { font-size: var(--fs-base); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.delivery-recipient__address { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.delivery-recipient__seen { font-size: var(--fs-sm); color: var(--text-3); }
.delivery-viewers { display: flex; flex-direction: column; gap: var(--size-2); }
.delivery-viewer__email { color: var(--muted); }

.doc-page {
  min-height: 100dvh; background: var(--bg); padding: var(--size-32) var(--size-16);
  display: grid; grid-template-columns: minmax(0, var(--size-720)); justify-content: center;
  align-content: start; gap: var(--size-16);
}
.doc-page__sheet {
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-top: var(--size-4) solid var(--accent);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--size-32);
  display: flex; flex-direction: column; gap: var(--size-24);
}
.doc-page__bar { display: flex; justify-content: flex-end; }
.doc-page__brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--size-4); min-width: 0; }
.doc-page__brand > :first-child { margin-bottom: var(--size-8); }
.doc-page__notes small {
  display: block; font-size: var(--fs-micro); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide);
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--size-4);
}
.doc-page__totals { display: flex; justify-content: flex-end; }
.doc-page__totals > * { flex: 0 1 var(--size-360); }
.doc-page__totals .totes { border-top: none; margin-top: 0; padding-top: 0; }
.doc-page__totals .tote.grand { border-top-color: var(--text); }
.doc-page__sheet .tbl thead th { background: none; border-bottom: var(--stroke-1) solid var(--text); }
.doc-page__notes { display: flex; flex-direction: column; gap: var(--size-4); font-size: var(--fs-sm); }
.doc-page__notes p { margin: 0; }
.doc-page__brand-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
@media (max-width: 720px) {
  .doc-page__sheet { padding: var(--size-20); }
}
.doc-page__sheet--plain { border-top: var(--stroke-1) solid var(--border); gap: var(--size-32); }
.doc-page__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--size-20); }
.doc-page__heading {
  font-size: var(--fs-4xl); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight);
  text-transform: uppercase; color: var(--text); margin: 0;
}
.doc-page__billing { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--size-240), 1fr)); gap: var(--size-24); }
.doc-page__billing small, .doc-page__payment small, .doc-page__grid dt {
  display: block; font-size: var(--fs-sm); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide);
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--size-6);
}
.doc-page__billing b { display: block; margin-bottom: var(--size-2); font-size: var(--fs-xl); }
.doc-page__address { max-width: var(--size-400); }
.doc-page__sheet--plain .doc-page__brand-name { font-size: var(--fs-2xl); }
.doc-page__sheet--plain .doc-page__lines, .doc-page__sheet--plain .doc-page__notes { font-size: var(--fs-md); }
.doc-page__items .tbl { font-size: var(--fs-md); }
.doc-page__billing .doc-page__lines { color: var(--text); }
.doc-page__grid { display: grid; gap: var(--size-10); margin: 0; align-content: start; }
.doc-page__grid > div { display: grid; grid-template-columns: var(--size-128) 1fr; gap: var(--size-16); align-items: baseline; }
.doc-page__grid dt { margin: 0; }
.doc-page__grid dd { margin: 0; font-size: var(--fs-md); }
.doc-page__items .tbl thead th { background: var(--text); color: var(--surface); border-bottom: none; }
.doc-page__payment dl { margin: 0; font-size: var(--fs-md); }
.doc-page__payment dl > div {
  display: grid; grid-template-columns: var(--size-200) 1fr; gap: var(--size-16);
  padding: var(--size-8) 0; border-bottom: var(--stroke-1) solid var(--border);
}
.doc-page__payment dt { font-weight: var(--fw-bold); }
.doc-page__payment dd { margin: 0; grid-column: 2; overflow-wrap: anywhere; }
.doc-page__payment dl > div:not(:has(dt)) dd { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .doc-page__payment dl > div { grid-template-columns: 1fr; gap: var(--size-2); }
  .doc-page__payment dd { grid-column: 1; }
}
.doc-page__countdown {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--size-12);
  padding: var(--size-16) var(--size-20); border-radius: var(--radius-lg);
  background: var(--warn-soft); border: var(--stroke-1) solid var(--warn);
}
.doc-page__countdown-clock { font-size: var(--fs-3xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; color: var(--warn); }
.doc-page__logo { max-width: var(--size-200); max-height: var(--size-56); object-fit: contain; }
.doc-page__lines { font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-normal); }
.doc-page__choices { display: flex; flex-direction: column; gap: var(--size-8); }
.doc-page__choice {
  display: flex; align-items: center; gap: var(--size-10); padding: var(--size-10) var(--size-12);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius); cursor: pointer;
  font-size: var(--fs-base);
}
.doc-page__choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.doc-page__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--size-10); }
.auth-or {
  display: flex; align-items: center; gap: var(--size-12);
  margin: var(--size-20) 0 var(--size-14); font-size: var(--fs-sm); color: var(--muted);
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: var(--stroke-1); background: var(--border); }

.field input.auth-code {
  font-size: var(--fs-2xl); font-weight: var(--fw-bold); text-align: center; letter-spacing: var(--ls-code);
  font-variant-numeric: tabular-nums; text-indent: var(--ls-code);
}
.auth-code::placeholder { font-weight: var(--fw-medium); color: var(--border-2); }
.auth-meta { font-size: var(--fs-sm); color: var(--muted); text-align: center; margin-top: var(--size-14); }

.auth-meta button {
  color: var(--link); font-weight: var(--fw-semibold); text-decoration: none; cursor: pointer;
  background: none; border: none; font: inherit; padding: var(--size-8) var(--size-6); min-height: var(--size-36);
}
.auth-meta button:hover { text-decoration: underline; }

.auth--solo { grid-template-columns: minmax(0, 1fr); }
.auth--solo .auth__panel { grid-template-columns: minmax(0, var(--size-440)); }
.auth--solo .auth__card {
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: var(--size-28);
}
.auth--solo .auth-cues { margin-top: var(--size-20); margin-bottom: var(--size-24); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth__brand { display: none; } }

.state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--size-56) var(--size-28); gap: var(--size-4);
}
.state__icon {
  width: var(--size-56); height: var(--size-56); border-radius: var(--radius-lg); display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); margin-bottom: var(--size-14);
}
.state__icon svg { width: var(--icon-xl); height: var(--icon-xl); }
.state--danger .state__icon { background: var(--danger-soft); color: var(--danger); }
.state--warn .state__icon { background: var(--warn-soft); color: var(--warn); }
.state h3 { font-size: var(--fs-lg); }
.state p { color: var(--muted); font-size: var(--fs-base); max-width: 42ch; margin: var(--size-4) 0 0; }
.state__actions { display: flex; gap: var(--size-10); margin-top: var(--size-16); flex-wrap: wrap; justify-content: center; }

.sk { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-row { display: flex; align-items: center; gap: var(--size-14); padding: var(--size-12) var(--size-4); border-bottom: var(--stroke-1) solid var(--border); }
.sk-row .sk { height: var(--size-14); }

.usermenu-wrap { position: relative; }
.usermenu-wrap .avatar { border: none; cursor: pointer; padding: 0; }
.usermenu {
  position: absolute; top: calc(100% + var(--size-8)); inset-inline-end: 0; width: var(--sidebar-w); z-index: 60;
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: var(--size-6); opacity: 0; transform: translateY(calc(var(--size-6) * -1));
  pointer-events: none; transition: opacity 0.14s, transform 0.14s;
}
.usermenu.open { opacity: 1; transform: none; pointer-events: auto; }
.usermenu__head { display: flex; align-items: center; gap: var(--size-10); padding: var(--size-10) var(--size-10) var(--size-12); }
.usermenu__head b { font-size: var(--fs-base); display: block; }
.usermenu__head small { color: var(--muted); font-size: var(--fs-sm); }
.usermenu__foot { display: block; padding: var(--size-6) var(--size-10) var(--size-4); color: var(--muted); font-size: var(--fs-sm); }
.usermenu__sep { height: var(--stroke-1); background: var(--border); margin: var(--size-6) var(--size-4); }
.usermenu__item { display: flex; align-items: center; gap: var(--size-10); width: 100%; text-align: start; background: none; border: none; padding: var(--size-8) var(--size-10); border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: var(--fs-base); }
.usermenu__item svg { width: var(--icon-md); height: var(--icon-md); color: var(--muted); flex: none; }
.usermenu__item:hover { background: var(--surface-3); }
.usermenu__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__item svg.usermenu__chev { width: var(--icon-md); height: var(--icon-md); margin-inline-start: auto; }
.usermenu__item.danger { color: var(--danger); }
.usermenu__item.danger svg { color: var(--danger); }
.usermenu-wrap > .avatar__count {
  position: absolute; inset-block-start: calc(var(--size-4) * -1); inset-inline-end: calc(var(--size-4) * -1);
  min-width: var(--size-16); padding: 0 var(--size-4); border-radius: var(--radius-pill); pointer-events: none;
  background: var(--accent); color: var(--accent-ink); font-size: var(--fs-micro); font-weight: var(--fw-bold);
  line-height: var(--lh-normal); text-align: center; box-shadow: 0 0 0 var(--stroke-2) var(--surface);
}
.usermenu-wrap > .avatar__count.mention-count { background: var(--danger); color: var(--danger-ink); }
.usermenu__count {
  margin-inline-start: auto; min-width: var(--size-20); padding: 0 var(--size-6); border-radius: var(--radius-lg); flex: none;
  background: var(--accent); color: var(--accent-ink); font-size: var(--fs-micro);
  font-weight: var(--fw-bold); line-height: var(--lh-loose); text-align: center;
}
.usermenu__count.mention-count { background: var(--danger); color: var(--danger-ink); }
.usermenu__count + svg.usermenu__chev { margin-inline-start: 0; }

.title-wrap {
  display: flex; flex-direction: column; justify-content: center; min-width: var(--size-72);
  margin-inline-end: auto;
  background: none; border: none; padding: 0; color: inherit; font: inherit;
  text-align: start; cursor: default;
}

.co-pill {
  display: none; align-items: center; gap: var(--size-4); align-self: flex-start;
  max-width: 100%; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--accent);
}
.co-pill > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-pill svg { width: var(--icon-sm); height: var(--icon-sm); flex: none; }

.co-list { display: flex; flex-direction: column; gap: var(--size-8); }
.co-row {
  position: relative;
  display: flex; align-items: flex-start; gap: var(--size-12); width: 100%;
  padding: var(--size-12) var(--size-14); border: var(--stroke-1) solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; text-align: start;
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.co-row:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-2); }
.co-row.active { border-color: var(--accent); background: var(--accent-soft); }
.co-row:disabled { cursor: not-allowed; opacity: 0.58; }
.co-row .mk {
  width: var(--size-36); height: var(--size-36); flex: none; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-weight: var(--fw-bold); font-size: var(--fs-sm);
  background: var(--surface-3); color: var(--text-2);
}
.co-row.active .mk { background: var(--accent); color: var(--accent-ink); }
.co-row .co-main { display: block; flex: 1; min-width: 0; }
.co-row b { display: block; font-size: var(--fs-base); padding-inline-end: var(--size-72); }
.co-row small { display: block; margin-top: var(--size-2); font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-normal); }

.co-row .tag { position: absolute; top: var(--size-14); inset-inline-end: var(--size-14); }
.co-row__count {
  display: inline-block; margin-inline-start: var(--size-6); min-width: var(--size-20); padding: 0 var(--size-6);
  border-radius: var(--radius-lg); vertical-align: middle;
  background: var(--accent); color: var(--accent-ink); font-size: var(--fs-micro);
  font-weight: var(--fw-bold); line-height: var(--lh-loose); text-align: center;
}
.co-row__count.mention-count { background: var(--danger); color: var(--danger-ink); }
.co-foot { margin-top: var(--size-16); font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-normal); }

.acts { display: flex; flex-direction: column; gap: var(--size-8); }
.acts-h {
  display: flex; align-items: baseline; gap: var(--size-8); margin: var(--size-20) 0 var(--size-10);
}
.acts-h:first-child { margin-top: var(--size-4); }
.acts-h b { font-size: var(--fs-base); font-weight: var(--fw-bold); }
.acts-h small { font-size: var(--fs-sm); color: var(--muted); }

.act {
  display: flex; align-items: center; gap: var(--size-12); padding: var(--size-10) var(--size-12);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: background 0.1s;
}
.act:hover { background: var(--surface-2); }

.act--late { border-inline-start: var(--stroke-3) solid var(--danger); }
.act__i {
  width: var(--size-32); height: var(--size-32); flex: none; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}

.act__i .ic { width: var(--icon-md); height: var(--icon-md); }
.compose .btn .ic { width: var(--icon-md); height: var(--icon-md); flex: none; }
.way .act__i .ic { width: var(--icon-md); height: var(--icon-md); }
.act__i--call { background: var(--accent-soft); color: var(--accent); }
.act__i--email { background: var(--info-soft); color: var(--info); }
.act__i--whatsapp { background: var(--brand-whatsapp-soft); color: var(--brand-whatsapp); }
.act__i--meeting { background: var(--warn-soft); color: var(--warn); }
.act__i--won, .act__i--accepted, .act__i--qualification {
  background: var(--accent-soft); color: var(--accent);
}
.act__i--lost, .act__i--declined { background: var(--danger-soft); color: var(--danger); }
.act__i--comment, .act__i--quoted, .act__i--reopened {
  background: var(--surface-2); color: var(--text-2);
}
.act__b { flex: 1; min-width: 0; }
.act__t { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.act__s { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--size-2); }
.act__s b { font-weight: var(--fw-semibold); color: var(--text-2); }
.act__w { font-size: var(--fs-sm); color: var(--muted); flex: none; text-align: end; }
.act__w b { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); }
.act__w .late { color: var(--danger); font-weight: var(--fw-semibold); }
.act__go { display: flex; gap: var(--size-6); flex: none; }
.act-auto {
  display: inline-flex; align-items: center; gap: var(--size-4);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-pill); padding: var(--stroke-1) var(--size-6); margin-inline-start: var(--size-6);
}

.conn {
  display: flex; align-items: center; gap: var(--size-10); padding: var(--size-8) var(--size-12); margin-bottom: var(--size-14);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius); font-size: var(--fs-sm);
  background: var(--surface);
}

.ev { display: flex; gap: var(--size-10); padding: var(--size-10) 0; border-top: var(--stroke-1) solid var(--border); }
.ev:first-child { border-top: none; }

.compose { display: flex; gap: var(--size-6); flex-wrap: wrap; margin-bottom: var(--size-4); }
.compose .btn { flex: 1 1 auto; min-width: var(--size-80); }

.ways { display: flex; flex-direction: column; gap: var(--size-6); }
.way {
  display: flex; align-items: center; gap: var(--size-8); padding: var(--size-6) var(--size-10);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-sm);
}

.way--edit { padding: 0; border: none; gap: var(--size-6); }
.way--edit .way__in { flex: 1 1 auto; min-width: 0; }
.way--edit .way__lb { flex: 0 0 var(--size-96); }
.way--edit input {
  height: var(--size-36); padding: 0 var(--size-10); font-size: var(--fs-base); font-family: inherit;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none;
}
.way--edit input:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.way__fl {
  flex: none; height: var(--size-36); padding: 0 var(--size-10); border-radius: var(--radius-sm);
  border: var(--stroke-1) solid var(--border); background: var(--surface-2); color: var(--muted);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); font-family: inherit; cursor: pointer; white-space: nowrap;
}
.way__fl.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
@media (max-width: 720px) {
  .way--edit { flex-wrap: wrap; row-gap: var(--size-6); }
  .way--edit .way__in { flex: 1 1 100%; }
  .way--edit .way__lb { flex: 1 1 auto; }
}

.hourlog { display: flex; flex-direction: column; gap: var(--size-6); }
.hourlog__row { display: flex; align-items: center; gap: var(--size-6); }
.hourlog__date { flex: 0 0 var(--size-128); min-width: 0; }
.hourlog__who { flex: 0 0 var(--size-128); min-width: 0; }
.hourlog__hours { flex: 0 0 var(--size-64); min-width: 0; text-align: end; font-variant-numeric: tabular-nums; }
.hourlog__note { flex: 1 1 auto; min-width: 0; }
.hourlog__bill { flex: 0 0 var(--size-48); display: flex; justify-content: center; }
.hourlog__kept { flex: 0 0 var(--size-36); }
.hourlog__name { display: block; padding: 0 var(--size-10); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
span.hourlog__date { padding: 0 var(--size-10); color: var(--text-2); }
.hourlog__row > .hourlog__date input { padding-inline-start: var(--size-6); }
.hourlog__row > input:not([type="checkbox"]), .hourlog__who .combo input {
  height: var(--size-36); padding: 0 var(--size-10); font-size: var(--fs-base); font-family: inherit; width: 100%;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none;
}
.hourlog__row > input:not([type="checkbox"]):focus, .hourlog__who .combo input:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.hourlog__row > input[readonly] { background: none; border-color: transparent; box-shadow: none; color: var(--text-2); }
.hourlog__row > input[aria-invalid="true"] { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.hourlog__row--new > input:not([type="checkbox"]), .hourlog__row--new .combo input { border-style: dashed; }
.hourlog .del {
  color: var(--muted); background: none; border: none; cursor: pointer;
  flex: 0 0 var(--size-36); height: var(--size-36); border-radius: var(--radius-sm);
}
.hourlog .del:hover { background: var(--danger-soft); color: var(--danger); }
.hourlog__row--head {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: var(--ls-wider); color: var(--text-2);
}
.hourlog__row--head > span:nth-child(1) { flex: 0 0 var(--size-128); }
.hourlog__row--head > span:nth-child(2) { flex: 0 0 var(--size-128); }
.hourlog__row--head > span:nth-child(3) { flex: 0 0 var(--size-64); text-align: end; }
.hourlog__row--head > span:nth-child(4) { flex: 1 1 auto; }
.hourlog__row--head > span:nth-child(5) { flex: 0 0 var(--size-48); text-align: center; }
.hourlog__row--head > span:nth-child(6) { flex: 0 0 var(--size-36); }
@media (max-width: 720px) {
  .hourlog__row { flex-wrap: wrap; row-gap: var(--size-6); padding-bottom: var(--size-6); border-bottom: var(--stroke-1) solid var(--border); }
  .hourlog__row--head { display: none; }
  .hourlog__note { flex: 1 1 100%; order: 1; }
  .hourlog__who { flex: 1 1 auto; }
}
.answers { display: flex; flex-direction: column; gap: var(--size-6); }
.answer { display: flex; align-items: center; gap: var(--size-6); }
.answer__c { flex: 0 0 var(--size-96); min-width: 0; }
.answer__n { flex: 1 1 auto; min-width: 0; }
.answer__x { flex: 0 0 var(--size-112); min-width: 0; text-align: end; font-variant-numeric: tabular-nums; }
.answer input {
  height: var(--size-36); padding: 0 var(--size-10); font-size: var(--fs-base); font-family: inherit;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none;
}
.answer input:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.answer input[readonly] { background: none; border-color: transparent; box-shadow: none; color: var(--text-2); }
.answer__kept { flex: 0 0 var(--size-36); }

.answer .del {
  color: var(--muted); background: none; border: none; cursor: pointer;
  height: var(--size-36); width: var(--size-36); border-radius: var(--radius-sm);
}
.answer .del:hover { background: var(--danger-soft); color: var(--danger); }

.answer--head {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: var(--ls-wider); color: var(--text-2);
}
.answer--head > span:nth-child(1) { flex: 0 0 var(--size-96); }
.answer--head > span:nth-child(2) { flex: 1 1 auto; }
.answer--head > span:nth-child(3) { flex: 0 0 var(--size-112); text-align: end; }
.answer--head > span:nth-child(4) { flex: 0 0 var(--size-36); }
@media (max-width: 720px) {
  .answer { flex-wrap: wrap; row-gap: var(--size-6); }
  .answer__n { flex: 1 1 100%; order: -1; }
  .answer--head { display: none; }
}

.rowedit { display: flex; flex-direction: column; gap: var(--size-6); }
.rowedit__row { display: flex; align-items: center; gap: var(--size-6); }
.rowedit__cell { flex: 1 1 0; min-width: 0; }
.rowedit input.rowedit__cell {
  height: var(--size-36); padding: 0 var(--size-10); font-size: var(--fs-base); font-family: inherit;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none;
}
.rowedit input.rowedit__cell:focus { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.rowedit input.rowedit__cell:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.rowedit input.rowedit__cell[aria-invalid="true"] { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.rowedit__cell--num, .rowedit__num { text-align: end; font-variant-numeric: tabular-nums; }
.rowedit .del {
  flex: 0 0 var(--size-36); color: var(--muted); background: none; border: none; cursor: pointer;
  height: var(--size-36); width: var(--size-36); border-radius: var(--radius-sm);
}
.rowedit .del:hover { background: var(--danger-soft); color: var(--danger); }
.rowedit__row--head {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: var(--ls-wider); color: var(--text-2);
}
.rowedit__row--head > span { flex: 1 1 0; min-width: 0; }
.rowedit__row--head > .rowedit__del { flex: 0 0 var(--size-36); }

.checks { display: flex; flex-direction: column; gap: var(--size-12); }
.checks__title {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: var(--ls-wider); color: var(--text-2); margin-bottom: var(--size-4);
}
.checks__row { display: flex; flex-wrap: wrap; gap: var(--size-6); }
.checks__row--stacked { flex-direction: column; flex-wrap: nowrap; }
.checks-tbl .checks-tbl__tick { width: var(--size-40); padding-inline-end: 0; }
.checks-tbl tbody .checks-tbl__group th {
  padding: var(--size-12) var(--size-16) var(--size-4); text-align: start; font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wider); color: var(--text-2); border-bottom: var(--stroke-1) solid var(--border);
}
.checks-tbl tbody .checks-tbl__group { cursor: default; }
.checks-tbl tbody .checks-tbl__group:hover { background: none; }
.checks-tbl tbody tr:not(.checks-tbl__on, .checks-tbl__group) td:not(.checks-tbl__tick) { color: var(--muted); }
@media (max-width: 720px) {
  .checks-tbl :is(th, td):nth-child(n + 4) { display: none; }
}

.checks__row .chk-row {
  flex: 0 0 auto; align-items: center; gap: var(--size-6);
  padding: var(--size-6) var(--size-12); border-radius: var(--radius-pill);
}

.tagbox-wrap { position: relative; }
.tagbox {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-6);
  min-height: var(--size-40); padding: var(--size-4) var(--size-8); cursor: text;
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.tagbox--fixed { cursor: default; }
.tagbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.field .tagbox input:not([type="checkbox"]) {
  flex: 1 1 var(--size-80); min-width: var(--size-80); width: auto; height: var(--size-28); padding: 0 var(--size-4);
  background: transparent; border: none; box-shadow: none;
}
.tagpill {
  display: inline-flex; align-items: center; gap: var(--size-2);
  padding: var(--size-2) var(--size-4) var(--size-2) var(--size-10); border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); max-width: calc(100% - var(--size-6));
}
.tagpill__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tagbox__opt .tagpill { padding-inline-end: var(--size-10); }
.tagpill--off { padding-inline-end: var(--size-10); border: var(--stroke-1) dashed var(--border-2); background: transparent; cursor: pointer; }
.tagpill--off:hover { background: var(--surface-3); }
.tagpill--red { background: var(--sheet-hl-red); color: var(--sheet-hl-red-ink); }
.tagpill--amber { background: var(--sheet-hl-amber); color: var(--sheet-hl-amber-ink); }
.tagpill--green { background: var(--sheet-hl-green); color: var(--sheet-hl-green-ink); }
.tagpill--blue { background: var(--sheet-hl-blue); color: var(--sheet-hl-blue-ink); }
.tagpill--purple { background: var(--sheet-hl-purple); color: var(--sheet-hl-purple-ink); }
.tagpill--teal { background: var(--sheet-hl-teal); color: var(--sheet-hl-teal-ink); }
.tagpill--pink { background: var(--sheet-hl-pink); color: var(--sheet-hl-pink-ink); }
.tagpill__x {
  display: grid; place-items: center; width: var(--size-20); height: var(--size-20); padding: 0;
  border: none; border-radius: 50%; background: transparent; color: inherit;
  font-size: var(--fs-micro); cursor: pointer; opacity: 0.7;
}
.tagpill__x:hover { opacity: 1; background: var(--surface-3); }
.tagbox__list {
  position: absolute; inset-inline: 0; top: calc(100% + var(--size-4)); z-index: 5;
  display: flex; flex-direction: column; max-height: var(--size-240); overflow-y: auto; padding: var(--size-4);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.tagbox__opt {
  display: flex; align-items: center; padding: var(--size-6) var(--size-8); border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm);
  text-align: start; cursor: pointer;
}
.tagbox__opt.on { background: var(--surface-3); }
.tagbox__refused { margin-top: var(--size-6); font-size: var(--fs-sm); color: var(--danger); }

.picks { display: flex; flex-direction: column; gap: var(--size-6); }
.pick {
  display: flex; align-items: center; gap: var(--size-10); padding: var(--size-8) var(--size-10); font-size: var(--fs-sm);
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
}
.pick b { flex: none; font-variant-numeric: tabular-nums; }
.pick__s { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); }
.pick__a { flex: none; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

.pick input.pick__rate {
  flex: none; width: var(--size-80); height: var(--size-32); text-align: end;
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums; padding: 0 var(--size-8);
  background: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); outline: none;
}
.pick input.pick__rate:focus { border-color: var(--accent); }

.pick .del {
  flex: none; display: grid; place-items: center; width: var(--size-32); height: var(--size-32);
  color: var(--muted); background: none; border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-size: var(--fs-sm); line-height: var(--lh-none);
}
.pick .del:hover { background: var(--danger-soft); color: var(--danger); }
.pick-none { margin: 0; font-size: var(--fs-sm); }
.roster { gap: 0; }
.roster .pick {
  padding: var(--size-4) 0 var(--size-4) var(--size-2); background: none; border: none; border-radius: 0;
  border-bottom: var(--stroke-1) solid var(--border); font-size: var(--fs-base);
}
.roster .pick b { font-weight: var(--fw-medium); }
.roster .pick .del { width: var(--size-28); height: var(--size-28); opacity: 0.6; }
.roster .pick:hover .del { opacity: 1; }
.roster > :last-child { margin-top: var(--size-8); }
.pick-tot {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--size-8) var(--size-10) 0; border-top: var(--stroke-1) solid var(--border); font-size: var(--fs-sm);
}
.pick-tot b { font-size: var(--fs-base); font-variant-numeric: tabular-nums; }

.combo { display: flex; flex-direction: column; }
.combo__list {
  position: fixed; z-index: 62;
  display: flex; flex-direction: column; max-height: var(--size-200); overflow-y: auto;
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: var(--size-4);
}

.combo__item {
  display: block; flex: none; width: 100%; min-height: var(--size-36); text-align: start;
  padding: var(--size-8) var(--size-10); border: none; border-radius: var(--radius-sm); background: none;
  color: var(--text); font-size: var(--fs-sm); font-family: inherit; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.combo__item.sel { background: var(--accent-soft); color: var(--accent); }
.time__list { width: var(--size-160); }
.combo__label, .combo__sub {
  display: block; overflow: hidden; text-overflow: ellipsis; line-height: var(--lh-snug);
}
.combo__sub { margin-top: var(--stroke-1); font-size: var(--fs-micro); color: var(--muted); }
.combo__none { margin: 0; padding: var(--size-10); color: var(--muted); font-size: var(--fs-sm); }

.combo__check {
  display: flex; align-items: center; gap: var(--size-8); width: 100%; min-height: var(--size-36);
  padding: var(--size-8) var(--size-10); border-radius: var(--radius-sm); color: var(--text); font-size: var(--fs-sm);
  cursor: pointer; white-space: nowrap;
}
.combo__check:hover { background: var(--surface-3); }

.ms { display: contents; }
.ms-catch { position: fixed; inset: 0; z-index: 61; }
.picker__catch { z-index: 89; }
.combo__list.picker__list { z-index: 90; max-height: var(--size-280); }
.picker__list .combo__item { white-space: normal; overflow-wrap: anywhere; }
.combo__item.picked { font-weight: var(--fw-semibold); }

.tip { display: inline-flex; }
.tip > :disabled { pointer-events: none; }
.tip__bubble {
  position: fixed; z-index: 95; max-width: var(--size-280);
  padding: var(--size-4) var(--size-8); border-radius: var(--radius-sm);
  background: var(--text); color: var(--surface);
  font-size: var(--fs-sm); line-height: var(--lh-tight);
  box-shadow: var(--shadow);
}
.combo__item.blank { color: var(--muted); }
.picker__group {
  padding: var(--size-8) var(--size-10) var(--size-4); font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--muted);
}

.usermenu__item--on { color: var(--accent); }
.usermenu__item--on svg { color: var(--accent); }
.usermenu__tick { margin-left: auto; font-size: var(--fs-sm); opacity: 0; }
.usermenu__item--on .usermenu__tick { opacity: 1; }

.perm-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  background:
    linear-gradient(to right, var(--surface) 60%, transparent) 0 0 / var(--size-28) 100% no-repeat local,
    linear-gradient(to left, var(--surface) 60%, transparent) 100% 0 / var(--size-28) 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-edge), transparent) 0 0 / var(--size-12) 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-edge), transparent) 100% 0 / var(--size-12) 100%
      no-repeat;
}
.perm-wrap::-webkit-scrollbar { display: none; }
.perm-wrap > * { min-width: var(--size-400); }

.pchks { display: flex; gap: var(--size-14); flex: none; }
.pchks__grp { display: flex; gap: var(--size-4); font-size: var(--fs-micro); color: var(--muted); }
.pchks-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--size-4) 0 var(--size-8); font-size: var(--fs-micro); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider); text-transform: uppercase; color: var(--muted);
}
.pchks-head .pchks__grp { width: var(--size-200); justify-content: center; letter-spacing: var(--ls-none); text-transform: none; font-weight: var(--fw-semibold); }

.pchk {
  display: inline-grid; place-items: center;
  padding: var(--size-2) var(--size-8); border-radius: var(--radius-pill);
  border: var(--stroke-1) solid var(--border); background: var(--surface);
  font-family: inherit; font-size: var(--fs-sm); color: var(--muted);
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pchk > span { grid-area: 1 / 1; }
.pchk::after {
  content: attr(data-label); grid-area: 1 / 1;
  font-weight: var(--fw-semibold); visibility: hidden; pointer-events: none;
}
.pchk:hover:not(:disabled) { border-color: var(--border-2); color: var(--text); }
.pchk.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: var(--fw-semibold); }
.role-perm--bits { display: flex; align-items: center; gap: var(--size-12); }
.role-perm--bits > b { flex: 1; min-width: 0; }

.ptags { display: inline-flex; gap: var(--size-4); }
.ptags i {
  font-style: normal; font-size: var(--fs-sm); padding: var(--size-2) var(--size-8); border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--border-2);
}
.ptags i.on { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-semibold); }
.ptags--own { margin-inline-end: var(--size-10); }

.field textarea, .field .rich__doc { height: auto; min-height: var(--size-64); max-height: 17em; padding-top: var(--size-8); line-height: var(--lh-snug); resize: vertical; }
.seg--full { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg--full:has(> :nth-child(4)) { grid-template-columns: repeat(4, 1fr); }
.seg--full button { flex: 1; }
.seg__ic { display: none; }
.modal__card--lg { max-width: var(--size-560); }
.drop-box { display: flex; flex-direction: column; }
.drop-box--over textarea, .drop-box--over .rich__doc { border-color: var(--accent); background: var(--accent-soft); }
.drop-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-6); margin-top: var(--size-6); }
.drop-bar__pick {
  display: inline-flex; align-items: center; gap: var(--size-6); padding: var(--size-2) var(--size-6); border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--muted); font-size: var(--fs-sm); font-family: inherit; cursor: pointer;
}
.drop-bar__pick:hover { background: var(--surface-3); color: var(--text); }
.drop-file {
  display: inline-flex; align-items: center; gap: var(--size-6); padding: var(--size-2) var(--size-2) var(--size-2) var(--size-8);
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: var(--fs-sm);
}
.drop-file svg { color: var(--accent); flex: none; }
.drop-file--busy { color: var(--muted); }
.drop-file--bad { border-color: var(--danger); color: var(--danger); }
.drop-file__x {
  display: inline-grid; place-items: center; width: var(--size-20); height: var(--size-20); padding: 0; border: 0;
  border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer;
}
.drop-file__x svg { color: inherit; }
.drop-file__x:hover { background: var(--surface-3); color: var(--text); }
.drop-file__open { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.drop-file__open:hover { text-decoration: underline; }

.sheet-record { min-height: 100%; }

.free-tab { height: 100%; }
.free-sheet { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--surface); }
.free-sheet--note { align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-base); padding: var(--size-24); }
.free-bar {
  display: flex; align-items: center; gap: var(--size-6); padding: var(--size-8) var(--size-12);
  border-bottom: var(--stroke-1) solid var(--border); overflow-x: auto; flex: none;
}
.free-bar .btn, .free-bar .select { flex: none; }
.free-bar .select { height: var(--size-32); }
.free-find input {
  height: var(--size-32); padding: 0 var(--size-10); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: var(--fs-base); font-family: inherit;
  width: var(--size-240); max-width: 50vw;
}
.free-find input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.free-bar__state { margin-inline-start: auto; flex: none; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.free-bar__state--dirty { color: var(--warn); }
.free-find { display: flex; align-items: center; gap: var(--size-6); padding: var(--size-6) var(--size-12); border-bottom: var(--stroke-1) solid var(--border); flex: none; }
.free-find__count { color: var(--muted); font-size: var(--fs-sm); min-width: var(--size-72); }
.free-formula { display: flex; align-items: stretch; border-bottom: var(--stroke-1) solid var(--border); flex: none; }
.free-formula__at {
  flex: none; width: var(--size-96); padding: var(--size-6) var(--size-10); border-inline-end: var(--stroke-1) solid var(--border);
  font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.free-formula__input {
  flex: 1; min-width: 0; border: 0; border-radius: 0; padding: var(--size-6) var(--size-10);
  font-family: var(--mono); font-size: var(--fs-base); background: var(--surface); color: var(--text);
}
.free-formula__input:focus-visible { outline: none; border-radius: 0; box-shadow: inset 0 0 0 var(--stroke-2) var(--accent); }
.free-note { padding: var(--size-6) var(--size-12); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-sm); flex: none; }
.free-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; }
.free-canvas { position: relative; }
.free-view {
  position: sticky; top: 0; left: 0; overflow: hidden; outline: none;
  background: var(--surface); color: var(--text); font-size: var(--fs-base); user-select: none; cursor: cell;
}
.free-view:focus-visible { box-shadow: inset 0 0 0 var(--stroke-2) var(--accent-line); }
.free-view[data-grab="column"] { cursor: col-resize; }
.free-view[data-grab="row"] { cursor: row-resize; }
.free-view[data-grab="fill"] { cursor: crosshair; }
.free-pane { position: absolute; overflow: hidden; }
.free-pane--head { background: var(--surface-3); }
.free-cell {
  position: absolute; display: flex; align-items: center; padding: 0 var(--size-6);
  border-inline-end: var(--stroke-1) solid var(--border); border-bottom: var(--stroke-1) solid var(--border);
  white-space: nowrap; overflow: hidden; line-height: var(--lh-tight); font-variant-numeric: tabular-nums;
}
.free-cell--end { justify-content: flex-end; }
.free-cell--center { justify-content: center; }
.free-cell--error { color: var(--danger); }
.free-cell--bold { font-weight: var(--fw-bold); }
.free-cell--italic { font-style: italic; }
.free-cell--wrap { white-space: normal; overflow-wrap: anywhere; align-items: flex-start; line-height: var(--lh-snug); padding-top: var(--size-2); }
.free-measure { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.free-shown--red { color: var(--danger); }
.free-shown--blue { color: var(--info); }
.free-shown--green { color: var(--accent); }
.free-cell--split { justify-content: space-between; }
.free-cell__lead { flex: none; margin-inline-end: var(--size-6); }
.free-dialog__split { display: grid; grid-template-columns: var(--size-144) minmax(0, 1fr); gap: var(--size-14); min-height: var(--size-280); }
.free-dialog__choices { display: flex; flex-direction: column; gap: var(--size-2); }
.free-dialog__pane .free-dialog__choices { max-height: var(--size-240); overflow-y: auto; }
.free-dialog__choices .sheet-menu__item { display: flex; justify-content: space-between; gap: var(--size-10); }
.free-dialog__pane { display: flex; flex-direction: column; gap: var(--size-10); min-width: 0; }
.free-dialog__sample-row { display: flex; gap: var(--size-10); align-items: baseline; padding: var(--size-8) var(--size-10); border-radius: var(--radius-sm); background: var(--surface-2); }
.free-dialog__sample { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.free-dialog__code { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.free-dialog__field { display: flex; flex-direction: column; gap: var(--size-4); }
@media (max-width: 560px) {
  .free-dialog__split { grid-template-columns: minmax(0, 1fr); }
  .free-dialog__split > .free-dialog__choices { flex-direction: row; flex-wrap: wrap; }
  .free-dialog__pane .free-dialog__choices { max-height: var(--size-200); }
}
.free-dialog { display: flex; flex-direction: column; gap: var(--size-12); }
.free-dialog__levels { display: flex; flex-direction: column; gap: var(--size-8); }
.free-dialog__level { display: grid; grid-template-columns: var(--size-72) minmax(0, 1fr) var(--size-128) auto; gap: var(--size-8); align-items: center; }
.free-dialog__label { color: var(--muted); font-size: var(--fs-sm); }
.share-nobody { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.share-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: var(--stroke-1) solid var(--border); }
.share-row { display: flex; align-items: center; gap: var(--size-8); min-height: var(--size-40); border-bottom: var(--stroke-1) solid var(--border); }
.share-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-base); }
.share-add { display: flex; align-items: center; gap: var(--size-8); }
.free-dialog .share-add__person { flex: 1; min-width: 0; }
.free-dialog .share-grant { width: var(--size-144); flex: none; }
.free-dialog .select:is(.share-add__person, .share-grant) { height: var(--size-36); font-size: var(--fs-base); }
@media (max-width: 560px) {
  .free-dialog__level { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .free-dialog__label { grid-column: 1 / -1; }
}
.free-cell--yellow { background: var(--sheet-hl-amber); color: var(--sheet-hl-amber-ink); }
.free-cell--green { background: var(--sheet-hl-green); color: var(--sheet-hl-green-ink); }
.free-cell--blue { background: var(--sheet-hl-blue); color: var(--sheet-hl-blue-ink); }
.free-cell--red { background: var(--sheet-hl-red); color: var(--sheet-hl-red-ink); }
.free-cell--grey { background: var(--surface-3); }
.free-cell--funnel { padding-inline-end: var(--size-20); }
.free-funnel {
  position: absolute; inset-inline-end: var(--size-2); top: 50%; width: var(--size-14); height: var(--size-14); margin-top: calc(var(--size-6) * -1);
  border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
}
.free-funnel::after {
  content: ""; position: absolute; left: var(--size-2); top: var(--size-4);
  border-left: var(--stroke-3) solid transparent; border-right: var(--stroke-3) solid transparent; border-top: var(--size-4) solid var(--muted);
}
.free-funnel--on { border-color: var(--accent); background: var(--accent-soft); }
.free-funnel--on::after { border-top-color: var(--accent); }
.free-head {
  position: absolute; display: flex; align-items: center; justify-content: center;
  border-inline-end: var(--stroke-1) solid var(--border-2); border-bottom: var(--stroke-1) solid var(--border-2);
  color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.free-head--on { color: var(--accent-strong); background: var(--accent-soft); }
.free-head--gap-start { border-inline-start: var(--stroke-2) solid var(--accent-line); }
.free-head--gap-top { border-top: var(--stroke-2) solid var(--accent-line); }
.free-selection { position: absolute; pointer-events: none; background: var(--accent-soft); border: var(--stroke-1) solid var(--accent); }
.free-cursor { position: absolute; pointer-events: none; box-shadow: inset 0 0 0 var(--stroke-2) var(--accent); }
.free-band { position: absolute; pointer-events: none; border: var(--stroke-1) dashed var(--accent); }
.free-menu__panel {
  position: fixed; margin-top: var(--size-6);
  width: var(--size-200); max-height: min(var(--size-480), 70vh); overflow-y: auto; z-index: 60; padding: var(--size-6);
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.free-menu__head {
  padding: var(--size-8) var(--size-10) var(--size-4); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  border-top: var(--stroke-1) solid var(--border);
}
.free-menu__head:first-child { border-top: 0; padding-top: var(--size-4); }
.free-scrim { position: fixed; inset: 0; z-index: 59; }
.free-picker {
  position: fixed; margin-top: var(--size-6); width: var(--size-240); z-index: 60; padding: var(--size-6);
  display: flex; flex-direction: column; gap: var(--size-2);
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: var(--fs-base);
}
.free-picker__condition { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--size-6); padding: var(--size-6) var(--size-4); border-top: var(--stroke-1) solid var(--border); }
.free-picker__condition .select { width: 100%; height: var(--size-32); }
.free-picker__input {
  width: 100%; height: var(--size-32); padding: 0 var(--size-8); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: var(--fs-base); font-family: inherit;
}
.free-picker__input:disabled { opacity: 0.55; }
.free-picker__search { position: relative; }
.free-picker__list { max-height: var(--size-240); overflow-y: auto; border-top: var(--stroke-1) solid var(--border); padding-top: var(--size-2); }
.free-picker__row { display: flex; align-items: center; gap: var(--size-8); padding: var(--size-4) var(--size-8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.free-picker__foot { display: flex; justify-content: flex-end; gap: var(--size-6); padding-top: var(--size-6); border-top: var(--stroke-1) solid var(--border); }
.free-point { position: absolute; pointer-events: none; background: var(--info-soft); border: var(--stroke-2) dashed var(--info); }
.free-fill {
  position: absolute; width: var(--size-8); height: var(--size-8); margin: calc(var(--size-4) * -1) 0 0 calc(var(--size-4) * -1);
  background: var(--accent); border: var(--stroke-1) solid var(--surface); cursor: crosshair;
}
.free-origin {
  position: absolute; left: 0; top: 0;
  background: var(--surface-3); border-inline-end: var(--stroke-1) solid var(--border-2); border-bottom: var(--stroke-1) solid var(--border-2);
}
.free-editor, .free-editor-ink {
  position: absolute; box-sizing: border-box; margin: 0; padding: 0 var(--size-6); border: 0; border-radius: 0; outline: none;
  box-shadow: inset 0 0 0 var(--stroke-2) var(--accent);
  background: var(--surface); color: var(--text); font-size: var(--fs-base); font-family: inherit; line-height: var(--lh-tight);
}
.free-editor-ink { display: flex; align-items: center; overflow: hidden; white-space: pre; pointer-events: none; }
.free-editor--inked, .free-formula__input--inked { background: transparent; color: transparent; caret-color: var(--text); }
.free-editor--inked::selection, .free-formula__input--inked::selection { color: transparent; background: color-mix(in srgb, var(--info) 28%, transparent); }
.free-ink { display: inline-block; white-space: pre; }
.free-formula__field { position: relative; flex: 1; min-width: 0; display: flex; }
.free-formula__ink {
  position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; white-space: pre; pointer-events: none;
  padding: var(--size-6) var(--size-10); font-family: var(--mono); font-size: var(--fs-base); background: var(--surface); color: var(--text);
}
.free-formula__input--inked { position: relative; }
.free-tone--blue { color: var(--sheet-hl-blue-ink); }
.free-tone--red { color: var(--sheet-hl-red-ink); }
.free-tone--purple { color: var(--sheet-hl-purple-ink); }
.free-tone--green { color: var(--sheet-hl-green-ink); }
.free-tone--amber { color: var(--sheet-hl-amber-ink); }
.free-tone--pink { color: var(--sheet-hl-pink-ink); }
.free-tone--teal { color: var(--sheet-hl-teal-ink); }
.free-ref { position: absolute; pointer-events: none; border: var(--stroke-2) solid currentColor; }
.free-suggest, .free-hint {
  position: absolute; z-index: 30; padding: var(--size-4);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2);
}
.free-suggest { min-width: var(--size-160); max-height: var(--size-240); overflow-y: auto; }
.free-suggest__row { padding: var(--size-2) var(--size-8); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.free-suggest__row--on { background: var(--accent-soft); color: var(--text); }
.free-hint { padding: var(--size-4) var(--size-8); white-space: nowrap; }
.free-hint__on { color: var(--text); font-weight: var(--fw-semibold); }
.free-status {
  display: flex; align-items: center; gap: var(--size-16); padding: var(--size-4) var(--size-12); flex: none;
  border-top: var(--stroke-1) solid var(--border); color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow-x: auto;
}
.free-status__error { color: var(--danger); }
.sheet-panel {
  position: absolute; inset-block-start: var(--size-6); inset-inline-start: var(--size-14); z-index: 20;
  max-width: calc(100% - var(--size-28)); padding: var(--size-6); font-size: var(--fs-sm);
  background: var(--surface); border: var(--stroke-1) solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.sheet-panel:focus { outline: none; }
.sheet-panel-input, .sheet-panel .select, .free-dialog .select, .free-dialog input:not([type="checkbox"]) {
  font: inherit; height: var(--size-28); min-width: 0; padding: 0 var(--size-8); color: var(--text);
  border: var(--stroke-1) solid transparent; border-radius: var(--radius-sm); background-color: var(--surface-2);
}
.sheet-panel .select, .free-dialog .select { padding-inline-end: var(--size-24); background-position: right var(--size-6) center; background-size: var(--size-14); }
.sheet-panel-input:hover, .sheet-panel .select:hover, .free-dialog .select:hover, .free-dialog input:not([type="checkbox"]):hover { background-color: var(--surface-3); }
.sheet-panel-input:focus, .sheet-panel .select:focus-visible, .free-dialog .select:focus-visible, .free-dialog input:not([type="checkbox"]):focus { border-color: var(--accent); background-color: var(--surface); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); outline: none; }
.sheet-panel-input::placeholder, .free-dialog input::placeholder { color: var(--text-3); }
.free-dialog .select, .free-dialog input:not([type="checkbox"]) { height: var(--size-32); font-size: var(--fs-sm); }
.free-dialog .chk-row { padding: 0; border: none; background: none; align-items: center; }
.free-dialog .chk-row input { margin-top: 0; accent-color: var(--accent); }
.sheet-panel-input.bad { border-color: var(--bad); background-color: var(--bad-soft); color: var(--bad); }
.sheet-panel input[type="checkbox"] { accent-color: var(--accent); }
.sheet-panel-acts {
  display: flex; justify-content: flex-end; gap: var(--size-6);
  margin-top: var(--size-6); padding-top: var(--size-6); border-top: var(--stroke-1) solid var(--line);
}
.sheet-panel-acts .btn--ghost { margin-inline-end: auto; }
.sheet-panel-acts .btn .kbd { padding: 0; background: none; border: 0; box-shadow: none; font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-normal); color: var(--text-3); }
.take-off { display: flex; flex-direction: column; gap: var(--size-8); width: var(--size-400); }
.take-off__what { padding: var(--size-4) var(--size-4) 0; color: var(--text-2); }
.take-off__name { margin-inline: var(--size-4); }
.take-off__progress { padding-inline: var(--size-4); color: var(--text-2); font-variant-numeric: tabular-nums; }
.take-off__refused { padding-inline: var(--size-4); color: var(--danger); }

.record-page__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--size-12) var(--size-24); margin-bottom: var(--size-20); }
.record-page__name { flex: 1 1 var(--size-280); min-width: 0; }
.record-page__head:not(:has(> .record-page__name > p)) { align-items: center; }
.record-page__head:has(~ .record-page__grid) .record-page__name:has(.title-edit) { flex: 1 1 var(--size-280); max-width: calc(100% - var(--size-320) - var(--size-20)); }
.record-page__head:has(~ .record-page__grid[data-side]) .record-page__name:has(.title-edit) { flex-basis: calc(50% - var(--size-10)); }
.record-page__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-10); }
.record-page__title h1 { font-size: var(--fs-2xl); overflow-wrap: anywhere; }
.record-page__title h1:has(.title-edit) { flex: 1 1 100%; min-width: 0; }
.record-page__title:has(.title-edit) { position: relative; }
.record-page__title:has(.title-edit) > .pill { position: absolute; right: var(--size-12); pointer-events: none; }
.record-page__title:has(> .pill) .title-edit { padding-right: var(--size-96); }
.record-page__name p { margin: var(--size-2) 0 0; color: var(--muted); font-size: var(--fs-base); }
.record-page__facts-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-4) var(--size-16); }
.record-page__facts-line > span { white-space: nowrap; }
.record-page__acts { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--size-8); }
.record-page__acts .btn { flex: none; }
.record-page__head:has(.title-edit) > .record-page__acts:not([data-stacked]) { flex-grow: 0; margin-left: auto; }
.record-page__acts[data-stacked] { row-gap: 0; }
.record-page__acts[data-stacked]::after { content: ""; order: 1; flex-basis: 100%; }
.record-page__acts[data-stacked] .btn:not([data-bare]) { order: 2; flex: 1 1 0; margin-top: var(--size-8); }
.acts-more, .acts-more__menu { display: contents; }
.acts-more > .btn { display: none; }
.record-page__acts[data-folded] { flex-wrap: nowrap; }
.record-page__acts[data-folded] > .acts-more { display: block; position: relative; }
.record-page__acts[data-folded] > .acts-more > .btn { display: inline-flex; padding: 0; aspect-ratio: 1; justify-content: center; }
.acts-more > .btn .btn__label { display: none; }
.acts-more__kept { display: contents; }
.record-page__acts:has(> .acts-more .acts-more__kept):not([data-folded]) { position: relative; }
.record-page__acts:not([data-folded]) > .acts-more:has(.acts-more__kept) > .btn { display: inline-flex; padding: 0; aspect-ratio: 1; justify-content: center; }
.record-page__acts:not([data-folded]) .acts-more__kept,
.record-page__acts[data-folded] .acts-more__menu {
  display: none; position: absolute; top: calc(100% + var(--size-6)); inset-inline-end: 0; z-index: 62;
  flex-direction: column; align-items: stretch; gap: var(--size-2); min-width: var(--size-200);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: var(--size-6);
}
.record-page__acts[data-folded] > .acts-more[data-open] .acts-more__menu,
.record-page__acts:not([data-folded]) > .acts-more[data-open] .acts-more__kept { display: flex; }
.record-page__acts:not([data-folded]) .acts-more__kept .btn,
.record-page__acts[data-folded] .acts-more__menu .btn { justify-content: flex-start; aspect-ratio: auto; padding-inline: var(--size-10); border-color: transparent; background: none; box-shadow: none; }
.record-page__acts:not([data-folded]) .acts-more__kept .btn:hover:not(:disabled),
.record-page__acts[data-folded] .acts-more__menu .btn:hover:not(:disabled) { background: var(--surface-2); }
.record-page__acts:not([data-folded]) .acts-more__kept .btn[data-bare] .btn__label,
.record-page__acts[data-folded] .acts-more__menu .btn[data-bare] .btn__label { display: inline; }
.record-page__note {
  margin: 0 0 var(--size-16); padding: var(--size-10) var(--size-12); border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger);
  border: var(--stroke-1) solid color-mix(in srgb, var(--danger) 26%, transparent);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh-normal);
}
.record-page__grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--size-320); gap: var(--size-20); align-items: start; }
.record-page__main { display: flex; flex-direction: column; gap: var(--size-20); min-width: 0; }
.record-page__section h2 { font-size: var(--fs-base); margin-bottom: var(--size-12); }
.record-page__section:has(> h2:only-child) { display: none; }
.record-page__section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--size-8); margin-bottom: var(--size-12); }
.record-page__section-head h2 { margin-bottom: 0; }
.detail-sec--tools { display: flex; align-items: center; justify-content: space-between; gap: var(--size-8); }
.sec-tools { position: relative; display: inline-flex; gap: var(--size-2); }
.sec-tools .icon-btn { width: var(--size-32); height: var(--size-32); }
.sec-tools .icon-btn.on { color: var(--text); background: var(--surface-3); }
.trail-compose {
  position: absolute; top: calc(100% + var(--size-8)); right: 0; z-index: 5;
  width: min(var(--size-480), calc(100vw - var(--size-32))); padding: var(--size-16);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-normal); text-transform: none; letter-spacing: var(--ls-none);
}
.form-doc__props .field > :is(.presets, .rich, .drop-box) { grid-column: 2; }
.form-doc__props .field > .presets { padding-inline: var(--size-8); }
.form-doc__props .field :is(textarea, .rich__doc) {
  padding: var(--size-6) var(--size-8); min-height: var(--size-56); max-height: none; font-size: var(--fs-base); line-height: var(--lh-normal);
  border: none; background: transparent; border-radius: var(--radius-sm); box-shadow: none; resize: none; overflow: hidden; field-sizing: content;
  transition: background-color 0.12s;
}
.form-doc__props .field :is(textarea, .rich__doc):is(:hover, :focus) { box-shadow: none; background-color: var(--surface-2); }
.form-doc__props .field:has(:is(textarea, .rich__doc)) { align-items: start; }
.form-doc__props .field:has(:is(textarea, .rich__doc)) > label { padding-top: var(--size-6); }
.form-doc__props .field > .field__choices { grid-column: 2; padding-inline: var(--size-8); margin-bottom: var(--size-6); }
@media (max-width: 720px) {
  .form-doc__props .field > .field__choices { grid-column: auto; }
}
.trail-compose .form-doc > .field :is(textarea, .rich__doc) { width: 100%; margin-inline: 0; }
.trail-compose .form-doc__props :is(.field, .form-doc__presets) { grid-template-columns: minmax(0, 1fr); }
.trail-compose .form-doc__props .field > * { grid-column: 1; }
.trail-compose .form-doc__props > :is(.field, .form-doc__presets) { margin-bottom: var(--size-16); }
.trail-compose .form-doc__props > .field:has(+ .form-doc__presets) { margin-bottom: var(--size-6); }
.trail-compose .form-doc__props .form-doc__presets > .presets { grid-column: 1; }
.trail-compose .form-doc__props .field > label {
  position: absolute; width: var(--stroke-1); height: var(--stroke-1); overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.form-doc__presets { display: grid; grid-template-columns: var(--size-144) minmax(0, 1fr); gap: var(--size-8); margin-bottom: var(--size-6); }
.form-doc__presets > .presets { grid-column: 2; padding-inline: var(--size-8); }
.presets { display: flex; flex-wrap: wrap; gap: var(--size-4); }
.presets--ticks { gap: var(--size-16); }
.presets--ticks .chk-row { padding: 0; border: none; background: none; align-items: center; }
.presets--ticks .chk-row input { margin-top: 0; }
.trail-compose > .presets { margin-bottom: var(--size-8); }
.card-trail { display: flex; gap: var(--size-2); }
.card-trail button.on { background: var(--surface-3); color: var(--text); }
.trail-compose--popup { position: static; width: min(var(--size-560), 100%); }
.trail-compose__head { margin-bottom: var(--size-12); }
.trail-compose__head h3 { font-size: var(--fs-lg); }
.trail-compose__head p { color: var(--muted); font-size: var(--fs-sm); }
.trail-compose__head--sheet { display: none; }
.trail-done { position: relative; flex: none; display: inline-flex; align-items: center; gap: var(--size-2); }
.trail-done .icon-btn { width: var(--size-32); height: var(--size-32); }
.trail-done .icon-btn.on { color: var(--text); background: var(--surface-3); }
.trail-compose__acts { display: flex; justify-content: flex-end; gap: var(--size-8); }
.trail-compose__cancel { margin-inline-end: auto; }
.trail-compose--popup .trail-compose__cancel { margin-inline-end: 0; }
@media (max-width: 720px) {
  .act-panel__catch { bottom: var(--sheet-strip-h); background: var(--scrim); }
  .act-panel, .trail-compose:not(.trail-compose--popup) {
    position: fixed; z-index: 62; top: auto !important; right: 0 !important; bottom: var(--sheet-strip-h); left: 0 !important;
    width: 100%; max-height: calc(100dvh - var(--size-56) - var(--sheet-strip-h)) !important;
    border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal:has(> :is(.modal__card--docked, .trail-compose--popup)) { z-index: 63; bottom: var(--sheet-strip-h); padding: 0; place-items: end stretch; }
  .modal > :is(.modal__card--docked, .trail-compose--popup) {
    width: 100%; max-height: calc(100dvh - var(--size-56) - var(--sheet-strip-h)); margin: 0; overflow-y: auto; overscroll-behavior: contain;
    border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .act-panel { clip-path: inset(-100vmax -100vmax 0); }
  .act-panel:has(.editlines) { width: 100%; }
  .trail-compose:not(.trail-compose--popup) {
    overflow-y: auto; overscroll-behavior: contain;
    box-shadow: var(--shadow-lg), 0 0 0 100vmax var(--scrim); clip-path: inset(-100vmax -100vmax 0);
  }
  :is(.act-panel, .trail-compose) .btn .kbd { display: none; }
  .trail-compose__head--sheet { display: block; }
  .trail-compose__head--sheet h3 { font-size: var(--fs-md); }
  .trail-compose:not(.trail-compose--popup) .trail-compose__acts {
    position: sticky; bottom: calc(var(--size-16) * -1); z-index: 1;
    margin-bottom: calc(var(--size-16) * -1); padding-block: var(--size-12) var(--size-16); background: var(--surface);
  }
  .trail-compose__acts .btn { padding: 0 var(--size-14); font-size: var(--fs-base); }
  .trail-compose__acts .btn--ghost { border-color: var(--border-2); background: var(--surface); color: var(--text); }
  .trail-compose__cancel { margin-inline-end: 0; }
  .record-page__acts:not([data-folded]) .acts-more__kept,
  .record-page__acts[data-folded] .acts-more__menu {
    position: fixed; inset: auto 0 var(--sheet-strip-h) 0; min-width: 0;
    max-height: calc(100dvh - var(--size-56) - var(--sheet-strip-h)); overflow-y: auto;
    padding: var(--size-8) var(--size-8) var(--size-12);
    border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg), 0 0 0 100vmax var(--scrim); clip-path: inset(-100vmax -100vmax 0);
  }
  .record-page__acts:not([data-folded]) .acts-more__kept .btn,
  .record-page__acts[data-folded] .acts-more__menu .btn { min-height: var(--size-44); }
}
.record-page__facts { position: sticky; top: 0; }
.record-page__facts dl { display: flex; flex-direction: column; gap: var(--size-14); margin: 0; }
.record-page__facts dt { font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--muted); }
.record-page__facts dd { margin: var(--size-2) 0 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.record-page__facts dd .over { color: var(--danger); }

.record-page__grid[data-side] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.view:has(> .record-page__grid > .record-page__main .form-doc, > .record-page__grid > .record-page__side > .record-page__section > .form-doc__props) > .record-page__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.view:has(> .record-page__grid > .record-page__main .form-doc, > .record-page__grid > .record-page__side > .record-page__section > .form-doc__props) > .record-page__head .record-page__name:has(.title-edit) { flex-basis: var(--size-280); max-width: calc((100% - var(--size-20)) * 3 / 5); }
.view:has(> .record-page__grid > .record-page__main .form-doc) > .record-page__head .record-page__name:not(:has(.title-edit)) { padding-inline-start: var(--record-inset); }
.record-page__side {
  position: sticky; top: var(--size-16); display: flex; flex-direction: column; gap: var(--size-20); min-height: 0;
  max-height: calc(100vh - var(--topbar-h) - var(--sheet-tabs-h, 0) - var(--size-32));
}
.record-page__side > .record-page__section { display: flex; flex-direction: column; min-height: 0; }
.record-page__side > .record-page__section > :not(h2, .record-page__section-head) { min-height: 0; overflow-y: auto; }
.record-page__side:has(:is(.trail, .convo, .form-doc__props)) { position: static; max-height: none; }
.record-page__side:has(:is(.trail, .convo, .form-doc__props)) > .record-page__section > * { overflow-y: visible; }
.record-page__side .form-doc > .field > label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
.record-page__side .form-doc > .field + .field { margin-top: var(--size-16); padding-top: var(--size-16); border-top: var(--stroke-1) solid var(--border); }

@media (max-width: 1024px) {
  .record-page__grid { grid-template-columns: minmax(0, 1fr); }
  .view > .record-page__head:has(~ .record-page__grid) .record-page__name:has(.title-edit) { flex: 1 1 var(--size-280); max-width: none; }
  .record-page__facts { position: static; order: -1; }
  .record-page__grid[data-side] { grid-template-columns: minmax(0, 1fr); }
  .view:has(> .record-page__grid > .record-page__main .form-doc, > .record-page__grid > .record-page__side > .record-page__section > .form-doc__props) > .record-page__grid { grid-template-columns: minmax(0, 1fr); }
  .view:has(> .record-page__grid > .record-page__main .form-doc, > .record-page__grid > .record-page__side > .record-page__section > .form-doc__props) > .record-page__head .record-page__name:has(.title-edit) { max-width: none; }
  .record-page__side { position: static; max-height: none; }
  .record-page__facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--size-160), 1fr)); }
}

.detail-pairs { display: grid; grid-template-columns: max-content minmax(0, 1fr); padding: var(--size-2) 0; }
.detail-pairs > div { display: contents; }
.detail-pairs span,
.detail-pairs b { padding-block: var(--size-8); border-top: var(--stroke-1) solid var(--border); }
.detail-pairs > div:first-child span,
.detail-pairs > div:first-child b { border-top: 0; }

.detail-pairs span { padding-inline-end: var(--size-28); font-size: var(--fs-sm); font-weight: var(--fw-normal); color: var(--muted); line-height: var(--lh-snug); }
.detail-pairs b { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh-snug); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.detail-pairs b.absent { color: var(--muted); font-weight: var(--fw-normal); }

.detail-pairs button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-align: start; }
.detail-pairs button:hover { text-decoration: underline; }
.detail-pairs button i { font-style: normal; opacity: 0.7; }

.detail-sec { font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wider); color: var(--muted); margin: var(--size-20) 0 var(--size-10); padding-top: var(--size-20); border-top: var(--stroke-1) solid var(--border); }
div:has(> .detail-sec:only-child) { display: none; }
.tbl--tight th, .tbl--tight td { padding-top: var(--size-8); padding-bottom: var(--size-8); }
.mini-tbl {
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--surface) 60%, transparent) 0 0 / var(--size-28) 100% no-repeat local,
    linear-gradient(to left, var(--surface) 60%, transparent) 100% 0 / var(--size-28) 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-edge), transparent) 0 0 / var(--size-12) 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-edge), transparent) 100% 0 / var(--size-12) 100% no-repeat;
}
.mini-tbl__acts { display: flex; justify-content: flex-end; gap: var(--size-8); white-space: nowrap; }
.timeline { display: flex; flex-direction: column; gap: var(--size-2); }
.tl { display: flex; gap: var(--size-12); padding: var(--size-2) 0; position: relative; }
.tl-dot { width: var(--size-12); height: var(--size-12); border-radius: 50%; border: var(--stroke-2) solid var(--border-2); background: var(--surface); margin-top: var(--size-2); flex: none; z-index: 1; }
.tl-dot.done { background: var(--accent); border-color: var(--accent); }
.tl:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: var(--size-4); top: var(--size-14); bottom: calc(var(--size-2) * -1); width: var(--stroke-1); background: var(--border-2); }
.tl__b { flex: 1; min-width: 0; }
.tl__ic { flex: none; color: var(--muted); margin-top: var(--stroke-1); }
.tl__ic .ic { display: block; width: var(--icon-md); height: var(--icon-md); }
.tl__act { flex: none; align-self: center; }
.tl .tl__reveal { display: inline-flex; align-items: center; gap: var(--size-8); opacity: 0; }
.tl:is(:hover, :focus-within) .tl__reveal { opacity: 1; }
@media (hover: none) {
  .tl .tl__reveal { opacity: 1; }
}
.tl b { font-size: var(--fs-base); font-weight: var(--fw-semibold); display: block; }
.tl small { color: var(--muted); font-size: var(--fs-sm); }

.tl-note { display: block; font-weight: var(--fw-normal); white-space: pre-wrap; overflow-wrap: anywhere; }


.trail-filter { margin-bottom: var(--size-12); }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--size-20); }
.trail-item {
  position: relative; display: flex; flex-direction: column; gap: var(--size-6);
  margin: calc(var(--size-8) * -1); padding: var(--size-8); border-radius: var(--radius-sm);
}
.trail-item:hover { background: var(--surface-2); }
.trail-item:hover .trail-item__ic { background: var(--surface); }
.trail-item:not(:last-child)::before {
  content: ""; position: absolute; left: calc(var(--size-20) - var(--stroke-1) / 2); top: var(--size-32);
  bottom: calc(var(--size-12) * -1); width: var(--stroke-1); background: var(--border-2);
}
.trail-item > :not(.trail-item__head) { margin-left: calc(var(--size-24) + var(--size-10)); }
.trail-item__head { display: flex; align-items: center; gap: var(--size-10); min-height: var(--size-24); }
.trail-item__ic {
  flex: none; display: grid; place-items: center; width: var(--icon-xl); height: var(--icon-xl);
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
}
.trail-item[data-open] .trail-item__ic { color: var(--warn); }
.trail-item__ic .ic { display: block; width: var(--icon-md); height: var(--icon-md); }
.trail-item__who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--size-6); }
.trail-item__who b { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.trail-item__who small { color: var(--muted); font-size: var(--fs-sm); }
.trail-item__who em { color: var(--text-3); font-size: var(--fs-sm); font-style: normal; }
.trail-item__talk { display: inline-flex; align-items: baseline; gap: var(--size-2); color: var(--muted); font-size: var(--fs-sm); }
.trail-item__talk .ic { align-self: center; width: var(--icon-sm); height: var(--icon-sm); }
.trail-item__talk::before { content: "·"; margin-inline-end: var(--size-6); }
.trail-item__subject { font-size: var(--fs-base); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.trail-item__part { display: flex; flex-direction: column; gap: var(--size-2); }
.trail-item__part--outcome > span:first-child { font-size: var(--fs-sm); color: var(--muted); }
.trail-item__part .tl-note { font-size: var(--fs-base); }
.trail-item .drop-bar { margin-top: 0; margin-bottom: 0; }
.trail-pic {
  display: block; padding: 0; border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2); cursor: zoom-in;
}
.trail-pic img { display: block; width: var(--size-96); height: var(--size-72); object-fit: cover; }

.settings { display: grid; grid-template-columns: var(--size-240) 1fr; gap: var(--size-20); align-items: start; }
.settings-body { max-width: var(--size-640); margin-inline: auto; }
.settings-body--wide { max-width: var(--size-960); }
.settings-body--full { max-width: none; }
.view:has(> .settings-body--full) { max-width: calc(var(--size-1180) + 2 * var(--size-24)); }
.set-card { background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); padding: var(--size-20); box-shadow: var(--shadow-sm); }

.set-card + .set-card { margin-top: var(--size-16); }
.set-card__head { margin-bottom: var(--size-16); }
.set-card__head h3 { font-size: var(--fs-lg); }
.set-card__head p { color: var(--muted); font-size: var(--fs-base); margin: var(--size-2) 0 0; }
.set-card__head--acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-10); }
.set-card__acts { display: flex; flex-wrap: wrap; gap: var(--size-8); margin-inline-start: auto; }
.set-logo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-16); margin-bottom: var(--size-16); }
.set-logo__who { flex: 1; min-width: 0; }
.set-logo__mark { width: var(--size-56); height: var(--size-56); border-radius: var(--radius-lg); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: var(--fw-bold); font-size: var(--fs-2xl); flex: none; position: relative; overflow: hidden; }

.set-logo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.set-logo__acts { display: flex; flex-wrap: wrap; gap: var(--size-8); margin-top: var(--size-10); }
.set-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-16); padding: var(--size-14) 0; border-top: var(--stroke-1) solid var(--border); }
.set-row > div:first-child { flex: 1 1 var(--size-128); min-width: 0; overflow-wrap: anywhere; }
.set-row > div:first-child:empty { flex-basis: 0; }
.set-row--check { gap: var(--size-10); cursor: pointer; }
.set-row b { font-size: var(--fs-base); font-weight: var(--fw-semibold); display: block; }
.set-row small { color: var(--muted); font-size: var(--fs-sm); }
.set-foot { display: flex; gap: var(--size-10); margin-top: var(--size-16); }

.je-head { display: grid; grid-template-columns: 1fr var(--size-128) var(--size-128) var(--size-32); gap: var(--size-8); font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--muted); padding: 0 var(--size-2) var(--size-8); }
.je-head .r { text-align: end; }
.je-line { display: grid; grid-template-columns: 1fr var(--size-128) var(--size-128) var(--size-32); gap: var(--size-8); margin-bottom: var(--size-8); align-items: center; }
.je-line .picker, .je-line input { height: var(--size-40); font-size: var(--fs-base); padding: 0 var(--size-8); background-color: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); color: var(--text); outline: none; width: 100%; }
.je-line input { text-align: end; font-variant-numeric: tabular-nums; }
.je-line .field-prefixed { height: var(--size-40); padding-inline-start: var(--size-8); background-color: var(--surface); border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-sm); }
.je-line .field-prefixed > input { height: 100%; border: none; background: none; box-shadow: none; }
.je-line .field-prefixed__unit { min-width: 0; padding-inline: 0; color: var(--muted); }
.je-line .picker { background-image: none; }
.je-head.je-described, .je-line.je-described { grid-template-columns: 1fr 1fr var(--size-128) var(--size-128) var(--size-32); }
.je-line input.je-description { text-align: start; font-variant-numeric: normal; }
.je-line .del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: var(--fs-lg); }
@media (max-width: 720px) {
  .record-page__head:has(.title-edit) > .record-page__acts { order: -1; flex-basis: 100%; }
}
@media (max-width: 720px) {
  .je-head, .je-line, .je-head.je-described, .je-line.je-described { grid-template-columns: 1fr 1fr var(--size-32); }
  .je-head > :first-child { display: none; }
  .je-head.je-described > :nth-child(2) { display: none; }
  .je-line > :first-child, .je-line > .je-description { grid-column: 1 / -1; }
}
.je-balance { display: flex; align-items: center; gap: var(--size-12); margin-top: var(--size-16); padding: var(--size-12) var(--size-14); border-radius: var(--radius-sm); font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.je-balance.ok { background: var(--accent-soft); color: var(--good); }
.je-balance.off { background: var(--warn-soft); color: var(--warn); }
.btn.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.lnk { color: var(--link); cursor: pointer; font-variant-numeric: tabular-nums; }
.lnk:hover { text-decoration: underline; }

button.lnk { border: 0; padding: 0; background: none; font: inherit; }
a.lnk { text-decoration: none; }
.lnk-out { display: inline-flex; align-items: center; gap: var(--size-4); }
.je-balance .nums { margin-inline-start: auto; font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); color: var(--text-2); }

.role-perm { display: flex; align-items: center; gap: var(--size-12); flex-wrap: wrap; padding: var(--size-10) 0; border-top: var(--stroke-1) solid var(--border); }
.role-perm b { flex: 1; min-width: var(--size-144); font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.role-perm b small { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-normal); }

.sync-hero { display: flex; align-items: center; gap: var(--size-12); padding: var(--size-14); border-radius: var(--radius); background: var(--surface-2); border: var(--stroke-1) solid var(--border); margin-bottom: var(--size-16); }
.sync-hero .sh-ic { width: var(--size-44); height: var(--size-44); border-radius: var(--radius); display: grid; place-items: center; flex: none; }
.sync-hero.online .sh-ic { background: var(--accent-soft); color: var(--good); }
.sync-hero.offline .sh-ic { background: var(--warn-soft); color: var(--warn); }
.sync-hero b { font-size: var(--fs-base); display: block; } .sync-hero small { color: var(--muted); font-size: var(--fs-sm); }
.sync-sec { font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wider); color: var(--muted); margin: var(--size-16) 0 var(--size-10); }
.sync-item { display: flex; align-items: center; gap: var(--size-12); padding: var(--size-10) 0; border-bottom: var(--stroke-1) solid var(--border); }
.sync-item .st-ic { width: var(--size-32); height: var(--size-32); border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.sync-item .st-ic.done { background: var(--accent-soft); color: var(--good); }
.sync-item .st-ic.queued { background: var(--warn-soft); color: var(--warn); }
.sync-item b { font-size: var(--fs-base); font-weight: var(--fw-semibold); display: block; } .sync-item small { color: var(--muted); font-size: var(--fs-sm); }
.sync-item .tag { margin-inline-start: auto; font-size: var(--fs-sm); font-weight: var(--fw-bold); }

.switch { width: var(--size-40); height: var(--size-24); border-radius: var(--radius-pill); border: none; background: var(--border-2); position: relative; cursor: pointer; flex: none; transition: background 0.16s; padding: 0; }
.switch span { position: absolute; top: var(--size-2); inset-inline-start: var(--size-2); width: var(--size-20); height: var(--size-20); border-radius: 50%; background: var(--knob); box-shadow: var(--shadow-sm); transition: transform 0.16s; }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(calc(var(--size-16) * var(--dir))); }

.switch.locked { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; }
}

.form { display: flex; flex-direction: column; gap: var(--size-14); }

.error { color: var(--danger); font-size: var(--fs-base); margin: 0; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--size-12); }
@media (max-width: 560px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.row__title { font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.row__sub { font-size: var(--fs-sm); margin-top: var(--size-2); }
.row__check { width: var(--size-20); height: var(--size-20); flex: none; accent-color: var(--accent); cursor: pointer; }

.toolbar--end { justify-content: flex-end; }
.panel__sub { font-size: var(--fs-sm); color: var(--muted); margin: var(--size-2) 0 0; }

.tbl .num-label { text-align: end; color: var(--text-2); }
.tbl__section {
  background: var(--surface-2); font-weight: var(--fw-bold); color: var(--text-2);
  text-transform: uppercase; font-size: var(--fs-sm); letter-spacing: var(--ls-wide);
}
.tbl__grand td { border-top: var(--stroke-2) solid var(--border-2); border-bottom: none; padding-top: var(--size-10); }
.tbl-wrap .tbl tr.tbl__expand > td { background: var(--surface-2); padding: var(--size-12); }
.variance--good { color: var(--accent); }
.variance--bad { color: var(--danger); }

.role-badge {
  font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: var(--ls-wide); color: var(--accent); background: var(--accent-soft);
  padding: var(--size-4) var(--size-10); border-radius: var(--radius-pill);
}

.set-panel { padding: var(--size-4) 0 var(--size-2); }
.set-card :is(.set-row, .set-panel).form-doc__props { margin-bottom: 0; border-bottom: none; }
.set-card .set-row.form-doc__props { padding-bottom: var(--size-14); }
.set-row.form-doc__props + .set-row { border-top: none; }
.set-row.form-doc__props > .field:first-child { flex-basis: var(--size-320); }
.set-card .set-props { margin: 0; padding: var(--size-8) 0; border-bottom: none; border-top: var(--stroke-1) solid var(--border); }
.set-card .set-props + .set-row:has(> div:first-child:empty) { border-top: none; padding-top: 0; }
.set-card .set-props .field { grid-template-columns: var(--size-240) minmax(0, 1fr); }
@media (max-width: 720px) {
  .set-card .set-props .field { grid-template-columns: var(--size-144) minmax(0, 1fr); }
}

.rec-stat--diff { border-color: var(--warn); }
.rec-suggestions { display: flex; flex-direction: column; gap: var(--size-6); }
.rec-suggestion { display: flex; align-items: center; justify-content: space-between; gap: var(--size-12); font-size: var(--fs-base); }

.rfq-quotes { display: flex; flex-direction: column; gap: var(--size-12); }
.rfq-quote { padding: var(--size-10) var(--size-12); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); }
.rfq-quote__head { display: flex; align-items: center; justify-content: space-between; gap: var(--size-12); }
.rfq-quote .tbl { margin-top: var(--size-8); }
.rfq-quote__acts { display: flex; justify-content: flex-end; gap: var(--size-8); margin-top: var(--size-12); }
.rfq-quote__acts:empty { display: none; }

.report { padding: var(--panel-pad); }
.report__table { margin-inline: calc(var(--panel-pad) * -1); overflow-x: auto; overscroll-behavior-x: contain; }
.report__table .tbl .r { white-space: nowrap; }
.report__table .tbl :is(thead th, tbody td, tfoot td):first-child { padding-inline-start: var(--panel-pad); }
.report__table .tbl :is(thead th, tbody td, tfoot td):last-child { padding-inline-end: var(--panel-pad); }
.report__tree { display: inline-flex; align-items: center; gap: var(--size-4); vertical-align: middle; padding-inline-start: calc(var(--depth, 0) * var(--size-20)); }
.report__twist { display: inline-grid; place-items: center; inline-size: var(--size-32); block-size: var(--size-32); margin-block: calc(var(--size-10) * -1); flex: none; border: none; background: none; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer; }
.report__twist:hover { color: var(--text); background: var(--surface-2); }
.report__twist svg { transition: transform 0.12s ease; }
.report__twist[aria-expanded="true"] svg { transform: rotate(90deg); }
.report__twist--leaf { visibility: hidden; cursor: default; }
.report__table .tbl tr.report__parent td { font-weight: var(--fw-semibold); }
.report__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--size-8) var(--size-12); margin-bottom: var(--size-12); }
.report__filters > .field { flex: 0 1 var(--size-200); min-width: 0; margin-bottom: 0; }
.date-field { position: relative; display: flex; align-items: center; }
.date-field input { flex: 1; min-width: 0; padding-inline-end: var(--size-40); }
.date-field input::-webkit-calendar-picker-indicator { display: none; }
.date-field__open {
  position: absolute; inset-inline-end: var(--size-4); display: grid; place-items: center;
  width: var(--size-32); height: var(--size-32); padding: 0; border: none; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); cursor: pointer;
}
.date-field__open:hover, .date-field__open[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.calendar {
  position: fixed; z-index: 62; width: var(--size-280); padding: var(--size-8);
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.calendar__head { display: flex; align-items: center; gap: var(--size-4); margin-bottom: var(--size-6); }
.calendar__step { width: var(--size-32); height: var(--size-32); }
.calendar__title {
  flex: 1; height: var(--size-32); border: none; border-radius: var(--radius-sm); background: none;
  color: var(--text); font: inherit; font-weight: var(--fw-semibold); cursor: pointer;
}
.calendar__title:hover:not(:disabled) { background: var(--surface-3); }
.calendar__title:disabled { cursor: default; }
.calendar__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--size-2); }
.calendar__months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--size-4); }
.calendar__weekday { padding-block: var(--size-4); color: var(--text-3); font-size: var(--fs-micro); text-align: center; }
.calendar__cell {
  height: var(--size-32); border: var(--stroke-1) solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; cursor: pointer;
}
.calendar__months .calendar__cell { height: var(--size-40); }
.calendar__cell:hover:not(:disabled) { background: var(--surface-3); }
.calendar__cell[data-outside] { color: var(--text-3); }
.calendar__cell[data-today] { border-color: var(--border-2); font-weight: var(--fw-semibold); }
.calendar__cell[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.calendar__cell:disabled { color: var(--text-3); cursor: default; }
.calendar__cell:focus-visible, .calendar__title:focus-visible, .date-field__open:focus-visible { outline: var(--stroke-2) solid var(--accent); outline-offset: var(--stroke-1); }
.calendar__foot { display: flex; justify-content: space-between; margin-top: var(--size-6); padding-top: var(--size-6); border-top: var(--stroke-1) solid var(--border); }
.report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--size-12); margin-bottom: var(--size-12); }
.report__head > div:first-child { min-width: 0; }
@media (max-width: 720px) {
  .report__table .tbl :is(th, td) { white-space: nowrap; }
  .report .report__table .tbl :is(thead tr th, tbody tr td):first-child { position: static; box-shadow: none; background: none; }
}
.report__sub { font-size: var(--fs-sm); margin-top: var(--size-2); }
.report__actions { display: flex; gap: var(--size-6); flex: none; }
.report__filters > .report__actions { margin-inline-start: auto; }
.report__spans {
  box-sizing: border-box; display: inline-flex; align-items: stretch; gap: var(--size-2); height: var(--size-40); padding: var(--size-2);
  background: var(--surface-2); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
}
.report__spans .seg { align-items: stretch; padding: 0; background: none; border: none; }
.report__spans .icon-btn { width: var(--size-32); height: auto; border: none; border-radius: var(--radius-sm); }

.report__printed { display: none; }

.report__letterhead { display: none; }

.letterhead { display: flex; align-items: flex-start; gap: var(--size-12); padding-bottom: var(--size-10); margin-bottom: var(--size-12); border-bottom: var(--stroke-1) solid var(--border); }

.letterhead__mark { width: var(--size-56); height: var(--size-56); object-fit: contain; flex: none; }
.letterhead__who { display: flex; flex-direction: column; gap: var(--stroke-1); min-width: 0; }
.letterhead__name { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.letterhead__line { font-size: var(--fs-sm); color: var(--muted); }
.letterhead__reg { font-size: var(--fs-micro); color: var(--muted); font-family: var(--mono); margin-top: var(--size-2); }


.printdoc { display: none; }

.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41;
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column; max-height: 88vh;
}
.sheet.open { transform: translateY(0); }

@media print {

  .auth, .act-panel, .modal, .cmdk, .toast, .combo__list, .tip__bubble, .sidebar, .topbar, .sheet, .subtabs, .toolbar, .pager, .bulkbar, .report__actions, .btn, .field { display: none !important; }

  .app { display: block; height: auto; overflow: visible; }
  .main, .scroll { overflow: visible; }

  .view { max-width: none; margin: 0; padding: 0; }

  .card, .report { --panel-pad: 0; border: none; box-shadow: none; padding: 0; margin: 0; }
  .report__printed { display: block; margin-top: var(--size-12); font-size: var(--fs-micro); }
  .report__letterhead { display: block; }
  .report__table { overflow: visible; }
  .sheet-topbar, .phone-bar, .report__spans, .report__twist { display: none !important; }
  .report__table .tbl { font-size: var(--fs-sm); }
  .report__table .tbl :is(th, td) { padding-inline: var(--size-6); }
  .report__table .tbl :is(th, td):first-child { white-space: normal; }
  .report__tree { padding-inline-start: calc(var(--depth, 0) * var(--size-12)); }

  body:has(.printdoc) .app *:not(:has(.printdoc), .printdoc, .printdoc *) { display: none !important; }
  .printdoc { display: block; }

  .pos-receipt { width: var(--size-280); font-family: var(--mono); font-size: var(--fs-sm); padding: var(--size-8); }
  .pos-receipt__lines { width: 100%; border-collapse: collapse; }
  .pos-receipt__lines td { padding: var(--size-2) 0; vertical-align: top; }
  .pos-receipt__lines .num { text-align: end; white-space: nowrap; padding-inline-start: var(--size-8); }
  @page { size: A4; margin: 14mm; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media (hover: none) and (pointer: coarse) {
  :is(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select, [contenteditable="true"]):not(.auth-code, .lc-row input) {
    font-size: var(--fs-lg) !important;
  }
  .chat-compose__tools { --tool: var(--size-44); --tool-ic: var(--icon-lg); gap: var(--size-4); padding-block-end: 0; }
  .chat-compose__tools .icon-btn:hover { background: none; }
  .chat-compose__tools .icon-btn:active:not(:disabled) { background: var(--surface-3); }
}

.cards { display: none; }

[data-nav-scrim] { display: none; }

@media (max-width: 720px) {

  .app, .app.collapsed { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
    width: var(--size-280); max-width: 84vw; z-index: 42;
    transform: translateX(calc(-1 * var(--slide)));
    transition: transform var(--enters-in) var(--ease-panel);
  }
  .app.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  [data-nav-scrim] { display: block; }

  .topbar, .sheet-topbar { padding: var(--stroke-1) var(--size-10) 0; gap: var(--size-8); }

  .page-title { font-size: var(--fs-lg); line-height: var(--lh-tight); min-height: 0; }
  .page-title small { display: none; }

  .title-wrap { align-self: stretch; cursor: pointer; padding-inline-end: var(--size-4); }
  .co-pill { display: inline-flex; }
  .shell-search .cmd-trigger { display: flex; }

  .cmd-trigger { width: var(--size-40); min-width: 0; padding: 0; justify-content: center; }
  .cmd-trigger span, .cmd-trigger .kbd { display: none; }
  .home .cmd-trigger { width: 100%; padding-inline: var(--size-12) var(--size-10); justify-content: flex-start; }
  .home .cmd-trigger span:not(.kbd) { display: inline; }

  .view { padding: var(--size-16) var(--size-12) var(--size-24); }
  .app:has(> .sidebar):has(.tabbar) .scroll { padding-bottom: var(--size-64); }

  .act {
    display: grid; grid-template-columns: var(--size-32) minmax(0, 1fr);
    column-gap: var(--size-12); row-gap: var(--size-8); align-items: center;
  }
  .act__i { grid-area: 1 / 1; }
  .act__b { grid-area: 1 / 2; }

  .act__w { grid-area: 2 / 2; justify-self: start; text-align: start; }
  .act__go { grid-area: 2 / 2; justify-self: end; }
  .conn { flex-wrap: wrap; row-gap: var(--size-8); }

  .kpi-row { grid-template-columns: 1fr 1fr; gap: var(--size-10); }
  :root { --panel-pad: 14px; --sheet-strip-h: calc(var(--size-64) + env(safe-area-inset-bottom)); }
  .list-summary { gap: var(--size-12) var(--size-16); }
  .banner-note { align-items: flex-start; font-size: var(--fs-sm); }
  .banner-note svg { flex: none; margin-top: var(--stroke-1); }

  .toolbar { gap: var(--size-8); }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .btn { flex: 1 1 auto; }

  .toolbar .select { flex: 1 1 0; max-width: none; min-width: 0; }
  .btn { height: var(--size-40); }
  .pager { flex-direction: column; gap: var(--size-10); align-items: stretch; text-align: center; }
  .pager-btns { justify-content: center; }
  .pager-btns .btn { flex: 1; }

  .tbl-wrap--desk { display: none; }
  .cards { display: flex; flex-direction: column; gap: var(--size-8); }
  .rowcard {
    display: flex; align-items: center; gap: var(--size-12); width: 100%;
    padding-block: var(--size-12); padding-inline: var(--size-14) var(--size-12); text-align: start; cursor: pointer;
    background: var(--surface); border: var(--stroke-1) solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    color: inherit; font-family: inherit;
  }
  .rowcard:active { background: var(--surface-2); }
  .rowcard__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--size-2); }
  .rowcard__main b { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
  .rowcard__main small { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .rowcard__side { flex: none; max-width: 46%; display: flex; flex-direction: column; align-items: flex-end; gap: var(--size-4); }
  .rowcard__side .pill { white-space: normal; text-align: end; }
  .rowcard__amt { font-size: var(--fs-base); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .rowcard__chev { width: var(--size-16); height: var(--size-16); flex: none; color: var(--border-2); }
  .rowcard--empty { flex-direction: column; align-items: flex-start; gap: var(--size-6); cursor: default; padding: var(--size-20) var(--size-16); }
  .rowcard--empty p { font-size: var(--fs-sm); color: var(--muted); }
  .rowcard--empty .btn { margin-top: var(--size-6); }
  .toolbar .btn--primary { display: none; }

  table.tbl { font-size: var(--fs-base); }
  .tbl thead th { padding: var(--size-8) var(--size-8); }
  .tbl tbody td { padding: var(--size-10) var(--size-8); }

  .tbl .pill { white-space: normal; }
  .tbl .doc-no { white-space: nowrap; }
  .tbl thead th:first-child,
  .tbl tbody tr:not(.no-rows) td:first-child {
    position: sticky; inset-inline-start: 0; z-index: 1;
    background: var(--surface); box-shadow: var(--stroke-1) 0 0 var(--border);
  }
  .tbl thead th:first-child { background: var(--surface-2); z-index: 2; }
  .tbl tbody tr:hover td:first-child { background: var(--surface-2); }

  .tbl tbody tr.sel td:first-child { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); }

  .field-row { grid-template-columns: 1fr; gap: 0; }

  .line-head, .line-head--q { display: none; }
  .line, .editlines .line, .form-doc .editlines .line {
    grid-template-columns: 1fr 1fr;
    gap: var(--size-10) var(--size-12); padding: var(--size-12); margin-bottom: var(--size-10);
    border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2);
  }
  .line > :first-child { grid-column: 1 / -1; }
  .line .del { grid-column: 2; justify-self: end; width: var(--size-40); }
  .line input.line-d-row { order: -1; grid-column: 1 / -1; height: var(--size-36); }
  .line > .line-item { order: -2; }
  .line-cell { display: flex; flex-direction: column; gap: var(--size-2); min-width: 0; }
  .line-cap { display: block; font-size: var(--fs-micro); color: var(--muted); }
  .line-cell > .line-amt { align-self: flex-start; min-height: var(--size-32); display: flex; align-items: center; }
  .form-doc .line .line-cell :is(input, .picker) { background-color: var(--surface); border-color: var(--border); }
  .mini-tbl--stacked thead { display: none; }
  .mini-tbl--stacked :is(table, tbody, tr, td) { display: block; }
  .mini-tbl--stacked tr {
    padding: var(--size-10) var(--size-12); margin-bottom: var(--size-10);
    border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2);
  }
  .mini-tbl--stacked td {
    display: flex; justify-content: space-between; gap: var(--size-12);
    padding: var(--size-4) 0; border: none; text-align: end;
  }
  .mini-tbl--stacked td::before { content: attr(data-label); color: var(--muted); text-align: start; flex: none; }
  .mini-tbl--stacked .tbl tbody tr td:first-child { position: static; background: none; box-shadow: none; }
  .person .line { grid-template-columns: minmax(0, 1fr) var(--size-40); padding: 0; margin-bottom: 0; border: none; background: none; }
  .person .line > :first-child, .person .line .del { grid-column: auto; }
  .person .line--way { grid-template-columns: minmax(0, 1fr); }

  .lc-row {
    grid-template-columns: 1fr var(--size-96);
    grid-template-areas: "name qty" "avail qty";
    gap: var(--size-2) var(--size-12); padding: var(--size-12) 0;
  }
  .lc-row--head { display: none; }
  .lc-row > :nth-child(1) { grid-area: name; }
  .lc-row > :nth-child(2) { grid-area: avail; text-align: start; }
  .lc-row > :nth-child(3) { grid-area: qty; }
  .lc-row .avail::before { content: "Books say "; }
  .linecount:not(.countsheet) .lc-row .avail::before { content: "Outstanding "; }
  .lc-row input { height: var(--size-48); font-size: var(--fs-xl); font-weight: var(--fw-semibold); text-align: center; }
  .linecount--money .lc-row, .form-doc .linecount--money .lc-row { grid-template-columns: 1fr var(--size-144); }
  .form-doc .lc-row { grid-template-columns: 1fr var(--size-96); }

  .lc-lot { grid-template-columns: 1fr; padding-bottom: var(--size-12); }
  .lc-lot input { height: var(--size-44); font-size: var(--fs-base); }
  .lc-foot { padding-top: var(--size-12); }
  .fin-row { font-size: var(--fs-sm); gap: var(--size-12); }

  .seg { flex-wrap: wrap; max-width: 100%; }
  .seg button { padding: var(--size-8) var(--size-14); font-size: var(--fs-base); }
  .seg--full button { padding: var(--size-8) var(--size-6); }
  .seg--icons .seg__ic { display: inline-flex; justify-content: center; }
  .seg--icons .seg__ic .ic { width: var(--icon-lg); height: var(--icon-lg); }
  .seg--icons .seg__label { display: none; }
  .report__spans { display: flex; flex: 1 1 100%; }
  .report__spans .seg { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .report__spans .icon-btn { width: var(--size-40); }
  .report__spans .seg button { padding: var(--size-8) var(--size-6); }

  .switch::before { content: ""; position: absolute; inset: calc(var(--size-10) * -1) calc(var(--size-8) * -1); }

  a.lnk { position: relative; }
  a.lnk::after { content: ""; position: absolute; inset: calc(var(--size-8) * -1) calc(var(--size-4) * -1); }

  .modal { padding: var(--size-14); }

  .modal__card { width: 100%; min-width: 0; }
  .modal__card .tbl-wrap { overflow-x: auto; }
  .cmdk { padding: 0 var(--size-12); }
  .cmdk__box { width: 100%; max-width: none; }
  .toast { inset-inline-start: var(--size-12); inset-inline-end: var(--size-12); width: auto; max-width: none; }
  .tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: var(--size-2);
    border: none; background: none; color: var(--muted);
    font-size: var(--fs-micro); font-weight: var(--fw-semibold); font-family: inherit; cursor: pointer;

    text-decoration: none;
  }
  .tab svg { width: var(--icon-lg); height: var(--icon-lg); }
  .tab.active { color: var(--accent); }
}

.sheet-frame {
  display: grid;

  height: 100%;
  min-height: 0;
  min-width: 0;
  --sheet-tabs-h: var(--sheet-strip-h);
}

.sheet-frame > * {
  grid-area: 1 / 1;
  min-height: 0;
  min-width: 0;
}

.sheet-screen {

  position: relative;
  z-index: 1;
  margin-bottom: var(--sheet-tabs-h);
  overflow: auto;
  background: var(--bg);
}
.sheet-screen:has(.act-panel, .trail-compose, .modal.open, .pos-cart.is-open) { z-index: 7; }

.sheet-host {
  --line: var(--border);
  --line-strong: var(--border-2);
  --head: var(--surface-3);
  --frozen: var(--sunk);
  --dirty: var(--warn-soft);
  --bad: var(--danger);
  --bad-soft: var(--danger-soft);

  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text);

  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.view:has(> .sheet-host) { max-width: none; margin: 0; padding: 0; height: 100%; }

.app:not(:has(> .sidebar)) { grid-template-columns: 1fr; }
.app:not(:has(> .sidebar)) .topbar > .icon-btn:first-child { display: none; }

.sheet-topbar__acts { display: flex; align-items: center; margin-inline-start: auto; }
.sheet-topbar__acts > .usermenu-wrap { margin-inline-start: var(--size-6); }

.topbar .page-title, .sheet-topbar .page-title { min-height: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.sheet-topbar__lead { display: flex; flex: none; align-items: center; gap: var(--size-6); min-width: 0; max-width: 45%; }
.sheet-topbar__lead > .page-title { flex: 0 1 auto; }
.sheet-search { flex: 0 1 var(--size-440); min-width: var(--size-112); height: var(--size-36); padding-inline: var(--size-10) var(--size-6); }
.sheet-search input { font-size: var(--fs-base); }
.search-clear { display: inline-flex; flex: none; padding: var(--size-4); border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); }
.search-clear:hover { color: var(--text); background: var(--surface-3); }
.sheet-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 var(--stroke-3) var(--accent-soft); }
.sheet-search__chips { display: flex; flex: 0 1 auto; max-width: 70%; gap: var(--size-4); min-width: 0; overflow: hidden; }
.sheet-search__chip { display: inline-flex; flex: none; align-items: center; gap: var(--size-2); height: var(--size-24); padding-inline: var(--size-8) var(--size-2); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-sm); white-space: nowrap; }
.sheet-search__chip-label { max-width: var(--size-200); overflow: hidden; text-overflow: ellipsis; }
.sheet-search__chip button { display: inline-flex; padding: var(--size-2); border: 0; border-radius: var(--radius-xs); background: none; color: inherit; cursor: pointer; }
.sheet-search__chip button:hover { background: var(--accent-line); }
.sheet-search__more { flex: none; height: var(--size-24); padding-inline: var(--size-8); border: 0; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; cursor: pointer; }
.sheet-search__more:hover { background: var(--accent-line); }
.sheet-search.has-chips input { flex: 1 1 var(--size-80); width: auto; min-width: var(--size-80); }
.sheet-search__find { display: inline-flex; flex: none; padding: var(--size-4); border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.sheet-search__find:hover { color: var(--text); background: var(--surface-3); }
.sheet-search__find.on { color: var(--accent-strong); }
.sheet-search__tools { display: flex; flex: none; align-items: center; gap: var(--size-8); }
.search-hides { display: contents; }
.search-hides[hidden] { display: none; }
.search-progress { display: grid; justify-items: center; gap: var(--size-8); margin: var(--size-24) auto; padding: var(--size-24); max-width: var(--size-200); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.search-progress__spin { width: var(--size-24); height: var(--size-24); border: var(--stroke-2) solid var(--border); border-block-start-color: var(--accent); border-radius: 50%; animation: search-progress-spin 0.8s linear infinite; }
.search-progress__title { margin: 0; color: var(--text); font-weight: var(--fw-semibold); }
.search-progress__steps { display: grid; gap: var(--size-4); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-base); text-align: start; }
.search-progress__step::before { content: "○"; display: inline-block; width: var(--size-16); }
.search-progress__step.tried { text-decoration: line-through; }
.search-progress__step.tried::before { content: "✕"; }
.search-progress__step.trying { color: var(--accent-strong); font-weight: var(--fw-semibold); }
.search-progress__step.trying::before { content: "●"; }
@keyframes search-progress-spin { to { transform: rotate(1turn); } }
.sheet-tools { display: none; position: relative; flex: none; }
.sheet-topbar .sheet-tools { order: -1; }
.sheet-tools__shell, .sheet-tools__scrim, .sheet-search__open, .page-title__phone { display: none; }
.sheet-tools__panel {
  position: absolute; inset-inline-start: 0; top: calc(100% + var(--size-6));
  width: var(--size-200); z-index: 60; padding: var(--size-6);
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.14s;
}
.sheet-tools__panel.open { opacity: 1; pointer-events: auto; }
.sheet-tools__panel svg { flex: none; color: var(--muted); }
.sheet-tools__panel .on svg { color: inherit; }
.sheet-tools__count { margin-inline-start: auto; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
:is(.sheet-topbar--sheet, .sheet-topbar--chat, .sheet-topbar--find) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(var(--size-112), var(--size-560)) minmax(0, 1fr); }
:is(.sheet-topbar--sheet, .sheet-topbar--chat, .sheet-topbar--find) > * { grid-row: 1; }
:is(.sheet-topbar--sheet, .sheet-topbar--chat, .sheet-topbar--find) > .sheet-topbar__lead { grid-column: 1; justify-self: start; max-width: 100%; }
:is(.sheet-topbar--sheet, .sheet-topbar--chat, .sheet-topbar--find) > .sheet-search { grid-column: 2; }
:is(.sheet-topbar--sheet, .sheet-topbar--chat, .sheet-topbar--find) > .sheet-topbar__acts { grid-column: 3; justify-self: end; }
@media (max-width: 1024px) {
  .sheet-tools { display: block; }
  .sheet-topbar--sheet { display: flex; }
  .sheet-topbar--sheet > .sheet-topbar__lead { max-width: 45%; }
  .sheet-search__tools { display: none; }
}

.sheet-topbar .btn b { font-weight: var(--fw-bold); font-size: var(--fs-sm); color: inherit; }

.sheet-menu {
  position: absolute; inset-inline-start: 0; bottom: 0; z-index: 6;
  display: flex; align-items: stretch; height: var(--sheet-strip-h); min-width: var(--sheet-tabs-lead); padding-inline: var(--size-8) var(--size-2);
  background: var(--tabs); border-top: var(--stroke-1) solid var(--border-2);
}
.sheet-menu::after {
  content: ""; position: absolute; inset-inline-end: 0; inset-block: var(--size-10); width: var(--stroke-1); background: var(--border-2);
}
.sheet-menu__open {
  display: inline-flex; flex: 1; align-items: center; justify-content: center; padding: 0 var(--size-12);
  border: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: none;
  color: var(--text-2); font: inherit; font-weight: var(--fw-medium);
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.12s, color 0.12s;
}
.sheet-menu__open:hover,
.sheet-menu__open[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.sheet-menu__open:disabled { opacity: 0.5; cursor: default; background: none; color: inherit; }

.sheet-menu__panel {
  position: absolute; inset-inline-start: 0; bottom: calc(100% + var(--size-8));
  width: var(--size-200); z-index: 60; padding: var(--size-6);
  max-height: calc(100vh - var(--size-44)); overflow-y: auto;
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.14s;
}
.sheet-menu__panel.open { opacity: 1; pointer-events: auto; }
.sheet-menu__group { position: relative; }

.sheet-menu__module {
  display: flex; align-items: center; gap: var(--size-8);
  width: 100%; border: none; background: none; text-align: start;
  padding: var(--size-8) var(--size-10); border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-base); color: var(--text); cursor: pointer;
}
.sheet-menu__module i {
  margin-inline-start: auto; font-style: normal; color: var(--text-3);
}

.sheet-menu__module .ic { width: var(--icon-md); height: var(--icon-md); flex: none; color: var(--muted); }
.sheet-menu__group.on > .sheet-menu__module { background: var(--surface-3); }

.sheet-menu__sub {
  position: fixed; z-index: 60;
  width: var(--size-240); max-height: 60vh; overflow-y: auto; padding: var(--size-6);
  background: var(--surface); border: var(--stroke-1) solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.sheet-menu__item {
  display: flex; align-items: center; gap: var(--size-8); width: 100%;
  padding: var(--size-8) var(--size-10); border: none; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-base);
  text-align: start; cursor: pointer;
}
.sheet-menu__item:hover { background: var(--surface-3); }
.sheet-menu__item.on { color: var(--accent); font-weight: var(--fw-semibold); }

.sheet-menu__item .ic { width: var(--icon-md); height: var(--icon-md); flex: none; color: var(--muted); }

.phone-bar, .phone-drawer { display: none; }
@media (max-width: 720px) {
  .chat-side:has(> .chat-sec--merged) > :is(.chat-side__tops, .chat-sec--assistant, .chat-sec--channel, .chat-sec--direct) { display: none; }
  .chat-sec--merged { display: flex; padding-inline: var(--size-8); }
  .chat-find--later { inset-inline: 0; width: auto; }
  .sheet-topbar--chat { display: flex; }
  .sheet-topbar--chat > .sheet-search { display: none; }
  .sheet-topbar--find { display: flex; }
  .sheet-topbar--find > .sheet-search { flex: 1 1 0; min-width: 0; }
  .sheet-topbar--find > .sheet-search .kbd { display: none; }
  .chat-search--desk { display: none; }
  .chat-search--phone { display: flex; }
  .chat-sec--merged > :is(.chat-sec__head, .chat-sec__list) { padding-inline: 0; }
  .chat-sec--merged > .chat-sec__list .chat-room {
    gap: var(--size-12); min-height: var(--size-64); padding: var(--size-10) var(--size-12);
    border-radius: var(--radius-sm); font-size: var(--fs-md);
  }
  .chat-sec--merged .chat-find { padding: var(--size-10); }
  .chat-sec--merged .chat-find__box { gap: var(--size-8); margin-block-end: var(--size-6); }
  .chat-sec--merged .chat-find__box input { min-height: var(--size-40); padding-inline: var(--size-12); font-size: var(--fs-md); }
  .chat-sec--merged .chat-find__list .chat-room { min-height: var(--size-44); padding-inline: var(--size-12); font-size: var(--fs-md); }
  .chat-sec--merged .chat-face { width: var(--size-40); height: var(--size-40); font-size: var(--fs-sm); }
  .chat-sec--merged .chat-room__tile {
    display: grid; place-items: center; flex: none; width: var(--size-40); height: var(--size-40);
    border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-strong);
    box-shadow: inset 0 0 0 var(--stroke-1) color-mix(in srgb, var(--accent) 22%, transparent);
    font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  }
  .chat-sec--merged .chat-room__tile--assistant { background: var(--sheet-hl-purple); color: var(--sheet-hl-purple-ink); box-shadow: inset 0 0 0 var(--stroke-1) color-mix(in srgb, var(--sheet-hl-purple-ink) 22%, transparent); }
  .chat-sec--merged .chat-room__tile--assistant .ic { width: var(--icon-lg); height: var(--icon-lg); }
  .chat-sec--merged :is(.chat-room__sigil, .chat-room__dot--idle) { display: none; }
  .sheet-menu { display: none; }

  .phone-bar {
    position: absolute; inset-inline: 0; bottom: 0; z-index: 6;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
    height: var(--sheet-strip-h); padding: 0 var(--size-4) env(safe-area-inset-bottom);
    background: var(--surface); border-top: var(--stroke-1) solid var(--border);
  }
  .phone-bar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--size-4);
    min-width: 0; height: var(--size-56); border: none; background: none;
    color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    white-space: nowrap; cursor: pointer;
  }
  .phone-bar__item .ic { width: var(--icon-xl); height: var(--icon-xl); }
  .phone-bar__icon { position: relative; display: flex; }
  .phone-bar__count {
    position: absolute; inset-block-start: calc(var(--size-6) * -1); inset-inline-start: calc(100% - var(--size-10));
    min-width: var(--size-20); padding: 0 var(--size-4); border-radius: var(--radius-pill);
    background: var(--accent); color: var(--accent-ink); font-size: var(--fs-micro); font-weight: var(--fw-bold);
    line-height: var(--lh-loose); text-align: center;
  }
  .phone-bar__count.mention-count { background: var(--danger); color: var(--danger-ink); }
  .phone-bar__item.on { color: var(--accent); font-weight: var(--fw-semibold); }
  .phone-bar__item:disabled { opacity: 0.5; cursor: default; }

  .phone-drawer { display: block; position: fixed; inset: 0; bottom: var(--sheet-strip-h); z-index: 62; }
  .phone-drawer__scrim { position: absolute; inset: 0; background: transparent; }
  .phone-drawer__panel {
    position: absolute; inset-inline: 0; bottom: 0;
    max-height: calc(100% - var(--size-48)); overflow-y: auto;
    padding: var(--size-8) var(--size-16) var(--size-20);
    background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg);
    clip-path: inset(-100vmax -100vmax 0);
  }
  .phone-drawer__grip {
    display: block; width: var(--size-48); height: var(--size-4); margin: 0 auto var(--size-12);
    border-radius: var(--radius-pill); background: var(--border);
  }
  .phone-drawer__title {
    display: flex; align-items: center; gap: var(--size-8); margin: 0 0 var(--size-12);
    font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-2);
  }
  .phone-drawer__back {
    display: grid; place-items: center; width: var(--size-32); height: var(--size-32);
    margin-inline-start: calc(var(--size-8) * -1); border: none; border-radius: var(--radius-sm); background: none;
    color: var(--text); font: inherit; font-size: var(--fs-xl); cursor: pointer;
  }
  .phone-drawer__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--size-12); }
  .phone-drawer__tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--size-8);
    min-width: 0; aspect-ratio: 1; padding: var(--size-6); border: none; border-radius: var(--radius-lg);
    background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    cursor: pointer;
  }
  .phone-drawer__tile .ic { width: var(--icon-xl); height: var(--icon-xl); }
  .phone-drawer__tile.on { background: var(--accent-soft); color: var(--accent); }
  .phone-drawer__list { display: flex; flex-direction: column; gap: var(--size-2); }
  .phone-drawer__item {
    display: flex; align-items: center; gap: var(--size-12); width: 100%; min-height: var(--size-48);
    padding: 0 var(--size-10); border: none; border-radius: var(--radius-sm); background: none;
    color: var(--text); font: inherit; font-size: var(--fs-md); text-align: start; cursor: pointer;
  }
  .phone-drawer__item .ic { width: var(--icon-lg); height: var(--icon-lg); flex: none; color: var(--muted); }
  .phone-drawer__item.on { color: var(--accent); font-weight: var(--fw-semibold); }
  .phone-drawer__item:active, .phone-drawer__tile:active { background: var(--surface-3); }
}

.rich { position: relative; }
.rich__doc { overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.rich__doc p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: inline-start; height: 0; color: var(--text-3); pointer-events: none; }
.rich__doc, .prose { line-height: var(--lh-normal); }
.rich__doc > :first-child, .prose > :first-child { margin-top: 0; }
.rich__doc > :last-child, .prose > :last-child { margin-bottom: 0; }
.rich__doc p, .prose p { margin: 0; }
.rich__doc p + p, .prose p + p { margin-top: var(--size-8); }
.rich__doc :is(h1, h2, h3), .prose :is(h3, h4, h5) { margin: var(--size-16) 0 var(--size-4); line-height: var(--lh-snug); font-weight: var(--fw-semibold); }
.rich__doc h1, .prose h3 { font-size: var(--fs-xl); }
.rich__doc h2, .prose h4 { font-size: var(--fs-lg); }
.rich__doc h3, .prose h5 { font-size: var(--fs-md); }
.rich__doc :is(ul, ol), .prose :is(ul, ol) { margin: var(--size-4) 0; padding-inline-start: var(--size-24); }
.rich__doc ul, .prose ul { list-style: disc; }
.rich__doc ol, .prose ol { list-style: decimal; }
.rich__doc li > p + :is(ul, ol), .prose li :is(ul, ol) { margin: 0; }
.rich__doc ul[data-type="taskList"], .prose ul:has(> .prose__task) { list-style: none; padding-inline-start: var(--size-4); }
.rich__doc ul[data-type="taskList"] li, .prose__task { display: flex; align-items: flex-start; gap: var(--size-8); }
.rich__doc ul[data-type="taskList"] li > label { flex: none; margin-top: var(--size-2); }
.rich__doc ul[data-type="taskList"] li > label input { width: var(--size-16); height: var(--size-16); margin: 0; accent-color: var(--accent); cursor: pointer; }
.rich__doc ul[data-type="taskList"] li > div, .prose__task > div { flex: 1; min-width: 0; }
.rich__doc ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--text-3); text-decoration: line-through; }
.prose__check {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--size-16); height: var(--size-16); margin-top: var(--size-2);
  border: var(--stroke-1) solid var(--border-2); border-radius: var(--radius-xs); color: var(--surface);
}
button.prose__check { padding: 0; background: none; cursor: pointer; }
.prose__check[data-done] { background: var(--accent); border-color: var(--accent); }
.prose__task:has(> .prose__check[data-done]) > div { color: var(--text-3); text-decoration: line-through; }
.rich__doc blockquote, .prose blockquote { margin: var(--size-8) 0; padding-inline-start: var(--size-12); border-inline-start: var(--stroke-3) solid var(--border-2); color: var(--text-2); }
.rich__doc code, .prose code { padding: 0 var(--size-4); font-family: var(--mono); font-size: var(--fs-sm); background: var(--surface-2); border-radius: var(--radius-xs); }
.rich__doc pre, .prose pre { margin: var(--size-8) 0; padding: var(--size-8) var(--size-12); background: var(--surface-2); border-radius: var(--radius-sm); overflow-x: auto; white-space: pre; }
.rich__doc pre code, .prose pre code { padding: 0; background: none; }
.rich__doc hr, .prose hr { margin: var(--size-12) 0; border: none; border-top: var(--stroke-1) solid var(--border); }
.prose__table {
  width: fit-content; max-width: 100%; margin: var(--size-8) 0; overflow-x: auto;
  border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  background:
    linear-gradient(to right, var(--surface) 60%, transparent) 0 0 / var(--size-28) 100% no-repeat local,
    linear-gradient(to left, var(--surface) 60%, transparent) 100% 0 / var(--size-28) 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-edge), transparent) 0 0 / var(--size-12) 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-edge), transparent) 100% 0 / var(--size-12) 100% no-repeat,
    var(--surface);
}
.prose__table table { border-collapse: collapse; font-size: var(--fs-base); font-variant-numeric: tabular-nums; white-space: normal; }
.prose__table :is(th, td) { padding: var(--size-8) var(--size-12); text-align: start; vertical-align: top; overflow-wrap: normal; }
.prose__table th {
  font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wider);
  color: var(--muted); white-space: nowrap; background: var(--surface-2); border-bottom: var(--stroke-1) solid var(--border);
}
.prose__table td { border-bottom: var(--stroke-1) solid var(--border); }
.prose__table tbody tr:last-child td { border-bottom: none; }
.prose__table tbody tr:hover { background: var(--surface-2); }
.prose__table [data-align="center"] { text-align: center; }
.prose__table [data-align="end"] { text-align: end; }
.rich__doc a, .prose a { color: var(--link); text-decoration: none; }
.rich__doc a:hover, .prose a:hover { text-decoration: underline; }
.prose__mention { padding: 0 var(--size-2); border-radius: var(--radius-xs); background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-medium); }
.prose__embed { margin: var(--size-8) 0; width: 100%; max-width: var(--size-640); aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.prose__embed[data-shape="tall"] { max-width: var(--size-320); aspect-ratio: 9 / 16; }
.prose__embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.prose.tl-note, .prose.chat-msg__body { white-space: normal; }
.help { display: grid; grid-template-columns: var(--size-240) minmax(0, 1fr); gap: var(--size-40); max-width: var(--size-1180); margin-inline: auto; padding: var(--size-8) var(--size-16) var(--size-48); align-items: start; }
.help__nav { position: sticky; top: var(--size-16); max-height: calc(100vh - var(--size-128)); overflow-y: auto; display: flex; flex-direction: column; gap: var(--size-16); padding-inline-end: var(--size-16); border-inline-end: var(--stroke-1) solid var(--border); }
.help__nav-group { display: flex; flex-direction: column; gap: var(--size-2); }
.help__nav-head { padding: 0 var(--size-10) var(--size-4); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.help__nav-item { padding: var(--size-6) var(--size-10); border-radius: var(--radius-sm); color: var(--text-2); font-size: var(--fs-base); text-decoration: none; }
.help__nav-item:hover { background: var(--surface-2); color: var(--text); }
.help__nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-semibold); }
.help__doc { max-width: var(--size-720); min-width: 0; }
.help__back { display: none; margin-bottom: var(--size-16); }
.help__head { padding-bottom: var(--size-20); margin-bottom: var(--size-24); border-bottom: var(--stroke-1) solid var(--border); }
.help__head small { display: block; margin-bottom: var(--size-4); color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--ls-wider); }
.help__head h1 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.help__head p { margin-top: var(--size-8); color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-normal); }
.help__body { font-size: var(--fs-md); line-height: var(--lh-loose); }
.help__body p + p { margin-top: var(--size-12); }
.help__body :is(h4, h5) { margin: var(--size-32) 0 var(--size-8); }
.help__body h4 { font-size: var(--fs-xl); }
.help__body h5 { font-size: var(--fs-lg); }
.help__body :is(ul, ol) { margin: var(--size-12) 0; }
.help__body li + li { margin-top: var(--size-6); }
.help__body .prose__table { margin: var(--size-16) 0; }
.help__index { display: grid; gap: var(--size-12); margin: 0; padding: 0; list-style: none; }
.help__search { position: relative; display: flex; align-items: center; margin-bottom: var(--size-24); }
.help__search input { width: 100%; padding: var(--size-10) var(--size-14); padding-inline-end: var(--size-40); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); font-size: var(--fs-md); color: var(--text); }
.help__search input:focus { outline: none; border-color: var(--accent); }
.help__search .search-clear { position: absolute; inset-inline-end: var(--size-8); }
.help__section + .help__section { margin-top: var(--size-32); }
.help__section h2 { margin-bottom: var(--size-12); font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.help__section .help__index { grid-template-columns: repeat(auto-fill, minmax(var(--size-280), 1fr)); }
.help__none { color: var(--muted); }
.help__card { display: flex; flex-direction: column; gap: var(--size-4); padding: var(--size-16) var(--size-20); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.help__card:hover { border-color: var(--accent); }
.help__card b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.help__card small { color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.help__card span { color: var(--text-2); font-size: var(--fs-base); }
button.help__nav-item { border: 0; background: none; text-align: start; cursor: pointer; }
.handbook__section { scroll-margin-top: var(--size-16); }
.handbook__section + .handbook__section { margin-top: var(--size-48); }
.handbook__section > h2 { margin-bottom: var(--size-16); padding-bottom: var(--size-8); border-bottom: var(--stroke-1) solid var(--border); color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--ls-wider); }
.handbook__policy { scroll-margin-top: var(--size-16); }
.handbook__policy + .handbook__policy { margin-top: var(--size-32); }
.handbook__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-8) var(--size-12); }
.handbook__title h3 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.handbook__policy .help__body :is(h4, h5) { margin: var(--size-20) 0 var(--size-6); font-size: var(--fs-lg); }
.handbook__meta { margin: var(--size-4) 0 var(--size-12); color: var(--muted); font-size: var(--fs-sm); }
.handbook__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--size-8) var(--size-12); margin-top: var(--size-16); }
.handbook__sign { scroll-margin-top: var(--size-16); display: flex; flex-direction: column; gap: var(--size-14); margin-top: var(--size-40); padding: var(--size-20) var(--size-24); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-lg); }
.handbook__sign h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.handbook__sign p { margin: 0; color: var(--text-2); }
@media (max-width: 720px) {
  .help { grid-template-columns: minmax(0, 1fr); gap: var(--size-16); }
  .help__nav { display: none; }
  .help[data-open] .help__back { display: block; }
  .help__head h1 { font-size: var(--fs-2xl); }
}
.fval.prose { display: block; padding-block: var(--size-8); }
.rich-bar {
  display: flex; align-items: center; gap: var(--size-2); padding: var(--size-4); z-index: 63;
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.rich-bar__btn {
  display: inline-flex; align-items: center; justify-content: center; width: var(--size-28); height: var(--size-28);
  border: none; border-radius: var(--radius-xs); background: none; color: var(--text-2); cursor: pointer;
}
.rich-bar__btn:hover { background: var(--surface-2); color: var(--text); }
.rich-bar__btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.rich-bar__link {
  width: var(--size-240); height: var(--size-28); padding: 0 var(--size-8); font: inherit; font-size: var(--fs-sm);
  border: none; background: none; color: var(--text); outline: none;
}
.rich-menu {
  position: fixed; z-index: 90; display: flex; flex-direction: column; width: var(--size-240); max-height: var(--size-280); overflow-y: auto;
  margin: 0; padding: var(--size-4); list-style: none;
  background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.rich-menu .combo__item { display: flex; align-items: center; gap: var(--size-8); }
.rich-menu .combo__item svg { flex: none; color: var(--text-2); }
.rich-menu .combo__item .emoji-animated, .rich-menu__mark { flex: none; width: var(--size-20); text-align: center; font-size: var(--fs-lg); line-height: var(--lh-tight); }
