/* ==========================================================================
   Truss Workspace — company platform
   Design system + application shell
   ========================================================================== */

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f3f7fc;
  --surface: #ffffff;
  --surface-2: #edf3fa;
  --surface-3: #e1eaf5;
  --ink: #0b1a2b;
  --ink-2: #33455c;
  --muted: #6b7c92;
  --line: #dfe7f1;
  --line-strong: #c3d2e3;

  --brand: #0b3558;
  --brand-2: #0e7490;
  --brand-3: #12a594;
  --accent: #1fc98a;
  --accent-soft: #dcf8ec;
  --accent-ink: #04301f;
  --amber: #c98518;
  --amber-soft: #fdf2dc;

  --ok: #16805c;
  --ok-soft: #e2f5ec;
  --warn: #96620c;
  --warn-soft: #fbf1d8;
  --bad: #a63a2f;
  --bad-soft: #f9ebe7;
  --info: #1d5a99;
  --info-soft: #e8f1fb;
  --violet: #6b4fa3;
  --violet-soft: #f0ecf8;

  --side-bg: #071d30;
  --side-bg-2: #0d2c45;
  --side-line: rgba(226, 238, 247, .1);
  --side-ink: #e9f1f8;
  --side-muted: #8aa2b8;
  --side-hover: rgba(233, 243, 251, .07);

  --topbar-bg: rgba(243, 247, 252, .88);
  --btn-bg: #0b3558;
  --btn-ink: #f5f9fd;

  --chart-grid: #e2e9f2;
  --chart-line: #0e7490;
  --chart-fill: rgba(14, 116, 144, .10);
  --chart-alt: #c98518;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-xs: 0 1px 2px rgba(11, 26, 43, .05);
  --shadow: 0 12px 36px -18px rgba(11, 26, 43, .26);
  --shadow-lg: 0 40px 90px -30px rgba(6, 18, 31, .4);
  --sidebar-w: 252px;
  --topbar-h: 64px;
}

[data-theme="dark"] {
  --bg: #06101a;
  --surface: #0c1a28;
  --surface-2: #112334;
  --surface-3: #172d42;
  --ink: #e8f1fa;
  --ink-2: #b3c4d6;
  --muted: #7e93a9;
  --line: #1c2f44;
  --line-strong: #2a4560;

  --brand: #5fe0c8;
  --brand-2: #35c3ab;
  --brand-3: #21a68f;
  --accent: #43e08f;
  --accent-soft: rgba(67, 224, 143, .13);
  --accent-ink: #042b1c;
  --amber: #f0bb62;
  --amber-soft: rgba(240, 187, 98, .12);

  --ok: #6ed3a9;
  --ok-soft: rgba(70, 190, 145, .16);
  --warn: #e6b566;
  --warn-soft: rgba(230, 181, 102, .12);
  --bad: #f0928a;
  --bad-soft: rgba(198, 84, 70, .16);
  --info: #86b8ea;
  --info-soft: rgba(90, 140, 200, .14);
  --violet: #b7a1e6;
  --violet-soft: rgba(140, 110, 200, .14);

  --side-bg: #040c15;
  --side-bg-2: #081a29;
  --side-line: rgba(226, 238, 247, .08);
  --side-ink: #e6f0f9;
  --side-muted: #7791a8;

  --topbar-bg: rgba(6, 16, 26, .86);
  --btn-bg: #43e08f;
  --btn-ink: #042b1c;

  --chart-grid: #1c2f44;
  --chart-line: #43e08f;
  --chart-fill: rgba(67, 224, 143, .10);
  --chart-alt: #f0bb62;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 14px 40px -20px rgba(0, 0, 0, .7);
  --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ------------------------------- Shell ---------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(201, 240, 90, .09), transparent 55%),
    linear-gradient(175deg, var(--side-bg-2), var(--side-bg) 46%);
  color: var(--side-ink);
  border-right: 1px solid rgba(0, 0, 0, .25);
  overflow: hidden;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.14) transparent;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 2px;
  margin-bottom: 18px;
}
.brand-mark {
  display: none;
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  place-items: center;
  background: #fff;
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .65);
}
.brand-mark img { width: 32px; height: 32px; display: block; }
.brand-text { min-width: 0; flex: 1; }
.brand-plate {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 7px 9px;
  box-shadow: 0 10px 26px -18px rgba(0, 0, 0, .8);
  max-width: 100%;
}
.brand-logo { display: block; width: 100%; height: auto; max-width: 190px; }
.brand-sub {
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--side-muted);
  margin-top: 7px;
}
.sidebar-close { display: none; margin-left: auto; color: var(--side-muted); background: none; border: 0; padding: 6px; border-radius: 8px; }
.sidebar-close:hover { background: var(--side-hover); color: var(--side-ink); }

.scope-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--side-line);
  border-radius: 12px;
  color: var(--side-ink);
  text-align: left;
  transition: background .15s, border-color .15s;
}
.scope-btn:hover { background: rgba(255,255,255,.09); border-color: rgba(31,201,138,.35); }
.scope-glyph {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(201, 240, 90, .13);
  color: var(--accent);
}
.scope-glyph svg { width: 16px; height: 16px; }
.scope-copy { min-width: 0; flex: 1; overflow: hidden; display: block; }
.scope-name { display: block; font-size: 12.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-meta { display: block; font-size: 10.5px; color: var(--side-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-btn > svg { width: 15px; height: 15px; color: var(--side-muted); flex: none; }

.nav-group { margin-top: 20px; }
.nav-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--side-muted);
  padding: 0 10px 7px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 10px;
  margin: 2px 0;
  border-radius: 9px;
  color: #b7c4b8;
  font-size: 13.2px;
  font-weight: 500;
  transition: background .14s, color .14s;
}
.nav-item .ico { width: 18px; height: 18px; flex: none; opacity: .86; }
.nav-item:hover { background: var(--side-hover); color: var(--side-ink); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 240, 90, .16), rgba(201, 240, 90, .07));
  color: #f3f8e4;
}
.nav-item.active .ico { color: var(--accent); opacity: 1; }
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  font-size: 9.5px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.nav-badge.muted { background: rgba(255,255,255,.1); color: var(--side-muted); }
.nav-badge.warn { background: #d9a441; color: #211804; }

.sidebar-foot {
  border-top: 1px solid var(--side-line);
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-user { min-width: 0; flex: 1; }
.side-user b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user span { display: block; font-size: 10.5px; color: var(--side-muted); margin-top: 1px; }
.icon-btn.on-dark { color: var(--side-muted); }
.icon-btn.on-dark:hover { color: var(--side-ink); background: rgba(255,255,255,.08); }

/* ------------------------------- Main ----------------------------------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }

/* ----------------------------- News ticker ------------------------------- */
.ticker {
  position: sticky; top: var(--topbar-h); z-index: 39;
  display: flex; align-items: stretch; height: 34px;
  background: var(--accent-soft); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ticker-tag {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding: 0 14px 0 28px; background: var(--accent); color: var(--accent-ink);
  font-size: 9.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
}
.ticker-tag svg { width: 13px; height: 13px; }
.ticker-view {
  flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.ticker-track { display: flex; align-items: center; width: max-content; animation: ticker-scroll linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  border: 0; background: none; padding: 0; margin-right: 48px;
  color: var(--ink); font: inherit; font-size: 11.5px; white-space: nowrap; cursor: pointer;
}
.ticker-kind { display: inline-flex; color: var(--accent); }
.ticker-kind.msg { color: var(--violet); }
.ticker-kind.rec { color: var(--brand-3); }
.ticker-kind svg { width: 13px; height: 13px; }
.ticker-lead { font-weight: 700; }
.ticker-text { color: var(--ink-2); }
.ticker-item:hover .ticker-text { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ticker-meta { color: var(--muted); font-size: 10px; }
.ticker-item.unread .ticker-text::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px;
  border-radius: 50%; background: var(--accent); vertical-align: 2px;
}
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-view { overflow-x: auto; }
}
@media (max-width: 760px) {
  .ticker-tag { padding: 0 10px 0 14px; }
  .ticker-tag span { display: none; }
  .ticker-item { margin-right: 34px; font-size: 11px; }
  .ticker-meta { display: none; }
}

.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumbs .sep { opacity: .5; }
.crumbs b { color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.crumb-current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  width: min(340px, 30vw);
  min-width: 0;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  transition: border-color .15s, box-shadow .15s;
}
.top-search:hover { border-color: var(--line-strong); }
.top-search .ico { width: 16px; height: 16px; }
.top-search-label { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search .kbd { flex: none; }
.kbd {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-divider { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--muted); white-space: nowrap;
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line);
}
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.top-scope {
  display: none;
  align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface);
  font-size: 12px; font-weight: 600;
  max-width: 150px;
}
.top-scope span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-scope .ico { width: 14px; height: 14px; color: var(--muted); flex: none; }
.test-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 10.5px; font-weight: 650;
  white-space: nowrap;
}
.test-chip .ico { width: 13px; height: 13px; }
.test-chip:hover { border-color: var(--accent); }
[data-theme="dark"] .test-chip { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  position: relative;
  transition: background .14s, border-color .14s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar-btn { display: flex; align-items: center; gap: 8px; padding: 3px; border: 0; background: none; border-radius: 999px; }
.avatar-btn:hover { background: var(--surface-2); }
.avatar-btn > .chev { width: 14px; height: 14px; color: var(--muted); margin-right: 4px; }

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 32px 72px;
  flex: 1;
}
.view { animation: viewIn .28s cubic-bezier(.2,.7,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------- Typography -------------------------------- */
.display { font-family: var(--serif); font-weight: 600; letter-spacing: -.025em; }
h1.page-title { font-family: var(--serif); font-size: clamp(27px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.028em; line-height: 1.1; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.eyebrow { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.table .mono, .kv-table .mono { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 650; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stack { display: grid; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head.compact { margin-bottom: 18px; }

/* ------------------------------ Buttons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.8px; font-weight: 600;
  white-space: nowrap;
  transition: transform .08s, background .14s, border-color .14s, box-shadow .14s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-bg); border-color: var(--btn-bg); filter: brightness(1.08); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent); filter: brightness(1.03); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-soft { background: var(--surface-2); border-color: var(--line); }
.btn-danger { color: var(--bad); border-color: var(--line); background: var(--surface); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 13.5px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--brand-2); font-weight: 600; font-size: 12.5px;
  background: none; border: 0; padding: 0;
}
[data-theme="dark"] .link { color: var(--brand); }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.link .ico { width: 14px; height: 14px; }

/* --------------------------- Chips & badges ----------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 7px;
  border-radius: 6px;
  font-size: 10.2px; font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid transparent;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
[data-theme="dark"] .badge-accent { color: var(--accent); }
.badge-outline { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.badge-lg { height: 25px; padding: 0 9px; font-size: 11px; border-radius: 7px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.chip.ok .dot { background: var(--ok); }
.chip.warn .dot { background: var(--warn); }
.chip.bad .dot { background: var(--bad); }
.chip.info .dot { background: var(--info); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #f4f6eb; }
[data-theme="dark"] .chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.active .dot { background: currentColor; }
.chip-click { cursor: pointer; }
.chip-click:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip-click.active:hover { background: var(--brand); }
.count-pill {
  min-width: 20px; height: 19px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--warn);
}

/* ------------------------------ Avatars --------------------------------- */
.avatar {
  --av-bg: #2f6b52;
  position: relative;
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--av-bg);
  color: #f8f8ef;
  font-size: 11px; font-weight: 700;
  letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  overflow: visible;
}
.avatar.sm { width: 26px; height: 26px; font-size: 9.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.xl { width: 72px; height: 72px; font-size: 23px; border-radius: 22px; }
.avatar .status-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--muted);
}
.avatar.lg .status-dot, .avatar.xl .status-dot { width: 13px; height: 13px; right: 1px; bottom: 1px; }
.avatar-photo { overflow: hidden; background: var(--surface-2); }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-photo .status-dot { right: 0; bottom: 0; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person-cell .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-dot.ok, .dot.ok { background: var(--ok); }
.status-dot.warn, .dot.warn { background: var(--warn); }
.status-dot.bad, .dot.bad { background: var(--bad); }
.status-dot.info, .dot.info { background: var(--info); }
.status-dot.leave, .dot.leave { background: var(--violet); }
.status-dot.off, .dot.off { background: var(--muted); }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -7px; border: 2px solid var(--surface); width: 27px; height: 27px; font-size: 9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  margin-left: -7px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--surface);
  display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--ink-2);
}
.presence-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.presence-badge .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ------------------------------- Cards ---------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 13.5px; font-weight: 650; letter-spacing: -.005em; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card.subtle { background: var(--surface-2); box-shadow: none; }
.card.clickable { transition: border-color .15s, transform .15s, box-shadow .15s; }
.card.clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack-16 { display: grid; gap: 16px; }

/* KPI */
.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 18px 18px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  overflow: hidden;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .015em; }
.kpi-ico {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; background: var(--surface-2); color: var(--ink-2);
}
.kpi-ico .ico { width: 15px; height: 15px; }
.kpi-value { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; color: var(--muted); font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.kpi-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 650; color: var(--muted); }
.kpi-delta .ico { width: 13px; height: 13px; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta.flat { color: var(--muted); }
.kpi-spark { width: 92px; height: 30px; opacity: .9; }
.kpi-accent { background: var(--brand); color: #f3f8fd; border-color: var(--brand); }
.kpi-accent .kpi-label, .kpi-accent .kpi-delta { color: rgba(243,248,253,.66); }
.kpi-accent .kpi-value { color: #ffffff; }
.kpi-accent .kpi-ico { background: rgba(255,255,255,.1); color: var(--accent); }
[data-theme="dark"] .kpi-accent { background: linear-gradient(140deg, #0c2b45, #0a2237); border-color: #1d4867; }

/* ------------------------------ Tables ---------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.table th {
  text-align: left;
  font-size: 9.8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .cell-main { font-weight: 600; font-size: 12.9px; }
.table .cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.table td.right, .table th.right { text-align: right; }
.table.compact td { padding: 8px 12px; }
.table.compact th { padding: 8px 12px; }
.table tr.selected { background: var(--accent-soft); }
.table tr.selected:hover { background: var(--accent-soft); }
.table .check, .check {
  appearance: none;
  width: 15px; height: 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  display: inline-grid; place-items: center;
  cursor: pointer;
  flex: none;
  vertical-align: middle;
}
.check:checked { background: var(--brand); border-color: var(--brand); }
.check:checked::after { content: ""; width: 7px; height: 4px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(-45deg) translateY(-1px); }
[data-theme="dark"] .check:checked { background: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .check:checked::after { border-color: var(--accent-ink); }

.bulkbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--brand);
  color: #f3f8fd;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  animation: viewIn .18s ease;
}
[data-theme="dark"] .bulkbar { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong); }
.bulkbar .btn { height: 29px; font-size: 11.5px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
[data-theme="dark"] .bulkbar .btn { background: var(--surface); border-color: var(--line); color: var(--ink); }
.bulkbar .btn:hover { background: rgba(255,255,255,.18); }
.bulkbar .spacer { flex: 1; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 3px; }
.pager button {
  min-width: 27px; height: 27px; padding: 0 7px;
  display: inline-grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.pager button:hover { background: var(--surface-2); }
.pager button.active { background: var(--brand); color: #fff; }
[data-theme="dark"] .pager button.active { background: var(--accent); color: var(--accent-ink); }

/* Toolbar / filters */
.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.search-field {
  position: relative;
  display: flex; align-items: center;
  height: 34px;
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}
.search-field .ico { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-field input {
  width: 100%; height: 100%;
  padding: 0 12px 0 33px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-field input::placeholder { color: var(--muted); }
.search-field input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(63,138,102,.14); }
[data-theme="dark"] .search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67,224,143,.14); }
.select {
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-size: 12px; font-weight: 550;
  appearance: none;
  outline: none;
  color: var(--ink-2);
  max-width: 100%;
}
.select:focus { border-color: var(--brand-2); }
.toolbar .grow { flex: 1; }

/* Segmented tabs */
.tabs { display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border-radius: 10px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  height: 30px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.tab .count-pill { height: 17px; min-width: 17px; font-size: 9.5px; }
.tab.active .count-pill { background: var(--accent); color: var(--accent-ink); }

.tab-underline { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-underline::-webkit-scrollbar { display: none; }
.tab-underline button {
  position: relative;
  height: 38px; padding: 0 12px;
  background: none; border: 0;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
}
.tab-underline button:hover { color: var(--ink); }
.tab-underline button.active { color: var(--ink); }
.tab-underline button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-2); }
[data-theme="dark"] .tab-underline button.active::after { background: var(--accent); }

/* ------------------------------ Forms ----------------------------------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.input, .textarea, .form-select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.input:focus, .textarea:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(63,138,102,.13); }
[data-theme="dark"] .input:focus, [data-theme="dark"] .textarea:focus, [data-theme="dark"] .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67,224,143,.12); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 32px;
}
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 10.5px; color: var(--muted); }
.switch {
  appearance: none;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  cursor: pointer;
  flex: none;
  border: 1px solid var(--line-strong);
  transition: background .18s, border-color .18s;
}
.switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .18s;
}
.switch:checked { background: var(--brand); border-color: var(--brand); }
.switch:checked::after { transform: translateX(16px); }
[data-theme="dark"] .switch:checked { background: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .switch:checked::after { background: #1a2408; }

/* --------------------------- Progress etc. ------------------------------ */
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand-2); transition: width .5s cubic-bezier(.2,.8,.2,1); }
[data-theme="dark"] .bar > i { background: var(--accent); }
.bar.thin { height: 4px; }
.bar.thick { height: 9px; }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }
.bar > i.info { background: var(--info); }
.bar > i.accent { background: var(--accent); }
.progress-row { display: grid; gap: 6px; }
.progress-row .row { font-size: 11.5px; }

.metric-list { display: grid; gap: 13px; }
.metric-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.metric-line b { font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-bar { display: flex; align-items: center; gap: 10px; }
.metric-bar .bar { flex: 1; }

.stat-strip { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.stat-strip .stat { padding: 0 18px; border-left: 1px solid var(--line); }
.stat-strip .stat:first-child { border-left: 0; padding-left: 0; }
.stat-strip .stat:last-child { padding-right: 0; }
.stat .stat-k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.stat .stat-v { font-size: 17px; font-weight: 650; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .stat-v small { font-size: 10.5px; color: var(--muted); font-weight: 500; }

.empty-state { padding: 54px 24px; text-align: center; }
.empty-ico { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.empty-ico .ico { width: 22px; height: 22px; }
.empty-state h4 { font-size: 14px; margin-bottom: 4px; }
.empty-state p { font-size: 12px; color: var(--muted); max-width: 360px; margin: 0 auto 16px; }

/* ------------------------------ Charts ---------------------------------- */
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-line { width: 14px; height: 2px; border-radius: 2px; background: var(--chart-line); }
.legend-dash { width: 14px; height: 0; border-top: 2px dashed var(--brand-3); }
.area-chart { width: 100%; height: auto; overflow: visible; }
.area-chart text { font-family: var(--sans); font-size: 8.5px; fill: var(--muted); }
.area-chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.area-chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.area-chart .line2 { fill: none; stroke: var(--chart-alt); stroke-width: 1.6; stroke-dasharray: 4 4; opacity: .85; }
.area-chart .area { fill: var(--chart-fill); }
.area-chart .dot { fill: var(--surface); stroke: var(--chart-line); stroke-width: 2; }
.area-chart .target { stroke: var(--brand-3); stroke-width: 1.3; stroke-dasharray: 5 4; opacity: .75; }
.area-chart text.target-label { fill: var(--brand-3); font-weight: 600; }
.sparkline { overflow: visible; }
.sparkline path.l { fill: none; stroke: var(--chart-line); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sparkline path.a { fill: var(--chart-fill); stroke: none; }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 116px 1fr 54px; align-items: center; gap: 10px; font-size: 11.5px; }
.hbar .label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar .track { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand-2); border-radius: inherit; }
[data-theme="dark"] .hbar .track i { background: var(--accent); }
.hbar .track i.accent { background: var(--accent); }
.hbar .track i.warn { background: var(--warn); }

.donut {
  --p: 70;
  --c: var(--brand-2);
  width: 78px; height: 78px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center;
  flex: none;
}
.donut::before { content: ""; width: 60px; height: 60px; border-radius: 50%; background: var(--surface); grid-area: 1/1; }
.donut span { grid-area: 1/1; z-index: 1; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.spark-row { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark-row i { flex: 1; border-radius: 2px 2px 0 0; background: var(--brand-2); opacity: .3; min-height: 3px; }
.spark-row i.hot { opacity: .9; }
[data-theme="dark"] .spark-row i { background: var(--accent); }

/* ----------------------------- Empty / misc ----------------------------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.divider.soft { opacity: .6; }
.notice {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--info-soft);
  border: 1px solid transparent;
  font-size: 11.8px;
  line-height: 1.45;
  color: var(--ink-2);
}
.notice > span { flex: 1 1 200px; }
.notice .ico { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--info); }
.notice b { color: var(--ink); }
.notice.warn { background: var(--warn-soft); }
.notice.warn .ico { color: var(--warn); }
.notice.bad { background: var(--bad-soft); }
.notice.bad .ico { color: var(--bad); }
.notice.ok { background: var(--ok-soft); }
.notice.ok .ico { color: var(--ok); }
.notice.accent { background: var(--accent-soft); }
.notice.accent .ico { color: var(--accent-ink); }
[data-theme="dark"] .notice.accent .ico { color: var(--accent); }

.key-val { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 12.3px; }
.key-val dt { color: var(--muted); }
.key-val dd { margin: 0; color: var(--ink); font-weight: 500; }

.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 16px 22px; }
.timeline-item::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: -4px; width: 1px; background: var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-item::after { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline-item.hot::after { border-color: var(--brand-2); background: var(--brand-2); }
.timeline-item .t { font-size: 11.8px; line-height: 1.45; }
.timeline-item .d { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .sw { width: 14px; height: 9px; border-radius: 3px; display: inline-block; }

.list-rows { display: grid; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-main { min-width: 0; }
.list-row .row-title { display: block; font-size: 12.5px; font-weight: 600; }
.list-row .row-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.alias-rows { grid-template-columns: minmax(0, 1fr); }
.alias-rows .row-title, .alias-rows .row-sub { overflow-wrap: anywhere; }
.alias-rows .btn { flex: none; }

/* --------------------------- Messaging ---------------------------------- */
.ann-list { display: grid; }
.ann-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ann-row:last-child { border-bottom: 0; }
.ann-row:hover { background: var(--surface-2); }
.ann-main { flex: 1; min-width: 0; }
.ann-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; }
.ann-title .dot { width: 6px; height: 6px; }
.ann-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ann-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.receipt-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.receipt-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.receipt-row:last-child { border-bottom: 0; }
.chk-row { display: flex; gap: 16px; flex-wrap: wrap; }

.messages-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-items { display: grid; max-height: 560px; overflow-y: auto; }
.msg-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; color: var(--ink); cursor: pointer;
}
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover { background: var(--surface-2); }
.msg-item.selected { background: var(--accent-soft); }
.mi-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mi-top { display: flex; align-items: center; gap: 6px; }
.mi-name { font-size: 12px; font-weight: 650; }
.mi-subject { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-last { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-time { flex: none; font-size: 9.5px; color: var(--muted); }
.msg-body { display: grid; gap: 10px; padding: 16px 20px; }
.msg-bubble { max-width: 78%; justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.msg-bubble.me { justify-self: end; background: var(--brand); border-color: var(--brand); color: #fff; }
.msg-bubble.me .xs.muted, .msg-bubble.me .mb-head span { color: rgba(255,255,255,.72); }
.mb-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.mb-head b { font-size: 11px; }
.msg-bubble p { font-size: 12.5px; line-height: 1.6; white-space: pre-line; }
.msg-reply { display: flex; gap: 10px; align-items: flex-end; padding: 0 20px 18px; }
.msg-reply .textarea { flex: 1; }

/* ----------------------------- Sidebar collapse ------------------------- */
body.side-collapsed { --sidebar-w: 78px; }
body.side-collapsed .brand-text,
body.side-collapsed .scope-copy,
body.side-collapsed .scope-btn > svg,
body.side-collapsed .nav-label,
body.side-collapsed .nav-text,
body.side-collapsed .nav-badge,
body.side-collapsed .side-user,
body.side-collapsed .side-action,
body.side-collapsed .collapse-label { display: none; }
body.side-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.side-collapsed .brand-mark { display: grid; width: 38px; height: 38px; }
body.side-collapsed .scope-btn { justify-content: center; padding: 8px; }
body.side-collapsed .scope-glyph { width: 34px; height: 34px; }
body.side-collapsed .nav-item { justify-content: center; padding: 0; }
body.side-collapsed .nav-item.active::before { left: -14px; }
body.side-collapsed .sidebar-foot { justify-content: center; }
body.side-collapsed .sidebar-scroll { padding-left: 12px; padding-right: 12px; }
body.side-collapsed .nav-group { margin-top: 16px; }
body.side-collapsed .nav-group + .nav-group { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--side-line); }
.collapse-btn {
  position: absolute; right: 10px; top: 76px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--side-bg-2);
  border: 1px solid var(--side-line);
  color: var(--side-muted);
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.sidebar:hover .collapse-btn { opacity: 1; }
.collapse-btn:hover { color: var(--side-ink); }
.collapse-btn .ico { width: 12px; height: 12px; transition: transform .2s; }
body.side-collapsed .collapse-btn .ico { transform: rotate(180deg); }

/* ----------------------------- Mobile nav ------------------------------- */
.mobile-nav { display: none; }
.sidebar-backdrop { display: none; }

/* ------------------------------ Popover menus --------------------------- */
.popover-anchor { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 120;
  animation: menuIn .15s ease;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
.menu.left { right: auto; left: 0; }
.menu-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 10px 5px; font-weight: 700; }
.menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border: 0; border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 12.3px; font-weight: 550;
  text-align: left;
}
.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.menu-item.active { background: var(--accent-soft); color: var(--ink); }
.menu-item .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.menu-item.active .ico { color: var(--brand-2); }
[data-theme="dark"] .menu-item.active .ico { color: var(--accent); }
.menu-item .meta { margin-left: auto; font-size: 10px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-scroll { max-height: 280px; overflow: auto; }
.menu-foot { border-top: 1px solid var(--line); margin-top: 5px; padding: 8px 4px 3px; }
.menu-head { padding: 8px 10px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }

/* ------------------------------ Toasts ---------------------------------- */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--brand);
  color: #f5f7ec;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 12.3px;
  line-height: 1.4;
  pointer-events: auto;
  animation: toastIn .25s cubic-bezier(.2,.8,.2,1);
}
[data-theme="dark"] .toast { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong); }
.toast.out { animation: toastOut .2s ease forwards; }
.toast .t-ico { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent); }
.toast .t-body { flex: 1; }
.toast .t-title { display: block; font-weight: 650; }
.toast .t-sub { display: block; opacity: .68; font-size: 11px; margin-top: 2px; }
.toast .t-close { background: none; border: 0; color: inherit; opacity: .55; padding: 2px; }
.toast .t-close:hover { opacity: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ------------------------------ Overlay base ---------------------------- */
#overlay-root:empty { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(9, 16, 11, .44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 160;
  width: min(580px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: drawerIn .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: none;
}
.drawer-head .grow { min-width: 0; }
.drawer-head h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.drawer-sub { font-size: 11.8px; color: var(--muted); margin-top: 4px; }
.drawer-close { margin-left: auto; flex: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 22px 26px; }
.drawer-body.pad { padding-top: 18px; }
.drawer-foot {
  flex: none;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.drawer-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  margin: 0 -22px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.drawer-tabs::-webkit-scrollbar { display: none; }
.drawer-tabs button {
  height: 42px; padding: 0 12px;
  border: 0; background: none;
  font-size: 12px; font-weight: 600; color: var(--muted);
  position: relative; white-space: nowrap;
}
.drawer-tabs button.active { color: var(--ink); }
.drawer-tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand-2); border-radius: 2px; }
[data-theme="dark"] .drawer-tabs button.active::after { background: var(--accent); }

.modal-wrap {
  position: fixed; inset: 0; z-index: 160;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  pointer-events: none;
}
.modal {
  flex: none;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.modal.wide { width: min(760px, 100%); }
.modal.xwide { width: min(980px, 100%); }
.modal-head {
  padding: 18px 22px 14px;
  display: flex; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.modal-head p { font-size: 11.8px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 20px 22px; overflow-y: auto; overflow-x: hidden; }
.modal-body.flush { padding: 0; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: none; background: var(--surface); }
.modal-foot .left { margin-right: auto; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* Command palette */
.palette-wrap { position: fixed; inset: 0; z-index: 170; display: flex; justify-content: center; padding: 11vh 20px 20px; }
.palette {
  width: min(660px, 100%);
  height: fit-content;
  max-height: 70vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .18s cubic-bezier(.2,.8,.2,1);
}
.palette-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-input-row .ico { width: 19px; height: 19px; color: var(--muted); flex: none; }
.palette-input { flex: 1; border: 0; background: none; outline: none; font-size: 15px; }
.palette-input::placeholder { color: var(--muted); }
.palette-results { overflow-y: auto; padding: 6px 8px 10px; }
.palette-group-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 12px 5px; }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px;
  border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; text-align: left;
  cursor: pointer;
  font-size: 12.5px;
}
.palette-item:hover, .palette-item.sel { background: var(--surface-2); }
.palette-item .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.palette-item .p-main { flex: 1; min-width: 0; }
.palette-item .p-title { display: block; font-weight: 600; font-size: 12.5px; line-height: 1.35; }
.palette-item .p-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; line-height: 1.35; }
.palette-item .p-hint { font-size: 9.5px; color: var(--muted); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.palette-empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.palette-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.palette-foot .kbd { font-size: 9px; padding: 1px 4px; }

/* Notifications drawer */
.notif-item { display: flex; gap: 11px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.notif-ico .ico { width: 15px; height: 15px; }
.notif-ico.warn { background: var(--warn-soft); color: var(--warn); }
.notif-ico.bad { background: var(--bad-soft); color: var(--bad); }
.notif-ico.info { background: var(--info-soft); color: var(--info); }
.notif-ico.ok { background: var(--ok-soft); color: var(--ok); }
.notif-item .n-main { flex: 1; min-width: 0; }
.notif-item .n-title { font-size: 12.4px; font-weight: 600; }
.notif-item .n-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.notif-item .n-time { font-size: 9.8px; color: var(--muted); white-space: nowrap; }
.notif-item.unread { position: relative; }
.notif-item.unread::before { content: ""; position: absolute; left: -10px; top: 21px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-2); }
[data-theme="dark"] .notif-item.unread::before { background: var(--accent); }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.3px; }
.pref-row:last-child { border-bottom: 0; }
.pref-row span small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }

/* ----------------------------- Home ------------------------------------- */
.greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.greeting h1 { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 600; letter-spacing: -.03em; line-height: 1.08; }
.greeting .date { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.greeting .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.weather-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.weather-pill .ico { width: 13px; height: 13px; color: var(--warn); }

.needs-list { display: grid; }
.need-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.need-row:last-child { border-bottom: 0; }
.need-row:hover { background: var(--surface-2); }
.need-ico { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.need-ico.bad { background: var(--bad-soft); color: var(--bad); }
.need-ico.info { background: var(--info-soft); color: var(--info); }
.need-ico.ok { background: var(--ok-soft); color: var(--ok); }
.need-ico .ico { width: 16px; height: 16px; }
.need-row .need-main { flex: 1; min-width: 0; }
.need-row .need-title { font-size: 12.6px; font-weight: 600; }
.need-row .need-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.need-row .btn { opacity: .5; transition: opacity .15s; }
.need-row:hover .btn { opacity: 1; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 14px 6px; padding: 4px 2px 2px; }
.team-person { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; cursor: pointer; border: 0; background: none; padding: 2px 0; border-radius: 8px; }
.team-person:hover .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.team-person .tp-name { font-size: 9.5px; color: var(--ink-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-person .avatar { width: 36px; height: 36px; font-size: 11px; }
.team-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px; color: var(--muted); margin-top: 14px; }
.team-legend span { display: inline-flex; align-items: center; gap: 4px; }
.team-legend .dot { width: 6px; height: 6px; border-radius: 50%; }

.branch-league td { white-space: nowrap; }
.branch-league .bar { width: 86px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.rank { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.rank.top { background: var(--accent); color: var(--accent-ink); }
.trend-up { color: var(--ok); }
.trend-down { color: var(--bad); }

/* ----------------------------- People ----------------------------------- */
.avatar-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-cell .ac-main { min-width: 0; }
.avatar-cell .ac-name { font-weight: 600; font-size: 12.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-cell .ac-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .avatar { width: 30px; height: 30px; font-size: 10px; }

.profile-hero { display: flex; align-items: center; gap: 16px; padding: 18px 0 16px; }
.profile-hero .p-name { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.profile-hero .p-role { font-size: 12px; color: var(--muted); margin-top: 3px; }
.profile-hero .p-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.profile-section { padding-top: 18px; }
.profile-section h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.fact .k { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.fact .v { font-size: 12.3px; margin-top: 3px; font-weight: 550; }
.masked { letter-spacing: .08em; color: var(--muted); }
.att-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.att-mini .am { background: var(--surface-2); border-radius: 10px; padding: 10px 11px; }
.att-mini .am b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.att-mini .am span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.day-row { display: flex; gap: 5px; }
.day-cell { flex: 1; min-width: 0; text-align: center; }
.day-cell .dc-day { font-size: 9px; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.day-cell .dc-val { height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; }
.dc-val.ok { background: var(--ok-soft); color: var(--ok); }
.dc-val.late { background: var(--warn-soft); color: var(--warn); }
.dc-val.bad { background: var(--bad-soft); color: var(--bad); }
.dc-val.leave { background: var(--violet-soft); color: var(--violet); }
.dc-val.off { background: var(--surface-2); color: var(--muted); }

/* ------------------------------ Time ------------------------------------ */
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.device-name { display: flex; align-items: center; gap: 9px; }
.device-glyph { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.device-glyph .ico { width: 14px; height: 14px; }
.device-glyph.offline { background: var(--bad-soft); color: var(--bad); }
.device-glyph.online { background: var(--ok-soft); color: var(--ok); }
.device-glyph.degraded { background: var(--warn-soft); color: var(--warn); }
.health-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 9px; }
.heat-cell { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: var(--surface); }
.heat-cell .hc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.heat-cell .hc-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-cell .hc-sub { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.heat-dots { display: flex; gap: 3px; margin-top: 7px; }
.heat-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--ok); }
.heat-dots i.warn { background: var(--warn); }
.heat-dots i.bad { background: var(--bad); }
.heat-dots i.off { background: var(--surface-3); }

.punch-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.punch-row:last-child { border-bottom: 0; }
.punch-time { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 54px; flex: none; font-variant-numeric: tabular-nums; }
.punch-row .p-name { flex: 1; font-size: 12px; font-weight: 550; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.punch-row .p-device { font-size: 9.5px; color: var(--muted); }
.dir { font-size: 9px; font-weight: 750; padding: 2px 5px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); letter-spacing: .04em; }
.dir.out { background: var(--surface-2); color: var(--muted); }

.roster-table th, .roster-table td { text-align: center; }
.roster-table th:first-child, .roster-table td:first-child { text-align: left; }
.roster-table td { padding: 8px 6px; }
.roster-cell {
  width: 100%; min-width: 38px; height: 32px;
  display: grid; place-items: center;
  border-radius: 7px; border: 1px solid transparent;
  font-size: 9.5px; font-weight: 750; letter-spacing: .04em;
  background: transparent;
  color: var(--ink-2);
}
button.roster-cell:hover { border-color: var(--line-strong); background: var(--surface-2); }
.roster-cell.M { background: var(--ok-soft); color: var(--ok); }
.roster-cell.E { background: var(--info-soft); color: var(--info); }
.roster-cell.N { background: var(--violet-soft); color: var(--violet); }
.roster-cell.OFF { background: var(--surface-2); color: var(--muted); }
.roster-cell.empty { color: var(--muted); border: 1px dashed var(--line-strong); }
.roster-table .weekend { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

.calendar-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { text-align: center; padding: 5px 2px; border-radius: 6px; font-size: 10px; }
.cal-day.today { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal-day.has-leave { background: var(--violet-soft); color: var(--violet); font-weight: 650; }

/* ------------------------------- Pay ------------------------------------ */
.run-status { display: flex; align-items: center; gap: 6px; }
.state-trail { display: flex; align-items: center; gap: 0; margin: 4px 0 6px; }
.state-step { flex: 1; position: relative; text-align: center; padding-top: 17px; font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.state-step::before { content: ""; position: absolute; top: 3px; left: 50%; transform: translateX(-50%); width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); z-index: 1; }
.state-step::after { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 1px; background: var(--line); }
.state-step:first-child::after { left: 50%; }
.state-step:last-child::after { right: 50%; }
.state-step.done { color: var(--ink-2); }
.state-step.done::before { background: var(--brand-2); border-color: var(--brand-2); }
.state-step.done::after { background: var(--brand-2); }
.state-step.current { color: var(--ink); }
.state-step.current::before { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
[data-theme="dark"] .state-step.done::before, [data-theme="dark"] .state-step.current::before { background: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .state-step.done::after { background: var(--accent); }

.chunk-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.chunk { height: 22px; border-radius: 4px; background: var(--surface-3); display: grid; place-items: center; font-size: 8px; color: var(--muted); font-weight: 700; }
.chunk.done { background: var(--ok); color: #fff; }
.chunk.active { background: var(--accent); color: var(--accent-ink); animation: pulse 1.2s infinite; }
.chunk.fail { background: var(--bad); color: #fff; }
@keyframes pulse { 50% { opacity: .55; } }

.payslip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.payslip-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; background: var(--surface-2); }
.payslip-head .ps-logo { height: 20px; width: auto; display: block; margin-bottom: 8px; }
.payslip-head .ps-org { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.payslip-head .ps-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.payslip-cols { display: grid; grid-template-columns: 1fr 1fr; }
.payslip-col { padding: 14px 20px; }
.payslip-col + .payslip-col { border-left: 1px solid var(--line); }
.payslip-col h5 { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.payslip-line { display: flex; justify-content: space-between; gap: 10px; font-size: 11.8px; padding: 4px 0; }
.payslip-line span:last-child { font-variant-numeric: tabular-nums; font-weight: 550; }
.payslip-total { display: flex; justify-content: space-between; padding: 9px 20px; border-top: 1px solid var(--line); font-size: 12px; }
.payslip-total b { font-size: 13.5px; }
.payslip-total.net { background: var(--brand); color: #f6f8ed; }
[data-theme="dark"] .payslip-total.net { background: var(--surface-3); color: var(--ink); border-top: 1px solid var(--line-strong); }

.statutory-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.statutory-chip .sc-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex: none; }
.statutory-chip .sc-ico .ico { width: 14px; height: 14px; }
.statutory-chip .sc-v { font-size: 15px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.statutory-chip .sc-k { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ------------------------------- CRM ------------------------------------ */
.forecast-strip {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(130% 240% at 100% 0%, rgba(201, 240, 90, .17), transparent 48%),
    var(--brand);
  color: #f5f7ec;
  border: 1px solid rgba(255,255,255,.06);
}
.forecast-strip .f-label { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(245,247,236,.6); font-weight: 650; }
.forecast-strip .f-val { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.forecast-strip .f-div { width: 1px; align-self: stretch; background: rgba(255,255,255,.12); }
.forecast-strip .f-bar { flex: 1; min-width: 160px; }
.forecast-strip .bar { background: rgba(255,255,255,.15); }
.forecast-strip .bar > i { background: var(--accent); }
.forecast-strip .f-meta { display: flex; justify-content: space-between; font-size: 10px; color: rgba(245,247,236,.6); margin-top: 6px; }
[data-theme="dark"] .forecast-strip { background: radial-gradient(130% 240% at 100% 0%, rgba(67,224,143,.12), transparent 48%), #0b2237; }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-height: 120px;
  transition: background .15s, border-color .15s;
}
.kanban-col.dragover { border-color: var(--brand-2); background: var(--accent-soft); }
[data-theme="dark"] .kanban-col.dragover { border-color: var(--accent); background: rgba(67,224,143,.07); }
.kanban-col-head { display: flex; align-items: center; gap: 7px; padding: 2px 3px 10px; }
.kanban-col-head .kc-name { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.kanban-col-head .count-pill { margin-left: auto; }
.kanban-col-head .kc-total { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.stage-dot.lead { background: #8fa1b5; }
.stage-dot.qualified { background: var(--info); }
.stage-dot.proposal { background: var(--violet); }
.stage-dot.negotiation { background: var(--warn); }
.stage-dot.closed-won, .stage-dot.won { background: var(--ok); }
.stage-dot.closed-lost { background: var(--bad); }
.deal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.deal-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.deal-card:active { cursor: grabbing; }
.deal-card.dragging { opacity: .45; transform: rotate(1.5deg); }
.deal-card .dc-account { font-size: 12.4px; font-weight: 650; line-height: 1.25; }
.deal-card .dc-value { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -.02em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.deal-card .dc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.deal-card .dc-owner { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted); }
.deal-card .dc-owner .avatar { width: 18px; height: 18px; font-size: 7px; }
.deal-card .dc-tag { font-size: 9px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.deal-card .dc-tag.warn { color: var(--warn); font-weight: 650; }
.deal-card .dc-tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.kanban-empty { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 14px; text-align: center; font-size: 10px; color: var(--muted); }

.activity-item { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-ico { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.activity-ico .ico { width: 13px; height: 13px; }
.activity-item .a-main { flex: 1; min-width: 0; }
.activity-item .a-title { font-size: 12px; line-height: 1.4; }
.activity-item .a-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.account-card { padding: 16px; display: grid; gap: 12px; }
.account-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-family: var(--serif); font-size: 16px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }

/* ---------------------------- Reports ----------------------------------- */
.report-card { display: flex; align-items: flex-start; gap: 13px; padding: 16px; }
.report-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex: none; }
.report-ico .ico { width: 17px; height: 17px; }
.report-card .rc-main { flex: 1; min-width: 0; }
.report-card .rc-title { display: block; font-size: 12.8px; font-weight: 650; }
.report-card .rc-sub { display: block; font-size: 10.8px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.report-card .rc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.report-preview-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.report-preview-body { padding: 18px 20px; }

/* ---------------------------- Approvals --------------------------------- */
.approval-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.approval-card:last-child { border-bottom: 0; }
.approval-card:hover { background: var(--surface-2); }
.approval-main { flex: 1; min-width: 0; }
.approval-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.6px; font-weight: 650; }
.approval-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.approval-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 10.2px; color: var(--muted); margin-top: 8px; }
.approval-meta .sla { display: inline-flex; align-items: center; gap: 4px; }
.approval-meta .sla.warn { color: var(--warn); font-weight: 650; }
.approval-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.approval-actions .btn { height: 30px; font-size: 11.5px; padding: 0 10px; }
.approval-type { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.approval-type .ico { width: 16px; height: 16px; }
.type-leave { background: var(--violet-soft); color: var(--violet); }
.type-payroll { background: var(--ok-soft); color: var(--ok); }
.type-attendance { background: var(--warn-soft); color: var(--warn); }
.type-crm { background: var(--info-soft); color: var(--info); }
.type-finance { background: var(--accent-soft); color: var(--accent-ink); }
.type-remote { background: var(--surface-2); color: var(--ink-2); }

/* ------------------------------ Documents ------------------------------- */
.doc-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.doc-icon .ico { width: 15px; height: 15px; }
.doc-icon.pdf { background: var(--bad-soft); color: var(--bad); }
.doc-icon.signed { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------- Settings ------------------------------- */
.settings-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.org-tree { padding: 8px; }
.org-node { display: grid; }
.org-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  font-size: 12.2px;
  color: var(--ink-2);
  width: 100%;
}
.org-row:hover { background: var(--surface-2); }
.org-row.selected { background: var(--accent-soft); border-color: rgba(31,201,138,.5); color: var(--ink); }
.org-row .org-ico { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); flex: none; }
.org-row .org-ico .ico { width: 14px; height: 14px; }
.org-row.selected .org-ico { color: var(--brand-2); }
[data-theme="dark"] .org-row.selected .org-ico { color: var(--accent); }
.org-row .org-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-row .org-meta { margin-left: auto; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.org-children { padding-left: 20px; position: relative; }
.org-children::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 8px; width: 1px; background: var(--line); }

.inspector { padding: 20px; }
.inspector h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.inspector .ins-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ins-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.ins-stat { background: var(--surface-2); border-radius: 9px; padding: 10px 12px; }
.ins-stat b { display: block; font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ins-stat span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.perm { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px; font-size: 9.5px; font-weight: 700; }
.perm.x { background: var(--brand); color: #fff; }
.perm.ve { background: var(--info-soft); color: var(--info); }
.perm.v { background: var(--surface-2); color: var(--ink-2); }
.perm.none { color: var(--muted); }
.perm.a { background: var(--ok-soft); color: var(--ok); }
[data-theme="dark"] .perm.x { background: var(--accent); color: var(--accent-ink); }

.integration-card { display: flex; gap: 12px; padding: 15px 16px; align-items: flex-start; }
.int-logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); flex: none; }
.integration-card .int-main { flex: 1; min-width: 0; }
.integration-card .int-name { font-size: 12.6px; font-weight: 650; }
.integration-card .int-sub { font-size: 10.8px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.audit-row { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11.8px; }
.audit-row:last-child { border-bottom: 0; }
.audit-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.audit-ico .ico { width: 12px; height: 12px; }
.audit-row .a-main { flex: 1; min-width: 0; }
.audit-row .a-time { font-size: 9.8px; color: var(--muted); white-space: nowrap; }

/* ------------------------------- Wizard --------------------------------- */
.wizard-steps { display: flex; align-items: center; gap: 0; padding: 4px 0 18px; }
.wiz-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; font-size: 9.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wiz-step::after { content: ""; position: absolute; top: 9px; left: calc(50% + 11px); right: calc(-50% + 11px); height: 1px; background: var(--line); }
.wiz-step:last-child::after { display: none; }
.wiz-dot { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 9px; z-index: 1; }
.wiz-step.done .wiz-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.wiz-step.done { color: var(--ink-2); }
.wiz-step.active .wiz-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wiz-step.active { color: var(--ink); }
.wiz-step.done::after { background: var(--brand-2); }
[data-theme="dark"] .wiz-step.done .wiz-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.device-provision-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.device-provision-row .dp-main { flex: 1; min-width: 0; }

/* ------------------------------ Misc ------------------------------------ */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h3 { font-size: 13px; font-weight: 650; }
.section-head .sh-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.two-col-list { columns: 2; column-gap: 36px; }
.two-col-list li { break-inside: avoid; margin-bottom: 6px; }
.scroll-y { overflow-y: auto; }
.dot-sep { color: var(--line-strong); }

.meter { display: flex; align-items: center; gap: 8px; }
.meter .bar { flex: 1; min-width: 60px; }
.meter span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------- Grow ---------------------------------- */
.kpi-person {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 10px;
  background: none; text-align: left; color: var(--ink);
  transition: background .14s, border-color .14s;
}
.kpi-person:hover { background: var(--surface-2); }
.kpi-person.selected { border-color: var(--brand-2); background: var(--accent-soft); }
.kp-main { flex: 1; min-width: 0; display: grid; }
.kp-name { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-role { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.kp-score { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kp-score small { font-size: 9px; color: var(--muted); font-weight: 600; margin-left: 1px; }

.kpi-pack-head { display: flex; align-items: center; gap: 12px; }
.kpi-pack-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.kpi-pack-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.kpi-pack-stats b { display: block; font-size: 17px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-pack-stats small { font-size: 10px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi-rating-text { font-size: 13px !important; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.kpi-score-cell { display: flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-score-cell .meter { flex: 1; }
.kpi-lines td:last-child { width: 128px; }

.kpi-team-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 64px auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kpi-team-row:last-child { border-bottom: 0; }
.kpi-team-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kpi-team-person > div { min-width: 0; }
.kpi-team-bar { display: grid; gap: 5px; min-width: 0; }
.kpi-team-score { font-size: 17px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.kpi-team-score small { font-size: 9px; color: var(--muted); font-weight: 600; }

.kpi-home-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; }
.kpi-home-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; }
.kpi-home-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--brand-2); }
.kpi-home-ico .ico { width: 19px; height: 19px; }
.kpi-home-score { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-home-score small { font-size: 10px; color: var(--muted); font-weight: 600; margin: 0 6px 0 -8px; align-self: flex-end; padding-bottom: 3px; }

.kpi-form-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; }
.kpi-form-totals { display: flex; gap: 24px; }
.kpi-form-totals b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi-form-totals small { font-size: 10px; color: var(--muted); margin-left: 2px; }
.kpi-weight.ok { color: var(--ok); }
.kpi-weight.warn { color: var(--warn); }
.kpi-weight.bad { color: var(--bad); }
.kpi-line { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.kpi-line-head { display: flex; align-items: center; gap: 10px; }
.kpi-line-no { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.kpi-line-name { flex: 1; font-weight: 600; }
.kpi-auto { width: 46px; flex: none; text-align: center; padding: 7px 0; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-auto::after { content: " /5"; font-size: 9px; color: var(--muted); font-weight: 600; }
.kpi-line-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-top: 10px; }
.kpi-line .field label { font-size: 10px; }

/* Performance reviews */
.review-score { display: block; font-variant-numeric: tabular-nums; font-weight: 700; }
.review-band-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.kpi-pack-stats .review-score { font-size: 17px; font-weight: 800; margin-top: 2px; }
.review-section { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-top: 12px; background: var(--surface); }
.review-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.review-section h4 { font-size: 12.5px; font-weight: 700; }
.review-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.review-note { font-size: 12px; line-height: 1.55; color: var(--ink-2); margin-top: 5px; white-space: pre-line; }
.review-fields { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.review-fields .textarea, .review-fields .input, .review-fields .form-select { width: 100%; }
.review-goals { margin-top: 6px; }
.row-chev { display: inline-flex; color: var(--muted); }
.table tr.clickable:hover .row-chev { color: var(--ink); }
@media (max-width: 640px) {
  .review-fields { grid-template-columns: 1fr; }
  .review-section { padding: 11px 12px; }
}

@media (max-width: 700px) {
  .kpi-lines thead th:nth-child(2), .kpi-lines tbody td:nth-child(2),
  .kpi-lines thead th:nth-child(3), .kpi-lines tbody td:nth-child(3) { display: none; }
  .kpi-lines td:last-child { width: 74px; }
  .kpi-lines .meter { display: none; }
  .kpi-pack-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-team-row { grid-template-columns: minmax(0, 1fr) 56px auto; }
  .kpi-team-bar { display: none; }
  .kpi-line-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-form-totals { gap: 16px; }
  .review-table thead th:nth-child(2), .review-table tbody td:nth-child(2),
  .review-table thead th:nth-child(4), .review-table tbody td:nth-child(4),
  .review-table thead th:nth-child(5), .review-table tbody td:nth-child(5) { display: none; }
  .review-table .btn-group { flex-direction: column; align-items: stretch; }
  .kpi-home-card { gap: 10px; }
  .kpi-home-left { min-width: 100%; }
  .kpi-home-score { flex: 1; }
}

.kv-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.kv-table td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv-table tr:last-child td { border-bottom: 0; }
.kv-table td:first-child { color: var(--muted); width: 42%; }
.kv-table td:last-child { font-weight: 550; text-align: right; }

.callout-date { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.callout-date .ico { width: 12px; height: 12px; }

.scope-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.scope-line b { color: var(--ink); font-weight: 600; }

/* ---------------------------- Responsive -------------------------------- */
@media (max-width: 860px) {
  .messages-grid { grid-template-columns: minmax(0, 1fr); }
  .msg-items { max-height: none; }
  .ann-row { flex-wrap: wrap; }
  .ann-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .msg-bubble { max-width: 92%; }
  .tabs { flex-wrap: wrap; width: 100%; overflow: visible; }
}
@media (max-width: 1320px) {
  .content { padding: 22px 24px 64px; }
  .topbar { padding: 0 24px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .settings-layout { grid-template-columns: 290px minmax(0, 1fr); }
  .sync-pill { display: none; }
}
@media (max-width: 1120px) {
  :root { --sidebar-w: 78px; }
  .brand-text, .scope-copy, .scope-btn > svg, .nav-label, .nav-text, .nav-badge, .side-user, .side-action, .collapse-btn { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand-mark { display: grid; width: 38px; height: 38px; }
  .scope-btn { justify-content: center; padding: 8px; }
  .scope-glyph { width: 34px; height: 34px; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-foot { justify-content: center; }
  .sidebar-scroll { padding-left: 12px; padding-right: 12px; }
  .nav-group + .nav-group { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--side-line); }
  .top-search { width: 260px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; --topbar-h: 58px; }
  .app { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 264px; height: 100vh;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.2,.8,.2,1);
    z-index: 180;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 80px rgba(0,0,0,.4); }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 170; background: rgba(9,16,11,.5); backdrop-filter: blur(3px); }
  .sidebar .brand-text, .sidebar .scope-copy, .sidebar .scope-btn > svg, .sidebar .nav-label,
  .sidebar .nav-text, .sidebar .nav-badge, .sidebar .side-user, .sidebar .side-action, .sidebar .collapse-btn { display: revert; }
  .sidebar .brand { justify-content: flex-start; }
  .sidebar .brand-mark { display: none; }
  .sidebar .scope-btn { justify-content: flex-start; }
  .sidebar .nav-item { justify-content: flex-start; padding: 0 10px; }
  .sidebar .sidebar-foot { justify-content: flex-start; }
  .sidebar .nav-group + .nav-group { margin-top: 20px; padding-top: 0; border-top: 0; }
  .sidebar-close { display: inline-grid; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; gap: 8px; }
  .top-search { width: 34px; padding: 0; justify-content: center; border-color: transparent; background: transparent; flex: none; margin-left: auto; }
  .top-search .top-search-label, .top-search .kbd { display: none; }
  .top-search:hover { background: var(--surface-2); }
  .top-scope { display: inline-flex; }
  .crumbs { font-size: 11.5px; }
  .crumbs .crumb-root, .crumbs .sep { display: none; }
  .content { padding: 16px 14px 100px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .top-divider { display: none; }
  .kpi { min-height: 116px; padding: 14px; }
  .kpi-value { font-size: 26px; }
  .kpi-spark { width: 64px; height: 24px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100vw; }
  .modal-wrap { padding: 12px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 24px); border-radius: 16px; }
  .palette-wrap { padding: 6vh 12px 12px; }
  .mobile-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 90;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a, .mobile-nav button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    border: 0; background: none;
    padding: 5px 0;
    color: var(--muted);
    font-size: 9px; font-weight: 600;
    border-radius: 8px;
    position: relative;
  }
  .mobile-nav .ico { width: 19px; height: 19px; }
  .mobile-nav .active { color: var(--ink); }
  .mobile-nav .active::before { content: ""; position: absolute; top: 0; width: 16px; height: 2px; border-radius: 2px; background: var(--accent); }
  .mobile-nav .m-badge { position: absolute; top: 2px; right: calc(50% - 16px); width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
  .toast-root { bottom: calc(78px + env(safe-area-inset-bottom)); right: 12px; }
  .hide-sm { display: none !important; }
  .kanban { grid-auto-columns: 78vw; }
  .branch-league .bar { width: 60px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-strip .stat { padding: 0 12px; }
  .stat .stat-v { font-size: 15px; }
  .payslip-cols { grid-template-columns: 1fr; }
  .payslip-col + .payslip-col { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 .kpi:nth-child(n+3) { min-height: 100px; }
  .kpi-spark { display: none; }
  .hide-xs { display: none !important; }
  .top-scope { display: none; }
  .top-search { margin-left: 0; }
  .top-actions { margin-left: auto; }
  .page-title { font-size: 25px; }
  .greeting .actions { width: 100%; }
  .greeting .actions .btn { flex: 1; }
  .toolbar { padding: 12px 14px; }
  .search-field { max-width: none; min-width: 100%; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 14px 16px; }
  .card-foot { padding: 10px 16px; }
  .profile-hero { gap: 12px; }
  .profile-hero .p-name { font-size: 21px; }
  .att-mini { grid-template-columns: repeat(2, 1fr); }
  .fact-grid { grid-template-columns: minmax(0, 1fr); }
  .approval-card { flex-wrap: wrap; }
  .approval-actions { width: 100%; padding-left: 48px; }
  .ins-stats { grid-template-columns: repeat(3, 1fr); }
  .two-col-list { columns: 1; }
  .stat-strip .stat { padding: 6px 12px; border-left: 0; width: 50%; }
  .stat-strip .stat:nth-child(1), .stat-strip .stat:nth-child(2) { padding-top: 0; }
  .forecast-strip { gap: 14px; }
  .forecast-strip .f-div { display: none; }
  .forecast-strip .f-bar { flex-basis: 100%; }
  .heat-grid { grid-template-columns: repeat(2, 1fr); }
  .chunk-grid { grid-template-columns: repeat(6, 1fr); }
  .state-step { font-size: 8px; letter-spacing: .02em; padding-top: 15px; }
  .topbar .icon-btn.hide-mobile { display: none; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; row-gap: 8px; }
  .modal-foot > .xs { flex-basis: 100%; margin-right: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .drawer-head .drawer-close, .drawer-foot, .drawer-tabs, .scrim { display: none !important; }
  .drawer { position: static; width: 100%; box-shadow: none; border: 0; }
  .drawer-body { overflow: visible; padding: 0; }
  body { background: #fff; color: #000; }
}

/* ---------------------- Chart + matrix extras --------------------------- */
.serif { font-family: var(--serif); }
.chip-x {
  border: 0; background: none; padding: 0 0 0 2px;
  color: inherit; font-size: 13px; line-height: 1; cursor: pointer;
  opacity: .6;
}
.chip-x:hover { opacity: 1; }
.perm.c { background: var(--warn-soft); color: var(--warn); }
.perm.e { background: var(--accent-soft, var(--info-soft)); color: var(--brand-2); }
[data-theme="dark"] .perm.e { color: var(--accent); }

.columns {
  display: flex; align-items: flex-end; gap: 10px;
  min-height: 148px; padding: 8px 2px 0;
  border-bottom: 1px solid var(--line);
}
.column {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 4px; height: 140px;
}
.column .cv { font-size: 10px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.column i {
  display: block; width: 100%; max-width: 34px; min-height: 4px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  margin-top: auto;
}
.column .cl { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
[data-theme="dark"] .column i { background: linear-gradient(180deg, var(--accent), #12a594); }

.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
.funnel-row .fl { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-row .ft { height: 22px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.funnel-row .ft i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
[data-theme="dark"] .funnel-row .ft i { background: linear-gradient(90deg, #12a594, var(--accent)); }
.funnel-row .fv { font-size: 11px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Org tree rows */
.org-node { position: relative; }
.org-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 7px; background: none;
  text-align: left; font-size: 12px; color: var(--ink-2);
}
.org-row:hover { background: var(--surface-2); }
.org-row.selected { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.org-row .org-ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.org-row .org-ico .ico { width: 12px; height: 12px; }
.org-row.selected .org-ico { background: var(--brand); color: #fff; }
.org-row .org-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-row .org-meta { font-size: 10px; color: var(--muted); white-space: nowrap; }
.org-children { margin-left: 14px; padding-left: 8px; border-left: 1px dashed var(--line-strong); }
.org-tree { align-self: start; position: sticky; top: 14px; max-height: calc(100vh - 120px); overflow-y: auto; }

@media (max-width: 720px) {
  .funnel-row { grid-template-columns: 84px minmax(0, 1fr) 48px; }
  .org-tree { position: static; max-height: none; }
}

/* --------------------------- Icon baseline ------------------------------ */
.ico { width: 16px; height: 16px; flex: none; vertical-align: -2px; }
.empty-ico .ico, .drawer-head .ico, .palette-item .ico, .notif-ico .ico { vertical-align: middle; }

/* Accent KPI chart contrast */
.kpi-accent .sparkline path.l { stroke: rgba(243,248,253,.9); }
.kpi-accent .sparkline path.a { fill: rgba(31,201,138,.22); }
.kpi-accent .sparkline circle { fill: var(--accent); }

/* -------------------------------- Login --------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: clamp(16px, 3vw, 40px);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(18, 165, 148, .10), transparent 55%),
    radial-gradient(100% 90% at 100% 100%, rgba(31, 201, 138, .08), transparent 50%),
    var(--bg);
}
.login-grid {
  flex: 1; width: 100%; max-width: 1160px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(20px, 4vw, 56px); align-items: center;
}
.login-hero { min-width: 0; }
.login-logo { height: 44px; width: auto; margin-bottom: 30px; }
.login-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-2); margin-bottom: 10px; }
.login-hero .display { font-size: clamp(52px, 8vw, 88px); line-height: .95; color: var(--brand); }
.login-hero .display em { font-style: normal; color: var(--accent); }
.login-lede { max-width: 44ch; margin-top: 18px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.login-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 30px; }
.login-facts div { display: flex; align-items: baseline; gap: 7px; }
.login-facts b { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.login-facts span { font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

.login-card { width: 100%; max-width: 420px; justify-self: end; padding: clamp(20px, 2.4vw, 30px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.login-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.login-card-head img { width: 34px; height: 34px; object-fit: contain; }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: .02em; color: var(--ink-2); }
.login-form input[type="email"], .login-form input[type="password"] {
  height: 42px; padding: 0 12px; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
}
.login-form input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(14, 116, 144, .14); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.check-row { flex-direction: row !important; align-items: center; gap: 7px !important; font-weight: 500 !important; color: var(--muted) !important; }
.btn-block { width: 100%; justify-content: center; }
.login-note { display: flex; gap: 9px; margin-top: 16px; padding: 11px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.login-note .ico { width: 14px; height: 14px; margin-top: 2px; color: var(--brand-2); }
.login-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.login-foot {
  width: 100%; max-width: 1160px; margin: 24px auto 0;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
[data-theme="dark"] .login-hero .display { color: #e8f1fa; }
[data-theme="dark"] .login-wrap { background: radial-gradient(120% 100% at 0% 0%, rgba(18,165,148,.14), transparent 55%), radial-gradient(100% 90% at 100% 100%, rgba(67,224,143,.09), transparent 50%), var(--bg); }

@media (max-width: 900px) {
  .login-grid { grid-template-columns: 1fr; gap: 26px; align-content: center; }
  .login-hero { text-align: left; }
  .login-logo { margin-bottom: 20px; }
  .login-card { justify-self: stretch; max-width: none; }
  .login-hero .display { font-size: 52px; }
  .login-facts { margin-top: 20px; }
}
@media (max-width: 560px) {
  .login-wrap { padding: 18px 16px 22px; }
  .login-logo { height: 34px; margin-bottom: 16px; }
  .login-hero .display { font-size: 44px; }
  .login-lede { font-size: 13.5px; margin-top: 12px; }
  .login-facts { gap: 10px 18px; }
  .login-facts b { font-size: 22px; }
  .login-foot { flex-direction: column; gap: 4px; margin-top: 18px; }
}

/* ---------------------------- Small phones ------------------------------ */
@media (max-width: 430px) {
  body { overflow-x: hidden; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-4 .kpi { padding: 12px; min-height: 0; }
  .grid-4 .kpi:nth-child(n+3) { min-height: 0; }
  .greeting .actions .btn, .page-head .actions .btn {
    flex: 1 1 0; min-width: 0;
    padding: 0 10px; font-size: 12px;
  }
  .mobile-nav a, .mobile-nav button { min-width: 0; }
  .crumbs { min-width: 0; overflow: hidden; }
  .crumbs .current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi-value { font-size: 24px; }
  .content { padding-left: 12px; padding-right: 12px; }
}

/* ------------------------------ Photo upload ---------------------------- */
.photo-crop {
  position: relative;
  width: 300px; height: 300px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.photo-crop.dragging { cursor: grabbing; }
.photo-crop img { position: absolute; display: block; pointer-events: none; }
.photo-zoom-row { display: flex; align-items: center; gap: 10px; max-width: 340px; margin: 14px auto 0; }
.photo-zoom-row .range { flex: 1; accent-color: var(--accent); }
.photo-variants { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.photo-empty {
  text-align: center;
  padding: 26px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--surface-2);
}
.photo-empty-ico {
  display: inline-flex; width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.photo-empty-ico svg { width: 22px; height: 22px; }

/* ----------------------------- Go-live checklist ------------------------ */
.go-live-list { display: grid; }
.go-live-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.go-live-row:last-child { border-bottom: 0; }
.go-live-check {
  flex: none;
  width: 21px; height: 21px;
  margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.go-live-check svg { width: 13px; height: 13px; }
.go-live-check:hover { border-color: var(--accent); }
.go-live-row.done .go-live-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.go-live-main { flex: 1; min-width: 0; }
.go-live-text { display: block; font-size: 12px; line-height: 1.45; }
.go-live-row.done .go-live-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.go-live-meta { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.go-live-meta .chip { font-size: 10px; padding: 1px 7px; }

/* ------------------------------ Import tables --------------------------- */
.import-template-table { min-width: 560px; }
.import-table { min-width: 580px; }
.import-history-table { min-width: 680px; }

.wizard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px; }
.wizard-stats .card { padding: 10px 12px; }
.wizard-stats .kpi-label { font-size: 10px; }
.wizard-stats .kpi-value { font-size: 20px !important; margin-top: 2px; }

/* ------------------------- Access & role sign-in ------------------------ */
.scope-btn.static { cursor: default; }
.scope-btn.static:hover { background: inherit; }

.login-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; max-width: 46ch; }
.login-points li { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.login-points .ico { width: 17px; height: 17px; margin-top: 2px; color: var(--brand-2); flex: none; }
.login-points b { color: var(--ink); font-weight: 650; }
.login-status {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 26px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.login-card { max-width: 470px; }
.login-secure {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ok);
}
.login-secure .ico { width: 13px; height: 13px; }
.login-input { position: relative; display: flex; align-items: center; }
.login-input .ico {
  position: absolute; left: 12px; width: 15px; height: 15px;
  color: var(--muted); pointer-events: none;
}
.login-form .login-input input { width: 100%; padding-left: 36px; }
.login-error {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 11px; border-radius: 9px;
  background: rgba(176, 60, 45, .08); border: 1px solid rgba(176, 60, 45, .22);
  color: var(--bad); font-size: 11px; line-height: 1.45;
}
.login-error .ico { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 12px; color: var(--muted);
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.demo-group-label { display: flex; align-items: center; justify-content: space-between; margin: 11px 2px 5px; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.demo-group-label:first-child { margin-top: 2px; }
.demo-group-label span:last-child { font-weight: 650; letter-spacing: 0; }
.demo-tile {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 9px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.demo-tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.demo-main {
  grid-column: 1 / -1;
  border-color: var(--brand-2);
  background: linear-gradient(105deg, var(--accent-soft), var(--surface) 70%);
}
.demo-tile-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--brand-2);
}
.demo-tile-ico .ico { width: 15px; height: 15px; }
.demo-main .demo-tile-ico { background: var(--brand); color: var(--surface); }
.demo-tile-main { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.demo-tile-main b { font-size: 10.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-tile-main span { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* HOD visibility editor */
.access-card { margin-bottom: 0; }
.access-body { padding: 2px 18px 16px; }
.access-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.access-col { min-width: 0; }
.access-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0 8px; border-bottom: 1px solid var(--line);
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.access-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.access-row:last-child { border-bottom: 0; }
.access-row.locked { cursor: default; }
.access-ico {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--brand-2);
}
.access-ico .ico { width: 14px; height: 14px; }
.access-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.access-main b { font-size: 11.5px; font-weight: 650; }
.access-main span { font-size: 10px; color: var(--muted); line-height: 1.4; }
.access-row .switch { flex: none; }
.access-row.locked .switch { opacity: .45; pointer-events: none; }
.access-lock { width: 14px; height: 14px; color: var(--muted); flex: none; }
.access-scopes { display: grid; gap: 7px; padding-top: 9px; }
.access-scope {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 36px 9px 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.access-scope b { font-size: 11px; }
.access-scope span { font-size: 9.5px; color: var(--muted); }
.access-scope.selected { border-color: var(--accent); background: var(--accent-soft); }
.access-scope:disabled { cursor: default; opacity: .8; }
.access-scope-tick { position: absolute; right: 11px; top: 11px; width: 15px; height: 15px; color: var(--brand-2); }
.access-sensitive { display: grid; }
@media (max-width: 900px) { .access-columns { grid-template-columns: 1fr; gap: 12px; } }

/* Staff form intake */
.intake-card { margin-bottom: 16px; }
.intake-body { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; padding: 2px 18px 16px; }
.intake-left, .intake-right { min-width: 0; }
.intake-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.form-drop {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
}
.form-drop:hover, .form-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.form-drop-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--brand-2);
}
.form-drop-ico .ico { width: 20px; height: 20px; }
.form-drop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.form-drop-main b { font-size: 12.5px; font-weight: 650; }
.form-drop-main span { font-size: 10.5px; color: var(--muted); }
.form-drop-sm { padding: 11px 12px; border-radius: 11px; }
.form-drop-sm .form-drop-ico { width: 34px; height: 34px; border-radius: 9px; }
.form-drop-sm .form-drop-ico .ico { width: 16px; height: 16px; }
.intake-link { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.intake-link label { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.intake-link em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; }
.intake-link .select { flex: 1; min-width: 0; }
.intake-tips { display: grid; gap: 5px; margin-top: 11px; font-size: 10px; color: var(--muted); }
.intake-tips span { display: flex; align-items: center; gap: 7px; }
.intake-tips .ico { width: 12px; height: 12px; flex: none; }
.form-files { display: grid; gap: 6px; margin-top: 4px; max-height: 250px; overflow: auto; }
.form-file {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.form-file-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--brand-2);
}
.form-file-ico .ico { width: 15px; height: 15px; }
.form-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.form-file-main b { font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-file-main span { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-file .chip { font-size: 9px; }
.form-file-actions { display: flex; gap: 1px; flex: none; }
.form-file-actions .icon-btn { width: 26px; height: 26px; }
.form-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 4px; padding: 26px 14px; text-align: center;
  border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); font-size: 11px;
}
.form-empty .ico { width: 26px; height: 26px; color: var(--line-strong); }
@media (max-width: 900px) { .intake-body { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .form-file .chip, .form-file > .badge { display: none; }
  .form-drop { padding: 13px; }
}
@media (max-width: 480px) { .form-drop .btn { display: none; } }

/* Staff self-service */
.me-hero {
  display: grid; grid-template-columns: 1.25fr auto; gap: 14px 22px;
  align-items: center; padding: 20px;
}
.me-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.me-hero-main h1 { font-size: clamp(22px, 2.4vw, 30px); margin: 6px 0 6px; font-family: var(--serif); }
.me-hero-main h2 { font-size: 22px; }
.me-hero-side { display: flex; gap: 22px; flex-wrap: wrap; }
.me-fact { display: flex; flex-direction: column; }
.me-fact b { font-size: 12.5px; }
.me-fact span { font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.me-hero > .btn-group, .profile-hero-card > .btn-group {
  grid-column: 1 / -1; justify-content: flex-start;
  border-top: 1px solid var(--line); padding-top: 13px;
}
.me-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.profile-hero-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.leave-ring {
  width: 96px; height: 96px; border-radius: 50%; margin: 4px auto 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 7px solid var(--accent-soft); background: var(--surface);
}
.leave-ring b { font-size: 25px; font-family: var(--serif); line-height: 1; }
.leave-ring span { font-size: 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 3px; }
@media (max-width: 900px) {
  .me-hero { grid-template-columns: 1fr; }
  .me-hero-side { gap: 16px; }
  .me-grid { grid-template-columns: 1fr; }
}

/* -------------------------------- Queries ------------------------------- */
.query-block {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-2);
  border-radius: 10px;
  background: var(--surface-2);
}
.query-block.ok { border-left-color: var(--ok); }
.query-block-label {
  font-size: 9px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.query-subject { font-size: 14px; font-weight: 650; color: var(--ink); }
.query-statement {
  font-size: 12.5px; line-height: 1.65; color: var(--ink-2);
  margin-top: 7px; white-space: pre-line;
}
.queries-table .cell-main { font-size: 12.5px; }
.queries-table .cell-sub { white-space: nowrap; }
.queries-table th:first-child { width: 36%; }
.queries-table .col-raised { width: 16%; }
.queries-table .col-raised .cell-main { white-space: nowrap; }
.queries-table .col-due { white-space: nowrap; }
@media (max-width: 1120px) {
  .queries-table .col-raised, .queries-table .col-cat { display: none; }
  .queries-table th:first-child { width: 42%; }
  .queries-table .col-person .cell-sub { display: none; }
  .queries-table .col-person .cell-main { white-space: nowrap; }
}
@media (max-width: 640px) {
  .queries-table .col-person, .queries-table .col-due { display: none; }
  .queries-table .cell-sub { white-space: normal; }
}

/* ------------------------------ Work reports ---------------------------- */
.wr-periods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.reports-table .cell-main { font-size: 12.5px; }
.reports-table th:first-child { width: 34%; }
.reports-table .col-person { width: 20%; }
.reports-table .col-person .cell-main { white-space: nowrap; }
.reports-table .col-submitted, .reports-table .col-reviewer { white-space: nowrap; }
.reports-table .col-reviewer .cell-sub { white-space: nowrap; }
.work-block {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-2);
  border-radius: 10px;
  background: var(--surface-2);
}
.work-block.warn { border-left-color: var(--warn); }
.work-block.ok { border-left-color: var(--ok); }
.work-label {
  font-size: 9px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.work-text { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); white-space: pre-line; }
.work-list { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
@media (max-width: 1120px) {
  .reports-table .col-reviewer { display: none; }
  .reports-table th:first-child { width: 40%; }
}
@media (max-width: 640px) {
  .reports-table .col-person, .reports-table .col-submitted { display: none; }
  .reports-table .cell-sub { white-space: normal; }
}

/* ---------------------------------- Mail -------------------------------- */
.mail-table { table-layout: fixed; }
.mail-table th:first-child { width: 26%; }
.mail-table .col-mail-from .person-cell { align-items: center; gap: 8px; min-width: 0; }
.mail-table .col-mail-from .person-cell > div { min-width: 0; }
.mail-table .col-mail-from .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-table td:nth-child(2) .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-table td:nth-child(2) .cell-sub {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mail-table .col-mail-box { width: 104px; }
.mail-table .col-mail-when { width: 116px; white-space: nowrap; }
.mail-table .col-actions { width: 48px; }
.mail-table tr.is-unread { background: var(--accent-soft); }
.mail-table tr.is-unread .cell-main { font-weight: 600; }
.mail-table .col-mail-when .cell-sub { display: inline-flex; align-items: center; gap: 4px; }
.mail-table .col-mail-when .cell-sub .ico { width: 12px; height: 12px; }
.unread-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: transparent; border: 1px solid var(--line); display: inline-block;
}
.unread-dot.on { background: var(--brand-2); border-color: var(--brand-2); }
.mail-address { display: flex; align-items: center; gap: 10px; }
.mail-address-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--brand-2);
}
.mail-address-ico .ico { width: 18px; height: 18px; }
.mail-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mail-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 11px; line-height: 1.55; color: var(--muted);
}
.mail-note .ico { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.mail-server-edit {
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.mail-server-edit summary {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 12.5px; font-weight: 620; color: var(--ink-2);
}
.mail-server-edit summary .ico { width: 14px; height: 14px; }
.mail-server-edit .form-grid { margin-top: 12px; }
.mail-server-edit > p { margin: 10px 0 0; }
.mail-body { margin-top: 14px; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.mail-body p { margin: 0 0 12px; white-space: pre-line; }
.mail-attach {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.mail-attach > .ico { width: 18px; height: 18px; color: var(--brand-2); flex: none; }
.mail-attach > span { flex: 1; min-width: 0; display: grid; }
.mail-attach > span b { font-size: 12.5px; }
.mail-attach > span span { font-size: 11px; color: var(--muted); }
.from-line {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 12px;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.from-line .ico { width: 14px; height: 14px; }
.from-line b { color: var(--ink); }
.notice-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mail-layout { margin-top: 0; }
@media (max-width: 1120px) {
  .mail-table .col-mail-box { display: none; }
  .mail-table th:first-child { width: 32%; }
}
@media (max-width: 640px) {
  .mail-table .col-mail-when { width: 92px; }
  .mail-table th:first-child { width: 40%; }
  .mail-table .col-mail-when .cell-sub { display: none; }
}

/* settings → email */
.shared-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.shared-row:last-child { border-bottom: 0; }
.shared-main { flex: 1; min-width: 0; }
.shared-row .avatar-stack { flex: none; }
.shared-row .btn { flex: none; }
.card .list-row .access-ico { flex: none; }
@media (max-width: 720px) {
  .shared-row { flex-wrap: wrap; }
  .shared-row .avatar-stack { order: -1; display: none; }
  .shared-row .btn, .shared-row > .xs { margin-left: auto; }
}
.email-addr-sub { display: none; }
@media (max-width: 720px) {
  .email-directory-table th:nth-child(2), .email-directory-table td:nth-child(2),
  .email-directory-table th:nth-child(4), .email-directory-table td:nth-child(4),
  .email-directory-table th:nth-child(5), .email-directory-table td:nth-child(5) { display: none; }
  .email-directory-table { table-layout: fixed; width: 100%; }
  .email-directory-table th:nth-child(1), .email-directory-table td:nth-child(1) { width: 62%; }
  .email-directory-table th:nth-child(3), .email-directory-table td:nth-child(3) { width: 38%; }
  .email-directory-table .email-addr-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; margin-top: 2px; }
  .email-directory-table .badge { font-size: 10px; }
}

/* mail polish — labels, folders, sync */
.mail-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.label-chip {
  font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-2); background: var(--accent-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px;
}
.mail-label-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 16px 0; }
.mail-filter-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 11px; cursor: pointer;
}
.mail-filter-chip:hover { border-color: var(--brand-2); color: var(--ink); }
.mail-filter-chip.active { background: var(--accent-soft); border-color: var(--brand-2); color: var(--ink); font-weight: 600; }
.mail-filter-chip .muted { font-size: 10px; margin-left: 2px; }
.mail-sync {
  margin: 12px 16px 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  font-size: 11.5px; color: var(--ink-2);
}
.mail-sync-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.mail-sync .ico { width: 14px; height: 14px; }
.mail-folders { display: flex; flex-direction: column; gap: 2px; }
.mail-folder-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: none; padding: 8px; border-radius: 8px;
  font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer; text-align: left;
}
.mail-folder-row:hover { background: var(--surface-2); }
.mail-folder-row.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.mail-folder-row .ico { width: 14px; height: 14px; flex: none; }
.mail-folder-row b { margin-left: auto; font-size: 11px; color: var(--muted); }
.mail-label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.mail-label-row .eyebrow { margin-right: 2px; }

/* ------------------------------- team chat ------------------------------- */
.chat-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 288px;
  gap: 16px;
  align-items: start;
}
.chat-rail,
.chat-main,
.chat-side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chat-rail {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 258px);
  min-height: 520px;
  overflow: hidden;
}
.chat-rail-top { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.chat-rail-title { display: flex; flex-direction: column; gap: 1px; }
.chat-rail-title b { font-size: 17px; letter-spacing: -.01em; }
.chat-rail-actions { display: flex; gap: 6px; }
.chat-rail-actions .btn { flex: 1; justify-content: center; }
.chat-search-field { max-width: none; width: 100%; }
.chat-rail-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.chat-group + .chat-group { margin-top: 12px; }
.chat-group-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 4px; }
.chat-channel {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: none; border-radius: 9px; padding: 7px 8px;
  font: inherit; text-align: left; cursor: pointer; color: var(--ink-2);
}
.chat-channel:hover { background: var(--surface-2); }
.chat-channel.active { background: var(--accent-soft); color: var(--ink); }
.chat-channel.has-unread .chat-channel-top b { font-weight: 800; color: var(--ink); }
.chat-channel-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chat-channel-ico.private { color: var(--violet); background: var(--violet-soft); border-color: transparent; }
.chat-channel-ico.announcement { color: var(--info); background: var(--info-soft); border-color: transparent; }
.chat-glyph { font-weight: 700; font-size: 15px; display: inline-grid; place-items: center; }
.chat-glyph.lock, .chat-glyph.zap { width: 28px; height: 28px; border-radius: 8px; }
.chat-glyph.lock { color: var(--violet); background: var(--violet-soft); }
.chat-glyph.zap { color: var(--info); background: var(--info-soft); }
.chat-glyph .ico { width: 14px; height: 14px; }
.chat-channel-ava { position: relative; flex: none; display: inline-flex; }
.chat-channel-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.chat-channel-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.chat-channel-top b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-kind-tag { font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; flex: none; }
.chat-channel-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread { margin-left: auto; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.chat-channel-when { margin-left: auto; flex: none; font-size: 9.5px; color: var(--muted); }
.chat-rail-foot { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); line-height: 1.45; background: var(--surface-2); }
.chat-rail-foot .ico { width: 13px; height: 13px; flex: none; margin-top: 1px; }

.presence-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--line-strong); }
.presence-dot.office { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }
.presence-dot.remote-verified { background: var(--info); box-shadow: 0 0 0 2px var(--info-soft); }
.presence-dot.remote-unverified { background: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
.presence-dot.away { background: var(--amber, var(--warn)); box-shadow: 0 0 0 2px var(--amber-soft, var(--warn-soft)); }
.presence-dot.offline { background: var(--line-strong); }
.presence-dot.on-avatar { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border: 2px solid var(--surface); box-shadow: none; }
.presence-dot.static { box-shadow: none; }

.chat-main { display: flex; flex-direction: column; height: calc(100vh - 258px); min-height: 520px; overflow: hidden; }
.chat-head { border-bottom: 1px solid var(--line); padding: 12px 16px; }
.chat-head-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chat-head-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-head-title .chat-glyph { font-size: 19px; }
.chat-head-title .chat-glyph.lock, .chat-head-title .chat-glyph.zap { width: 34px; height: 34px; }
.chat-head-title .chat-glyph .ico { width: 17px; height: 17px; }
.chat-head-ava { position: relative; display: inline-flex; }
.chat-title { font-size: 17px; margin: 0; letter-spacing: -.01em; line-height: 1.2; }
.chat-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 2px; }
.chat-sub .badge { font-size: 9px; }
.presence-inline { display: inline-flex; align-items: center; gap: 5px; }
.dot-sep { color: var(--line-strong); }
.chat-head-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.chat-member-stack .avatar { width: 24px; height: 24px; font-size: 9px; }
.chat-member-stack { margin-right: 2px; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 8px; scroll-behavior: smooth; }
.chat-scroll, .chat-rail-scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.chat-scroll::-webkit-scrollbar, .chat-rail-scroll::-webkit-scrollbar { width: 7px; }
.chat-scroll::-webkit-scrollbar-thumb, .chat-rail-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.chat-scroll::-webkit-scrollbar-track, .chat-rail-scroll::-webkit-scrollbar-track { background: transparent; }
.chat-day { display: flex; align-items: center; gap: 10px; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 2px 0 14px; }
.chat-day::before, .chat-day::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.chat-msg { display: flex; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 10px; position: relative; border-left: 2px solid transparent; }
.chat-msg:hover { background: var(--surface-2); }
.chat-msg.unread { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.chat-msg.system { background: var(--info-soft); border-left-color: var(--info); }
.chat-msg.mine .chat-text { color: var(--ink); }
.chat-ava { flex: none; padding-top: 1px; }
.chat-bot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--info); color: #fff; }
.chat-bot .ico { width: 15px; height: 15px; }
.chat-body { min-width: 0; flex: 1; }
.chat-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.chat-meta b { font-size: 12.5px; }
.chat-meta .badge { font-size: 8.5px; }
.chat-private-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; color: var(--violet); margin-left: auto; }
.chat-private-tag .ico { width: 10px; height: 10px; }
.chat-text { font-size: 13px; line-height: 1.55; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-mention { background: var(--accent-soft); color: var(--ink); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.chat-files { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.chat-file {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; width: fit-content; max-width: 100%;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 11.5px;
}
.chat-file > .ico { width: 16px; height: 16px; color: var(--info); flex: none; }
.chat-file-main { display: flex; flex-direction: column; min-width: 0; }
.chat-file-main b { font-size: 11.5px; overflow-wrap: anywhere; }
.chat-file-main span, .chat-file-main small { font-size: 10px; color: var(--muted); }
.chat-file .badge { flex: none; }
.chat-link-chip, .chat-task-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; margin-right: 6px;
  padding: 3px 8px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); font-size: 10px;
}
.chat-link-chip .ico, .chat-task-chip .ico { width: 11px; height: 11px; }
.chat-task-chips { display: flex; flex-wrap: wrap; }
.chat-reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chat-reaction {
  display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; cursor: pointer;
}
.chat-reaction b { font-size: 10px; color: var(--muted); }
.chat-reaction.mine { background: var(--accent-soft); border-color: var(--brand-2); }
.chat-reaction.mine b { color: var(--ink-2); }
.chat-react-picker { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.chat-react-picker button { border: 0; background: none; font-size: 14px; padding: 2px 4px; border-radius: 999px; cursor: pointer; }
.chat-react-picker button:hover { background: var(--surface-2); }
.chat-msg-actions { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .12s; }
.chat-msg:hover .chat-msg-actions, .chat-msg:focus-within .chat-msg-actions { opacity: 1; }
.chat-mini {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 10px; padding: 3px 5px; border-radius: 6px; cursor: pointer;
}
.chat-mini .ico { width: 12px; height: 12px; }
.chat-mini:hover { background: var(--surface-3); color: var(--ink); }
.chat-thread-link {
  display: flex; align-items: center; gap: 7px; margin-top: 6px; padding: 5px 8px; width: fit-content; max-width: 100%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  font: inherit; font-size: 10.5px; color: var(--muted); cursor: pointer; text-align: left;
}
.chat-thread-link b { color: var(--ink-2); }
.chat-thread-link .ico { width: 12px; height: 12px; flex: none; }
.chat-thread { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.chat-thread-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.chat-thread-head span { display: inline-flex; align-items: center; gap: 6px; }
.chat-thread-head .ico { width: 12px; height: 12px; }
.chat-thread-list { padding: 8px 10px 2px; display: flex; flex-direction: column; gap: 9px; max-height: 240px; overflow-y: auto; }
.chat-thread-row { display: flex; gap: 8px; }
.chat-thread-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.chat-thread-meta span { color: var(--muted); font-size: 9.5px; }
.chat-thread-text { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.chat-thread-empty { font-size: 11px; color: var(--muted); padding: 8px 10px; margin: 0; }
.chat-thread-compose { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.chat-thread-compose .input { flex: 1; min-width: 0; }

.chat-composer { border-top: 1px solid var(--line); padding: 10px 12px 9px; background: var(--surface); }
.chat-compose-row { display: flex; align-items: flex-end; gap: 7px; }
.chat-input { flex: 1; min-width: 0; min-height: 38px; max-height: 120px; resize: vertical; font-size: 13px; padding: 9px 11px; }
.chat-attach { flex: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; }
.chat-send { flex: none; height: 36px; }
.chat-hint { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 9.5px; color: var(--muted); }
.chat-hint span { display: inline-flex; align-items: center; gap: 4px; }
.chat-hint .ico { width: 10px; height: 10px; }
.chat-composer.locked { display: flex; align-items: flex-start; gap: 9px; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); background: var(--surface-2); }
.chat-composer.locked .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--muted); }
.chat-attach-chip { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.chat-attach-chip > .ico { width: 15px; height: 15px; color: var(--info); flex: none; }
.chat-attach-chip span { display: flex; flex-direction: column; min-width: 0; }
.chat-attach-chip b { font-size: 11.5px; overflow-wrap: anywhere; }
.chat-attach-chip small { font-size: 10px; color: var(--muted); }

.chat-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 236px); overflow-y: auto; padding-bottom: 2px; }
.chat-side-card { padding: 14px; }
.chat-side-card .section-head { margin-bottom: 8px; }
.chat-person-big { display: flex; gap: 11px; align-items: center; }
.chat-person-big > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-person-big b { font-size: 14px; }
.chat-person-big span { font-size: 11px; color: var(--muted); }
.chat-presence-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.chat-presence-label { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); padding: 3px 6px; border-radius: 6px; }
.chat-presence-label.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.chat-side-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chat-member-list { display: flex; flex-direction: column; gap: 7px; }
.chat-member-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-member-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-member-name b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-member-name small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-member-presence { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: var(--muted); flex: none; }
.chat-privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chat-privacy-grid > div { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: var(--surface-2); display: flex; flex-direction: column; }
.chat-privacy-grid span { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chat-privacy-grid b { font-size: 17px; line-height: 1.2; }
.chat-privacy-grid small { font-size: 9px; color: var(--muted); }
.chat-file-row, .chat-task-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.chat-file-row:last-child, .chat-task-row:last-child { border-bottom: 0; }
.chat-file-row > .ico { width: 15px; height: 15px; color: var(--info); flex: none; }
.chat-file-row .chat-file-main { flex: 1; }
.chat-task-row .badge { flex: none; }
.chat-side-card .mail-note { margin-top: 10px; }

.chat-menu-scrim { position: fixed; inset: 0; z-index: 1390; border: 0; background: transparent; cursor: default; }
.chat-msg-menu {
  position: fixed; z-index: 1400; width: 224px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px;
  box-shadow: 0 18px 40px rgba(7, 29, 48, .18);
}
.chat-msg-menu-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.chat-msg-menu-head .ico { width: 12px; height: 12px; }
.chat-msg-menu > button {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none;
  font: inherit; font-size: 12px; color: var(--ink-2); padding: 7px 8px; border-radius: 7px; cursor: pointer; text-align: left;
}
.chat-msg-menu > button:hover { background: var(--surface-2); color: var(--ink); }
.chat-msg-menu > button .ico { width: 14px; height: 14px; color: var(--muted); }
.chat-msg-menu-note { display: flex; gap: 6px; padding: 7px 8px 3px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 9px; line-height: 1.4; color: var(--muted); }
.chat-msg-menu-note .ico { width: 11px; height: 11px; flex: none; margin-top: 1px; }

.chat-search-results { flex: 1; overflow-y: auto; padding: 12px 16px; }
.chat-search-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.chat-search-head b { font-size: 13px; }
.chat-search-row {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 6px; border: 0; background: none;
  border-bottom: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; color: var(--ink-2);
}
.chat-search-row:hover { background: var(--surface-2); }
.chat-search-ico { flex: none; width: 28px; display: grid; place-items: center; }
.chat-search-ico .chat-glyph.lock, .chat-search-ico .chat-glyph.zap { width: 24px; height: 24px; }
.chat-search-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-search-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.chat-search-top span { font-size: 9.5px; color: var(--muted); }
.chat-search-text { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-search-row > .ico { width: 13px; height: 13px; color: var(--muted); flex: none; }
.chat-search-note { display: flex; gap: 7px; margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 10px; color: var(--muted); line-height: 1.45; }
.chat-search-note .ico { width: 13px; height: 13px; flex: none; }

.chat-quote { display: flex; gap: 8px; padding: 9px 11px; border-left: 3px solid var(--brand-2); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); margin-bottom: 14px; }
.chat-quote .ico { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--muted); }
.chat-preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 14px; }
.chat-preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 9px;
  font: inherit; text-align: left; cursor: pointer; color: var(--ink-2); min-width: 0;
}
.chat-preset:hover { border-color: var(--brand-2); background: var(--surface-2); }
.chat-preset .ico { width: 14px; height: 14px; color: var(--muted); margin-bottom: 2px; }
.chat-preset b { font-size: 11.5px; }
.chat-preset span { font-size: 9.5px; color: var(--muted); line-height: 1.35; }
.chat-preset-active { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 11px; margin-bottom: 12px; }
.chat-preset-active .ico { width: 14px; height: 14px; flex: none; }
.chat-member-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; max-height: 230px; overflow-y: auto; padding: 2px; }
.chat-pick { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; cursor: pointer; }
.chat-pick:has(input:checked) { border-color: var(--brand-2); background: var(--accent-soft); }
.chat-pick input { flex: none; }
.chat-pick > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-pick b { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pick small { display: none; }
.chat-add-member { display: flex; gap: 6px; margin-top: 12px; }
.chat-add-member .select { flex: 1; min-width: 0; }
.chat-profile-head { display: flex; gap: 12px; align-items: center; }
.chat-profile-head > div { display: flex; flex-direction: column; gap: 2px; }
.chat-profile-head b { font-size: 15px; }
.chat-profile-head span { font-size: 11px; color: var(--muted); }
.chat-profile-channels { display: flex; flex-direction: column; gap: 4px; }
.chat-profile-channel {
  display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 6px 7px;
  border-radius: 7px; font: inherit; font-size: 11.5px; color: var(--ink-2); cursor: pointer; text-align: left;
}
.chat-profile-channel:hover { background: var(--surface-2); }
.chat-profile-channel .xs { margin-left: auto; }
.chat-profile-channel .chat-glyph { width: 20px; height: 20px; font-size: 12px; }

/* meet — provider handoff, records and recordings */
.chat-meet-card { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 12px; max-width: 540px; }
.chat-meet-card.live { border-color: color-mix(in srgb, var(--ok) 42%, var(--line)); }
.chat-meet-card-head { display: flex; align-items: center; gap: 9px; }
.chat-meet-ico { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--brand-2); }
.chat-meet-ico .ico { width: 16px; height: 16px; }
.chat-meet-card-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-meet-card-main b { font-size: 12.5px; overflow-wrap: anywhere; }
.chat-meet-card-main span { font-size: 10.5px; color: var(--muted); }
.chat-meet-card-head .badge { flex: none; }
.chat-meet-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chat-meet-flag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 9.5px; color: var(--muted); }
.chat-meet-flag .ico { width: 11px; height: 11px; }
.chat-meet-flag.rec { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 32%, var(--line)); }
.chat-meet-flag.ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.chat-meet-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chat-meet-card-actions .btn { min-height: 26px; }

.chat-meet-list { display: flex; flex-direction: column; margin-top: 2px; }
.chat-meet-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 5px;
  border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit;
  color: var(--ink-2); text-align: left; cursor: pointer; border-radius: 6px;
}
.chat-meet-row:last-child { border-bottom: 0; }
.chat-meet-row:hover { background: var(--surface-2); }
.chat-meet-row-ico { flex: none; width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-2); }
.chat-meet-row-ico .ico { width: 14px; height: 14px; }
.chat-meet-row-ico.live { background: var(--ok-soft); color: var(--ok); }
.chat-meet-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-meet-row-main b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meet-row-main small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meet-row .badge { flex: none; font-size: 9px; }
.chat-meet-side .mail-note { margin-top: 10px; }

.chat-meet-provider-box { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 14px; }
.chat-meet-provider-box > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-meet-provider-box b { font-size: 12.5px; }
.chat-meet-provider-box span { font-size: 10.5px; line-height: 1.45; color: var(--muted); }
.chat-meet-rec-box { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; padding: 11px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.chat-meet-rec-box .check-row { margin: 0; font-size: 11px !important; line-height: 1.5; align-items: flex-start !important; }
.chat-meet-rec-box .check-row input { margin-top: 1px; flex: none; }
.chat-meet-rec-box .check-row b { font-size: 11.5px; }
.chat-meet-rec-box p { margin: 0; }
.chat-meet-privacy { display: flex; gap: 6px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 9.5px; line-height: 1.45; color: var(--muted); }
.chat-meet-privacy .ico { width: 12px; height: 12px; flex: none; margin-top: 1px; color: var(--brand-2); }
.chat-meet-attendees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.chat-meet-attendee { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.chat-meet-attendee > span { display: flex; flex-direction: column; min-width: 0; }
.chat-meet-attendee b { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meet-attendee small { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-meet-handoff { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.chat-meet-handoff > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-meet-handoff b { font-size: 13px; }
.chat-meet-handoff span { font-size: 10.5px; color: var(--muted); }
.chat-meet-handoff-ico { flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--brand-2); }
.chat-meet-handoff-ico .ico { width: 17px; height: 17px; }
.chat-meet-handoff .badge { flex: none; }
.chat-meet-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.chat-meet-kv > div { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); min-width: 0; }
.chat-meet-kv span { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chat-meet-kv b { font-size: 11.5px; overflow-wrap: anywhere; }
.chat-meet-kv-stack { grid-template-columns: minmax(0, 1fr); margin: 0 0 12px; }
.chat-meet-rec-notice { background: var(--accent-soft, #f1f5e6); border-color: color-mix(in srgb, var(--brand-2) 26%, var(--line)); margin-top: 10px; }
.chat-meet-rec-notice .ico { color: var(--brand-2); }
.chat-meet-ref { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; padding: 9px 11px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.chat-meet-ref span { font-size: 9.5px; color: var(--muted); }
.chat-meet-ref b { font-size: 13px; letter-spacing: .05em; }

.chat-meet-hero { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 14px; }
.chat-meet-hero > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-meet-hero b { font-size: 15px; overflow-wrap: anywhere; }
.chat-meet-hero span { font-size: 10.5px; color: var(--muted); }
.chat-meet-hero .badge { flex: none; }
.chat-meet-hero-ico { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--brand-2); }
.chat-meet-hero-ico .ico { width: 18px; height: 18px; }
.chat-meet-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.chat-meet-facts > div { padding: 2px 0 2px 8px; border-left: 2px solid var(--line-strong); min-width: 0; }
.chat-meet-facts span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chat-meet-facts b { display: block; font-size: 11.5px; overflow-wrap: anywhere; }
.chat-meet-agenda { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.chat-meet-agenda p { margin: 3px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
.chat-meet-people { display: flex; flex-direction: column; }
.chat-meet-person { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-bottom: 1px dashed var(--line); }
.chat-meet-person:last-child { border-bottom: 0; }
.chat-meet-person-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-meet-person-name b { font-size: 11.5px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chat-meet-person-name small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meet-person > .badge { flex: none; font-size: 9px; }
.chat-meet-recording { background: var(--surface-2); }
.chat-meet-player { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.chat-meet-play { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand-2); color: #fff; cursor: pointer; }
.chat-meet-play:hover { filter: brightness(1.06); }
.chat-meet-play .ico { width: 14px; height: 14px; }
.chat-meet-track { flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.chat-meet-track i { display: block; width: 32%; height: 100%; border-radius: 999px; background: var(--brand-2); }
.chat-meet-player .mono { font-size: 10px; color: var(--muted); flex: none; }
.chat-meet-file { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.chat-meet-file > .ico { width: 15px; height: 15px; color: var(--info); flex: none; }
.chat-meet-file > span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-meet-file b { font-size: 11px; }
.chat-meet-file small { font-size: 9.5px; color: var(--muted); }
.chat-meet-file .badge { flex: none; font-size: 9px; }
.chat-meet-summary { margin-top: 8px; }
.chat-meet-summary p { margin: 2px 0 0; font-size: 11.2px; line-height: 1.5; color: var(--ink-2); }
.chat-meet-retention,
.chat-meet-retention .ico,
.chat-meet-retention b,
.chat-meet-rec-actions { margin-top: 9px; }
.chat-meet-audit { display: flex; flex-direction: column; }
.chat-meet-audit-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.chat-meet-audit-row:last-child { border-bottom: 0; }
.chat-meet-audit-row span { flex: none; width: 104px; font-size: 9.5px; color: var(--muted); }
.chat-meet-audit-row p { margin: 0; font-size: 10.8px; line-height: 1.45; color: var(--ink-2); }
.chat-meet-group-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 4px; }
.chat-meet-group-label:first-child { margin-top: 0; }
.chat-meet-ack { margin-top: 10px; align-items: flex-start !important; line-height: 1.45; font-size: 10.5px !important; color: var(--ink-2) !important; }
.chat-meet-ack input { margin-top: 2px; }
.chat-meet-room { display: flex; flex-direction: column; gap: 10px; }
.chat-meet-room-strip { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.chat-meet-room-strip.rec { border-color: var(--warn); background: var(--warn-soft); }
.chat-meet-room-strip > .ico { flex: none; width: 15px; height: 15px; color: var(--muted); }
.chat-meet-room-strip.rec > .ico { color: var(--warn); }
.chat-meet-room-strip > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-meet-room-strip b { font-size: 11px; }
.chat-meet-room-strip small { font-size: 9.5px; color: var(--muted); }
.chat-meet-room-strip .badge { flex: none; }
.chat-meet-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chat-meet-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 16px 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); text-align: center; }
.chat-meet-tile.self { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chat-meet-tile-name { font-size: 11.5px; font-weight: 650; }
.chat-meet-tile-meta { font-size: 9.5px; color: var(--muted); }
.chat-meet-tile-badge { position: absolute; top: 7px; left: 7px; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 1px 5px; border-radius: 999px; background: var(--brand); color: var(--surface); }
.chat-meet-room-bar { display: flex; justify-content: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.chat-meet-room-ctl { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer; }
.chat-meet-room-ctl:hover { border-color: var(--accent); color: var(--ink); }
.chat-meet-room-ctl.on { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.chat-meet-room-ctl.danger { color: var(--bad); }
.chat-meet-room-ctl.danger:hover { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.chat-meet-room-ctl .ico { width: 14px; height: 14px; }
.chat-meet-room-note { display: flex; gap: 7px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 9.8px; line-height: 1.5; }
.chat-meet-room-note .ico { flex: none; width: 13px; height: 13px; margin-top: 1px; }

/* chat — sheets, receipts, views, calls, admin */
.chat-sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.chat-sheet { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 10.5px; cursor: pointer; }
.chat-sheet:hover { background: var(--surface-2); }
.chat-sheet.active { border-color: var(--brand-2); background: var(--accent-soft); color: var(--ink); }
.chat-sheet .ico { width: 12px; height: 12px; color: var(--muted); }
.chat-sheet b { margin-left: auto; font-size: 9.5px; color: var(--brand-2); }
.chat-rail-me { display: flex; align-items: center; gap: 6px; padding: 2px 2px 0; }
.chat-rail-me .avatar { flex: none; }
.chat-rail-status { border: 0; background: none; padding: 2px 5px; border-radius: 6px; font: inherit; font-size: 9.5px; color: var(--muted); cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.chat-rail-status:hover { background: var(--surface-2); color: var(--ink); }
.chat-rail-me .icon-btn { margin-left: auto; width: 26px; height: 26px; }
.chat-kind-tag.ext { color: var(--info); border-color: color-mix(in srgb, var(--info) 34%, var(--line)); }
.chat-ackdot { margin-left: auto; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; }
.chat-status-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--ink-2); font-size: 9.5px; }
.chat-status-chip .ico { width: 10px; height: 10px; }
.chat-tag { color: var(--brand-2); font-weight: 600; }
.chat-ticks { font-size: 10px; letter-spacing: -.08em; color: var(--muted); }
.chat-ticks.delivered { color: var(--ink-2); }
.chat-ticks.read { color: var(--info); }
.chat-ticks.queued { color: var(--warn); letter-spacing: 0; }
.chat-pin-tag, .chat-star-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 8.5px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 0 6px; }
.chat-pin-tag .ico, .chat-star-tag .ico { width: 9px; height: 9px; }
.chat-star-tag { background: var(--accent-soft); color: var(--brand-2); }
.chat-private-tag.secret { color: var(--violet); }
.chat-receipt-line { margin-top: 4px; font-size: 9px; color: var(--muted); }
.chat-deleted { margin-top: 5px; font-size: 10px; color: var(--muted); font-style: italic; }
.chat-ack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 7px 9px; border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--line)); border-radius: 8px; background: var(--warn-soft); font-size: 10.5px; line-height: 1.45; }
.chat-ack .ico { width: 13px; height: 13px; flex: none; color: var(--warn); }
.chat-ack.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.chat-ack.done .ico { color: var(--ok); }
.chat-ack .btn { margin-left: auto; }
.chat-poll { margin-top: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); max-width: 430px; }
.chat-poll-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; margin-bottom: 7px; }
.chat-poll-head .ico { width: 13px; height: 13px; color: var(--brand-2); flex: none; }
.chat-poll-head span { margin-left: auto; font-size: 9px; color: var(--muted); }
.chat-poll-opt { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font: inherit; font-size: 10.5px; color: var(--ink-2); cursor: pointer; overflow: hidden; text-align: left; }
.chat-poll-opt:hover { border-color: var(--brand-2); }
.chat-poll-opt.mine { border-color: var(--brand-2); font-weight: 650; }
.chat-poll-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); }
.chat-poll-label, .chat-poll-opt b { position: relative; }
.chat-poll-opt b { margin-left: auto; font-size: 9.5px; color: var(--muted); }
.chat-preview { display: flex; gap: 9px; align-items: center; margin-top: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); max-width: 480px; }
.chat-preview-ico { flex: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.chat-preview-ico .ico { width: 14px; height: 14px; }
.chat-preview-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-preview-main b { font-size: 11px; }
.chat-preview-main span { font-size: 10px; color: var(--muted); line-height: 1.4; }
.chat-preview-main small { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview.internal { border-style: dashed; }
.chat-preview.internal .chat-preview-ico { background: var(--violet-soft); color: var(--violet); }
.chat-preview .btn { margin-left: auto; flex: none; }
.chat-banner { display: flex; align-items: center; gap: 9px; margin: 0 16px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 10.5px; line-height: 1.45; }
.chat-banner .ico { width: 14px; height: 14px; flex: none; color: var(--muted); }
.chat-banner b { color: var(--ink); }
.chat-banner .btn { margin-left: auto; flex: none; }
.chat-banner.archived { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }
.chat-banner.archived .ico { color: var(--warn); }
.chat-banner.secret { background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 28%, var(--line)); }
.chat-banner.secret .ico { color: var(--violet); }
.chat-banner.offline { background: var(--warn-soft); }
.chat-banner.offline .ico { color: var(--warn); }
.chat-banner.call { background: var(--info-soft); }
.chat-banner.call .ico { color: var(--info); }
.chat-view.chat-main { padding: 0; }
.chat-view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.chat-view-head h2 { margin: 2px 0 3px; font-size: 20px; letter-spacing: -.02em; }
.chat-view-head p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.45; max-width: 560px; }
.chat-view-scroll { flex: 1; overflow-y: auto; padding: 8px 12px 14px; }
.chat-mention-row, .chat-archive-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink-2); text-align: left; cursor: pointer; border-radius: 7px; }
.chat-mention-row:hover, .chat-archive-row:hover { background: var(--surface-2); }
.chat-mention-row.unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.chat-mention-row .chat-unread { font-size: 9px; }
.chat-mention-row > .ico, .chat-archive-row > .ico { width: 13px; height: 13px; color: var(--muted); flex: none; }
.chat-star-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.chat-star-row .chat-search-row { border-bottom: 0; flex: 1; min-width: 0; }
.chat-call-log { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.chat-call-log-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-2); }
.chat-call-log-ico .ico { width: 14px; height: 14px; }
.chat-call-log-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-call-log-main b { font-size: 12px; }
.chat-call-log-main small { font-size: 9.5px; color: var(--muted); overflow-wrap: anywhere; }
.chat-call-log-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.chat-call-log-badges .badge { font-size: 8.5px; }
.chat-pinned { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 10.5px; }
.chat-pinned > .ico { width: 13px; height: 13px; color: var(--warn); flex: none; }
.chat-pinned b { flex: none; font-size: 10px; }
.chat-pinned span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pin-row { display: flex; align-items: flex-start; gap: 7px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.chat-pin-row:last-of-type { border-bottom: 0; }
.chat-pin-row > .ico { width: 12px; height: 12px; color: var(--warn); flex: none; margin-top: 2px; }
.chat-pin-row > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-pin-row b { font-size: 10.5px; }
.chat-pin-row small { font-size: 9.5px; color: var(--muted); line-height: 1.4; }
.chat-pin-row .icon-btn { width: 24px; height: 24px; flex: none; }
.chat-cmd-palette { display: none; margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); overflow: hidden; max-height: 220px; overflow-y: auto; }
.chat-cmd-palette.on { display: block; }
.chat-cmd-row { display: flex; align-items: baseline; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink-2); }
.chat-cmd-row:hover { background: var(--surface-2); }
.chat-cmd-row b { font-size: 11.5px; color: var(--brand-2); flex: none; }
.chat-cmd-row span { font-size: 10px; color: var(--muted); }
.chat-cmd-foot { padding: 6px 10px; font-size: 9px; color: var(--muted); background: var(--surface-2); }
.chat-cmd-btn { font-weight: 700; color: var(--brand-2); font-size: 15px; }
.chat-notes-new { border: 1px dashed var(--line-strong); background: var(--surface); }
.chat-glyph.notes { color: var(--violet); background: var(--violet-soft); }
.chat-channel-ico .chat-glyph.notes { width: 100%; height: 100%; }
.chat-team-note, .chat-hold-line, .chat-checkin-line, .chat-receipt-note { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 10px; line-height: 1.45; color: var(--muted); }
.chat-team-note .ico, .chat-hold-line .ico, .chat-checkin-line .ico, .chat-receipt-note .ico { width: 13px; height: 13px; flex: none; color: var(--brand-2); }
.chat-team-note .btn { margin-left: auto; }
.chat-hold-line { background: var(--warn-soft); }
.chat-hold-line .ico { color: var(--warn); }
.chat-guarantees .chat-guarantee-list { display: flex; flex-direction: column; gap: 7px; }
.chat-guarantee-row { display: flex; align-items: center; gap: 8px; }
.chat-guarantee-row > span:not(.chat-guarantee-ico) { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-guarantee-row b { font-size: 10.5px; }
.chat-guarantee-row small { font-size: 9.2px; color: var(--muted); line-height: 1.35; }
.chat-guarantee-row .badge { flex: none; font-size: 8.5px; }
.chat-guarantee-ico { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-2); }
.chat-guarantee-ico .ico { width: 13px; height: 13px; }
.chat-queue-line { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 9.5px; color: var(--muted); }
.chat-queue-line .ico { width: 12px; height: 12px; flex: none; }
.chat-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chat-tag-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 10px; color: var(--ink-2); cursor: pointer; }
.chat-tag-chip:hover { border-color: var(--brand-2); background: var(--accent-soft); }
.chat-tag-chip b { font-size: 9px; color: var(--brand-2); }
.chat-call-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.chat-call-row:last-child { border-bottom: 0; }
.chat-call-row > .ico { width: 13px; height: 13px; color: var(--brand-2); flex: none; }
.chat-call-row span { display: flex; flex-direction: column; min-width: 0; }
.chat-call-row b { font-size: 10.5px; }
.chat-call-row small { font-size: 9px; color: var(--muted); }
.chat-detail-facts { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 8px; font-size: 10px; color: var(--muted); }
.chat-detail-facts b { color: var(--ink-2); }
.chat-member-actions { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.chat-member-actions .chat-mini { font-size: 9px; }
.chat-call-stage { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); text-align: center; }
.chat-call-stage.live { background: var(--accent-soft); border-color: var(--brand-2); }
.chat-call-stage h3 { margin: 6px 0 0; font-size: 15px; }
.chat-call-stage p { margin: 0; }
.chat-call-ava { position: relative; display: inline-flex; }
.chat-call-ring { position: absolute; inset: -8px; border: 2px solid var(--brand-2); border-radius: 50%; opacity: .35; animation: chat-ring 1.4s ease-out infinite; }
@keyframes chat-ring { 0% { transform: scale(.9); opacity: .5; } 100% { transform: scale(1.25); opacity: 0; } }
.chat-call-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chat-call-controls .btn.active { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.chat-call-people { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chat-call-person { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px 3px 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; }
.chat-admin-sec { padding: 12px 0; border-bottom: 1px solid var(--line); }
.chat-admin-sec:last-of-type { border-bottom: 0; }
.chat-admin-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chat-admin-sec-head h3 { margin: 0; font-size: 12.5px; }
.chat-admin-sec-head span { font-size: 9.5px; color: var(--muted); text-align: right; }
.chat-admin-list { display: flex; flex-direction: column; gap: 2px; }
.chat-admin-row { display: flex; align-items: center; gap: 6px; padding: 5px 2px; border-bottom: 1px dashed var(--line); }
.chat-admin-row:last-child { border-bottom: 0; }
.chat-admin-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-admin-main b { font-size: 10.8px; }
.chat-admin-main small { font-size: 9.2px; color: var(--muted); overflow-wrap: anywhere; }
.chat-admin-row .chat-mini { flex: none; border: 1px solid var(--line); }
.chat-admin-row .badge { flex: none; font-size: 8.5px; }
.chat-role-row { display: flex; flex-direction: column; gap: 3px; }
.mail-note.secret { background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 26%, var(--line)); }
.mail-note.secret .ico { color: var(--violet); }

@media (max-width: 1200px) {
  .chat-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .chat-side { position: static; max-height: none; overflow: visible; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-head:has(+ .chat-layout) .actions { display: none; }
  .chat-rail { height: auto; min-height: 0; max-height: 320px; }
  .chat-main { height: 68vh; min-height: 460px; }
  .chat-side { grid-template-columns: minmax(0, 1fr); }
  .chat-head-actions { width: 100%; justify-content: space-between; }
  .chat-member-stack { display: none; }
  .chat-msg-actions { opacity: 1; }
  .chat-preset-row { grid-template-columns: 1fr; }
  .chat-msg-menu { width: min(240px, calc(100vw - 24px)); }
  .chat-hint span:last-child { display: none; }
  .chat-meet-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-meet-attendees { grid-template-columns: minmax(0, 1fr); }
  .chat-meet-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-cmd-palette.on { position: fixed; left: 10px; right: 10px; bottom: 80px; z-index: 60; max-height: 44vh; box-shadow: 0 18px 40px rgba(0, 0, 0, .2); }
}
@media (max-width: 480px) {
  .chat-rail-actions .btn { font-size: 10.5px; padding: 0 8px; }
  .chat-main { height: 72vh; min-height: 420px; }
  .chat-scroll { padding: 10px 8px 6px; }
  .chat-msg { padding: 6px 4px; gap: 7px; }
  .chat-msg .avatar { width: 26px; height: 26px; font-size: 10px; }
  .chat-composer { padding: 8px; }
  .chat-send { padding: 0 9px; }
  .chat-head { padding: 10px 12px; }
  .chat-head-actions .btn { font-size: 10px; padding: 0 8px; }
  .chat-msg-actions .chat-mini span { display: none; }
  .chat-private-tag { display: none; }
  .chat-member-picks { grid-template-columns: 1fr; }
  .chat-meet-card { padding: 8px 9px; }
  .chat-meet-card-actions .btn { font-size: 10px; padding: 0 8px; }
  .chat-meet-flags { gap: 4px; }
  .chat-meet-kv, .chat-meet-facts { grid-template-columns: minmax(0, 1fr); }
  .chat-meet-hero { padding: 10px; gap: 9px; }
  .chat-meet-hero b { font-size: 13.5px; }
  .chat-meet-hero-ico { width: 32px; height: 32px; }
  .chat-meet-audit-row { flex-direction: column; gap: 1px; }
  .chat-meet-audit-row span { width: auto; }
  .chat-meet-row .badge { display: none; }
  .chat-meet-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .chat-meet-tile { padding: 13px 6px 9px; }
  .chat-meet-tile .avatar { width: 46px; height: 46px; font-size: 15px; }
  .chat-meet-room-bar { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; border-radius: 12px; }
  .chat-meet-room-ctl { justify-content: center; padding: 8px 4px; font-size: 9.5px; }
  .chat-meet-room-ctl .ico { width: 13px; height: 13px; }
  .chat-meet-room-note { font-size: 9px; }
  .chat-sheet { padding: 6px 5px; font-size: 10px; gap: 4px; }
  .chat-banner, .chat-pinned { margin: 0 10px 6px; flex-wrap: wrap; font-size: 10px; }
  .chat-view-head { padding: 12px 12px 10px; }
  .chat-view-head h2 { font-size: 17px; }
  .chat-view-scroll { padding: 6px 8px 10px; }
  .chat-poll, .chat-preview { max-width: none; }
  .chat-call-stage { padding: 16px 10px 14px; }
  .chat-call-controls { width: 100%; justify-content: center; }
  .chat-admin-sec-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .chat-admin-sec-head span { text-align: left; }
  .chat-admin-row { flex-wrap: wrap; }
  .chat-detail-facts { gap: 4px 10px; }
  .alias-rows .list-row { flex-wrap: wrap; row-gap: 6px; }
  .alias-rows .row-main { flex: 1 1 100%; order: 3; }
  .alias-rows .btn { margin-left: auto; }
}

/* --------------------------- Mail signatures ---------------------------- */
.af-sig-preview-wrap { margin-top: 8px; }
.af-sig-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface, var(--panel, #fff));
  max-width: 560px;
}
.af-sig-brand { display: flex; gap: 16px; align-items: flex-start; }
.af-sig-logo { width: 170px; height: auto; flex: 0 0 auto; margin-top: 2px; }
.af-sig-lines { display: grid; gap: 3px; font-size: 13px; line-height: 1.45; }
.af-sig-name { font-weight: 800; letter-spacing: .02em; font-size: 14px; }
.af-sig-company { font-weight: 700; }
.af-sig-row b { font-weight: 700; }
.af-sig-tagline { font-style: italic; font-weight: 600; margin: 12px 0 0; font-size: 13.5px; }
.af-sig-notice { margin: 10px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted); }
.af-sig-manage { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.af-sig-manage.is-default { border-color: var(--accent); }
.af-sig-manage-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.af-sig-manage-head .btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.af-sig-manage .af-sig-preview { border: 0; padding: 0; max-width: none; }
@media (max-width: 640px) {
  .af-sig-brand { flex-direction: column; gap: 10px; }
  .af-sig-logo { width: 140px; }
}

/* ----------------------- Outlook-style mail client ----------------------- */
.af-mail-cmdbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.af-mail-cmdbar .btn { white-space: nowrap; }
.af-cmd-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.af-mail-search { max-width: 340px; margin-left: auto; }
.af-cmd-menu { position: relative; }
.af-cmd-menu summary { list-style: none; cursor: pointer; }
.af-cmd-menu summary::-webkit-details-marker { display: none; }
.af-cmd-drop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 20, 12, .16); display: grid; gap: 2px;
}
.af-cmd-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-size: 13px; color: var(--ink, var(--text, #1c241a)); text-align: left; cursor: pointer;
}
.af-cmd-item:hover { background: var(--bg, rgba(0,0,0,.05)); }

/* folder pane */
.af-mail-folders { display: flex; flex-direction: column; padding: 10px 8px; gap: 4px; overflow-y: auto; }
.af-fav { display: grid; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.af-accounts { display: grid; gap: 2px; padding-top: 4px; }
.af-acct { border-radius: 9px; }
.af-acct > summary {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: 9px; cursor: pointer; list-style: none;
}
.af-acct > summary::-webkit-details-marker { display: none; }
.af-acct > summary:hover { background: var(--bg, rgba(0,0,0,.045)); }
.af-acct-ava {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 750;
  background: var(--brand, #5b6236); color: #fff;
}
.af-acct-name { display: grid; line-height: 1.25; min-width: 0; }
.af-acct-name b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-acct-name small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-acct-chev { margin-left: auto; color: var(--muted); display: grid; place-items: center; transition: transform .15s; }
.af-acct[open] .af-acct-chev { transform: rotate(180deg); }
.af-acct-folders { display: grid; gap: 1px; padding: 2px 0 6px 12px; }
.af-f-unread {
  margin-left: auto; font-size: 11px; font-weight: 750; font-style: normal;
  background: var(--accent, var(--brand-2, #b7791f)); color: #fff;
  border-radius: 999px; padding: 1px 7px;
}
.af-acct-remove { color: var(--muted); }
.af-add-acct { margin-top: 8px; justify-content: flex-start; }

/* message list */
.af-focus-tabs { display: flex; border-bottom: 1px solid var(--line); }
.af-focus-tab {
  flex: 1; padding: 10px 8px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.af-focus-tab b { font-weight: 700; color: inherit; opacity: .75; margin-left: 4px; }
.af-focus-tab.active { color: var(--brand); border-bottom-color: var(--brand-2); font-weight: 650; }
.af-msg-list { display: grid; }
.af-msg {
  display: grid; grid-template-columns: 14px 34px minmax(0, 1fr) auto;
  gap: 4px 10px; align-items: start; padding: 10px 12px 10px 8px;
  border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
}
.af-msg:hover { background: var(--bg, rgba(0,0,0,.035)); }
.af-msg.af-selected { background: color-mix(in srgb, var(--brand, #5b6236) 9%, transparent); box-shadow: inset 2px 0 0 var(--brand-2, var(--accent)); }
.af-msg .unread-dot { margin-top: 7px; }
.af-msg-body { display: grid; gap: 2px; min-width: 0; }
.af-msg-line1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.af-msg-from { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-msg.is-unread .af-msg-from { font-weight: 750; }
.af-msg-box {
  flex: none; font-size: 10px; font-weight: 650; color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  border-radius: 999px; padding: 0 7px; white-space: nowrap;
}
.af-msg-when { margin-left: auto; flex: none; font-size: 11px; color: var(--muted); }
.af-msg-line2 { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.af-msg-subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-msg.is-unread .af-msg-subject { font-weight: 650; }
.af-msg-line3 {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.af-msg-side { display: grid; justify-items: end; gap: 2px; }
.af-msg-side .mail-star { font-size: 14px; }
.af-msg-hover { display: none; gap: 2px; }
.af-msg:hover .af-msg-hover { display: flex; }
.af-msg:hover .af-msg-side > .mail-star { visibility: hidden; }
.af-list-more { margin: 10px auto; display: flex; }

/* mini calendar panel */
.af-mail-cal {
  border-left: 1px solid var(--line); background: var(--bg, transparent);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
}
.af-cal-head b { font-size: 13px; }
.af-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); }
.af-cal-dow span { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.af-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.af-cal-day {
  text-align: center; font-size: 11px; padding: 3px 0; border-radius: 50%;
  color: var(--ink, inherit);
}
.af-cal-day.empty { visibility: hidden; }
.af-cal-day.today { background: var(--brand, #5b6236); color: #fff; font-weight: 700; }
.af-cal-events { display: grid; gap: 6px; margin-top: 4px; }
.af-cal-day-label { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.af-cal-ev {
  border: 1px solid var(--line); border-left: 3px solid var(--brand-2, var(--accent));
  border-radius: 8px; padding: 7px 9px; display: grid; gap: 1px; background: var(--surface);
}
.af-cal-ev b { font-size: 12px; }
.af-cal-ev span { font-size: 11px; color: var(--muted); }
.af-cal-ev.none { border-style: dashed; border-left-width: 1px; color: var(--muted); font-size: 11.5px; display: block; }

/* inline reader quick actions + blocked senders */
.af-reader-quick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.blocked-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.blocked-list .eyebrow { width: 100%; }
.blocked-chip {
  font-size: 11px; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; color: var(--muted); background: var(--bg, transparent);
}
.thread-pill {
  flex: none; font-size: 10px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0 6px;
}
.af-mail-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------------- Independent pane scrolling (Outlook) ------------------ */
.af-mail-workspace .af-mail-list { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.af-mail-workspace .af-mail-list .af-focus-tabs,
.af-mail-workspace .af-mail-list .mail-sync,
.af-mail-workspace .af-mail-list .af-list-more { flex: none; }
.af-mail-workspace .af-mail-list .af-msg-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.af-mail-workspace .af-mail-reader { overflow-y: auto; min-height: 0; }
.af-mail-workspace .af-mail-folders, .af-mail-workspace .af-mail-cal { min-height: 0; }

/* ------------------- Reply / reply-all context in compose ---------------- */
.af-reply-ctx {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-left: 3px solid var(--brand, #6b7f3a);
  border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px;
  background: var(--bg, #f7f7f3);
}
.af-reply-badge {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand, #6b7f3a); background: color-mix(in srgb, var(--brand, #6b7f3a) 12%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.af-reply-badge .ico { width: 12px; height: 12px; }
.af-reply-who { min-width: 0; font-size: 13px; line-height: 1.45; }
.af-reply-who .mono { color: var(--muted); font-size: 11.5px; }
.af-reply-when { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.af-reply-subj { font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-reply-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; }
.af-reply-people + .af-reply-people { margin-top: -6px; }
.af-reply-people .eyebrow { flex: none; }
.af-reply-chip {
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--brand, #6b7f3a) 35%, var(--line));
  background: color-mix(in srgb, var(--brand, #6b7f3a) 8%, transparent);
}
.af-reply-quote { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; background: var(--bg, #f7f7f3); }
.af-reply-quote summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 11px; font-size: 12px; list-style: none;
}
.af-reply-quote summary::-webkit-details-marker { display: none; }
.af-reply-quote summary .ico { width: 13px; height: 13px; color: var(--muted); }
.af-reply-quote summary .xs { margin-left: auto; }
.af-reply-quote-body { border-top: 1px solid var(--line); padding: 9px 12px; max-height: 220px; overflow-y: auto; }
.af-reply-quote-body pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 12px; color: var(--muted); }
.af-sig-note { display: flex; align-items: center; gap: 5px; margin: 0; }
.af-sig-note .ico { width: 12px; height: 12px; flex: none; }

/* ------------------------ Compose template chips ------------------------ */
.mail-template-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 10px; }
.mail-template-row .eyebrow { flex: none; }
.mail-template-row .xs.muted { flex: 1 1 100%; margin: 0; }
.mail-template-row .mail-op {
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  background: var(--surface, var(--panel, #fff)); color: inherit;
}
.mail-template-row .mail-op:hover { border-color: var(--brand, #3a7015); color: var(--brand, #3a7015); }

.modal.af-compose-modal { width: min(940px, 100%); height: min(940px, calc(100dvh - 48px)); border-radius: 10px; }
.af-compose-modal .modal-head { flex: none; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.af-compose-modal .modal-head h2 { font-family: var(--sans); font-size: 20px; }
.af-compose-modal .modal-body.flush { padding: 0; flex: 1; min-height: 0; }
.af-compose-modal .modal-foot { justify-content: flex-start; align-items: center; padding: 12px 22px; }
.af-compose-modal .af-compose-send { min-width: 108px; font-size: 14px; justify-content: center; }
.af-compose-modal .af-compose-discard { margin-left: auto; }
.af-compose-ribbon { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 22px; background: var(--surface-2, var(--bg)); border-bottom: 1px solid var(--line); }
.af-compose-ribbon .af-ai-mark { width: 16px; height: 18px; }
.af-compose-attach { display: inline-flex; position: relative; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; min-height: 32px; }
.af-compose-attach .ico { width: 16px; height: 16px; }
.af-compose-attach input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.af-compose-attach:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.af-compose-signature { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.af-compose-signature select { max-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--surface); font: inherit; }
.af-compose-addresses { padding: 0 22px; }
.af-compose-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; min-height: 43px; border-bottom: 1px solid var(--line); }
.af-compose-row label { font-size: 12px; color: var(--muted); font-weight: 600; }
.af-compose-row .input, .af-compose-row .form-select { border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 13px; padding: 8px 0; }
.af-compose-row:focus-within { border-bottom-color: var(--brand); }
.af-compose-context { padding: 12px 22px 0; }
.af-compose-format { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.af-compose-format button, .af-compose-format select { border: 1px solid transparent; background: transparent; border-radius: 4px; color: var(--text); height: 30px; min-width: 30px; font: inherit; font-size: 12px; cursor: pointer; }
.af-compose-format button:hover, .af-compose-format select:hover { border-color: var(--line); background: var(--surface-2, var(--bg)); }
.af-compose-format select { border-color: var(--line); margin-right: 5px; background: var(--surface); }
.af-compose-format .ico { width: 15px; height: 15px; }
.af-compose-format input[type="color"] { width: 25px; height: 25px; padding: 2px; border: 0; background: transparent; cursor: pointer; }
.af-compose-paper { padding: 0; background: #fff; color: #1e1e1e; }
.af-mail-editor { min-height: 360px; padding: 24px 22px; font: 14px/1.5 Arial, sans-serif; color: #1e1e1e; background: #fff; outline: none; overflow-wrap: anywhere; }
.af-mail-editor:focus { box-shadow: inset 2px 0 var(--brand); }
.af-mail-editor p { margin: 0 0 12px; }
.af-mail-editor table { table-layout: auto; }
.af-mail-editor td { border: 0; }
.af-mail-editor img { max-width: 100%; }
.af-mail-editor [data-mail-signature] { margin-top: 26px; }
.af-signature-editor { border: 1px solid var(--line); min-height: 310px; padding: 18px; overflow-x: auto; }
.af-compose-under { padding: 10px 22px 16px; }
.af-compose-hint { color: var(--muted); font-size: 11px; margin: 0 0 10px; }
.af-compose-options summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 6px 0; }
.af-compose-options .form-grid { margin-top: 10px; }
@media (max-width: 600px) {
  .modal.af-compose-modal { height: calc(100dvh - 24px); }
  .af-compose-modal .modal-head, .af-compose-modal .modal-foot { padding: 12px 14px; }
  .af-compose-ribbon { gap: 6px 10px; padding: 8px 14px; }
  .af-compose-signature select { max-width: 138px; }
  .af-compose-addresses { padding: 0 14px; }
  .af-compose-row { grid-template-columns: 52px minmax(0, 1fr); }
  .af-compose-format { padding: 8px 10px; }
  .af-mail-editor { padding: 20px 12px; }
  .af-compose-context, .af-compose-under { padding-left: 14px; padding-right: 14px; }
  .af-compose-send-note { display: none; }
  .af-reply-ctx { flex-wrap: wrap; }
  .af-reply-chip, .af-reply-who { overflow-wrap: anywhere; max-width: 100%; }
}

/* ---------------------------- Truss Meet calls ---------------------------- */
.tc-panel { position: fixed; right: 18px; bottom: 18px; width: min(460px, calc(100vw - 24px)); max-height: min(720px, calc(100vh - 36px)); overflow: auto; z-index: 130; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 60px rgba(18, 30, 20, .28); display: flex; flex-direction: column; }
.tc-panel > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tc-panel > header > div { flex: 1; min-width: 0; }
.tc-panel > header b { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.tc-panel > header small { display: block; font-size: 11px; color: var(--muted, #6b7a6b); overflow-wrap: anywhere; }
.tc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted, #9aa); flex: none; }
.tc-dot.on { background: var(--ok, #4d961e); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok, #4d961e) 22%, transparent); }
.tc-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; }
.tc-stage { position: relative; background: #0d1512; aspect-ratio: 16 / 9; }
.tc-stage video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0d1512; }
.tc-local { position: absolute; right: 10px; bottom: 10px; width: 28%; aspect-ratio: 4 / 3; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35); object-fit: cover; }
.tc-badge { position: absolute; left: 10px; bottom: 10px; background: rgba(10, 18, 14, .72); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.tc-meta { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.tc-row { display: flex; gap: 10px; font-size: 12px; align-items: baseline; }
.tc-row > span { min-width: 74px; color: var(--muted, #6b7a6b); }
.tc-row > b { font-weight: 600; overflow-wrap: anywhere; }
.tc-notices { margin: 4px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--muted, #6b7a6b); }
.tc-report { margin: 0 14px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--ok, #4d961e) 6%, var(--surface)); }
.tc-report p { margin: 4px 0 0; font-size: 12.5px; white-space: pre-wrap; }
.tc-end { padding: 0 14px 8px; }
.tc-controls { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.tc-authorize .tc-body { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 10px; }
.tc-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.tc-field > span { color: var(--muted, #6b7a6b); }
.tc-field input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; }
.tc-error { margin: 0; font-size: 12px; color: var(--danger, #b42318); }
.tc-authorize .tc-controls { padding-left: 0; padding-right: 0; }
@media (max-width: 640px) {
  .tc-panel { right: 8px; left: 8px; bottom: 76px; width: auto; max-height: calc(100vh - 96px); }
}

/* WhatsApp-like chat surface and emoji picker */
.chat-scroll { background: #efeae2; background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.55), transparent 45%), radial-gradient(circle at 80% 80%, rgba(255,255,255,.4), transparent 40%); }
.chat-msg { align-items: flex-start; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .chat-body { align-items: flex-end; }
.chat-msg.mine .chat-ava { display: none; }
.chat-msg .chat-text { background: #fff; border-radius: 4px 12px 12px 12px; padding: 7px 10px; box-shadow: 0 1px 1px rgba(0,0,0,.08); max-width: min(560px, 82%); }
.chat-msg.mine .chat-text { background: #d9fdd3; border-radius: 12px 4px 12px 12px; }
.chat-msg.mine .chat-meta { justify-content: flex-end; }
.chat-msg.mine .chat-receipt-line { text-align: right; }
.chat-ticks.sent { color: #1f7a8c; font-weight: 700; }
.chat-composer { background: #f0f2f5; border-top: 1px solid rgba(0,0,0,.08); }
[data-theme="dark"] .chat-scroll { background: #0b141a; background-image: none; }
[data-theme="dark"] .chat-msg .chat-text { background: #202c33; color: #e9edef; }
[data-theme="dark"] .chat-msg.mine .chat-text { background: #005c4b; color: #e9edef; }
[data-theme="dark"] .chat-composer { background: #111b21; }
.chat-compose-row { align-items: flex-end; }
.chat-compose-row .chat-input { background: #fff; border-radius: 22px; border: 1px solid rgba(0,0,0,.08); padding: 9px 14px; min-height: 40px; max-height: 120px; }
[data-theme="dark"] .chat-compose-row .chat-input { background: #2a3942; color: #e9edef; }
.chat-send { border-radius: 22px; align-self: flex-end; }
.chat-send:disabled { opacity: .55; }
.chat-emoji-btn { font-size: 18px; line-height: 1; }
.chat-emoji-panel { display: none; position: absolute; left: 10px; right: 10px; bottom: calc(100% + 8px); max-height: 280px; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 10px 12px; z-index: 40; }
.chat-emoji-panel.on { display: block; }
.chat-composer { position: relative; }
.chat-emoji-group + .chat-emoji-group { margin-top: 8px; }
.chat-emoji-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #6b7a6b); margin-bottom: 4px; }
.chat-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; }
.chat-emoji-grid button { font-size: 20px; line-height: 1; border: 0; background: transparent; border-radius: 8px; padding: 5px 0; cursor: pointer; }
.chat-emoji-grid button:hover, .chat-emoji-grid button:focus-visible { background: rgba(0,0,0,.07); outline: none; }
[data-theme="dark"] .chat-emoji-panel { background: #233138; }
[data-theme="dark"] .chat-emoji-grid button:hover { background: rgba(255,255,255,.08); }
.tc-stage.tc-audio { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: radial-gradient(circle at 50% 30%, #1f3a2d, #0d1512 70%); }
.tc-audio-card { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #e8f1ea; text-align: center; padding: 20px; }
.tc-audio-card svg { width: 46px; height: 46px; opacity: .9; }
.tc-audio-card b { font-size: 16px; }
.tc-audio-card span { font-size: 12px; opacity: .75; }
.tc-controls .btn { border-radius: 999px; padding-left: 16px; padding-right: 16px; }
