/* BIQDADDY LINE CRM
   The homepage's world (navy ink, teal for action, Google Sans, a glowing teal
   dot on section labels, pill buttons) set as a working tool. Light is the
   default; dark reuses the homepage's own navy surfaces. Every colour and
   length lives in the token blocks below; components only read var(). */

:root,
[data-theme="light"] {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f6f9fa;
  --surface-3: #edf2f5;
  --line: #e1e8ed;
  --line-strong: #cbd6de;
  --text-1: #05243f;
  --text-2: #3b5366;
  --text-3: #566c80;
  --accent: #2fd3c6;
  --accent-hover: #5fe0d5;
  --on-accent: #030a14;
  --accent-ink: #0b6e65;
  --accent-tint: #dff6f3;
  --accent-tint-ink: #08605a;
  --nav-active-bg: #05243f;
  --nav-active-fg: #ffffff;
  --focus: #0b6e65;
  --chart-1: #12988c;
  --chart-2: #3a62d6;
  --chart-track: #e7edf1;
  --chart-grid: #e6ecf0;
  --chart-axis: #566c80;
  --tip-bg: #05243f;
  --tip-fg: #f2f7f9;
  --ok: #12703f;
  --ok-tint: #e1f3e8;
  --warn: #7f5000;
  --warn-tint: #fff0d2;
  --bad: #b42318;
  --bad-tint: #fde7e4;
  --info: #2c50b8;
  --info-tint: #e7edfc;
  --tone-1-bg: #dff6f3; --tone-1-fg: #08605a;
  --tone-2-bg: #e5ebfb; --tone-2-fg: #2c4aa3;
  --tone-3-bg: #f6ecdc; --tone-3-fg: #6e4a12;
  --tone-4-bg: #f0e5f6; --tone-4-fg: #643782;
  --tone-5-bg: #e8eef2; --tone-5-fg: #3b5366;
  --tone-6-bg: #fbe6e3; --tone-6-fg: #8f2a20;
  --chat-bg: #c9d7e6;
  --chat-oa: #ffffff;
  --chat-oa-fg: #111b24;
  --chat-me: #b9ee99;
  --chat-me-fg: #111b24;
  --chat-meta: #3f5263;
  --chat-pill: rgba(255, 255, 255, .55);
  --backdrop: rgba(3, 10, 20, .42);
  --knob-shadow: 0 1px 2px rgba(3, 10, 20, .25);
  --shadow: 0 1px 2px rgba(5, 36, 63, .05);
  --shadow-pop: 0 14px 36px rgba(5, 36, 63, .16);
  --topbar-bg: rgba(255, 255, 255, .86);
  --logo-filter: none;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #030a14;
  --surface: #08182b;
  --surface-2: #0b1f36;
  --surface-3: #0f2742;
  --line: rgba(228, 237, 241, .1);
  --line-strong: rgba(228, 237, 241, .2);
  --text-1: #e8f0f3;
  --text-2: #b3c3cb;
  --text-3: #8fa4b3;
  --accent: #2fd3c6;
  --accent-hover: #5fe0d5;
  --on-accent: #030a14;
  --accent-ink: #2fd3c6;
  --accent-tint: rgba(47, 211, 198, .13);
  --accent-tint-ink: #7fe6dc;
  --nav-active-bg: #2fd3c6;
  --nav-active-fg: #030a14;
  --focus: #2fd3c6;
  --chart-1: #17a99d;
  --chart-2: #5f80e8;
  --chart-track: rgba(228, 237, 241, .08);
  --chart-grid: rgba(228, 237, 241, .08);
  --chart-axis: #8fa4b3;
  --tip-bg: #e8f0f3;
  --tip-fg: #05243f;
  --ok: #63d69d;
  --ok-tint: rgba(99, 214, 157, .12);
  --warn: #ffd59a;
  --warn-tint: rgba(255, 213, 154, .12);
  --bad: #ff9a8f;
  --bad-tint: rgba(255, 140, 140, .12);
  --info: #9fb4ff;
  --info-tint: rgba(143, 168, 255, .13);
  --tone-1-bg: rgba(47, 211, 198, .16); --tone-1-fg: #8fe9e0;
  --tone-2-bg: rgba(111, 143, 240, .2); --tone-2-fg: #b9c9ff;
  --tone-3-bg: rgba(255, 213, 154, .16); --tone-3-fg: #ffd9a6;
  --tone-4-bg: rgba(196, 150, 230, .18); --tone-4-fg: #e2c6f5;
  --tone-5-bg: rgba(228, 237, 241, .1); --tone-5-fg: #c9d6dd;
  --tone-6-bg: rgba(255, 140, 140, .16); --tone-6-fg: #ffc2bb;
  --chat-bg: #0f2742;
  --chat-oa: #e8f0f3;
  --chat-oa-fg: #0b1824;
  --chat-me: #a6e487;
  --chat-me-fg: #0b1824;
  --chat-meta: #b3c3cb;
  --chat-pill: rgba(8, 24, 43, .7);
  --backdrop: rgba(0, 0, 0, .6);
  --knob-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 0 rgba(0, 0, 0, .2);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, .5);
  --topbar-bg: rgba(3, 10, 20, .8);
  --logo-filter: brightness(0) invert(1);
  color-scheme: dark;
}

:root {
  --font: 'Google Sans', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* type scale */
  --fs-2xs: 10.5px;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-base: 14.5px;
  --fs-body: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 26px;
  --fs-4xl: 30px;
  --fs-5xl: 32px;
  --fs-hero-sm: 48px;
  --fs-hero: 56px;

  /* spacing */
  --s-px: 1px;
  --s-0-5: 2px;
  --s-0-75: 3px;
  --s-1: 4px;
  --s-1-5: 6px;
  --s-2: 8px;
  --s-2-5: 10px;
  --s-3: 12px;
  --s-3-5: 14px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 96px;
  --pad: clamp(var(--s-4), 3vw, var(--s-8));

  /* radii */
  --r-xs: 3px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-phone: 22px;
  --r-pill: 999px;
  --r-bubble-oa: 4px 16px 16px 16px;
  --r-bubble-me: 16px 4px 16px 16px;

  /* fixed sizes */
  --hairline: 1px;
  --rule: 1.6px;
  --bar-2: 2px;
  --maxw: 1320px;
  --topbar-h: 64px;
  --logo-w: 128px;
  --logo-w-sm: 108px;
  --logo-w-lg: 168px;
  --h-xs: 32px;
  --h-sm: 36px;
  --h-md: 42px;
  --h-lg: 44px;
  --icon-btn: 40px;
  --icon-btn-sm: 32px;
  --icon-sm: 13px;
  --icon-md: 14px;
  --dot: 6px;
  --dot-md: 7px;
  --dot-lg: 8px;
  --dot-glow: 9px;
  --swatch: 10px;
  --av-sm: 28px;
  --av: 36px;
  --av-lg: 72px;
  --av-lg-sm: 56px;
  --bar-h: 6px;
  --bar-h-lg: 8px;
  --badge: 20px;
  --switch-w: 38px;
  --switch-h: 22px;
  --knob: 16px;
  --chev: 7px;
  --dl-key: 128px;
  --subnav-w: 220px;
  --phone-w: 320px;
  --phone-min-h: 300px;
  --bubble-w: 236px;
  --bubble-me-w: 220px;
  --log-time: 56px;
  --stat-min: 150px;
  --tip-min: 160px;
  --trunc: 260px;
  --trunc-sm: 150px;
  --date-w: 128px;
  --slip-w: 132px;
  --slip-h: 168px;
  --snippet-pad-r: 104px;
  --dlg-w: 600px;
  --toast-w: 420px;
  --login-w: 420px;
  --chart-min-h: 220px;
  --table-max-h: 260px;
  --sticky-top: 96px;
  --scroll-pad: 88px;
  --skip-off: -120px;
  --nudge: 4px;
  --tl-line-x: 13.5px;
  --tl-line-top: 30px;
  --skel-h: 14px;
  --skel-tall: 40px;
  --skel-block: 220px;
  --slip-img-w: 168px;

  --dur-fast: .16s;
  --dur: .26s;
  --dur-skel: 1.4s;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-padding-top: var(--scroll-pad); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
main { flex: 1; outline: none; }
main:focus-visible { outline: none; }
/* the hidden attribute must win over component display rules (.count, .field) */
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
:focus-visible { outline: var(--bar-2) solid var(--focus); outline-offset: var(--bar-2); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.sr-only { position: absolute; width: var(--s-px); height: var(--s-px); overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.nb { white-space: nowrap; }
.muted { color: var(--text-3); }
.soft { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: var(--s-4); top: var(--skip-off); z-index: 100; background: var(--surface); color: var(--text-1); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); }
.skip:focus { top: var(--s-3); box-shadow: var(--shadow-pop); }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(var(--s-3-5)) saturate(1.2);
  backdrop-filter: blur(var(--s-3-5)) saturate(1.2);
  border-bottom: var(--hairline) solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: var(--s-5); min-height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: var(--s-3); flex: 0 0 auto; }
.brand img { width: var(--logo-w); height: auto; filter: var(--logo-filter); }
.brand-tag {
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-tint-ink); background: var(--accent-tint);
  padding: var(--s-0-75) var(--s-2) var(--s-0-5); border-radius: var(--r-pill); white-space: nowrap;
}
.mainnav { display: flex; gap: var(--s-0-5); margin-left: auto; }
.mainnav a {
  position: relative; display: inline-flex; align-items: center; gap: var(--s-1-5);
  padding: var(--s-1-5) var(--s-3-5); border-radius: var(--r-pill);
  font-size: var(--fs-base); color: var(--text-2); white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.mainnav a:hover { background: var(--surface-3); color: var(--text-1); }
.mainnav a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-fg); }
.count {
  display: inline-grid; place-items: center; min-width: var(--badge); height: var(--badge); padding: 0 var(--s-1-5);
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  background: var(--warn-tint); color: var(--warn);
}
.mainnav a[aria-current="page"] .count { background: var(--nav-active-fg); color: var(--nav-active-bg); }
.topbar-tools { display: flex; align-items: center; gap: var(--s-2); }
.ws {
  display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-1-5) var(--s-3);
  border: var(--hairline) solid var(--line); border-radius: var(--r-pill);
  font-size: var(--fs-md); color: var(--text-2); white-space: nowrap;
}
.ws--pick { position: relative; padding-right: var(--s-7); cursor: pointer; }
.ws--pick select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: var(--text-1); font-size: var(--fs-md); cursor: pointer; padding: 0; }
.ws--pick select:focus-visible { outline: none; }
.ws--pick:focus-within { border-color: var(--focus); }
.ws--pick::after { content: ''; position: absolute; right: var(--s-3); top: 50%; width: var(--chev); height: var(--chev); border-right: var(--rule) solid var(--text-2); border-bottom: var(--rule) solid var(--text-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.ws-dot { width: var(--dot-md); height: var(--dot-md); border-radius: 50%; background: var(--accent); box-shadow: 0 0 var(--s-2) var(--accent); }

@media (max-width: 1180px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .ws { display: none; }
}
@media (max-width: 1060px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .topbar-in { flex-wrap: wrap; gap: 0 var(--s-3); padding-top: var(--s-2); }
  .topbar-tools { margin-left: auto; }
  .mainnav {
    order: 3; width: 100%; margin: 0; padding: var(--s-2) 0;
    overflow-x: auto; scrollbar-width: none;
  }
  .mainnav::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .brand img { width: var(--logo-w-sm); }
  .brand-tag { display: none; }
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--h-md); padding: var(--s-2) var(--s-5); border-radius: var(--r-pill);
  font-size: var(--fs-base); font-weight: 500; line-height: 1.2; white-space: nowrap;
  border: var(--hairline) solid transparent; background: none;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn svg { flex: 0 0 auto; }
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { border-color: var(--line-strong); color: var(--text-1); background: var(--surface); }
.btn--ghost:hover { border-color: var(--text-3); }
.btn--quiet { color: var(--text-2); }
.btn--quiet:hover { background: var(--surface-3); color: var(--text-1); }
.btn--danger { color: var(--bad); border-color: var(--line-strong); background: var(--surface); }
.btn--danger:hover { border-color: var(--bad); }
.btn--sm { min-height: var(--h-sm); padding: var(--s-1-5) var(--s-3-5); font-size: var(--fs-md); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--icon-btn); height: var(--icon-btn); flex: 0 0 auto;
  border-radius: 50%; border: var(--hairline) solid var(--line); background: var(--surface); color: var(--text-2);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--text-1); }
.icon-btn--sm { width: var(--icon-btn-sm); height: var(--icon-btn-sm); }
.icon-btn--bare { border-color: transparent; background: none; }
.linkish { color: var(--accent-ink); font-weight: 500; }
.linkish:hover { text-decoration: underline; text-underline-offset: var(--s-0-75); }

/* -------------------------------------------------------------- page head */
.page { padding-block: var(--s-7) var(--s-9); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-6); margin-bottom: var(--s-6); }
.eyebrow { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-md); font-weight: 500; letter-spacing: .04em; color: var(--text-3); }
.eyebrow i { width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--accent); box-shadow: 0 0 var(--dot-glow) var(--accent); flex: 0 0 auto; }
.eyebrow .en { font-size: var(--fs-xs); letter-spacing: .18em; text-transform: uppercase; }
h1.title { font-size: clamp(var(--fs-3xl), 2.6vw, var(--fs-5xl)); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin-top: var(--s-1-5); }
.subtitle { margin: var(--s-1) 0 0; color: var(--text-2); }
.section-label { margin: var(--s-8) 0 var(--s-4); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.section-label h2 { font-size: var(--fs-xl); font-weight: 600; }
.section-label .note { font-size: var(--fs-md); color: var(--text-3); }
.back { display: inline-flex; align-items: center; gap: var(--s-1-5); font-size: var(--fs-base); color: var(--text-2); margin-bottom: var(--s-4); }
.back:hover { color: var(--text-1); }

/* ------------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-4); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.stack { display: grid; gap: var(--s-4); align-content: start; }
@media (max-width: 1060px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .md-6 { grid-column: span 6; }
}
@media (max-width: 720px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .md-6 { grid-column: span 12; }
}

/* ------------------------------------------------------------------- cards */
.card { background: var(--surface); border: var(--hairline) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s-5) var(--s-6); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card-head h2, .card-head h3 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.4; }
.card-head .aside { font-size: var(--fs-md); color: var(--text-3); }
.card--flush .card-head { padding: var(--s-5) var(--s-6) 0; }
.card-foot { margin-top: var(--s-4); font-size: var(--fs-md); color: var(--text-3); }
.card--fill { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.empty { padding: var(--s-6) 0; color: var(--text-3); font-size: var(--fs-base); }
.empty strong { display: block; color: var(--text-2); font-weight: 500; margin-bottom: var(--s-0-5); }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap: var(--s-1-5); padding: var(--s-0-5) var(--s-2-5);
  border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 500; line-height: 1.6; white-space: nowrap;
  background: var(--accent-tint); color: var(--accent-tint-ink);
}
.chip--muted { background: var(--surface-3); color: var(--text-2); }
.chip--ok { background: var(--ok-tint); color: var(--ok); }
.chip--warn { background: var(--warn-tint); color: var(--warn); }
.chip--bad { background: var(--bad-tint); color: var(--bad); }
.chip--info { background: var(--info-tint); color: var(--info); }
.chip--plain { background: none; padding: 0; color: var(--text-3); font-weight: 400; font-size: var(--fs-base); }
.chip .dot { width: var(--dot); height: var(--dot); border-radius: 50%; background: currentColor; }
.chip svg { width: var(--icon-sm); height: var(--icon-sm); }

/* ---------------------------------------------------------------- avatars */
.av {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: var(--av); height: var(--av); border-radius: 50%;
  font-size: var(--fs-base); font-weight: 600; line-height: 1;
  background: var(--tone-5-bg); color: var(--tone-5-fg);
}
.av--lg { width: var(--av-lg); height: var(--av-lg); font-size: var(--fs-4xl); }
.av--sm { width: var(--av-sm); height: var(--av-sm); font-size: var(--fs-sm); }
.av[data-tone="1"] { background: var(--tone-1-bg); color: var(--tone-1-fg); }
.av[data-tone="2"] { background: var(--tone-2-bg); color: var(--tone-2-fg); }
.av[data-tone="3"] { background: var(--tone-3-bg); color: var(--tone-3-fg); }
.av[data-tone="4"] { background: var(--tone-4-bg); color: var(--tone-4-fg); }
.av[data-tone="5"] { background: var(--tone-5-bg); color: var(--tone-5-fg); }
.av[data-tone="6"] { background: var(--tone-6-bg); color: var(--tone-6-fg); }
.who { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.who > span { min-width: 0; }
.who-name { display: block; font-weight: 500; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { display: block; font-size: var(--fs-sm); color: var(--text-3); }
.code { font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--text-1); }

/* ----------------------------------------------------------------- forms */
.field { display: grid; gap: var(--s-1-5); align-content: start; min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-md); font-weight: 500; color: var(--text-2); }
.field .hint { font-size: var(--fs-sm); color: var(--text-3); }
.input, .select select, .textarea {
  width: 100%; height: var(--h-lg); padding: 0 var(--s-3-5);
  background: var(--surface); color: var(--text-1);
  border: var(--hairline) solid var(--line-strong); border-radius: var(--r);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:hover, .select select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 var(--s-0-75) var(--accent-tint); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.textarea { height: auto; min-height: calc(var(--s-10) + var(--s-6)); padding: var(--s-3) var(--s-3-5); line-height: 1.6; resize: vertical; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: var(--s-8); cursor: pointer; }
.select::after {
  content: ''; position: absolute; right: var(--s-4); top: 50%; width: var(--chev); height: var(--chev); pointer-events: none;
  border-right: var(--rule) solid var(--text-2); border-bottom: var(--rule) solid var(--text-2);
  transform: translateY(-70%) rotate(45deg);
}
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: var(--s-3-5); top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: var(--s-8); }
.input-affix { position: relative; }
.input-affix span { position: absolute; left: var(--s-3-5); top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-affix .input { padding-left: var(--s-7); }
.err { font-size: var(--fs-sm); color: var(--bad); }
.err:empty { display: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s-2-5); cursor: pointer; font-size: var(--fs-base); }
.switch input { position: absolute; opacity: 0; width: var(--s-px); height: var(--s-px); }
.switch .track { position: relative; width: var(--switch-w); height: var(--switch-h); border-radius: var(--r-pill); background: var(--line-strong); transition: background var(--dur-fast); flex: 0 0 auto; }
.switch .track::after { content: ''; position: absolute; left: var(--s-0-75); top: var(--s-0-75); width: var(--knob); height: var(--knob); border-radius: 50%; background: var(--surface); box-shadow: var(--knob-shadow); transition: transform var(--dur) var(--ease-out); }
.switch input:checked + .track { background: var(--accent-ink); }
.switch input:checked + .track::after { transform: translateX(var(--s-4)); }
.switch input:focus-visible + .track { outline: var(--bar-2) solid var(--focus); outline-offset: var(--bar-2); }

/* segmented control */
.seg { display: inline-flex; padding: var(--s-0-75); gap: var(--s-0-5); border: var(--hairline) solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.seg button { border: 0; background: none; padding: var(--s-1-5) var(--s-3-5); border-radius: var(--r-pill); font-size: var(--fs-md); color: var(--text-2); white-space: nowrap; min-height: var(--h-xs); }
.seg button:hover { color: var(--text-1); background: var(--surface-3); }
.seg button[aria-pressed="true"] { background: var(--nav-active-bg); color: var(--nav-active-fg); }

.range { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.daterange { display: inline-flex; align-items: center; gap: var(--s-1-5); padding: var(--s-0-75) var(--s-1) var(--s-0-75) var(--s-3); border: var(--hairline) solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.daterange input { border: 0; background: none; height: var(--h-xs); font-size: var(--fs-md); color: var(--text-1); padding: 0 var(--s-0-5); min-width: 0; width: var(--date-w); }
.daterange input:focus { outline: none; }
.daterange:focus-within { border-color: var(--focus); }
.daterange span { color: var(--text-3); }

/* ----------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; position: relative; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.tbl caption { text-align: left; }
.tbl th {
  text-align: left; font-size: var(--fs-sm); font-weight: 500; color: var(--text-3);
  padding: var(--s-2-5) var(--s-4); background: var(--surface-2); border-bottom: var(--hairline) solid var(--line); white-space: nowrap;
}
.tbl td { padding: var(--s-3) var(--s-4); border-bottom: var(--hairline) solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl tbody tr.is-link { cursor: pointer; transition: background var(--dur-fast); }
.tbl tbody tr.is-link:hover td { background: var(--surface-2); }
.tbl .sort { border: 0; background: none; padding: 0; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: var(--s-1); }
.tbl .sort:hover { color: var(--text-1); }
.tbl th[aria-sort] .sort { color: var(--text-1); font-weight: 600; }
.tbl .sort svg { opacity: .55; }
.tbl th[aria-sort] .sort svg { opacity: 1; }
.tbl--compact th { padding: var(--s-2) var(--s-3); background: none; }
.tbl--compact td { padding: var(--s-2-5) var(--s-3); }
.tbl--compact th:first-child, .tbl--compact td:first-child { padding-left: 0; }
.tbl--compact th:last-child, .tbl--compact td:last-child { padding-right: 0; }
.cell-sub { display: block; font-size: var(--fs-sm); color: var(--text-3); }
.trunc { display: block; max-width: var(--trunc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show-sm { display: none; }

/* rank bar under a label */
.rank { height: var(--bar-h); border-radius: var(--r-xs); background: var(--chart-track); margin-top: var(--s-1-5); overflow: hidden; }
.rank > i { display: block; height: 100%; min-width: var(--bar-h); border-radius: var(--r-xs); background: var(--chart-1); }
.rank-list { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.rank-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-3); font-size: var(--fs-base); }
.rank-list .rank { grid-column: 1 / -1; margin-top: var(--s-1); }
.rank-list b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- figures */
.hero-num { font-size: var(--fs-hero); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.big-num { font-size: var(--fs-5xl); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.delta { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-md); font-weight: 500; color: var(--text-2); }
.delta svg { width: var(--icon-md); height: var(--icon-md); }
.delta.up svg { color: var(--ok); }
.delta.down svg { color: var(--bad); }
.kv { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-md); color: var(--text-2); }
.kv b { color: var(--text-1); font-weight: 600; }

.hero-card { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s-4); }
.hero-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-6); }
.hero-label { font-size: var(--fs-base); color: var(--text-2); margin-bottom: var(--s-1-5); }

.legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-md); color: var(--text-2); margin: 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: var(--s-1-5); }
.legend i { width: var(--swatch); height: var(--swatch); border-radius: var(--r-xs); }
.legend .s1 { background: var(--chart-1); }
.legend .s2 { background: var(--chart-2); }

/* funnel */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3-5); }
.funnel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-0-5) var(--s-3); align-items: baseline; }
.funnel .f-label { font-size: var(--fs-base); color: var(--text-2); }
.funnel .f-val { font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel .f-val small { font-size: var(--fs-sm); font-weight: 500; color: var(--text-3); margin-left: var(--s-1-5); }
.funnel .rank { grid-column: 1 / -1; height: var(--bar-h-lg); border-radius: var(--r-xs); }
.divider { height: var(--hairline); background: var(--line); margin: var(--s-5) 0; border: 0; }
.side-card { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
.side-card .push { align-self: end; }

/* stat strip */
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.strip > div { padding: var(--s-1) var(--s-5); border-left: var(--hairline) solid var(--line); }
.strip > div:first-child { border-left: 0; padding-left: 0; }
.strip dt { font-size: var(--fs-md); color: var(--text-2); }
.strip dd { margin: var(--s-1) 0 0; font-size: var(--fs-3xl); font-weight: 600; line-height: 1.2; }
.strip dd small { display: block; font-size: var(--fs-sm); font-weight: 400; color: var(--text-3); margin-top: var(--s-0-5); }
@media (max-width: 1060px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s-4); }
  .strip > div:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
}
@media (max-width: 560px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div { border-left: 0; padding-left: 0; }
  .strip > div:nth-child(even) { border-left: var(--hairline) solid var(--line); padding-left: var(--s-4); }
}

/* ------------------------------------------------------------------ chart */
.chart { position: relative; min-height: var(--chart-min-h); }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--font); font-size: var(--fs-xs); fill: var(--chart-axis); }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: var(--hairline); shape-rendering: crispEdges; }
.chart .base-line { stroke: var(--line-strong); stroke-width: var(--hairline); shape-rendering: crispEdges; }
.chart .s1 { fill: var(--chart-1); }
.chart .s2 { fill: var(--chart-2); }
.chart .hit { fill: transparent; }
.chart .hit:focus { outline: none; }
.chart .col.is-dim { opacity: .45; }
.chart .val { font-size: var(--fs-sm); font-weight: 600; fill: var(--text-1); }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: var(--tip-min);
  background: var(--tip-bg); color: var(--tip-fg); border-radius: var(--s-2-5); padding: var(--s-2) var(--s-3);
  font-size: var(--fs-md); line-height: 1.5; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(var(--nudge)); transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.tip.is-on { opacity: 1; transform: none; }
.tip b { display: block; font-weight: 600; margin-bottom: var(--s-0-5); }
.tip .row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.tip .row span { display: inline-flex; align-items: center; gap: var(--s-1-5); }
.tip i { width: var(--dot-lg); height: var(--dot-lg); border-radius: var(--s-0-5); display: inline-block; }
.tip .s1 { background: var(--chart-1); }
.tip .s2 { background: var(--chart-2); }
.table-toggle { margin-top: var(--s-3); font-size: var(--fs-md); }
.table-toggle summary { cursor: pointer; color: var(--text-2); width: max-content; }
.table-toggle summary:hover { color: var(--text-1); }
.table-toggle .tbl-wrap { max-height: var(--table-max-h); overflow: auto; margin-top: var(--s-2); border: var(--hairline) solid var(--line); border-radius: var(--r); }

/* ------------------------------------------------------------- filter bar */
.filters { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)); align-items: end; }
@media (max-width: 1060px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .f-search { grid-column: 1 / -1; }
}
@media (max-width: 640px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .filters { grid-template-columns: minmax(0, 1fr); }
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-6); border-bottom: var(--hairline) solid var(--line); }
.toolbar .count-text { font-size: var(--fs-md); color: var(--text-2); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-6); border-top: var(--hairline) solid var(--line); font-size: var(--fs-md); color: var(--text-2); }
.pager-btns { display: flex; gap: var(--s-2); }

/* -------------------------------------------------------- customer detail */
.profile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); }
.profile-id { display: flex; align-items: center; gap: var(--s-5); min-width: 0; }
.profile-code { display: flex; align-items: center; gap: var(--s-2); }
.profile-code .code { font-size: var(--fs-4xl); line-height: 1.2; }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1-5) var(--s-3); margin-top: var(--s-1); font-size: var(--fs-lg); }
.profile-stats { display: flex; gap: var(--s-3); flex-wrap: wrap; margin: 0; }
.mini-stat { background: var(--surface); border: var(--hairline) solid var(--line); border-radius: var(--r-lg); padding: var(--s-3) var(--s-5); min-width: var(--stat-min); box-shadow: var(--shadow); }
.mini-stat dt { font-size: var(--fs-md); color: var(--text-2); }
.mini-stat dd { margin: var(--s-0-5) 0 0; font-size: var(--fs-3xl); font-weight: 600; line-height: 1.25; }
.dl { display: grid; grid-template-columns: var(--dl-key) minmax(0, 1fr); gap: var(--s-2) var(--s-4); margin: 0; font-size: var(--fs-base); }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text-1); overflow-wrap: anywhere; display: flex; align-items: center; gap: var(--s-1-5); flex-wrap: wrap; }
@media (max-width: 480px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .dl { grid-template-columns: minmax(0, 1fr); gap: var(--s-0-5); }
  .dl dd { margin-bottom: var(--s-2); }
}
.match {
  display: flex; gap: var(--s-3); align-items: flex-start; margin-top: var(--s-4); padding: var(--s-3) var(--s-4);
  border-radius: var(--r); background: var(--surface-2); border: var(--hairline) solid var(--line); font-size: var(--fs-md); color: var(--text-2);
}
.match svg { flex: 0 0 auto; margin-top: var(--s-0-5); color: var(--accent-ink); }
.match b { color: var(--text-1); font-weight: 600; }
.sale-form { display: grid; gap: var(--s-4); grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.sale-form .f-amt { grid-column: span 4; } .sale-form .f-date { grid-column: span 3; } .sale-form .f-svc { grid-column: span 5; }
.sale-form .f-note { grid-column: span 9; } .sale-form .f-act { grid-column: span 3; align-self: end; }
.sale-form .f-act .btn { width: 100%; min-height: var(--h-lg); }
@media (max-width: 720px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .sale-form > * { grid-column: span 12 !important; }
}

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { position: relative; display: grid; grid-template-columns: var(--av-sm) minmax(0, 1fr); gap: var(--s-3); padding-bottom: var(--s-4); }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ''; position: absolute; left: var(--tl-line-x); top: var(--tl-line-top); bottom: var(--s-0-5); width: var(--hairline); background: var(--line); }
.tl li:last-child::before { display: none; }
.tl-ic { width: var(--av-sm); height: var(--av-sm); border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.tl-ic svg { width: var(--icon-md); height: var(--icon-md); }
.tl-ic.is-accent { background: var(--accent-tint); color: var(--accent-tint-ink); }
.tl-ic.is-ok { background: var(--ok-tint); color: var(--ok); }
.tl-ic.is-bad { background: var(--bad-tint); color: var(--bad); }
.tl-ic.is-warn { background: var(--warn-tint); color: var(--warn); }
.tl-ic.is-info { background: var(--info-tint); color: var(--info); }
.tl .tl-body { font-size: var(--fs-base); padding-top: var(--s-0-75); min-width: 0; }
.tl .tl-body p { margin: 0; overflow-wrap: anywhere; }
.tl-meta { font-size: var(--fs-sm); color: var(--text-3); }
.bubble { display: inline-block; margin-top: var(--s-1); padding: var(--s-1-5) var(--s-3); border-radius: var(--r-bubble-oa); background: var(--surface-3); color: var(--text-1); font-size: var(--fs-base); max-width: 100%; }

/* feed list (overview) */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: var(--s-2-5) 0; border-bottom: var(--hairline) solid var(--line); }
.feed li:first-child { padding-top: 0; }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed .r { text-align: right; font-size: var(--fs-md); color: var(--text-3); }
.feed .r b { display: block; font-size: var(--fs-body); color: var(--text-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.feed a:hover .who-name { color: var(--accent-ink); }

/* ------------------------------------------------------------ links page */
.short { display: inline-flex; align-items: center; gap: var(--s-1); max-width: 100%; }
.short code { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utm { font-size: var(--fs-sm); color: var(--text-3); }
.utm b { font-weight: 500; color: var(--text-2); }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); counter-reset: how; margin: 0; padding: 0; list-style: none; }
.how li { counter-increment: how; display: grid; grid-template-columns: var(--av-sm) minmax(0, 1fr); gap: var(--s-3); font-size: var(--fs-base); color: var(--text-2); }
.how li::before { content: counter(how); display: grid; place-items: center; width: var(--av-sm); height: var(--av-sm); border-radius: 50%; background: var(--accent-tint); color: var(--accent-tint-ink); font-weight: 600; font-size: var(--fs-md); }
.how b { display: block; color: var(--text-1); font-weight: 600; }
@media (max-width: 860px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .how { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------- pending page */
.tabs { display: flex; gap: var(--s-1); border-bottom: var(--hairline) solid var(--line); margin-bottom: var(--s-5); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: var(--s-2-5) var(--s-3-5); font-size: var(--fs-base); color: var(--text-2); border-bottom: var(--bar-2) solid transparent; margin-bottom: calc(var(--hairline) * -1); white-space: nowrap; }
.tabs button:hover { color: var(--text-1); }
.tabs button[aria-selected="true"] { color: var(--text-1); font-weight: 600; border-bottom-color: var(--accent-ink); }
.tabs .count { margin-left: var(--s-1); }
.pend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.3fr); gap: var(--s-6); align-items: start; }
.pend + .pend { margin-top: var(--s-4); }
.pend-evidence { display: grid; gap: var(--s-2); font-size: var(--fs-base); justify-items: start; }
.slip {
  display: grid; place-items: center; align-content: center; gap: var(--s-1); width: var(--slip-w); height: var(--slip-h); border-radius: var(--r);
  border: var(--hairline) dashed var(--line-strong); background: var(--surface-2); color: var(--text-3); font-size: var(--fs-sm); text-align: center; padding: var(--s-2);
}
.pend-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); align-items: end; }
.pend-form .acts { grid-column: 1 / -1; display: flex; gap: var(--s-2); flex-wrap: wrap; }
.pend-done { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); font-size: var(--fs-base); }
@media (max-width: 960px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .pend { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
}

/* --------------------------------------------------------- history page */
.chips-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips-filter button { border: var(--hairline) solid var(--line); background: var(--surface); color: var(--text-2); border-radius: var(--r-pill); padding: var(--s-1-5) var(--s-3-5); font-size: var(--fs-md); min-height: var(--h-sm); }
.chips-filter button:hover { border-color: var(--line-strong); color: var(--text-1); }
.chips-filter button[aria-pressed="true"] { background: var(--nav-active-bg); border-color: var(--nav-active-bg); color: var(--nav-active-fg); }
.day { margin-top: var(--s-6); }
.day:first-child { margin-top: 0; }
.day h3 { font-size: var(--fs-md); font-weight: 600; color: var(--text-3); letter-spacing: .02em; margin-bottom: var(--s-1); }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: var(--log-time) var(--icon-btn-sm) minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; padding: var(--s-2-5) 0; border-bottom: var(--hairline) solid var(--line); font-size: var(--fs-base); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--text-3); font-variant-numeric: tabular-nums; padding-top: var(--s-1); font-size: var(--fs-md); }
.log .tl-ic { width: var(--icon-btn-sm); height: var(--icon-btn-sm); }
.log .log-body { padding-top: var(--s-1); min-width: 0; }
.log .log-body p { margin: 0; overflow-wrap: anywhere; }
.log .actor { font-size: var(--fs-sm); color: var(--text-3); padding-top: var(--s-1-5); white-space: nowrap; }
@media (max-width: 640px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .log li { grid-template-columns: var(--icon-btn-sm) minmax(0, 1fr); row-gap: var(--s-0-5); }
  .log .tl-ic { grid-row: 1 / span 3; }
  .log time, .log .log-body, .log .actor { grid-column: 2; padding: 0; }
  .log time { grid-row: 2; }
}

/* -------------------------------------------------------- settings page */
.settings { display: grid; grid-template-columns: var(--subnav-w) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.subnav { position: sticky; top: var(--sticky-top); display: grid; gap: var(--s-0-5); }
.subnav a { padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); font-size: var(--fs-base); color: var(--text-2); }
.subnav a:hover { background: var(--surface-3); color: var(--text-1); }
.subnav a.is-on { background: var(--accent-tint); color: var(--accent-tint-ink); font-weight: 500; }
.settings section + section { margin-top: var(--s-5); }
.lead { margin: calc(var(--s-2) * -1) 0 var(--s-5); color: var(--text-2); font-size: var(--fs-base); }
@media (max-width: 960px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .settings { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .subnav { position: static; display: flex; overflow-x: auto; gap: var(--s-1); }
  .subnav a { white-space: nowrap; }
}
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 720px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .two { grid-template-columns: minmax(0, 1fr); }
}
.copy-row { display: flex; gap: var(--s-2); align-items: center; }
.copy-row .input { font-family: var(--mono); font-size: var(--fs-md); }
.snippet-wrap { position: relative; }
.snippet {
  margin: 0; padding: var(--s-4) var(--s-5); padding-right: var(--snippet-pad-r);
  background: var(--surface-2); border: var(--hairline) solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.7; color: var(--text-1); overflow-x: auto; white-space: pre;
}
.snippet-wrap .btn { position: absolute; top: var(--s-2-5); right: var(--s-2-5); }
.greet { display: grid; grid-template-columns: minmax(0, 1fr) var(--phone-w); gap: var(--s-6); align-items: start; }
@media (max-width: 960px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .greet { grid-template-columns: minmax(0, 1fr); }
}
.vars { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.vars button { border: var(--hairline) dashed var(--line-strong); background: var(--surface); border-radius: var(--r-sm); padding: var(--s-0-75) var(--s-2-5); font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2); }
.vars button:hover { border-style: solid; color: var(--text-1); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.toggles { display: grid; gap: var(--s-4); }
.toggles .switch { justify-content: space-between; width: 100%; }
.toggles .switch small { display: block; font-size: var(--fs-sm); color: var(--text-3); }

/* LINE chat preview */
.phone { border-radius: var(--r-phone); border: var(--hairline) solid var(--line-strong); overflow: hidden; background: var(--chat-bg); }
.phone-bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-3-5); background: var(--surface); border-bottom: var(--hairline) solid var(--line); font-size: var(--fs-base); font-weight: 600; }
.phone-body { padding: var(--s-3-5) var(--s-3) var(--s-4); display: grid; gap: var(--s-2-5); min-height: var(--phone-min-h); align-content: start; }
.sys { justify-self: center; font-size: var(--fs-xs); color: var(--chat-meta); background: var(--chat-pill); padding: var(--s-0-5) var(--s-2-5); border-radius: var(--r-pill); }
.msg { display: grid; grid-template-columns: var(--av-sm) minmax(0, 1fr); gap: var(--s-2); align-items: start; }
.oa-av { width: var(--av-sm); height: var(--av-sm); border-radius: 50%; background: var(--nav-active-bg); color: var(--nav-active-fg); display: grid; place-items: center; font-size: var(--fs-2xs); font-weight: 700; }
.oa-name { font-size: var(--fs-xs); color: var(--chat-meta); margin-bottom: var(--s-0-75); }
.msg .b { background: var(--chat-oa); color: var(--chat-oa-fg); border-radius: var(--r-bubble-oa); padding: var(--s-2) var(--s-3); font-size: var(--fs-md); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-width: var(--bubble-w); }
.msg .b mark { background: none; color: inherit; font-weight: 700; letter-spacing: .04em; }
.msg-me { justify-self: end; background: var(--chat-me); color: var(--chat-me-fg); border-radius: var(--r-bubble-me); padding: var(--s-2) var(--s-3); font-size: var(--fs-md); max-width: var(--bubble-me-w); }

.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: var(--hairline) solid var(--line); }
.members li:last-child { border-bottom: 0; }
.status-line { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-md); color: var(--text-2); }
.status-line i { width: var(--dot-lg); height: var(--dot-lg); border-radius: 50%; background: var(--ok); }

/* --------------------------------------------------- loading and notices */
.skel { display: grid; gap: var(--s-4); }
.skel i { display: block; height: var(--skel-h); border-radius: var(--r-sm); background: var(--surface-3); animation: skel var(--dur-skel) ease-in-out infinite; }
.skel .w-30 { width: 30%; }
.skel .w-50 { width: 50%; }
.skel .tall { height: var(--skel-tall); }
.skel .block { height: var(--skel-block); border-radius: var(--r-lg); }
@keyframes skel { 50% { opacity: .5; } }
.is-busy { opacity: .55; pointer-events: none; transition: opacity var(--dur-fast); }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.notice { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r); border: var(--hairline) solid var(--line); background: var(--surface-2); font-size: var(--fs-md); color: var(--text-2); }
.notice b { color: var(--text-1); font-weight: 600; }
.notice--ok { border-color: var(--ok); background: var(--ok-tint); }
.notice--bad { border-color: var(--bad); background: var(--bad-tint); }
.notice:empty { display: none; }
.slip-img { width: var(--slip-img-w); max-height: var(--skel-block); object-fit: cover; border-radius: var(--r); border: var(--hairline) solid var(--line); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: end; }
.form-row .field { flex: 1 1 calc(var(--s-10) * 1.8); }
.sub-title { font-size: var(--fs-base); font-weight: 600; margin: var(--s-5) 0 var(--s-3); }

/* ---------------------------------------------------------------- dialog */
dialog.dlg {
  width: min(var(--dlg-w), calc(100vw - var(--s-7))); max-height: calc(100vh - var(--s-9)); padding: 0; border: var(--hairline) solid var(--line);
  border-radius: var(--r-xl); background: var(--surface); color: var(--text-1); box-shadow: var(--shadow-pop);
}
dialog.dlg::backdrop { background: var(--backdrop); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-6) 0; }
.dlg-head h2 { font-size: var(--fs-xl); font-weight: 600; }
.dlg-body { padding: var(--s-5) var(--s-6); display: grid; gap: var(--s-4); }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6) var(--s-5); border-top: var(--hairline) solid var(--line); }
.preview-url { font-family: var(--mono); font-size: var(--fs-sm); padding: var(--s-2-5) var(--s-3); border-radius: var(--r-sm); background: var(--surface-2); border: var(--hairline) solid var(--line); overflow-wrap: anywhere; color: var(--text-2); }
.radio-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.radio-card { position: relative; display: flex; gap: var(--s-2-5); align-items: flex-start; padding: var(--s-2-5) var(--s-3-5); border: var(--hairline) solid var(--line-strong); border-radius: var(--r); cursor: pointer; font-size: var(--fs-base); flex: 1 1 calc(var(--s-10) * 2.3); }
.radio-card input { margin-top: var(--s-1); accent-color: var(--accent-ink); }
.radio-card:has(input:checked) { border-color: var(--accent-ink); background: var(--accent-tint); }
.radio-card small { display: block; font-size: var(--fs-sm); color: var(--text-3); }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: 90; display: grid; gap: var(--s-2); justify-items: end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: var(--s-2-5); max-width: min(var(--toast-w), calc(100vw - var(--s-7)));
  background: var(--tip-bg); color: var(--tip-fg); padding: var(--s-2-5) var(--s-4); border-radius: var(--r);
  box-shadow: var(--shadow-pop); font-size: var(--fs-base); animation: toast-in var(--dur) var(--ease-out);
}
.toast svg { flex: 0 0 auto; color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(var(--s-2)); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ login */
.login { min-height: calc(100vh - var(--s-10)); display: grid; place-items: center; padding: var(--s-8) var(--pad); }
.login-card { width: min(var(--login-w), 100%); }
.login-card .brand { justify-content: center; margin-bottom: var(--s-6); }
.login-card .brand img { width: var(--logo-w-lg); }
.login-card h1 { font-size: var(--fs-2xl); font-weight: 600; text-align: center; }
.login-card p { text-align: center; color: var(--text-2); margin: var(--s-1-5) 0 var(--s-6); font-size: var(--fs-base); }
.login-card form { display: grid; gap: var(--s-4); }
.login-card .err { margin: 0; text-align: left; color: var(--bad); font-size: var(--fs-md); }
.login-card .btn { width: 100%; }
body.is-login .topbar, body.is-login .foot { display: none; }

/* ----------------------------------------------------------------- footer */
.foot { border-top: var(--hairline) solid var(--line); padding-block: var(--s-5); font-size: var(--fs-md); color: var(--text-3); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); }

/* ------------------------------------------------------- small screens */
@media (max-width: 1060px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .hide-md { display: none; }
}
@media (max-width: 720px) { /* ds-allow-hardcode: media queries cannot read custom properties */
  .page { padding-block: var(--s-5) var(--s-8); }
  .card { padding: var(--s-4); }
  .card--flush .card-head { padding: var(--s-4) var(--s-4) 0; }
  .toolbar, .pager { padding-inline: var(--s-4); }
  .tbl th, .tbl td { padding-inline: var(--s-3); }
  .hero-num { font-size: var(--fs-hero-sm); }
  .hide-sm { display: none; }
  .show-sm { display: block; }
  .trunc { max-width: var(--trunc-sm); }
  .profile-id { gap: var(--s-4); }
  .av--lg { width: var(--av-lg-sm); height: var(--av-lg-sm); font-size: var(--fs-2xl); }
  .profile-code .code { font-size: var(--fs-3xl); }
  .mini-stat { min-width: 0; flex: 1 1 calc(var(--stat-min) - var(--s-2-5)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } /* ds-allow-hardcode: near-zero duration is the reduced-motion convention */
}
