:root {
  --accent: #0e6b52;
  --accent-ink: #0f5a44;
  --accent-soft: #e7f2ee;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --ink: #16191c;
  --ink-2: #4b5258;
  --ink-3: #7b838a;
  --line: #e3e6e8;
  --danger: #c2410c;
  --danger-soft: #fdeee6;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --ok: #15803d;
  --ok-soft: #e7f5ec;
  --blue: #2563eb;
  --blue-soft: #e8effd;
  --violet: #7c3aed;
  --violet-soft: #f0eafd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 16px rgba(16, 24, 32, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #34c08f;
    --accent-ink: #6ee7b7;
    --accent-soft: #12302a;
    --bg: #111416;
    --surface: #181c1f;
    --surface-2: #21262a;
    --ink: #eceff1;
    --ink-2: #b3bac0;
    --ink-3: #868e95;
    --line: #2c3237;
    --danger: #fb923c;
    --danger-soft: #3a2116;
    --warn: #fbbf24;
    --warn-soft: #3a2e12;
    --ok: #4ade80;
    --ok-soft: #14301f;
    --blue: #60a5fa;
    --blue-soft: #172741;
    --violet: #a78bfa;
    --violet-soft: #251d3d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--ink-3); }

/* layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; padding: 6px 10px 14px; font-size: 15px; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-logo.dark { display: none; }
@media (prefers-color-scheme: dark) { .brand-logo.light { display: none; } .brand-logo.dark { display: block; } }
.brand-app { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-left: 1px solid var(--line); padding-left: 9px; margin-left: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 14px 10px 4px; font-weight: 600; }
.soon { margin-left: auto; font-size: 10px; background: var(--surface-2); color: var(--ink-3); padding: 1px 6px; border-radius: 99px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; }
.topbar .grow { flex: 1; }
.content { padding: 22px 28px 60px; max-width: 1400px; }
.btn.menu-btn { display: none; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--ink-3); }
input.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; outline: none; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.in { min-height: 90px; resize: vertical; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 12px 0 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.err { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: 8px; margin: 8px 0; }
.note { background: var(--accent-soft); color: var(--accent-ink); padding: 10px 12px; border-radius: 8px; margin: 8px 0; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h2 { font-size: 14px; margin: 0 0 10px; font-weight: 650; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.stat.bad .n { color: var(--danger); }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.pill.todo { background: var(--surface-2); color: var(--ink-2); }
.pill.in_progress { background: var(--blue-soft); color: var(--blue); }
.pill.in_review { background: var(--violet-soft); color: var(--violet); }
.pill.blocked { background: var(--danger-soft); color: var(--danger); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.prio { font-size: 12px; font-weight: 600; }
.prio.urgent { color: var(--danger); }
.prio.high { color: var(--warn); }
.prio.normal { color: var(--ink-3); }
.prio.low { color: var(--ink-3); opacity: .75; }
.tag { display: inline-block; font-size: 11px; background: var(--surface-2); color: var(--ink-2); padding: 1px 7px; border-radius: 99px; margin-right: 4px; }
.due.over { color: var(--danger); font-weight: 600; }
.due.today { color: var(--warn); font-weight: 600; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }

/* table */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.title-cell { font-weight: 550; }
.group-h { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 20px 0 8px; }
.group-h.bad { color: var(--danger); }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .in { width: auto; min-width: 140px; }
.filters input.in { min-width: 220px; }

/* board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 300px; }
.col.over { outline: 2px dashed var(--accent); }
.col h3 { font-size: 12px; margin: 2px 4px 10px; display: flex; justify-content: space-between; color: var(--ink-2); }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.tcard:hover { border-color: var(--accent); }
.tcard .t { font-weight: 550; margin: 3px 0 6px; }
.tcard .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); }

/* ticket page */
.tk { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.tk-title { font-size: 22px; font-weight: 700; margin: 4px 0 12px; letter-spacing: -.01em; }
.tk-title input { font-size: 22px; font-weight: 700; }
.prose { white-space: pre-wrap; word-wrap: break-word; }
.side-props .p { display: grid; grid-template-columns: 100px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.side-props .p:last-child { border: 0; }
.side-props .k { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.side-props select.in, .side-props input.in { padding: 5px 8px; }
.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment .h { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.comment .h b { color: var(--ink); }
.mention { color: var(--accent-ink); font-weight: 600; }
.act { font-size: 12px; color: var(--ink-3); padding: 3px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 8px; }
.tabs button { background: none; border: 0; padding: 8px 10px; cursor: pointer; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.subtask { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 18, .45); display: grid; place-items: start center; padding: 8vh 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 12px; width: min(640px, 100%); box-shadow: var(--shadow); padding: 20px 22px; max-height: 84vh; overflow-y: auto; }
.modal h2 { margin: 0 0 6px; font-size: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* org chart */
.org-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.node { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; min-width: 150px; text-align: center; }
.node b { display: block; font-size: 13px; }
.node span { font-size: 11px; color: var(--ink-3); }
.node.head { border-color: var(--accent); }
.org-depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 6px; }
.dept-head, .dept-person { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; }
.dept-head { border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 2px; }
.dept-person { padding-left: 14px; }

.empty { padding: 36px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
pre.code { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); animation: toastUp .22s cubic-bezier(.2,.8,.2,1); }
.suggest { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; max-height: 200px; overflow-y: auto; min-width: 220px; }
.suggest div { padding: 6px 10px; cursor: pointer; }
.suggest div:hover, .suggest div.on { background: var(--accent-soft); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .cols, .tk, .grid2 { grid-template-columns: 1fr; }
  .tbl .hide-sm { display: none; }
  .board { grid-template-columns: repeat(5, 78vw); }
}

/* team emails */
.email-cell { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.email-cell a { color: var(--accent, #0d9488); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.email-cell a:hover { text-decoration: underline; }
.copy-btn { border: 0; background: none; cursor: pointer; color: var(--muted, #888); padding: 0 2px; font-size: 12px; line-height: 1; }
.copy-btn:hover { color: var(--accent, #0d9488); }
.node-mail { display: block; font-size: 11px; color: var(--accent, #0d9488); text-decoration: none; margin-top: 2px; }
.btn.xs { padding: 2px 8px; font-size: 11px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 720px) {
  .email-td { max-width: 150px; }
  .email-cell { max-width: 150px; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 720px) { .hide-sm-inline { display: none !important; } }

/* ---------- finance ---------- */
.note.warn-note { background: var(--warn-soft); color: var(--warn); }
.note.warn-note a { color: inherit; font-weight: 600; }
.stat.good .n { color: var(--ok); }
.small-cards .stat .n { font-size: 18px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.over, .over { color: var(--danger); font-weight: 600; }
.tbl.flat { border: 0; }
.tbl.flat th { background: none; padding-left: 0; }
.tbl.flat td { padding-left: 0; }
.mbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 170px; align-items: end; }
.mbar { display: flex; flex-direction: column; height: 100%; }
.mbar .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.mbar .bars span { width: 40%; max-width: 14px; border-radius: 3px 3px 0 0; min-height: 1px; }
.b1 { background: var(--line); }
.b2 { background: var(--accent); }
.mbar .ml { font-size: 10.5px; color: var(--ink-3); text-align: center; margin-top: 4px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 90px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.hbar .hl { color: var(--ink-2); }
.hbar .ht { background: var(--surface-2); height: 10px; border-radius: 5px; overflow: hidden; }
.hbar .hf { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .hf.bad { background: var(--danger); }
.hbar .hv { text-align: right; font-variant-numeric: tabular-nums; }
.inv-cols { grid-template-columns: 1.55fr 1fr; align-items: start; }
.lines { display: grid; gap: 6px; }
.line { display: grid; grid-template-columns: 1fr 64px 104px 64px 104px 30px; gap: 6px; align-items: start; }
.line.head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.line .in { padding: 6px 8px; }
.line .in.sub { margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.line .num { padding-top: 7px; }
.totals { margin: 16px 0 0 auto; max-width: 340px; display: grid; gap: 6px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }
.paybox { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-top: 8px; font-size: 13px; display: grid; gap: 2px; }
.pdf-card { padding: 0; overflow: hidden; }
.pdf-card iframe { width: 100%; height: 78vh; border: 0; display: block; background: var(--surface-2); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--ink-3); }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-row.voided { opacity: .55; }
.pay-row.voided b { text-decoration: line-through; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 30; min-width: 240px; display: grid; }
.menu button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); font: inherit; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.fx-grid label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fx-grid .in { width: 120px; }
/* ---------- access ---------- */
.access-roles { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.role-list { display: grid; gap: 2px; padding: 10px; }
.role-item { display: grid; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.role-item:hover { background: var(--surface-2); }
.role-item.on { background: var(--accent-soft); }
.perm-group { margin-top: 14px; }
.perm-mod { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.perm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.perm-row .key { margin-left: 6px; }
.perm-toggle { display: flex; gap: 6px; align-items: center; width: 100%; background: none; border: 0; padding: 6px 0; cursor: pointer; text-align: left; font-family: inherit; }
.perm-feat { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 10px 0 2px; }
.perm-feature + .perm-feature { margin-top: 4px; }
.in.ov-set { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--surface); padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink-2); border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.role-checks { display: grid; gap: 6px; }
.role-checks label { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
@media (max-width: 900px) {
  .inv-cols, .access-roles { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr 50px 80px 46px 28px; }
  .line > span:nth-child(5) { display: none; }
  .perm-row .key { display: none; }
  .hbar { grid-template-columns: 96px 1fr 70px; }
  .pdf-card iframe { height: 60vh; }
}
.show-sm { display: none; }
@media (max-width: 900px) { .show-sm { display: inline; } }
@media (max-width: 900px) { .tbl .pill { white-space: normal; text-align: center; } }
@media (max-width: 900px) { .tbl td.num, .tbl th.num { white-space: normal; } .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; } }


/* ---------- design refresh: motion, depth, polish ---------- */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --t-fast: 120ms; --t: 180ms; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes toastUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }

.content { animation: fadeUp var(--t) var(--ease); }
.card { transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.card.stat:hover, .tbl tr.click:hover td { box-shadow: none; }
.card.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn { transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { box-shadow: 0 1px 2px rgba(15, 90, 68, .25); }
input.in, select.in, textarea.in { transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.overlay { animation: fadeIn var(--t) ease-out; backdrop-filter: blur(2px); }
.modal { animation: scaleIn .22s var(--ease); }
.tbl tr td { transition: background var(--t-fast); }
.topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); }
.nav a { position: relative; transition: background var(--t-fast), color var(--t-fast); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a > span:first-child { width: 18px; text-align: center; opacity: .8; }
.nav .badge { margin-left: auto; }

.loading { display: grid; gap: 10px; }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0, var(--line) 50%, var(--surface-2) 100%); background-size: 800px 100%; animation: shimmer 1.3s linear infinite; margin-bottom: 8px; }

.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; }
.badge.pop { animation: pop .3s var(--ease); }
.linkbtn { background: none; border: 0; color: var(--accent-ink); cursor: pointer; font-size: 12px; font-weight: 600; padding: 0; }

/* bell + panel */
.bell-wrap { position: relative; }
.bell { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast); }
.bell:hover { background: var(--surface-2); color: var(--ink); }
.bell.has svg { animation: ring .7s ease-in-out; transform-origin: 50% 10%; }
.bell .badge { position: absolute; top: -5px; right: -6px; }
.npanel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(16, 24, 32, .16); z-index: 40; animation: scaleIn .18s var(--ease); transform-origin: top right; overflow: hidden; }
.npanel-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.npanel-list { max-height: 60vh; overflow-y: auto; }
.npanel-f { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; text-align: center; }
.nitem { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; cursor: pointer; color: var(--ink); font: inherit; align-items: flex-start; transition: background var(--t-fast); }
.nitem:hover { background: var(--surface-2); }
.nitem.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.nicon { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 700; }
.nicon.k-message, .nicon.k-mentioned { background: var(--accent-soft); color: var(--accent-ink); }
.nicon.k-blocked, .nicon.k-overdue { background: var(--danger-soft); color: var(--danger); }
.nicon.k-finance { background: var(--warn-soft); color: var(--warn); }
.nbody { display: grid; gap: 2px; min-width: 0; flex: 1; }
.nt { font-weight: 600; font-size: 13px; }
.nb { font-size: 12.5px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-line; }
.nb.full { -webkit-line-clamp: unset; display: block; max-height: 240px; overflow-y: auto; }
.nm { font-size: 11px; color: var(--ink-3); }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.nempty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* toasts */
.ntoasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 70; width: min(360px, calc(100vw - 24px)); }
.ntoast { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 34px rgba(16, 24, 32, .18); overflow: hidden; animation: slideIn .24s var(--ease); }
.ntoast.out { animation: slideOut .18s ease-in forwards; }
.ntoast-h { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 6px 14px; cursor: pointer; }
.ntoast-hint { font-size: 10.5px; color: var(--ink-3); padding: 0 14px 9px 52px; }
.ntoast-a { display: grid; gap: 8px; padding: 2px 14px 12px 52px; animation: fadeIn .15s ease-out; }
.nx { background: none; border: 0; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.nx:hover { color: var(--ink); }

/* receipts */
.receipts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rc { font-size: 11px; color: var(--ink-3); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; }
.rc.read { color: var(--accent-ink); background: var(--accent-soft); }

/* messages */
.msgs { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 130px); min-height: 420px; }
.msg-list { overflow-y: auto; padding: 12px; }
.thread { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 8px; cursor: pointer; color: var(--ink); font: inherit; transition: background var(--t-fast); }
.thread:hover { background: var(--surface-2); }
.thread.on { background: var(--accent-soft); }
.tbody { display: grid; gap: 2px; min-width: 0; flex: 1; }
.tlast { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.lg { width: 34px; height: 34px; font-size: 12px; position: relative; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.online { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.msg-thread { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.thread-wrap { display: flex; flex-direction: column; height: 100%; }
.thread-h { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.back-btn { display: none; }
.thread-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 6px; align-content: start; background: var(--bg); }
.bubble-row { display: flex; animation: fadeUp .16s var(--ease); }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: min(560px, 78%); background: var(--surface); border: 1px solid var(--line); padding: 8px 12px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; word-wrap: break-word; }
.mine .bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.bmeta { font-size: 10.5px; opacity: .7; margin-top: 3px; text-align: right; }
.rcpt.read { font-weight: 700; opacity: 1; }
.day-sep { text-align: center; margin: 8px 0; }
.day-sep span { font-size: 11px; color: var(--ink-3); background: var(--surface-2); padding: 2px 10px; border-radius: 99px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; background: var(--surface); }
.composer textarea.in { min-height: 44px; max-height: 160px; }
@media (max-width: 900px) {
  .msgs { grid-template-columns: 1fr; height: calc(100vh - 110px); }
  .msgs.has-thread .msg-list { display: none; }
  .msgs:not(.has-thread) .msg-thread { display: none; }
  .back-btn { display: inline-flex; }
  .ntoasts { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- knowledge base ---------- */
.page-purpose { color: var(--ink-3); font-size: 13px; margin: -4px 0 14px; max-width: 820px; }
.seg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; flex-wrap: wrap; }
.seg-tabs button { background: none; border: 0; padding: 9px 12px; cursor: pointer; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; transition: color var(--t-fast), border-color var(--t-fast); }
.seg-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.ask { margin-top: 16px; background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--accent-soft) 60%, var(--surface)) 100%); }
.ask-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ask-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 16px; }
.ask-row { display: flex; gap: 8px; }
.ask-row .in { font-size: 15px; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); transition: background var(--t-fast), border-color var(--t-fast); }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.answer { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; animation: fadeUp .2s var(--ease); }
.answer.o-refused, .answer.o-not_found { border-color: var(--warn); background: var(--warn-soft); }
.cite { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10px; font-weight: 700; margin: 0 2px; vertical-align: super; line-height: 1; padding: 0 3px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.src { font-size: 12.5px; background: var(--surface-2); padding: 3px 9px; border-radius: 99px; color: var(--ink-2); }
.src:hover { text-decoration: none; background: var(--accent-soft); color: var(--accent-ink); }
.fb { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .3; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: 1; transform: translateY(-2px); } }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-card { display: grid; gap: 6px; color: var(--ink); align-content: start; }
.kb-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.kb-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--accent-ink); }
.kb-title { font-size: 15px; }
.kb-ex { font-size: 12.5px; color: var(--ink-2); }
.kb-cols { grid-template-columns: 1.7fr 1fr; align-items: start; }
.kb-doc { padding: 24px 28px; }
.kb-h { font-size: 22px; margin: 0 0 10px; letter-spacing: -.01em; }
.kb-md { line-height: 1.65; }
.kb-md h3 { font-size: 15px; margin: 20px 0 6px; }
.kb-md h4 { font-size: 14px; margin: 14px 0 4px; }
.kb-md p { margin: 0 0 10px; }
.kb-md ul, .kb-md ol { margin: 0 0 10px; padding-left: 22px; }
.kb-md li { margin: 3px 0; }
textarea.in.kb-editor { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; }
.flags { margin-top: 14px; border: 1px solid var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.flag { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ok-note { margin-top: 10px; font-size: 12.5px; color: var(--ok); }
.upd { border-top: 1px solid var(--line); padding: 8px 0; }
.kb-row { padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.kb-row:hover { background: var(--surface-2); }
.hol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.hol { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hol:last-child { border-bottom: 0; }
.hol.past { opacity: .5; }
.hol-d { width: 44px; text-align: center; background: var(--accent-soft); color: var(--accent-ink); border-radius: 8px; padding: 4px 0; display: grid; }
.hol-d b { font-size: 17px; line-height: 1.1; } .hol-d span { font-size: 10.5px; }
@media (max-width: 900px) { .kb-cols { grid-template-columns: 1fr; } .kb-doc { padding: 18px; } .ask-row { flex-direction: column; } }

/* ---------- Business Development ---------- */
.w-auto { width: auto !important; min-width: 130px; }
.warn-note { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); transition: background .15s; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.hbar2 { padding: 6px 0; font-size: 13px; }
.hbar2 .ht { background: var(--surface-2); height: 8px; border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
.hbar2 .hf { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; scroll-snap-type: x proximity; }
.kcol { flex: 0 0 260px; background: var(--surface-2); border-radius: var(--radius); padding: 8px; border: 2px dashed transparent; transition: border-color .15s, background .15s; scroll-snap-align: start; max-height: calc(100vh - 230px); display: flex; flex-direction: column; }
.kcol.over { border-color: var(--accent); background: var(--accent-soft); }
.kcol.k-won .kcol-h b { color: var(--ok); }
.kcol.k-lost .kcol-h b { color: var(--ink-3); }
.kcol-h { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 8px; border-bottom: 3px solid var(--accent); margin-bottom: 8px; }
.kcol.k-won .kcol-h { border-color: var(--ok); }
.kcol.k-lost .kcol-h { border-color: var(--ink-3); }
.kcards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: grab; font-size: 13px; transition: box-shadow .15s, transform .15s, opacity .15s; animation: fadeUp .25s ease both; }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.dragging { opacity: .45; }
.kcard .avatar { width: 24px; height: 24px; font-size: 10px; }
.stagebar { display: flex; gap: 3px; margin: 10px 0 14px; overflow-x: auto; }
.stagebar .sb { flex: 1 0 auto; border: 0; background: var(--surface-2); color: var(--ink-2); padding: 8px 12px; font: inherit; font-size: 12px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); transition: background .2s, color .2s; }
.stagebar .sb:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stagebar .sb:hover:not(:disabled) { background: var(--accent-soft); }
.stagebar .sb.on { background: var(--accent); color: #fff; font-weight: 600; }
.stagebar .sb.on.k-won { background: var(--ok); }
.stagebar .sb.on.k-lost { background: var(--ink-3); }
.stagebar .sb:disabled { cursor: default; }
.composer-card textarea.in { min-height: 70px; }
.timeline { position: relative; padding-left: 4px; }
.tl { display: flex; gap: 10px; padding: 10px 0; position: relative; animation: fadeUp .25s ease both; }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 38px; bottom: -4px; width: 2px; background: var(--line); }
.tl-i { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tl.k-email .tl-i { background: var(--blue-soft); }
.tl.k-meeting .tl-i { background: var(--violet-soft); }
.tl.k-call .tl-i { background: var(--ok-soft); }
.tl.k-stage .tl-i { background: var(--accent-soft); }
.tl-b { flex: 1; min-width: 0; font-size: 13px; }
.tl-b p, .tl-b .body { white-space: pre-wrap; word-break: break-word; margin: 4px 0 0; color: var(--ink-2); }
@media (max-width: 700px) { .kcol { flex-basis: 82vw; } }

/* =====================================================================
   Design v2 — "calm, alive": depth, colour accents and subtle motion.
   Applies to every module. Motion is disabled for people who ask the OS for reduced motion.
   ===================================================================== */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --bg: #f4f6f5;
  --line: #e4e8e6;
  --line-2: #eef1ef;
  --grad: linear-gradient(135deg, #0f5a44 0%, #0e6b52 45%, #14917a 100%);
  --grad-soft: linear-gradient(135deg, #e9f5f0 0%, #f3f8ff 100%);
  --shadow-1: 0 1px 2px rgba(16, 40, 32, .05), 0 1px 1px rgba(16, 40, 32, .03);
  --shadow: 0 1px 2px rgba(16, 40, 32, .05), 0 8px 24px -6px rgba(16, 40, 32, .10);
  --shadow-lg: 0 2px 4px rgba(16, 40, 32, .05), 0 24px 48px -12px rgba(16, 40, 32, .22);
  --glow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1012; --line: #252b2f; --line-2: #1d2226;
    --grad: linear-gradient(135deg, #0f5a44 0%, #138a6b 50%, #1fb58f 100%);
    --grad-soft: linear-gradient(135deg, #10241e 0%, #121a26 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -6px rgba(0,0,0,.5);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 24px 48px -12px rgba(0,0,0,.7);
  }
}
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, #2563eb 5%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -.003em;
}
h1, h2, h3, .topbar h1, .kb-h, .card h2, .stat .n { font-family: var(--font-display); }

/* sidebar */
.side { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); border-right-color: var(--line-2); }
.nav a { border-radius: 10px; padding: 8px 10px; transition: background .18s var(--ease), color .18s, transform .18s var(--ease); }
.nav a:hover { transform: translateX(2px); }
.nav a.on { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)); color: var(--accent-ink); font-weight: 600; }
.nav a.on::before { background: var(--grad); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.nav a.on > span:first-child { opacity: 1; }
.nav-label { letter-spacing: .09em; font-size: 10.5px; }

/* top bar + page transitions */
.topbar { border-bottom-color: var(--line-2); padding: 16px 32px; }
.topbar h1 { font-size: 20px; letter-spacing: -.02em; font-weight: 750; }
.content { padding: 24px 32px 72px; animation: pageIn .38s var(--ease) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* cards: softer, deeper, staggered entrance */
.card { border-radius: var(--radius); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.cards > .card, .cols > .card, .cols > div > .card, .kb-grid > .card, .grid2 > .card { animation: rise .45s var(--ease) backwards; }
.cards > :nth-child(2), .cols > :nth-child(2) { animation-delay: 50ms; }
.cards > :nth-child(3) { animation-delay: 100ms; }
.cards > :nth-child(4) { animation-delay: 150ms; }
.cards > :nth-child(5) { animation-delay: 200ms; }
.cards > :nth-child(6) { animation-delay: 250ms; }
.card.stat { position: relative; overflow: hidden; }
.card.stat::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); pointer-events: none; transition: transform .5s var(--ease); }
.card.stat:hover::after { transform: scale(1.3); }
.card.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat .n { font-size: 30px; letter-spacing: -.03em; font-weight: 800; font-variant-numeric: tabular-nums; }
.card h2 { font-size: 14.5px; letter-spacing: -.01em; }

/* buttons + inputs */
.btn { border-radius: 10px; border-color: var(--line); box-shadow: var(--shadow-1); }
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.btn.primary { background: var(--grad); border-color: transparent; position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 90, 68, .3), 0 6px 16px -6px rgba(15, 90, 68, .55); }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s var(--ease); }
.btn.primary:hover:not(:disabled)::after { transform: translateX(120%); }
.btn.primary:hover:not(:disabled) { filter: none; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 90, 68, .3), 0 10px 22px -8px rgba(15, 90, 68, .6); }
input.in, select.in, textarea.in { border-radius: 10px; border-color: var(--line); background: var(--surface); }
input.in:focus, select.in:focus, textarea.in:focus { box-shadow: var(--glow); }
.chip { transition: all .18s var(--ease); }
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* segmented controls + tabs */
.seg { border-radius: 11px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line-2); }
.seg button { border-radius: 8px; transition: background .2s var(--ease), color .2s, box-shadow .2s; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line-2); color: var(--ink); }
.seg-tabs button { position: relative; transition: color .2s; }
.seg-tabs button::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--grad); transform: scaleX(0); transition: transform .3s var(--ease); }
.seg-tabs button.on::after { transform: scaleX(1); }

/* tables */
.tbl { border-radius: var(--radius); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.tbl th { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.tbl tr.click td:first-child { box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow .18s var(--ease), background .15s; }
.tbl tr.click:hover td:first-child { box-shadow: inset 3px 0 0 0 var(--accent); }
.tbl tbody tr { animation: fadeIn .35s ease both; }

/* pills, avatars, modals, toasts */
.pill { border-radius: 99px; padding: 2px 9px; font-weight: 600; letter-spacing: .005em; }
.avatar { background: var(--grad); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.overlay { backdrop-filter: blur(6px) saturate(1.2); background: rgba(8, 14, 12, .38); }
.modal { border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-2); animation: modalIn .32s var(--spring) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.page-purpose { color: var(--ink-2); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }

/* ---------- Knowledge Base v2 ---------- */
.kb-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 30px 32px 26px; margin: 4px 0 26px; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); animation: rise .5s var(--ease) backwards; isolation: isolate; }
.kb-hero-glow { position: absolute; inset: -40%; z-index: -1; background:
  radial-gradient(closest-side at 20% 30%, rgba(110, 231, 183, .45), transparent),
  radial-gradient(closest-side at 80% 70%, rgba(96, 165, 250, .35), transparent),
  radial-gradient(closest-side at 60% 10%, rgba(255, 255, 255, .18), transparent);
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-4%, -3%) rotate(0deg); } to { transform: translate(4%, 3%) rotate(8deg); } }
.kb-hero .eyebrow { color: rgba(255,255,255,.75); }
.kb-hero-h { font-size: 30px; line-height: 1.15; margin: 6px 0 6px; letter-spacing: -.03em; font-weight: 800; }
.kb-hero-sub { margin: 0 0 18px; color: rgba(255,255,255,.82); max-width: 720px; font-size: 13.5px; }
.askx { background: rgba(255,255,255,.96); color: var(--ink); border-radius: 16px; padding: 8px; box-shadow: 0 12px 32px -10px rgba(0, 30, 20, .45); position: relative; }
@media (prefers-color-scheme: dark) { .askx { background: rgba(20, 26, 28, .94); } }
.askx.busy::before { content: ""; position: absolute; inset: -2px; border-radius: 18px; z-index: -1; background: conic-gradient(from var(--a, 0deg), #6ee7b7, #60a5fa, #a78bfa, #6ee7b7); animation: spin 2.4s linear infinite; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }
.askx-row { display: flex; gap: 8px; align-items: center; }
.askx-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 15px; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(18deg) scale(1.08); } }
.askx input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15.5px; padding: 8px 4px; color: var(--ink); }
.askx .chips { padding: 2px 4px 4px; margin-top: 6px; }
.askx .answer { margin: 10px 4px 4px; }
.hero-chip { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 99px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; transition: background .2s; backdrop-filter: blur(6px); }
.hero-chip:hover { background: rgba(255,255,255,.24); }
.src-sp { font-size: 10.5px; font-weight: 700; color: var(--violet); }

.sec-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.sec-h h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.sec-h span { color: var(--ink-3); font-size: 12.5px; }
.coll-grid, .space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 26px; }
.coll, .space { --c: var(--accent); position: relative; text-align: left; display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; overflow: hidden; box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.coll::before, .space::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .9; }
.coll::after, .space::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%); transition: transform .5s var(--ease); pointer-events: none; }
.coll:hover, .space:hover:not(.static) { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.coll:hover::after, .space:hover::after { transform: scale(1.5); }
.coll.on, .space.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent), var(--shadow); }
.space.static { cursor: default; }
.space.off { opacity: .55; }
.coll-ic, .space-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); transition: transform .3s var(--spring); }
.coll:hover .coll-ic, .space:hover .space-ic { transform: scale(1.1) rotate(-6deg); }
.coll b, .space b { font-size: 14.5px; font-family: var(--font-display); letter-spacing: -.01em; }
.coll-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.coll-n { font-size: 11.5px; font-weight: 600; color: var(--c); margin-top: 2px; }
.space-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mine { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }

.kb-list { scroll-margin-top: 80px; }
.kb-list-h { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.search-in { position: relative; margin-left: auto; width: 260px; max-width: 100%; }
.search-in span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-in .in { padding-left: 30px; }
.kb-card { --c: var(--accent); position: relative; overflow: hidden; padding-left: 20px; animation-delay: calc(var(--i, 0) * 35ms) !important; }
.kb-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); opacity: .85; transition: width .25s var(--ease); }
.kb-card:hover { border-color: color-mix(in srgb, var(--c) 40%, var(--line)); transform: translateY(-2px); }
.kb-card:hover::before { width: 6px; }
.kb-card .kb-cat { color: var(--c); }

.kb-article { --c: var(--accent); }
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 50%, #60a5fa)); transform-origin: 0 50%; transform: scaleX(0); transition: transform .1s linear; }
.kb-crumb { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); padding: 3px 10px; border-radius: 99px; }
.kb-doc { padding: 30px 36px; position: relative; overflow: hidden; }
.kb-doc::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--c), transparent); }
.kb-h { font-size: 27px; letter-spacing: -.03em; font-weight: 800; margin-bottom: 4px; }
.kb-byline { color: var(--ink-3); font-size: 12.5px; margin-bottom: 18px; }
.kb-md { font-size: 14.5px; line-height: 1.72; max-width: 760px; }
.kb-md h3 { font-size: 16.5px; margin: 26px 0 8px; font-family: var(--font-display); letter-spacing: -.015em; scroll-margin-top: 90px; }
.kb-md h3::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 2px; background: var(--c); margin: 0 9px 3px 0; transform: rotate(45deg); }
.kb-md li::marker { color: var(--c); }
.kb-md b { color: var(--ink); }
.kb-side { display: grid; gap: 16px; align-content: start; position: sticky; top: 84px; }
.kb-toc .toc-i { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); cursor: pointer; font-size: 13px; border-left: 2px solid var(--line); transition: all .18s var(--ease); }
.kb-toc .toc-i:hover { color: var(--c); border-left-color: var(--c); background: color-mix(in srgb, var(--c) 6%, transparent); padding-left: 14px; }

/* holiday calendar */
.k-closure { --k: #dc2626; } .k-floating { --k: #0e6b52; } .k-coverage { --k: #2563eb; } .k-optional { --k: #a16207; }
@media (prefers-color-scheme: dark) { .k-closure { --k: #f87171; } .k-floating { --k: #34d399; } .k-coverage { --k: #60a5fa; } .k-optional { --k: #fbbf24; } }
.kdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--k, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k, #fff) 22%, transparent); flex: none; }
.kpill { display: inline-flex; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; color: var(--k); background: color-mix(in srgb, var(--k) 12%, transparent); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.hol-top { display: grid; grid-template-columns: 1fr 260px; gap: 14px; margin-top: 14px; }
.hol-policy { background: var(--grad-soft); border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); animation: rise .45s var(--ease) backwards; }
.hol-policy h3 { margin: 6px 0 6px; font-size: 18px; letter-spacing: -.02em; line-height: 1.3; }
.hol-next { display: grid; gap: 6px; justify-items: start; position: relative; overflow: hidden; animation: rise .45s var(--ease) backwards; animation-delay: 60ms; }
.hol-next::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--k); }
.hol-next-d { display: grid; justify-items: center; width: 58px; padding: 6px 0; border-radius: 12px; color: #fff; background: var(--k); box-shadow: 0 8px 18px -8px var(--k); }
.hol-next-d b { font-size: 22px; line-height: 1; font-family: var(--font-display); } .hol-next-d span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.hol-stats { margin-top: 14px; }
.hol-month { animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.hol-d { background: color-mix(in srgb, var(--k, var(--accent)) 12%, var(--surface)); color: var(--k, var(--accent-ink)); border-radius: 10px; width: 46px; }
.hol { transition: background .15s; border-radius: 8px; padding: 9px 6px; }
.hol:hover { background: var(--surface-2); }
.hol.past { opacity: .55; }
.kind-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kind-opt { text-align: left; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; transition: all .18s var(--ease); font: inherit; color: var(--ink); }
.kind-opt b { color: var(--k); font-size: 13px; }
.kind-opt span { font-size: 11.5px; color: var(--ink-3); }
.kind-opt.on { border-color: var(--k); background: color-mix(in srgb, var(--k) 8%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 14%, transparent); }
@media (max-width: 900px) {
  .kb-hero { padding: 22px 18px; border-radius: 18px; } .kb-hero-h { font-size: 23px; }
  .askx-row { flex-wrap: wrap; } .askx-row .btn { width: 100%; justify-content: center; }
  .hol-top { grid-template-columns: 1fr; } .kb-side { position: static; } .kb-doc { padding: 22px 18px; } .kb-h { font-size: 22px; }
  .search-in { width: 100%; margin-left: 0; } .content { padding: 18px 16px 60px; } .topbar { padding: 12px 16px; }
  .kind-pick { grid-template-columns: 1fr; }
}

/* motion off for people who ask for it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .kb-hero-glow, .askx-ic { animation: none !important; }
}
.topbar { background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: saturate(1.4) blur(14px); }
.hero-chip .kdot { box-shadow: 0 0 0 2px #fff; }

@media (max-width: 600px) {
  .coll-grid, .space-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .coll, .space { padding: 12px; }
  .coll .coll-sub, .space .coll-sub { display: none; }
}

/* ---------- Business Success + Delivery ---------- */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring.ring-none { border: 2px dashed var(--c); border-radius: 50%; box-sizing: border-box; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke-linecap: round; stroke-dashoffset: var(--off); animation: ringIn 1s var(--ease) backwards; }
@keyframes ringIn { from { stroke-dashoffset: var(--full); } }
.ring b { font-family: var(--font-display); font-variant-numeric: tabular-nums; position: relative; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.client-card { --c: var(--accent); display: grid; gap: 10px; color: var(--ink); position: relative; overflow: hidden; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
.client-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .85; }
.client-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.cc-name { font-size: 15px; font-family: var(--font-display); letter-spacing: -.01em; display: block; margin-bottom: 2px; }
.cc-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.cc-team { display: flex; } .cc-team .avatar { margin-right: -6px; width: 26px; height: 26px; font-size: 10px; }
.sec-title { margin: 22px 0 10px; font-size: 16px; letter-spacing: -.02em; }
.ws-head { display: flex; gap: 18px; align-items: center; position: relative; overflow: hidden; flex-wrap: wrap; }
.ws-head::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.ws-head::after { content: ""; position: absolute; right: -80px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 12%, transparent), transparent 70%); pointer-events: none; }
.ws-name { margin: 0; font-size: 24px; letter-spacing: -.03em; font-weight: 800; }
.ws-band { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 2px 9px; border-radius: 99px; }
.ws-sub { margin-top: 3px; }
.ws-actions { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.ws-cols { margin-top: 14px; grid-template-columns: 1.6fr 1fr; align-items: start; }
.tag-link { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.ck-hist { display: flex; gap: 3px; } .ckd { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ck-met { background: var(--ok); } .ck-on_track { background: color-mix(in srgb, var(--accent) 60%, var(--surface)); } .ck-at_risk { background: var(--warn); } .ck-missed { background: var(--danger); }
.reason { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; } .reason:last-child { border: 0; }
.reason b { color: var(--danger); min-width: 30px; font-variant-numeric: tabular-nums; }
.person { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); } .person:last-child { border: 0; }
.person .avatar { width: 30px; height: 30px; font-size: 11px; }
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.perf-tile { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 4px; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.perf-n { font-size: 24px; font-weight: 800; font-family: var(--font-display); letter-spacing: -.03em; }
.spark polyline { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.perf-list { display: grid; gap: 12px; }
.perf-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 8px; }
.perf-metrics > div { display: grid; gap: 1px; } .perf-metrics b { font-size: 18px; font-family: var(--font-display); }
.commit-card { display: grid; gap: 6px; align-content: start; animation-delay: calc(var(--i, 0) * 35ms) !important; }
.hist { display: grid; gap: 4px; margin-top: 4px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.hist-r { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; } .hist-r .small:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-ed { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; }
.report-prev { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 12px; background: #f4f6f5; }
.overlay .modal:has(.report-ed) { width: min(1180px, 96vw); max-width: none; }
.sev { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; flex: none; }
.sev-critical { background: var(--danger); color: #fff; } .sev-high { background: var(--warn-soft); color: var(--warn); } .sev-normal { background: var(--surface-2); color: var(--ink-2); }
.sevk-critical { --k: var(--danger); } .sevk-high { --k: var(--warn); } .sevk-normal { --k: var(--ink-2); }
.stars { display: flex; gap: 2px; } .stars button { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--line); transition: transform .15s var(--spring), color .15s; padding: 0 2px; }
.stars button.on { color: #f59e0b; } .stars button:hover { transform: scale(1.18); }
.hbarx { display: flex; height: 30px; border-radius: 10px; overflow: hidden; gap: 2px; }
.hbarx span { display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; animation: growX .8s var(--ease) backwards; transform-origin: left; }
@keyframes growX { from { transform: scaleX(0); } }
@media (max-width: 900px) { .ws-cols, .report-ed { grid-template-columns: 1fr; } .ws-actions { width: 100%; } .ws-name { font-size: 20px; } .report-prev { height: 50vh; } }
.commit-card { min-width: 0; overflow: hidden; }

/* ---------- People & HR ---------- */
.pav { position: relative; display: inline-grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; flex: none; box-shadow: 0 0 0 2px var(--surface); }
.pav img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pdot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; max-width: 16px; max-height: 16px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink-3); display: inline-block; }
.me-menu .pdot { position: static; border: 0; width: 9px; height: 9px; min-width: 9px; min-height: 9px; margin-right: 8px; }
.st-ok { --s: #16a34a; } .st-busy { --s: #dc2626; } .st-away { --s: #f59e0b; } .st-leave { --s: #8b5cf6; } .st-off { --s: #9ca3af; }
.pdot.st-ok, .pdot.st-busy, .pdot.st-away, .pdot.st-leave, .pdot.st-off { background: var(--s); }
.pdot.st-ok { box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.st-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; color: var(--s); background: color-mix(in srgb, var(--s) 12%, transparent); }
.st-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
/* clock widget */
.clockw { margin: 0 4px 10px; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-1); display: grid; gap: 4px; position: relative; overflow: hidden; }
.clockw::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--ink-3); }
.clockw.st-in::before { background: var(--ok); } .clockw.st-break::before { background: var(--warn); } .clockw.st-out::before { background: var(--accent); } .clockw.st-done::before { background: var(--ink-3); }
.clockw.st-out { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.clockw-l { font-size: 12.5px; font-weight: 700; }
.clockw-s { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.clockw-t b { font-family: var(--font-display); font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .clockw-t span { font-size: 11.5px; color: var(--ink-3); }
.clockw-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; } .clockw-bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; transition: width .6s var(--ease); }
.clockw-a { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; } .clockw-a .btn.primary { width: 100%; justify-content: center; }
/* sidebar me */
.me-foot { position: relative; padding: 8px 6px; }
.me-btn { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 6px; border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: background .15s; }
.me-btn:hover { background: var(--surface-2); } .me-btn > span:last-child { display: grid; overflow: hidden; } .me-btn b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-menu { position: absolute; bottom: calc(100% + 4px); left: 6px; right: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; animation: scaleIn .18s var(--ease); z-index: 30; }
.me-menu button, .me-menu a { display: flex; align-items: center; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.me-menu button:hover, .me-menu a:hover { background: var(--surface-2); text-decoration: none; }
.me-sep { height: 1px; background: var(--line-2); margin: 4px 0; }
/* announcements */
.ann { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-bottom: 16px; }
.ann-i { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12.5px; animation: rise .4s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms); position: relative; }
.ann-i.k-eotm { background: linear-gradient(135deg, #fff7e6, var(--surface)); border-color: #f5d48a; }
@media (prefers-color-scheme: dark) { .ann-i.k-eotm { background: linear-gradient(135deg, #3a2e12, var(--surface)); border-color: #6b5420; } }
.ann-i.k-joiner { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ann-ic { font-size: 18px; flex: none; } .ann-i b { display: block; font-size: 12.5px; } .ann-sub { display: block; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 15px; opacity: 0; transition: opacity .15s; } .ann-i:hover .ann-x { opacity: 1; }
/* directory */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.person-card { display: grid; justify-items: center; text-align: center; gap: 4px; color: var(--ink); padding: 20px 14px; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.person-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); } .person-card .pav { margin-bottom: 6px; }
/* profile */
.prof-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; }
.prof-head::after { content: ""; position: absolute; right: -100px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); pointer-events: none; }
.prof-ph { position: relative; } .prof-up { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; font-size: 13px; box-shadow: var(--shadow-1); transition: transform .15s var(--spring); } .prof-up:hover { transform: scale(1.12); }
.prof-name { margin: 0; font-size: 26px; letter-spacing: -.03em; font-weight: 800; } .prof-sub { color: var(--ink-2); margin-top: 2px; }
.tag-warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.jd h3 { font-size: 15px; margin: 18px 0 6px; font-family: var(--font-display); } .pre { white-space: pre-wrap; line-height: 1.65; color: var(--ink-2); }
.pay-total { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 10px; display: flex; align-items: baseline; gap: 8px; } .pay-total span { font-size: 12px; font-weight: 500; color: var(--ink-3); font-family: var(--font); letter-spacing: 0; }
.stars.static b { color: var(--line); font-size: 16px; } .stars.static b.on { color: #f59e0b; }
.leave-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.leave-card { --c: var(--accent); position: relative; overflow: hidden; display: grid; gap: 2px; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.leave-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); }
.leave-n { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--c); letter-spacing: -.03em; } .leave-n span { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 6px; font-family: var(--font); letter-spacing: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-h { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 4px 6px; }
.cal-d { min-height: 74px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 6px 8px; display: grid; align-content: start; gap: 1px; font-size: 11.5px; transition: transform .15s; }
.cal-d:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.cal-n { font-weight: 700; font-size: 12.5px; } .cal-t { color: var(--ink-2); font-variant-numeric: tabular-nums; } .cal-w { color: var(--ink-3); } .cal-w b { color: var(--warn); font-weight: 600; }
.cal-d.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.c-present { background: color-mix(in srgb, var(--ok) 7%, var(--surface)); } .c-late { background: color-mix(in srgb, var(--warn) 9%, var(--surface)); } .c-half_day { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.c-absent, .c-missing { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); } .c-leave { background: color-mix(in srgb, #8b5cf6 9%, var(--surface)); } .c-closed { background: var(--surface-2); } .c-off { background: transparent; border-style: dashed; opacity: .6; }
@media (max-width: 700px) { .cal { gap: 3px; } .cal-d { min-height: 46px; padding: 4px; } .cal-t, .cal-w { display: none; } .prof-name { font-size: 21px; } }
.prof-head .prof-name { font-size: 26px; letter-spacing: -.03em; font-weight: 800; margin: 0; } @media (max-width: 700px) { .prof-head .prof-name { font-size: 21px; } }

/* ---------- Payroll, Employee of the Month, time ---------- */
.stagebar .sb.k-won:not(.on) { background: var(--ok-soft); color: var(--ok); }
.stagebar .sb:disabled { cursor: default; opacity: 1; }
.stagebar .sb.on { background: var(--accent); color: #fff; }
.ebars { display: grid; gap: 4px; margin-top: 8px; }
.ebars.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 12px; margin-top: 0; }
.ebar { display: grid; grid-template-columns: 112px 1fr 26px; align-items: center; gap: 6px; font-size: 11.5px; }
.ebars.compact .ebar { grid-template-columns: 1fr 26px; }
.ebars.compact .ebar .l { grid-column: 1 / -1; color: var(--ink-3); font-size: 10.5px; margin-bottom: -2px; }
.ebar .l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ebar .b, .b-track { display: block; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.ebar .b i, .b-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #34d399); border-radius: 99px; transition: width .6s var(--spring, ease); animation: grow-x .7s ease backwards; transform-origin: left; }
.ebar .b i.na { background: transparent; }
.ebar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
@keyframes grow-x { from { transform: scaleX(0); } }
.eotm-win { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(16,185,129,.08)); border-color: rgba(245,158,11,.35); }
.eotm-trophy { font-size: 44px; animation: pop .6s var(--spring, ease) backwards; }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.eotm-noms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.eotm-nom { border: 1px solid var(--line); border-radius: 12px; padding: 12px; transition: border-color .2s, box-shadow .2s; }
.eotm-nom:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.eotm-nom.won { border-color: #f59e0b; background: rgba(245,158,11,.06); }
.eotm-score { font-size: 24px; font-weight: 750; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.tt { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.tt .k { color: var(--ink-3); font-size: 12px; }
.tbl tr.muted td { opacity: .62; }
@media (max-width: 700px) { .ebars.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ebar { grid-template-columns: 90px 1fr 26px; } }
.slab-tbl td { padding: 4px 4px; } .slab-tbl .in { min-width: 92px; padding: 6px 8px; font-variant-numeric: tabular-nums; } .slab-tbl td:nth-child(4) .in { min-width: 56px; }
.echips { display: flex; flex-wrap: wrap; gap: 4px; }
.echip { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.echip b { font-variant-numeric: tabular-nums; }
.echip.hi { background: var(--ok-soft); color: var(--ok); } .echip.lo { background: var(--warn-soft); color: var(--warn); } .echip.na { opacity: .55; }
.stat .n.money { font-size: 24px; white-space: nowrap; }
@media (max-width: 700px) { .stat .n.money { font-size: 17px; } }
.pay-sched { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.pay-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-step { display: grid; grid-template-columns: 18px auto; column-gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
.pay-step span { grid-row: span 2; align-self: center; font-weight: 700; color: var(--ink-3); }
.pay-step small { color: var(--ink-3); }
.pay-step.done { background: var(--ok-soft); } .pay-step.done span, .pay-step.done b { color: var(--ok); }
.pay-step.late { background: var(--warn-soft); } .pay-step.late span { color: var(--warn); }
.stagebar .sb .sb-due { font-size: 11px; opacity: .8; }

/* ---------- Announcements board (home) ---------- */
.ann-board { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-bottom: 20px; }
.ann-board.solo { grid-template-columns: 1fr; }
.ann-feat { position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; color: #fff; display: flex; gap: 20px; align-items: flex-start; min-height: 190px;
  background: linear-gradient(135deg, #0b3d2e 0%, #0f5a44 45%, #14876a 100%); box-shadow: 0 18px 40px -18px rgba(11,61,46,.55); animation: annIn .55s var(--spring) backwards; }
.ann-feat.k-eotm { background: linear-gradient(135deg, #3b2a06 0%, #8a5a0b 45%, #d4a017 100%); box-shadow: 0 18px 40px -18px rgba(138,90,11,.6); }
.ann-feat.k-birthday { background: linear-gradient(135deg, #4c1d95 0%, #9d174d 55%, #f97316 100%); }
.ann-feat.k-holiday { background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 60%, #14b8a6 100%); }
.ann-glow { position: absolute; width: 340px; height: 340px; right: -90px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); animation: annFloat 9s ease-in-out infinite; pointer-events: none; }
.ann-feat-ic { font-size: 52px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0,0,0,.25)); animation: annBob 3.2s ease-in-out infinite; flex: none; }
.ann-feat-b { position: relative; min-width: 0; flex: 1; }
.ann-feat .eyebrow { color: rgba(255,255,255,.78); }
.ann-feat h2 { color: #fff; font-size: 24px; line-height: 1.2; margin: 6px 0 6px; letter-spacing: -.02em; }
.ann-feat p { margin: 0 0 10px; color: rgba(255,255,255,.88); font-size: 14px; max-width: 60ch; }
.ann-feat-f { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: rgba(255,255,255,.7); min-height: 16px; }
.ann-dots { display: flex; gap: 6px; margin-left: auto; } .ann-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: rgba(255,255,255,.4); cursor: pointer; padding: 0; transition: width .25s var(--ease), background .2s; }
.ann-dots button.on { width: 22px; background: #fff; }
.ann-feat.confetti::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, #fde047 2px, transparent 2.5px), radial-gradient(circle, #fff 1.5px, transparent 2px), radial-gradient(circle, #f472b6 2px, transparent 2.5px);
  background-size: 90px 90px, 70px 70px, 110px 110px; background-position: 0 0, 30px 40px, 60px 10px; animation: confetti 6s linear infinite; opacity: .7; }
.ann-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-content: start; }
.ann-tile { position: relative; padding: 14px 15px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); display: grid; gap: 6px; align-content: start;
  animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 120ms); transition: transform .2s var(--ease), box-shadow .2s; }
.ann-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ann-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 16px 16px 0 0; background: var(--grad); }
.ann-tile.k-birthday::before { background: linear-gradient(90deg, #a855f7, #f97316); } .ann-tile.k-holiday::before { background: linear-gradient(90deg, #0ea5e9, #14b8a6); }
.ann-tile.k-joiner::before { background: linear-gradient(90deg, #10b981, #84cc16); } .ann-tile.k-anniversary::before { background: linear-gradient(90deg, #f59e0b, #eab308); }
.ann-tile-h { display: flex; align-items: center; gap: 7px; } .ann-tile-h .ann-ic { font-size: 18px; } .ann-tile-h .ann-x { margin-left: auto; }
.ann-t { font-weight: 650; font-size: 14px; line-height: 1.3; }
.ann-sub { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.ann-count { display: flex; align-items: baseline; gap: 6px; } .ann-count b { font-family: var(--font-display); font-size: 34px; letter-spacing: -.03em; background: linear-gradient(135deg, #0e7490, #14b8a6); -webkit-background-clip: text; background-clip: text; color: transparent; } .ann-count span { color: var(--ink-3); font-size: 12px; }
.ann-avs { display: flex; align-items: center; padding-left: 6px; } .ann-av { margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); display: inline-flex; transition: transform .2s var(--spring); }
.ann-feat .ann-av { box-shadow: 0 0 0 2px rgba(255,255,255,.6); } .ann-av:hover { transform: translateY(-3px) scale(1.06); z-index: 1; }
.ann-av.today { box-shadow: 0 0 0 2px #f472b6, 0 0 12px #f472b6; } .ann-more { margin-left: 4px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.ann-cta { justify-self: start; margin-top: 2px; }
.ann-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; opacity: 0; transition: opacity .15s; } .ann-tile:hover .ann-x, .ann-feat:hover .ann-x { opacity: 1; }
.ann-x.light { position: absolute; top: 10px; right: 12px; color: rgba(255,255,255,.8); }
@keyframes annIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes annBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes annFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 20px); } }
@keyframes confetti { from { background-position: 0 0, 30px 40px, 60px 10px; } to { background-position: 0 180px, 30px 180px, 60px 230px; } }
@media (max-width: 900px) { .ann-board { grid-template-columns: 1fr; } .ann-feat { padding: 20px; } .ann-feat-ic { font-size: 40px; } .ann-feat h2 { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .ann-feat-ic, .ann-glow, .ann-feat.confetti::after { animation: none; } }

/* ---------- Collapsible sidebar + always-visible clock ---------- */
.side > * { flex-shrink: 0; }               /* the clock card never gets squeezed by a long menu */
.side .nav { flex-shrink: 1; }
.shell { transition: grid-template-columns .28s var(--ease); }
.brand { position: relative; }
.brand-mark { display: none; width: 30px; height: 30px; border-radius: 8px; }
.side-toggle { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center; transition: background .15s, color .15s, transform .2s var(--spring); }
.side-toggle:hover { background: var(--accent-soft); color: var(--accent-ink); transform: scale(1.08); }
@media (min-width: 901px) {
  .shell.mini { grid-template-columns: 68px 1fr; }
  .shell.mini .side { padding: 12px 8px; overflow-x: hidden; }
  .shell.mini .brand { flex-direction: column; padding: 4px 0 10px; gap: 8px; }
  .shell.mini .brand-logo, .shell.mini .brand-app { display: none !important; }
  .shell.mini .brand-mark { display: block; }
  .shell.mini .side-toggle { margin: 0; }
  .shell.mini .nav a { font-size: 0; justify-content: center; padding: 9px 0; gap: 0; }
  .shell.mini .nav a > span:first-child { font-size: 16px; width: auto; }
  .shell.mini .nav a .badge { position: absolute; top: 2px; right: 6px; font-size: 9px; padding: 0 4px; min-width: 0; }
  .shell.mini .nav a .soon { display: none; }
  .shell.mini .nav a:hover { transform: none; }
  .shell.mini .nav a.on::before { left: -8px; }
  .shell.mini .nav-label { font-size: 0; height: 1px; margin: 8px 10px; padding: 0; background: var(--line); }
  .shell.mini .me-btn > span { display: none; }
  .shell.mini .me-foot { padding: 8px 0; display: flex; justify-content: center; }
  .shell.mini .me-menu { left: 56px; bottom: 8px; width: 220px; }
}
.clockw-mini { position: relative; width: 44px; height: 44px; margin: 0 auto 10px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.clockw-mini svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.clockw-mini circle { fill: none; stroke-width: 3.5; } .clockw-mini .bg { stroke: var(--surface-2); } .clockw-mini .fg { stroke: var(--ok); stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }
.clockw-mini span { font-size: 18px; color: var(--ink-2); }
.clockw-mini.st-out { animation: pulseRing 2.4s ease-in-out infinite; border-radius: 50%; } .clockw-mini.st-out span { color: var(--accent-ink); }
.clockw-mini.st-break .fg { stroke: var(--warn); }
@keyframes pulseRing { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }

.topclock { position: relative; display: flex; align-items: center; gap: 6px; }
.topclock-s { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-2); transition: border-color .15s, box-shadow .15s; }
.topclock-s:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topclock-s b { font-variant-numeric: tabular-nums; color: var(--ink); }
.tc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.topclock.st-in .tc-dot { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: livePulse 2s infinite; }
.topclock.st-break .tc-dot { background: var(--warn); } .topclock.st-out .tc-dot { background: var(--danger); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.topclock-pop { position: absolute; top: 42px; right: 0; width: 240px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); z-index: 30; display: grid; gap: 6px; animation: rise .2s var(--ease) backwards; }
.tc-link { display: block; margin-top: 4px; }
@media (max-width: 900px) { .topclock .tc-l { display: none; } .side-toggle { display: none; } }
.nt-plus { display: none; font-size: 18px; line-height: 1; }
@media (max-width: 600px) { .nt-btn .nt-l, .nt-btn .kbd { display: none; } .nt-plus { display: inline; } .nt-btn { padding: 0 12px; } .topbar { gap: 8px; } .topbar h1 { font-size: 18px; } }
.ann-tile.k-away::before { background: linear-gradient(90deg, #06b6d4, #22c55e); }
.plan-card { display: grid; gap: 10px; }
.plan-bar { display: flex; gap: 5px; } .plan-bar i { flex: 1; height: 10px; border-radius: 4px; background: var(--surface-2); border: 1px dashed var(--line); }
.plan-bar i.used { background: var(--accent); border-color: transparent; } .plan-bar i.pend { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: transparent; }
.ann-tile.k-away::before { background: linear-gradient(90deg, #06b6d4, #22c55e); }
.plan-card { display: grid; gap: 10px; }
.plan-bar { display: flex; gap: 5px; } .plan-bar i { flex: 1; height: 10px; border-radius: 4px; background: var(--surface-2); border: 1px dashed var(--line); }
.plan-bar i.used { background: var(--accent); border-color: transparent; } .plan-bar i.pend { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: transparent; }

/* ---------- Tools ---------- */
.tool-cat { margin-bottom: 18px; } .tool-cat h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 8px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card { position: relative; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); cursor: pointer; display: grid; gap: 4px; align-content: start;
  animation: rise .4s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.tool-card.dim { opacity: .7; }
.tool-logo { flex: none; display: grid; place-items: center; border-radius: 12px; font-weight: 800; color: #fff; font-family: var(--font-display);
  background: linear-gradient(135deg, hsl(var(--h) 70% 45%), hsl(calc(var(--h) + 35) 75% 55%)); box-shadow: 0 6px 14px -6px hsl(var(--h) 70% 40% / .6); }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.tool-cost { position: absolute; top: 12px; right: 14px; font-size: 11px; font-weight: 700; color: var(--ink-2); } .tool-card .tool-cost ~ * { } .tool-cost span { color: var(--ink-3); font-weight: 500; }
.tool-card:has(.tool-cost) .tag { margin-top: 18px; }
.seat-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; } .seat-bar i { display: block; height: 100%; background: var(--grad); } .seat-bar i.over { background: var(--danger); }
.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.matrix-wrap { overflow: auto; max-height: 70vh; border-radius: 12px; border: 1px solid var(--line-2); }
.matrix th { position: sticky; top: 0; background: var(--surface); z-index: 2; vertical-align: bottom; height: 120px; }
.matrix .vh { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 11.5px; }
.matrix .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; }
.matrix th.sticky-col { z-index: 3; }
.matrix td.mx { text-align: center; cursor: pointer; color: var(--ok); font-weight: 800; min-width: 34px; transition: background .12s; }
.matrix td.mx:hover { background: var(--accent-soft); } .matrix td.mx.on { background: color-mix(in srgb, var(--ok) 10%, transparent); }

/* ---------- Gate (signed in but not an active member) ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.gate-art { position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(140deg, #072a20 0%, #0b3d2e 40%, #0f5a44 75%, #14876a 100%); }
.gate-glow { position: absolute; width: 520px; height: 520px; right: -160px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(52,211,153,.35), transparent 65%); animation: annFloat 12s ease-in-out infinite; }
.gate-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.gate-logo { position: relative; width: 150px; height: auto; z-index: 1; }
.gate-pitch { position: relative; z-index: 1; max-width: 460px; animation: annIn .7s var(--spring) backwards; }
.gate-pitch .eyebrow { color: #a7f3d0; } .gate-pitch h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; margin: 10px 0 14px; color: #fff; } .gate-pitch p { color: rgba(236,253,245,.85); font-size: 15px; line-height: 1.6; margin: 0; }
.gate-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(236,253,245,.6); }
.gate-panel { display: grid; place-items: center; padding: 32px 20px; }
.gate-card { width: 100%; max-width: 440px; animation: annIn .6s var(--spring) .1s backwards; }
.gate-mark { width: 52px; height: 52px; border-radius: 14px; box-shadow: var(--shadow); }
.gate-card h2 { font-size: 26px; margin: 18px 0 8px; letter-spacing: -.02em; } .gate-msg { color: var(--ink-2); line-height: 1.6; margin: 0 0 18px; }
.gate-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.gate-rules { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; background: var(--surface); font-size: 13px; } .gate-rules ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); line-height: 1.55; } .gate-rules li { margin: 4px 0; }
.boot { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 100vh; color: var(--ink-3); font-size: 13px; }
.boot-mark { width: 54px; height: 54px; border-radius: 14px; animation: annBob 2.4s ease-in-out infinite; }
@media (max-width: 860px) { .gate { grid-template-columns: 1fr; } .gate-art { padding: 28px 22px; min-height: 0; gap: 28px; } .gate-pitch h1 { font-size: 28px; } }

/* ---------- Agency pulse (CEO) ---------- */
.pulse { margin-bottom: 18px; padding: 16px 18px; }
.pulse-off { display: flex; align-items: center; gap: 12px; }
.pulse-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pulse-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pulse-k { display: grid; gap: 2px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; animation: rise .4s var(--ease) backwards; animation-delay: calc(var(--i) * 45ms); transition: transform .18s var(--ease), background .18s; }
.pulse-k:hover { transform: translateY(-2px); background: var(--accent-soft); text-decoration: none; }
.pulse-k span { font-size: 11.5px; color: var(--ink-3); } .pulse-k b { font-family: var(--font-display); font-size: 19px; letter-spacing: -.02em; } .pulse-k small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-att { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.pulse-a { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13px; } .pulse-a .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; transform: translateY(-1px); }
.pulse-a.sev-critical .pdot, .pulse-a.sev-high .pdot { background: var(--danger); } .pulse-a.sev-medium .pdot { background: var(--warn); }

/* ---------- Accounting ---------- */
.method-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -4px 0 14px; font-size: 12.5px; color: var(--ink-3); } .method-strip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; height: 200px; align-items: end; padding-top: 6px; }
.pl-col { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; }
.pl-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.pl-bars i { width: 38%; max-width: 22px; border-radius: 5px 5px 0 0; min-height: 2px; animation: growY .7s var(--ease) backwards; transform-origin: bottom; }
.pl-bars i.rev, .lg.rev { background: linear-gradient(180deg, #34d399, var(--accent)); } .pl-bars i.exp, .lg.exp { background: linear-gradient(180deg, #fca5a5, #ef4444); opacity: .85; }
.pl-p { font-size: 10.5px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; } .pl-p.neg { color: var(--danger); } .pl-m { font-size: 10.5px; color: var(--ink-3); }
.legend { display: flex; gap: 14px; margin-top: 8px; } .legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
@keyframes growY { from { transform: scaleY(0); } }
.num.pos { color: var(--ok); }

/* ---------- Team chat ---------- */
.content.chat-mode { padding: 12px 16px 12px; max-width: none; }
.chat { display: grid; grid-template-columns: 268px 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 92px); min-height: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.cside { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-2); min-width: 0; min-height: 0; overflow: hidden; }
.cside-top { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.cside-top .in { flex: 1; min-width: 0; }
.cside-scroll { overflow-y: auto; padding: 6px 6px 14px; flex: 1; }
.clink { font-size: 11.5px; background: var(--warn-soft); color: var(--warn); padding: 5px 10px; }
.clink .linkbtn { font-size: inherit; color: inherit; text-decoration: underline; margin-left: 4px; }
.cjump-none { padding: 10px 12px; line-height: 1.6; }
.cjump-new { margin-left: auto; white-space: nowrap; }
.csec { margin-top: 8px; }
.csec-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cicon { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.cicon:hover { background: var(--line); color: var(--ink); }
.cicon.big { font-size: 18px; display: inline-flex; align-items: center; padding: 8px; }
.crow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: 13.5px; text-align: left; transition: background .12s; }
.crow:hover { background: var(--line); }
.crow.on { background: var(--accent); color: #fff; }
.crow.on .cglyph { color: #fff; background: rgba(255,255,255,.18); }
.crow.unread .cname { font-weight: 700; color: var(--ink); }
.crow.on.unread .cname { color: #fff; }
.crow.arch { opacity: .55; }
.cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cglyph { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); background: var(--surface); flex: none; }
.cglyph.lg { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.cbadge { background: var(--ink-3); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.cbadge.at { background: var(--danger); }
.cmute { font-size: 11px; opacity: .7; }
.cav { position: relative; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; overflow: visible; }
.cav img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cdot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface-2); }
.cmain { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cempty { margin: auto; text-align: center; max-width: 420px; padding: 24px; }
.cempty-ic { font-size: 40px; margin-bottom: 6px; }
.cchan { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0; flex: 1; }
.cchan.with-thread { grid-template-columns: 1fr 360px; }
.cpane { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 56px; }
.chead-t { min-width: 0; flex: 1; }
.chead-t .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chead-a { display: flex; gap: 6px; align-items: center; }
.chead-a .btn.on { background: var(--accent-soft); }
.in.sm { padding: 5px 8px; font-size: 12.5px; width: auto; }
.cback { display: none; }
.cmsgs { flex: 1; overflow-y: auto; padding: 8px 0 4px; min-height: 0; }
.cmore, .cstart { text-align: center; padding: 14px; }
.cstart { text-align: left; padding: 18px 20px 8px; }
.cday { display: flex; align-items: center; gap: 10px; margin: 12px 20px 6px; color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.cday::before, .cday::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cnew { display: flex; align-items: center; gap: 8px; margin: 6px 20px; color: var(--danger); font-size: 11px; font-weight: 700; }
.cnew::after { content: ''; flex: 1; height: 1px; background: var(--danger); opacity: .5; }
.cmsg { display: flex; gap: 10px; padding: 6px 20px; position: relative; animation: fadeUp .16s var(--ease); }
.cmsg.grouped { padding-top: 1px; padding-bottom: 1px; }
.cmsg:hover { background: var(--surface-2); }
.cmsg.mentioned { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
.cmsg.pending { opacity: .6; }
.cmsg-av { width: 36px; flex: none; }
.ctime-h { visibility: hidden; font-size: 10.5px; color: var(--ink-3); display: block; text-align: right; padding-top: 3px; }
.cmsg:hover .ctime-h { visibility: visible; }
.cmsg-b { flex: 1; min-width: 0; }
.cmsg-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ctext { white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; }
.ctext code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.ctext a { color: var(--blue); }
.ccode { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; font-size: 12.5px; margin: 4px 0; }
.cment { background: var(--blue-soft); color: var(--blue); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cment.me, .cment.all { background: var(--warn-soft); color: var(--warn); }
.cpin { color: var(--warn); }
.ctk { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.csys { text-align: center; font-size: 12px; color: var(--ink-3); padding: 4px 20px; }
.cseen { text-align: right; font-size: 10.5px; margin-top: 2px; }
.cfiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cfwd { border-left: 3px solid var(--line, #3a3f47); padding: 4px 0 4px 10px; margin-top: 4px; }
.cfwd .ctext { margin-top: 2px; }
.cimg { max-width: min(360px, 100%); max-height: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.cfile { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; text-decoration: none; color: var(--ink); background: var(--surface); max-width: 320px; }
.cfile b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 230px; }
.creacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.creact { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 1px 8px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.creact.mine { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.creplies { display: block; border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 12.5px; padding: 3px 0; cursor: pointer; }
.creplies:hover { text-decoration: underline; }
.cacts { position: absolute; right: 16px; top: -12px; display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 2px; z-index: 3; }
.cmsg:hover .cacts, .cacts:focus-within { display: flex; }
.cacts > button { border: 0; background: none; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.cacts > button:hover { background: var(--surface-2); }
.cmenu { position: absolute; right: 0; top: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: grid; min-width: 200px; padding: 4px; z-index: 5; }
.cmenu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.cmenu button:hover { background: var(--surface-2); }
.cmenu button.danger { color: var(--danger); }
.cpick { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; width: max-content; margin-top: 4px; box-shadow: var(--shadow); }
.cpick button { border: 0; background: none; font-size: 18px; padding: 3px 5px; cursor: pointer; border-radius: 6px; }
.cpick button:hover { background: var(--surface-2); }
.cedit textarea { width: 100%; min-height: 60px; margin-bottom: 6px; }
.ctyping { height: 18px; padding: 0 20px; font-size: 11.5px; color: var(--ink-3); font-style: italic; }
.ccomp { padding: 0 14px 10px; position: relative; }
.ccomp.drag .ccomp-row { outline: 2px dashed var(--accent); }
.ccomp-row { display: flex; gap: 6px; align-items: flex-end; border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 2px; background: var(--surface); }
.ccomp-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ccomp textarea.in { border: 0; box-shadow: none; resize: none; min-height: 38px; max-height: 180px; field-sizing: content; background: transparent; padding: 9px 4px; }
.ccomp textarea.in:focus { outline: none; box-shadow: none; }
.chint { padding: 4px 4px 0; font-size: 11px; }
.cnopost { padding: 12px 20px; text-align: center; color: var(--ink-3); border-top: 1px solid var(--line); font-size: 13px; }
.cac { position: absolute; bottom: 100%; left: 14px; right: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; z-index: 6; display: grid; }
.cac button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; text-align: left; color: var(--ink); }
.cac button.on, .cac button:hover { background: var(--accent-soft); }
.cups { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 2px; }
.cup { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12px; }
.cup button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 14px; }
.cthread { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.cpanel { position: absolute; right: 12px; top: 62px; width: min(360px, calc(100% - 24px)); max-height: 60%; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; z-index: 7; display: grid; gap: 6px; }
.cpanel-row { display: block; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--ink); text-decoration: none; width: 100%; }
.cpanel-row:hover { background: var(--surface-2); }
.csearch { display: grid; gap: 6px; margin-top: 10px; max-height: 55vh; overflow-y: auto; }
.cpeople { display: grid; gap: 2px; max-height: 42vh; overflow-y: auto; margin-top: 6px; }
.cperson { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.cperson:hover { background: var(--surface-2); }
.ckinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.ckind { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px; cursor: pointer; font: inherit; color: var(--ink); }
.ckind.on { border-color: var(--accent); background: var(--accent-soft); }
.cbrowse { display: grid; gap: 6px; }
.cbrow { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 900px) {
  .content.chat-mode { padding: 0; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 64px); border-radius: 0; border: 0; }
  .chat.has-open .cside { display: none; }
  .chat:not(.has-open) .cmain { display: none; }
  .cback { display: inline-flex; }
  .cchan.with-thread { grid-template-columns: 1fr; }
  .cchan.with-thread .cpane { display: none; }
  .chead-a select { display: none; }
  .ckinds { grid-template-columns: 1fr; }
  .cacts { right: 8px; }
  .chint { display: none; }
}

.cthread .chint { display: none; }
.ctext + .small.muted { margin-left: 4px; }
.cpanel-wrap, .cac-wrap, .cups-wrap { display: contents; }

/* ---------- Calendar ---------- */
.linkish { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; font: inherit; }
.cal { display: flex; flex-direction: column; gap: 10px; }
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-nav h2 { margin: 0 0 0 8px; font-size: 20px; letter-spacing: -.01em; }
.cal-nav .btn.icon { width: 34px; padding: 0; justify-content: center; font-size: 18px; }
.cal-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-tools .seg button { padding: 6px 12px; font-size: 13px; }
.cal-tools .btn.on { background: var(--accent-soft); border-color: var(--accent); }
.cal-spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 6px 2px 8px; font-size: 12.5px; background: var(--surface); }
.cal-chip i { width: 9px; height: 9px; border-radius: 50%; }
.cal-chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); }
.cal-note { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cal-sync { margin-top: -4px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.cal-dow { padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-cell { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-num { color: var(--ink-3); }
.cal-cell.wknd { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.cal-cell.closed { background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.cal-num { align-self: flex-start; border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--ink); }
.cal-num:hover { background: var(--surface-2); }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; }
.cal-ev { --c: var(--accent); display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 12px; line-height: 1.35; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--ink); border-left: 3px solid var(--c); }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.cal-ev b { font-weight: 600; color: var(--c); }
.cal-ev.allday { background: var(--c); color: #fff; border-left: 0; }
.cal-ev.allday b { color: #fff; }
.cal-ev.busy { cursor: default; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, var(--surface)) 0 6px, var(--surface) 6px 12px); color: var(--ink-2); }
.cal-ev.declined, .cal-blk.declined { opacity: .5; text-decoration: line-through; }
.cal-ev.pending, .cal-blk.pending { background: var(--surface); border: 1px dashed var(--c); border-left: 3px solid var(--c); }
.cal-more { border: 0; background: none; color: var(--ink-3); font-size: 11.5px; text-align: left; padding: 0 6px; cursor: pointer; font-weight: 600; }
.cal-more:hover { color: var(--ink); }
.cal-hol { font-size: 11px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.cal-hol.k-floating, .cal-hol.k-coverage, .cal-hol.k-optional { background: var(--violet-soft); color: var(--violet); }
.cal-off { margin-top: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-off.sm { margin: 0 0 0 6px; }
.cal-grid { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.cal-ghead { display: grid; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-ghd { padding: 6px; border-left: 1px solid var(--line); display: grid; gap: 3px; align-content: start; min-width: 0; }
.cal-ghd.today b { color: var(--accent-ink); }
.cal-lane { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cal-lane b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.cal-av { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cal-gbody { overflow-y: auto; height: calc(100vh - 290px); min-height: 380px; }
.cal-gin { display: grid; position: relative; }
.cal-hours { position: relative; }
.cal-hours div { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; color: var(--ink-3); }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.cal-col.today { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; opacity: .7; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cal-blk { --c: var(--accent); position: absolute; border: 0; border-radius: 7px; padding: 3px 6px; text-align: left; font: inherit; font-size: 11.5px; line-height: 1.3; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); color: var(--ink); display: flex; flex-direction: column; z-index: 1; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.cal-blk:hover { z-index: 3; box-shadow: var(--shadow); }
.cal-blk b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-blk span { color: var(--ink-3); font-size: 10.5px; }
.cal-blk.busy { cursor: default; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0 6px, var(--surface) 6px 12px); }
.cal-agenda { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.cal-aday { display: grid; grid-template-columns: 90px 1fr; border-bottom: 1px solid var(--line); }
.cal-aday:last-child { border-bottom: 0; }
.cal-adate { padding: 12px 14px; display: grid; align-content: start; }
.cal-alist { display: grid; }
.cal-arow { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 0; border-left: 1px solid var(--line); background: none; text-align: left; font: inherit; cursor: pointer; color: var(--ink); }
.cal-arow:hover { background: var(--surface-2); }
.cal-arow.declined { opacity: .55; }
.cal-atime { width: 110px; flex: none; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-atitle { flex: 1; display: grid; min-width: 0; }
.cal-drawer-bg { position: fixed; inset: 0; background: rgba(10, 14, 18, .28); z-index: 60; animation: fadeIn .15s; }
.cal-drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); box-shadow: -8px 0 32px rgba(0,0,0,.12); padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; animation: slideIn .2s var(--ease); }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.cal-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.cal-dmeta { font-size: 13.5px; color: var(--ink-2); }
.cal-join { justify-content: center; }
.cal-rsvp { display: flex; gap: 6px; align-items: center; }
.cal-rsvp .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-drawer h3 { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.cal-people { display: grid; gap: 2px; }
.cal-person { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; }
label.cal-person { cursor: pointer; }
label.cal-person:hover { background: var(--surface-2); }
.r-accepted { color: var(--ok); } .r-declined { color: var(--danger); } .r-tentative { color: var(--warn); } .r-needsAction { color: var(--ink-3); }
.cal-desc { white-space: pre-wrap; font-size: 13.5px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.cal-dact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-pick { max-height: 50vh; overflow-y: auto; margin-top: 8px; display: grid; gap: 8px; }
.cal-pickd { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 4px; }
.cal-form { display: grid; gap: 6px; }
.cal-form .in.big { font-size: 16px; font-weight: 600; }
.cal-when { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.cal-when > div { flex: 1; min-width: 120px; }
.cal-tags { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); align-items: center; }
.cal-tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12.5px; font-weight: 600; }
.cal-tag.ext { background: var(--blue-soft); color: var(--blue); }
.cal-tag button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 14px; }
.cal-taginput { border: 0; outline: 0; flex: 1; min-width: 140px; font: inherit; background: transparent; color: var(--ink); padding: 4px; }
.cal-sugg { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-sugg button { border: 0; background: var(--surface); text-align: left; padding: 7px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.cal-sugg button:hover { background: var(--accent-soft); }
.cal-quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cal-avail { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; margin-top: 4px; }
.cal-arow2 { display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: center; }
.cal-aname { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar2 { position: relative; height: 16px; background: var(--surface); border-radius: 5px; border: 1px solid var(--line); overflow: hidden; }
.cal-bar2.leave { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 5px, var(--surface) 5px 10px); }
.cal-bar2 i { position: absolute; top: 0; bottom: 0; }
.cal-bar2 i.b { background: var(--ink-3); opacity: .45; }
.cal-bar2 i.sel { background: color-mix(in srgb, var(--accent) 45%, transparent); border: 1.5px solid var(--accent); border-radius: 3px; }
.cal-bar2 i.sel.clash { background: color-mix(in srgb, var(--danger) 35%, transparent); border-color: var(--danger); }
.cal-ticks { position: relative; height: 14px; margin-left: 88px; font-size: 10px; color: var(--ink-3); }
.cal-ticks span { position: absolute; transform: translateX(-50%); }
.cal-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-toggle { gap: 8px; margin-top: 8px; }
.small.ok { color: var(--ok); }
.cal-next .cal-nrow { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.cal-next .cal-nrow:first-of-type { border-top: 0; }
.cal-ntime { display: grid; width: 56px; flex: none; }
.cal-ntitle { flex: 1; text-align: left; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-next { margin-bottom: 16px; }
@media (max-width: 900px) {
  .cal-bar { flex-direction: column; align-items: stretch; }
  .cal-tools { justify-content: space-between; }
  .cal-cell { min-height: 74px; padding: 2px; }
  .cal-ev { font-size: 10.5px; padding: 1px 3px; }
  .cal-ev b { display: none; }
  .cal-hol, .cal-off { display: none; }
  .cal-gbody { height: calc(100vh - 330px); }
  .cal-aday { grid-template-columns: 64px 1fr; }
  .cal-atime { width: 80px; }
}
.cal-blk { justify-content: flex-start; align-items: stretch; }
.cal-blk.short { flex-direction: row; align-items: center; gap: 4px; padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.cal-blk.short span { flex: none; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* sign-in */
.gate-card form .in { margin-bottom: 4px; }
.code-in { font-size: 24px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.trust-dev { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; color: var(--ink-2); line-height: 1.4; }
.trust-dev input { margin-top: 2px; }
.pw-checks { list-style: none; padding: 0; margin: 8px 0 4px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pw-checks li.ok { color: #0f5a44; font-weight: 600; }
.invite-access { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0 14px; display: grid; gap: 6px; background: var(--bg); }
.signin-st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.signin-st.accepted { background: #dcfce7; color: #166534; } .signin-st.sent { background: #e0f2fe; color: #075985; }
.signin-st.pending { background: #fef3c7; color: #92400e; } .signin-st.noemail { background: #fee2e2; color: #991b1b; }

/* modules & roadmap */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mod-card { padding: 14px 16px; }
.mod-card.st-upcoming { border-style: dashed; }
.mod-feats { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 13px; }
.mod-feats li { display: flex; gap: 8px; } .mod-feats li span { width: 14px; flex: none; }
.mod-feats .f-live span { color: #0f5a44; } .mod-feats .f-upcoming { color: var(--muted); }

/* time tracking */
.timer-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid #fecaca; background: #fff1f2; border-radius: 999px; font-size: 13px; margin-right: 8px; }
.timer-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: pulse 1.6s ease-in-out infinite; }
.timer-chip .t { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes pulse { 50% { opacity: .35; } }
.ts-grid td, .ts-grid th { white-space: nowrap; } .ts-grid td:first-child { white-space: normal; min-width: 220px; }
.ts-total td { border-top: 2px solid var(--line); }
td.bad, .num.bad { color: #b91c1c; font-weight: 600; }
@media (max-width: 720px) { .timer-chip .t { display: none; } }

/* Top-bar clock: seconds, quiet */
.topclock-s .tc-sec { margin-left: 3px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); opacity: .75; display: inline-block; min-width: 2.1em; }

/* Ticket people, dependencies, quick subtasks (public/ticketpeople.js) */
.tp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--s, var(--ink-3)); flex: none; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; }
.tp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 8px; border-radius: 99px; background: var(--bg-2, var(--line)); font-size: 12px; }
.tp-chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 0 4px; font-size: 13px; line-height: 1; }
.tp-chip button:hover { color: var(--danger); }
.tp-away { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; margin: 8px 0 4px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 13px; }
.tp-list { display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.tp-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tp-row:hover { border-color: var(--accent); }
.tp-row.away { opacity: .6; }
.tp-row .tp-n { display: grid; min-width: 0; }
.tp-wait { color: var(--warn); font-weight: 600; font-size: 11.5px; }
.tp-h { margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.tp-pick { display: grid; gap: 4px; margin: 8px 0; }
.tp-hit { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; font-size: 13px; color: inherit; }
.tp-hit:hover { border-color: var(--accent); }
.tp-sub { display: flex; gap: 6px; margin-top: 8px; }
.tp-sub .in { flex: 1; }
.tcard .avs { display: inline-flex; } .tcard .avs .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.topclock-s b { white-space: nowrap; }

/* Checklists and templates (public/templates.js) */
.ck-bar { height: 4px; border-radius: 99px; background: var(--line); margin: 8px 0 4px; overflow: hidden; }
.ck-bar i { display: block; height: 100%; background: var(--ok); transition: width .3s var(--ease); }
.ck { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ck .ck-t { flex: 1; min-width: 0; }
.ck.done .ck-t { color: var(--ink-3); text-decoration: line-through; }
.ck .in { flex: 1; }
.ck-a { display: none; gap: 2px; } .ck:hover .ck-a { display: inline-flex; }
@media (hover: none) { .ck-a { display: inline-flex; } }
.ck-a button { border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 0 5px; font-size: 13px; }
.ck-a button:hover { color: var(--ink); }
.tpl-h { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl { display: grid; gap: 6px; } .tpl.off { opacity: .55; }

/* Password show/hide (public/signin.js) */
.pw-wrap { position: relative; }
.pw-wrap .in { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: var(--line); outline: none; }

/* Ticket files and activity (public/ticketactivity.js) */
.pf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px; border: 1.5px dashed var(--line-2); border-radius: 12px; transition: border-color .15s, background .15s; }
.pf.compact { padding: 6px 8px; border-style: dashed; }
.pf.over { border-color: var(--accent); background: var(--accent-soft); }
.pf-list { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.pf-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 4px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12px; }
.pf-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.pf-chip .pf-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pf-chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 14px; padding: 0 4px; }
.pf-chip button:hover { color: var(--danger); }
.pf-ext { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 700 9.5px/1 inherit; font-style: normal; flex: none; }
.pf-hint { flex: 1; min-width: 160px; }
.tfiles { display: grid; gap: 6px; margin-top: 8px; }
.fg-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.fg-img { position: relative; margin: 0; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.fg-img img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.fg-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: none; }
.fg-img:hover .fg-x { display: block; } @media (hover: none) { .fg-x { display: block; } }
.fg-doc { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.fg-doc .pf-ext { width: 30px; height: 30px; }
.iv { position: fixed; inset: 0; z-index: 100; background: rgba(8,10,12,.88); display: grid; place-items: center; padding: 24px 24px 72px; animation: rise .15s var(--ease); }
.iv img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; }
.iv-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; color: #e5e7eb; font-size: 13px; background: rgba(0,0,0,.4); flex-wrap: wrap; }
.act-h { margin: 0; font-size: 15px; }
.act-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--line); gap: 2px; flex-wrap: wrap; }
.act-seg button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.act-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow, 0 1px 2px rgba(0,0,0,.08)); }
.feed { margin-top: 10px; display: grid; gap: 2px; }
.feed-h { display: flex; gap: 8px; align-items: baseline; padding: 4px 0 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.feed-h i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; transform: translateY(-1px); }
.feed-h span:first-of-type { flex: 1; min-width: 0; }
.feed-p { display: flex; gap: 10px; padding: 12px; margin: 6px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.feed-p.is-upd { border-left: 3px solid var(--accent); }
.feed-b { flex: 1; min-width: 0; }
.feed-m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 4px; }
.upd-tag { padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.feed-a { margin-left: auto; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.feed-p:hover .feed-a { opacity: 1; } @media (hover: none) { .feed-a { opacity: 1; } }
.feed-a button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font: inherit; font-size: 12px; padding: 2px 4px; }
.feed-a button:hover { color: var(--ink); }
.tk-composer { margin-top: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); }
.tk-composer-f { margin-top: 8px; gap: 8px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--accent-soft); position: sticky; top: 64px; z-index: 5; }
.bulk .in.sm { width: auto; min-width: 120px; }
.tbl tr.sel td { background: var(--accent-soft); }

.iv-bar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.iv-bar .btn:hover { background: rgba(255,255,255,.22); }

/* Work views: switch, calendar, workload (public/workviews.js) */
.vs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px; border-radius: 10px; background: var(--line); flex-wrap: wrap; }
.vs a { padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.vs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.tcal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tcal-top .in.sm { width: auto; max-width: 220px; }
.tcal-m { min-width: 150px; text-align: center; font-size: 15px; }
.tcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); gap: 1px; }
.tcal-dow { background: var(--surface); padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tcal-d { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .12s; }
.tcal-d.out { background: color-mix(in srgb, var(--surface) 70%, var(--line)); } .tcal-d.out .tcal-n { opacity: .45; }
.tcal-d.today .tcal-n { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; align-self: flex-start; }
.tcal-d.over { background: var(--accent-soft); }
.tcal-n { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tcal-t { font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: var(--bg-2, var(--line)); border-left: 3px solid var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.tcal-t .key { font-size: 10px; opacity: .7; }
.tcal-t.p-urgent { border-left-color: var(--danger); } .tcal-t.p-high { border-left-color: var(--warn); } .tcal-t.p-normal { border-left-color: var(--accent); }
.tcal-t.s-done { opacity: .5; text-decoration: line-through; }
.tcal-t.late { box-shadow: inset 0 0 0 1px var(--danger); }
.tcal-more, .tcal-s { font-size: 11px; color: var(--ink-3); }
@media (max-width: 700px) { .tcal-d { min-height: 70px; padding: 3px; } .tcal-t { font-size: 0; padding: 0; height: 6px; border-left-width: 6px; } .tcal-t .key { display: none; } .tcal-dow { font-size: 9px; padding: 4px; } }
.wl { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.wl-r { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(170px, 1.4fr) repeat(7, 38px) 120px 70px; gap: 8px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.wl-h { border-top: 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2, transparent); }
.wl-p { display: flex; gap: 8px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.wl-p > span { display: grid; min-width: 0; } .wl-p b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-load { display: grid; gap: 3px; }
.wl-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.wl-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.wl-bar.full i { background: var(--warn); } .wl-bar.over i { background: var(--danger); } .wl-bar.off i { background: var(--ink-3); }
.wl-day { text-align: center; font-size: 12px; line-height: 1.15; border-radius: 6px; padding: 3px 0; }
.wl-day.rest { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 5px); }
.wl-day.leave { background: color-mix(in srgb, #8b5cf6 14%, transparent); }
.wl-day.today { outline: 1.5px solid var(--accent); }
.wl-day b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.wl-day b.many { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.wl-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 99px; font-size: 10.5px; background: var(--line); }
.wl-tag.late { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.wl-tag.hi { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
@media (max-width: 900px) { .wl-r { grid-template-columns: minmax(130px, 1fr) minmax(120px, 1fr) repeat(7, 26px); gap: 4px; padding: 8px; } .wl-day b { min-width: 18px; height: 18px; } }
@media (max-width: 560px) { .wl-r { grid-template-columns: 1fr 1fr; } .wl-r .wl-day { display: none; } }

/* Push / install (public/pushclient.js) */
.pn-tip { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; line-height: 1.5; }
.pn-nudge { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.pn-nudge > span { flex: 1; min-width: 200px; }

/* Onboarding and launch (public/onboarding.js) */
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ob-card { display: grid; gap: 8px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.ob-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ob-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ob-bar.big { height: 10px; margin-top: 12px; }
.ob-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s var(--ease); }
.ob-late { color: var(--danger); font-weight: 600; }
.ob-own { display: flex; flex-wrap: wrap; gap: 4px; }
.ob-tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--line); }
.ob-tag.o-hr { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #7c3aed; }
.ob-tag.o-lead { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ob-tag.o-joiner { background: var(--accent-soft); color: var(--accent); }
.ob-detail { display: grid; gap: 14px; max-width: 900px; }
.ob-sec { display: grid; gap: 2px; }
.ob-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ob-item:last-child { border-bottom: 0; }
.ob-item input[type=checkbox] { margin-top: 3px; }
.ob-item.done .ob-b > div:first-child { color: var(--ink-3); text-decoration: line-through; }
.ob-item.late .ob-b .small { color: var(--danger); }
.ob-b { flex: 1; min-width: 0; }
.ob-auto { font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: var(--line); color: var(--ink-3); text-decoration: none; display: inline-block; }
.ob-a { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s; } .ob-item:hover .ob-a { opacity: 1; } @media (hover: none) { .ob-a { opacity: 1; } }
.ob-a button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font: inherit; font-size: 13px; padding: 0 5px; }
.ob-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.ob-tile { display: grid; gap: 2px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; cursor: pointer; color: inherit; }
.ob-tile:disabled { cursor: default; }
.ob-tile b { font-size: 22px; } .ob-tile span { font-size: 12px; color: var(--ink-3); }
.ob-tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gs { margin-bottom: 14px; display: grid; gap: 8px; }
.gs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; font-size: 13px; }
.gs-i.done { color: var(--ink-3); text-decoration: line-through; }
.gs-i { display: flex; gap: 8px; align-items: flex-start; }
.gs-i > span:last-child { display: grid; }
.gs-c { width: 16px; flex: none; color: var(--ok); font-weight: 700; }
.gs-i:not(.done) .gs-c { color: var(--ink-3); }
.gs-i.done .gs-l { text-decoration: line-through; color: var(--ink-3); }
.gs-i.done { text-decoration: none; }
.gs-h { line-height: 1.35; }
.ann-body { white-space: pre-line; }

/* ---------- Home (role panels) ---------- */
.home-tk { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.home-tk > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.home-tk:last-child { border-bottom: 0; }
.home-panel { margin-top: 16px; }
.hm-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hm-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 120px; color: inherit; text-decoration: none; background: var(--card, #fff); }
.hm-stat:hover { border-color: var(--brand, #0e6b52); }
.hm-stat b { font-size: 20px; line-height: 1.1; }
.hm-stat span { font-size: 12px; color: var(--muted); }
.hm-stat.warn b { color: var(--warn, #b45309); }
.hm-stat.bad b { color: var(--danger); }
a.card.stat { color: inherit; text-decoration: none; display: block; }
.tbl.compact td, .tbl.compact th { padding-top: 7px; padding-bottom: 7px; }

/* chat: meeting picker */
.cmeet-people { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 160px; overflow: auto; padding: 4px 0; }
.cmeet-people label { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- Tickets workspace: department → project tree, status tabs ---------- */
.wsp { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 18px; align-items: start; }
.wsp-main { min-width: 0; }
.wsp-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.wsp-top .vs { margin-bottom: 8px; }
.wtree { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 4px; font-size: 13px; }
.wt-sec { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.wt-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wt-add { font-size: 16px; text-decoration: none; color: var(--muted); padding: 0 4px; }
.wt-item { display: flex; align-items: center; gap: 4px; width: 100%; border: 0; background: none; text-align: left; padding: 5px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font: inherit; min-width: 0; }
.wt-item:hover { background: var(--surface-2); }
.wt-item.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); font-weight: 600; }
.wt-item .wt-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; text-align: left; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.wt-item.dept { font-weight: 600; color: var(--ink); padding-left: 4px; }
.wt-item.proj { padding-left: 26px; }
.wt-caret { border: 0; background: none; width: 18px; color: var(--muted); cursor: pointer; padding: 0; }
.wt-n { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 0 7px; }
.wt-key { font-family: var(--mono, ui-monospace, monospace); font-size: 10.5px; color: var(--muted); margin-right: 6px; }
.wt-foot { padding: 8px 10px 2px; font-size: 12px; }
.wcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-bottom: 8px; }
.st-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.st-tabs button { border: 0; background: none; padding: 8px 12px; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; }
.st-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.st-tabs .n { font-size: 11px; background: var(--surface-2); border-radius: 99px; padding: 0 7px; color: var(--muted); font-weight: 600; }
.st-tabs .n.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.in.xs { padding: 3px 6px; font-size: 12px; height: auto; width: auto; border-radius: 7px; }
.st-sel.st-done { color: var(--ok); } .st-sel.st-blocked { color: var(--danger); } .st-sel.st-in_review { color: #7c3aed; } .st-sel.st-in_progress { color: var(--blue, #2563eb); }
.board-arch { display: block; margin: -4px 0 8px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.proj-card { padding: 14px; }
.proj-card.arch { opacity: .6; }
.proj-stats { display: flex; gap: 12px; margin-top: 8px; font-size: 13px; flex-wrap: wrap; }
.proj-stats a { text-decoration: none; color: inherit; }
.proj-stats a.over { color: var(--danger); }
@media (max-width: 900px) { .wsp { grid-template-columns: 1fr; } .wtree { position: static; max-height: 260px; } }
.wsp .board { grid-template-columns: repeat(5, minmax(185px, 1fr)); }
.nowrap { white-space: nowrap; }

/* client side of a ticket (module client-portal) */
.client-card { border-left: 3px solid #0d9488; }
.client-card .appr-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.client-card .client-files { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow: auto; padding: 4px 0; }
.upd-tag.client-tag { background: #ccfbf1; color: #0f766e; }
@media (prefers-color-scheme: dark) { .upd-tag.client-tag { background: #12302a; color: #5eead4; } }
.vault-shown { margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.vault-shown code { font-size: 13px; user-select: all; }

/* Client portal branding card (public/clientportal.js) */
.logo-slot { width: 180px; height: 72px; border: 1px dashed var(--line, #e2e8f0); border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 8px; background: var(--surface-2, transparent); }
.logo-slot img { max-width: 100%; max-height: 100%; object-fit: contain; }
.swatch { width: 22px; height: 22px; border-radius: 6px; display: inline-block; border: 1px solid var(--line, #e2e8f0); }
input[type="color"] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line, #e2e8f0); border-radius: 6px; background: none; cursor: pointer; }

/* Report editor checks (public/success.js) */
.rep-checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 4px; background: var(--surface-2); }
.warn-t { color: #b45309; }

/* ---------- Surge AI (public/assistant.js) ---------- */
.ai-shell { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: minmax(0, 1fr); gap: 0; height: calc(100vh - 110px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.ai-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-2); min-width: 0; min-height: 0; }
.ai-side-top { padding: 12px; border-bottom: 1px solid var(--line); }
.ai-side-list { flex: 1; overflow-y: auto; padding: 6px; }
.ai-side-foot { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.ai-group-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 8px 8px 4px; }
.ai-chat-i { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.ai-chat-i:hover { background: var(--surface); }
.ai-chat-i.on { background: var(--accent-soft); color: var(--accent-ink); }
.ai-chat-t { font-weight: 550; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ai-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ai-new { padding: 22px 26px; overflow-y: auto; }
.ai-asst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ai-asst { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.ai-asst:hover { border-color: var(--accent); }
.ai-asst.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ai-asst.dim { opacity: .55; }
.ai-tiers { display: inline-flex; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.ai-tier { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.ai-tier.on { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ai-composer { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.ai-new .ai-composer { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.ai-composer textarea.in { resize: vertical; min-height: 60px; max-height: 240px; }
.ai-starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ai-starter { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.ai-starter:hover { border-color: var(--accent); color: var(--accent-ink); }
.ai-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ai-title { cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.ai-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-user { max-width: min(640px, 82%); background: var(--accent-soft); color: var(--accent-ink); padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; word-wrap: break-word; }
.ai-reply { max-width: min(760px, 92%); }
.ai-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.ai-md { line-height: 1.55; }
.ai-md p { margin: 0 0 8px; }
.ai-md h2, .ai-md h3, .ai-md h4 { margin: 12px 0 6px; font-size: 15px; }
.ai-md h3 { font-size: 14px; } .ai-md h4 { font-size: 13px; }
.ai-md ul, .ai-md ol { margin: 4px 0 8px; padding-left: 22px; }
.ai-md li { margin: 2px 0; }
.ai-md code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.ai-md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; }
.ai-md pre code { background: none; padding: 0; }
.ai-md hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.ai-tbl { border-collapse: collapse; margin: 6px 0 10px; font-size: 13px; }
.ai-tbl th, .ai-tbl td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top; }
.ai-tbl th { background: var(--surface-2); font-weight: 600; }
.ai-dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); margin-right: 4px; animation: aiBlink 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .2s; } .ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes aiBlink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.ai-meter { min-width: 160px; }
.ai-meter-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.ai-meter-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.ai-meter.warn .ai-meter-bar i, .ai-meter-bar i.warn { background: var(--warn); }
.ai-meter.bad .ai-meter-bar i, .ai-meter-bar i.bad { background: var(--danger); }
.ai-blocked { padding: 14px 16px; border-top: 1px solid var(--line); background: var(--danger-soft); color: var(--danger); }
.ai-pct { font-variant-numeric: tabular-nums; } .ai-pct.warn { color: var(--warn); font-weight: 600; } .ai-pct.bad { color: var(--danger); font-weight: 600; }
.ai-pre { white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; background: var(--surface-2); padding: 12px; border-radius: 8px; max-height: 50vh; overflow-y: auto; }
textarea.ai-prompt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
.tbl tr.dim td { opacity: .55; }
.ai-back { display: none; }
@media (max-width: 900px) {
  .ai-shell { grid-template-columns: 1fr; height: calc(100vh - 64px); border-radius: 0; border: 0; }
  .ai-shell.has-open .ai-side { display: none; }
  .ai-shell:not(.has-open) .ai-main { display: none; }
  .ai-side { border-right: 0; }
  .ai-back { display: inline-flex; }
  .ai-title { max-width: 50vw; }
  .ai-head { padding: 8px 10px; }
  .ai-thread { padding: 12px; }
}

/* Surge AI 1b: context, citations, readiness */
.ai-ctx-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.ai-ctx-chip.ok { border-color: var(--ok); color: var(--ok); } .ai-ctx-chip.warn { border-color: var(--warn); color: var(--warn); } .ai-ctx-chip.bad { border-color: var(--danger); color: var(--danger); } .ai-ctx-chip.none { border-style: dashed; color: var(--ink-3); }
.ai-cite { display: inline-block; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); border-radius: 4px; padding: 0 5px; margin: 0 1px; text-decoration: none; vertical-align: baseline; }
.ai-cite:hover { text-decoration: underline; }
.ai-footing { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; font-size: 12px; }
.ai-footing-g { color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ai-footing-n { color: var(--ink-3); }
.ai-check.ok { color: var(--ok); } .ai-check.bad { color: var(--danger); } .ai-check.bad summary { cursor: pointer; font-weight: 600; } .ai-check.bad div { margin: 4px 0 0 14px; color: var(--ink-2); }
.ai-ready { display: flex; align-items: center; gap: 10px; }
.ai-ready-bar { display: inline-block; width: 110px; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; flex: none; }
.ai-ready-bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.ai-ready.warn .ai-ready-bar i { background: var(--warn); } .ai-ready.bad .ai-ready-bar i { background: var(--danger); }
.ai-ready-items { display: grid; gap: 4px; margin-top: 8px; }
.ai-ready-i { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: baseline; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ai-ready-i.ok > span:first-child { color: var(--ok); } .ai-ready-i.bad > span:first-child { color: var(--danger); }

/* Website health & index (public/website.js) */
.site-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.site-pill .since { font-weight: 400; color: var(--ink-3); }
.site-pill .site-dot, .site-dot-only { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.site-pill.ok { background: var(--ok-soft); color: var(--ok); } .site-pill.ok .site-dot, .site-dot-only.ok { background: var(--ok); }
.site-pill.warn { background: var(--warn-soft); color: var(--warn); } .site-pill.warn .site-dot, .site-dot-only.warn { background: var(--warn); }
.site-pill.bad { background: var(--danger-soft, #fdeee6); color: var(--danger); } .site-pill.bad .site-dot, .site-dot-only.bad { background: var(--danger); animation: site-pulse 1.6s ease-in-out infinite; }
.site-dot-only { margin-left: 6px; vertical-align: 1px; }
@keyframes site-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .site-dot-only.bad, .site-pill.bad .site-dot { animation: none; } }
.site-card { margin-bottom: 14px; }
.site-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0 4px; }
.site-stats > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.site-stats .l { font-size: 12px; color: var(--ink-3); } .site-stats .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.bad-t { color: var(--danger); } .warn-t { color: var(--warn); }
.sec-h { font-size: 14px; margin: 18px 0 8px; }
.site-spark { width: 100%; height: 70px; display: block; }
.site-spark .spark-line { fill: none; stroke: var(--brand, #0d9488); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.site-spark .slow-line { stroke: var(--line); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.site-spark .spark-down { fill: var(--danger); } .site-spark .spark-degraded { fill: var(--warn); }
.track-list, .event-list { display: grid; gap: 8px; }
.track-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.tick.ok { background: var(--ok-soft); color: var(--ok); } .tick.bad { background: var(--danger-soft, #fdeee6); color: var(--danger); }
.ev { font-weight: 600; }
.ev-down, .ev-tracking_lost, .ev-crawl_failed { color: var(--danger); } .ev-recovered, .ev-tracking_found, .ev-crawl_done { color: var(--ok); } .ev-degraded, .ev-ssl_expiring { color: var(--warn); }
.page-list { display: grid; gap: 2px; margin-top: 8px; }
.page-row { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.page-row.gone { opacity: .55; }
.websites-card .small a { font-weight: 600; }
@media (max-width: 760px) { .site-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Chat voice notes */
.cicon.on { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.crec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; margin-bottom: 6px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: 10px; font-size: 13px; }
.crec .btn:first-of-type { margin-left: auto; }
.crec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: crec-pulse 1s ease-in-out infinite; }
@keyframes crec-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .crec-dot { animation: none; } }
.caudio { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 22px; padding: 4px 10px 4px 12px; background: var(--surface); width: min(360px, 100%); box-sizing: border-box; }
.caudio audio { height: 34px; flex: 1; min-width: 180px; }

/* ---------- Surge AI 2a: knowledge index ---------- */
.ai-cite.ext::after { content: " ↗"; font-size: 9px; opacity: 0.7; }
.err-text { color: var(--danger); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.stat.warn .n { color: var(--warn); }
.tbl.small { font-size: 12px; }
.tbl.small td, .tbl.small th { padding: 5px 8px; }
.ai-hits { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ai-hit { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.ai-hit mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; }
.ai-index-k { margin-top: 8px; }
.ai-index-k summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.ai-index-d { padding: 4px 0 4px 10px; border-left: 2px solid var(--line); margin-top: 4px; }
.ai-unmatched { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ai-unmatched .in { width: auto; min-width: 160px; }
@media (max-width: 720px) { .ai-unmatched { flex-direction: column; align-items: stretch; } }

/* ---------- Surge AI 2b: files, lookups, feedback ---------- */
.ai-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ai-file { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--surface-2); color: var(--ink-2); border-radius: 6px; padding: 2px 8px; text-decoration: none; max-width: 100%; }
.ai-file.bad { color: var(--danger); }
.ai-user .ai-file { background: rgba(255,255,255,0.6); }
.ai-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.ai-tool.run { color: var(--accent-ink); }
.copy-btn.on { color: var(--accent, #0d9488); }
.ai-pending td { background: var(--warn-soft); }
.ai-pick { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 220px; overflow: auto; }
.ai-pick-i { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.ai-pick-i.on { border-color: var(--accent, #0d9488); background: var(--accent-soft); }

/* search across the portal (release 5) */
.search-btn { gap: 6px; color: var(--ink-2); }
.search-btn .kbd { margin-left: 4px; }
.search-veil { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-box { width: min(640px, 100%); background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden; display: flex; flex-direction: column; max-height: 75vh; }
.search-box .search-in { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 16px; padding: 16px 18px; }
.search-res { overflow: auto; padding: 6px 0; }
.search-res .pad { padding: 14px 18px; }
.search-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 10px 18px 4px; }
.search-it { display: flex; flex-direction: column; padding: 8px 18px; text-decoration: none; color: var(--ink); }
.search-it.on { background: var(--accent-soft, rgba(13, 148, 136, .1)); }
.search-it .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-it .s { font-size: 12.5px; color: var(--ink-2); }
.search-foot { border-top: 1px solid var(--line); padding: 8px 18px; }
@media (max-width: 760px) { .search-btn .sb-l { display: none; } .search-veil { padding-top: 12px; } }

/* mobile pass (release 5) */
.cols > *, .grid2 > *, .cards > * { min-width: 0; }
@media (max-width: 900px) {
  .topbar { gap: 8px; }
  .topbar h1 { font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .topbar .grow { display: none; }
  .content .tbl { font-size: 13px; }
}

/* ---------- client insights, account pulse and the Meta report (public/insights.js) ---------- */
.ins { margin-top: 6px; }
.ins .card { margin-bottom: 12px; }
.ins-head { align-items: flex-start; margin: 6px 0 12px; gap: 10px; }
.ins-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.ins-kpi { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.ins-kpi .l { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.ins-kpi .v { font-size: 19px; font-weight: 700; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.ins-kpi .p { font-size: 11.5px; }
.chg { font-weight: 600; white-space: nowrap; }
.chg.up { color: var(--ok); } .chg.down { color: var(--danger); } .chg.flat { color: var(--ink-3); }
.ins-text { white-space: pre-wrap; line-height: 1.6; font-size: 14px; }
.ins-sum.hidden .ins-text { opacity: .55; }
.ins-note { margin-top: 6px; }
.ins-an { display: flex; flex-direction: column; gap: 6px; }
.ins-an .an { padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.ins-an .an b { margin-right: 4px; }
.ins-an .bad { background: var(--danger-soft); color: var(--danger); }
.ins-an .warn { background: var(--warn-soft); color: var(--warn); }
.ins-an .info { background: var(--surface-2); color: var(--ink-2); }
.ins-an .good { background: var(--ok-soft); color: var(--ok); }
.ins-y { display: flex; flex-direction: column; gap: 6px; }
.ins-yrow { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 13px; }
.ins-yrow > b { min-width: 150px; }
.ins-ym { white-space: nowrap; }
.ins-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-top: 8px; }
.ins-tables > * { min-width: 0; }
.ins-tbl .b { font-weight: 600; margin-bottom: 4px; }
.ins-tbl .r, .meta-tbl .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ins-tbl .txt { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tbl-wrap { overflow-x: auto; }
.pulse { margin-bottom: 12px; }
.pulse details { margin-top: 8px; }
.meta-rep .mt-top { gap: 12px; flex-wrap: wrap; align-items: center; }
.meta-rep .seg { flex-wrap: wrap; }
.mt-name { font-weight: 600; overflow-wrap: anywhere; }
.mt-aud { color: var(--ink-2); margin-top: 2px; max-width: 420px; }
.crumbs { margin-bottom: 10px; }
.mt-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mt-ad { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0; overflow: hidden; cursor: pointer; font: inherit; color: inherit; }
.mt-ad:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.mt-ad img, .mt-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 12px; }
.mt-adb { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.mt-adfull { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 16px; }
.mt-adfull img { width: 100%; border-radius: 10px; }
.mt-bars { display: flex; flex-direction: column; gap: 8px; }
.mt-bar { display: grid; grid-template-columns: 200px 1fr; gap: 2px 12px; align-items: center; }
.mt-bl { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-bt { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.mt-bt span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.mt-bv { grid-column: 2; color: var(--ink-2); }
.ok-t { color: var(--ok); font-weight: 600; }
@media (max-width: 700px) {
  .ins-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ins-tables { grid-template-columns: 1fr; }
  .mt-adfull { grid-template-columns: 1fr; }
  .mt-bar { grid-template-columns: 1fr; }
  .mt-bv { grid-column: 1; }
  .ins-yrow > b { min-width: 0; width: 100%; }
}

/* ---------- page help: the "?" beside the page title (PageHelp / HelpIcon in app.js) ---------- */
.page-help { position: relative; display: inline-flex; align-items: center; margin-left: 8px; }
.page-help-btn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.page-help-btn:hover, .page-help.open .page-help-btn { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.page-help-tip { display: none; position: absolute; top: calc(100% + 8px); left: -8px; z-index: 60; width: min(420px, 80vw); background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: 10px 12px; font-size: 13px; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.page-help-tip p { margin: 0; }
.page-help-tip p + p { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.page-help:hover .page-help-tip, .page-help.open .page-help-tip, .page-help:focus-within .page-help-tip { display: block; }
@media (max-width: 700px) { .page-help-tip { position: fixed; top: 58px; left: 12px; right: 12px; width: auto; } }

/* ---------- Leads (lead quality, see docs/notes/lead-quality.md) ---------- */
.lq-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 10px; }
.lq-list { padding: 4px 16px; }
.lq-row { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.lq-row:last-child { border-bottom: 0; }
.lq-main { flex: 1; min-width: 0; line-height: 1.45; word-break: break-word; }
.lq-act { flex: 0 0 auto; max-width: 52%; display: flex; justify-content: flex-end; }
.lq-btns, .lq-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.lq-btns .lq-q { border-color: var(--ok, #15803d); color: var(--ok, #15803d); }
.lq-badge { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.lq-badge.ok { background: #e7f6ec; color: #166534; } .lq-badge.warn { background: #fff4e0; color: #9a5b00; } .lq-badge.bad { background: #fde8e8; color: #9b1c1c; }
.lq-more { width: 100%; text-align: right; } .lq-more summary { list-style: none; display: inline; } .lq-more[open] .lq-btns { margin-top: 6px; }
.lq-ans { margin: 6px 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; }
.lq-note { margin-top: 4px; }
@media (max-width: 640px) { .lq-row { flex-direction: column; gap: 8px; } .lq-act { max-width: 100%; justify-content: flex-start; } .lq-btns, .lq-pick { justify-content: flex-start; } .lq-more { text-align: left; } }
@media (prefers-color-scheme: dark) { .lq-badge.ok { background: #0f3320; color: #86efac; } .lq-badge.warn { background: #3a2a0a; color: #fcd34d; } .lq-badge.bad { background: #3b1111; color: #fca5a5; } }

.lq-setup summary { cursor: pointer; }
.lq-srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.lq-src { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; line-height: 1.45; min-width: 0; }
.lq-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lq-name { font-size: 14px; color: var(--ink); }
.lq-bar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .lq-bar .seg button { white-space: nowrap; flex: 0 0 auto; }

/* ---------- Surge AI 3a: guide and readiness programme ---------- */
.guide-btn { margin-left: 8px; border-radius: 99px; width: 26px; height: 26px; padding: 0; font-weight: 700; }
.guide-mini { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 99px; width: 18px; height: 18px; font-size: 11px; line-height: 1; padding: 0; cursor: pointer; margin-left: 4px; vertical-align: middle; }
.guide-mini:hover { border-color: var(--accent, #0d9488); color: var(--accent-ink); }
.ai-guide { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; display: flex; flex-direction: column; gap: 3px; }
.ai-prog-warn { border-left: 3px solid var(--warn); }

/* ---------- Surge AI 3b: watchers ---------- */
.ai-agents-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ai-agent.off { opacity: .6; }
.ai-mode-review { background: var(--accent-soft); color: var(--accent-ink); }
.ai-mode-auto { background: #ecfdf5; color: #047857; }
.ai-finding { margin-bottom: 10px; }
.ai-finding-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.ai-finding-actions .in { max-width: 240px; }
.ai-prio { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2, #f1f3f2); color: var(--ink-3); vertical-align: middle; }
.ai-prio.urgent { background: #fef2f2; color: #b91c1c; }
.ai-prio.high { background: #fffbeb; color: #b45309; }
.ai-explain { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface-2, #f7f8f8); border-radius: 6px; display: grid; gap: 8px; }
.ai-explain ol, .ai-explain ul { margin: 4px 0 0 18px; padding: 0; }
.ai-facts { white-space: pre-wrap; font-size: 12px; line-height: 1.45; max-height: 360px; overflow: auto; background: var(--surface-2, #f7f8f8); padding: 10px; border-radius: 6px; }
.ai-agents-home { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f7f8f8); font-size: 13px; }
.ai-agents-home.warn { background: #fffbeb; }
.ai-ticket-card { border-left: 3px solid var(--accent); }

/* ---------- Surge AI 3c: living KB pages ---------- */
.kb-handoff { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f7f8f8); }
.ai-brief-line { padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f7f8f8); }
.kb-md .kb-tbl { margin: 8px 0 12px; font-size: 13px; }
.kb-md .kb-em { color: var(--ink-3); font-size: 13px; }

/* Surge AI panel on every page (tickets from anywhere) */
.ai-fab { gap: 4px; font-weight: 600; color: var(--accent-ink); border-color: var(--accent-soft); background: var(--accent-soft); }
.ai-fab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 60; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 32px rgba(16, 24, 32, .12); display: flex; flex-direction: column; }
.ai-panel-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ai-panel-b { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.ai-panel-new { padding: 14px; }
.ai-panel .ai-chat { height: 100%; }
.ai-chat.compact .ai-head { padding: 8px 12px; }
.ai-chat.compact .ai-thread { padding: 12px; }
.ai-chat.compact .ai-composer { padding: 10px 12px; }
.ai-chat.compact .ai-foot .copy-btn { font-size: 11px; }
@media (max-width: 640px) { .ai-fab .nt-l { display: none; } }

/* Agency accounts (public/agencies.js) */
.ag-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ag-stat b { display: block; font-size: 22px; margin-top: 4px; }
.ag-stat b.ag-mode { font-size: 15px; }
.agency-banner { margin-top: 12px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-agency { background: var(--accent-soft); color: var(--accent-ink); }
.ag-wrap { min-width: 0; max-width: 100%; }
.ag-tbl { overflow-x: auto; max-width: 100%; }
.ag-tbl .tbl { min-width: 640px; }
@media (max-width: 640px) { .ag-top { grid-template-columns: 1fr 1fr; } .ag-stat b { font-size: 18px; } }
a.card.stat { color: inherit; text-decoration: none; cursor: pointer; display: block; }
/* payment reminders (public/reminders.js) */
.rm-list { display: grid; gap: 10px; }
.rm-row { display: flex; gap: 16px; align-items: center; padding: 14px 16px; }
.rm-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rm-top b { font-size: 15px; }
.rm-amt { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.rm-acts { display: grid; gap: 6px; min-width: 170px; }
.rm-stage { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.rm-blue { background: color-mix(in srgb, #2563eb 12%, transparent); color: #2563eb; }
.rm-amber { background: color-mix(in srgb, #b45309 13%, transparent); color: #b45309; }
.rm-orange { background: color-mix(in srgb, #ea580c 14%, transparent); color: #c2410c; }
.rm-red { background: color-mix(in srgb, #dc2626 13%, transparent); color: #dc2626; }
.rm-banner { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; padding: 12px 16px; color: inherit; text-decoration: none; border-left: 4px solid #b45309; }
.rm-banner .rm-go { margin-left: auto; font-weight: 600; color: var(--accent); }
@media (max-width: 640px) { .rm-row { flex-direction: column; align-items: stretch; } .rm-acts { min-width: 0; } .rm-banner { flex-wrap: wrap; } }
/* monthly reports board (public/reports.js) */
.rb-list { padding: 4px 16px; }
.rb-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.rb-row:last-child { border-bottom: 0; }
.rb-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rb-acts { display: flex; gap: 6px; align-items: center; }
.rb-bar { height: 5px; border-radius: 9px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.rb-bar i { display: block; height: 100%; background: var(--good, #15803d); border-radius: 9px; }
@media (max-width: 640px) { .rb-row { flex-wrap: wrap; } .rb-acts { width: 100%; justify-content: flex-end; } }
/* weekly summary (public/ceoweek.js) */
.cw-att { margin-bottom: 14px; border-left: 4px solid #dc2626; }
.cw-att.calm { border-left-color: var(--good, #15803d); }
.cw-att h2 { margin: 0 0 8px; }
.cw-a { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; }
.cw-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #b45309; transform: translateY(1px); }
.cw-dot.bad { background: #dc2626; }
.cw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cw-card h3 { margin: 0 0 8px; font-size: 15px; }
.cw-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.cw-row:last-of-type { border-bottom: 0; }
.cw-l { color: var(--muted); font-size: 13px; }
.cw-v { font-weight: 650; text-align: right; }
.cw-sub { flex-basis: 100%; }
.cw-d { margin-left: 6px; font-size: 11.5px; font-weight: 600; }
.cw-d.ok { color: var(--good, #15803d); } .cw-d.bad { color: #dc2626; }
.cw-list { margin: 2px 0 8px; display: grid; gap: 2px; }
.cw-card > a.small { display: inline-block; margin-top: 8px; }
.cw-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 10px; max-height: 220px; overflow: auto; padding: 4px 0; }
/* HR lifecycle (public/lifecycle.js) */
.prob-card.due { border-left: 4px solid #b45309; }
.oc { padding: 12px 16px; overflow-x: auto; }
.oc-ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--line); }
.oc-root { padding-left: 0; border-left: 0; }
.oc-li { margin: 4px 0; }
.oc-node { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; min-width: 0; }
.oc-node:hover { background: var(--bg-2, #f4f6f5); }
.oc-node.hit { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.oc-tog { width: 18px; flex: none; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 13px; }
.oc-txt { cursor: pointer; min-width: 0; flex: 1; }
.oc-txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* attendance month (people.js): the Calendar page also uses .cal (flex), so this grid has its own class */
.cal.att-cal { display: grid; flex-direction: initial; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 700px) { .cal.att-cal { gap: 3px; } }
/* record a past invoice (public/pastinvoice.js) */
.pi-cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pi-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 120px 70px 28px; gap: 6px; margin-bottom: 6px; }
.pi-pay { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.menu .menu-item { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.menu .menu-item:hover { background: var(--surface-2); }
@media (max-width: 760px) { .pi-cols { grid-template-columns: 1fr; } .pi-line { grid-template-columns: minmax(0, 1fr) 56px 90px 56px 28px; } }
/* Surge AI for everyone (public/assistant.js, admin → Access) */
.ai-everyone { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; border-left: 4px solid var(--line); }
.ai-everyone.on { border-left-color: var(--accent); }
.switch { position: relative; width: 44px; height: 24px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* Payments (public/payments.js) */
.modal.wide { width: min(860px, 100%); }
.pay-tbl tr.clickable { cursor: pointer; }
.pay-tbl tr.clickable:hover td { background: var(--surface-2, rgba(0,0,0,.02)); }
.drop { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; padding: 18px; border: 1.5px dashed var(--line); border-radius: 10px; cursor: pointer; color: var(--ink-2); background: var(--surface); }
.drop.on, .drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.drop.compact { flex-direction: row; padding: 8px 12px; width: fit-content; }
.proofs { display: flex; flex-wrap: wrap; gap: 10px; }
.proof { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 6px; max-width: 260px; }
.proof img, .proof .proof-doc { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2, #f3f4f4); }
.proof .proof-doc { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--danger); }
.proof .small { word-break: break-all; }
.alloc { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.alloc-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.alloc-row:first-child { border-top: 0; }
.alloc-row.on { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.aging { display: flex; gap: 3px; height: 44px; border-radius: 8px; overflow: hidden; }
.age { border: 0; min-width: 0; padding: 4px 8px; color: #fff; font: inherit; font-size: 11px; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: center; overflow: hidden; white-space: nowrap; }
.age b { font-size: 12px; }
.age.on { outline: 2px solid var(--ink); outline-offset: -2px; }
.age-not_due { background: #0d9488; } .age-d1_30 { background: #d4a72c; } .age-d31_60 { background: #e07b39; } .age-d61_90 { background: #d1495b; } .age-d90 { background: #8b1e3f; }
.tbl tr.sub-row td { background: var(--surface-2, rgba(0,0,0,.02)); padding-top: 4px; padding-bottom: 8px; }
@media (max-width: 640px) { .alloc-row { flex-wrap: wrap; } .alloc-row input.in { width: 100% !important; } }
.tag-credit { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); border-color: transparent; font-weight: 600; }
.credit-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); display: grid; gap: 6px; }
.credit-note b { color: var(--accent); }
.note.credit-banner { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

/* Profitability (public/profitability.js) */
.card.stat.good .n { color: var(--ok); } .card.stat.warn .n { color: #b7791f; }
.mpill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.mpill.good { background: var(--ok-soft); color: var(--ok); } .mpill.warn { background: #fdf3dc; color: #a16207; } .mpill.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); } .mpill.muted { background: var(--line); color: var(--ink-3); }
.profit-basis { display: grid; gap: 4px; }
.profit-basis .warn-text, .warn-text { color: #a16207; }
.basis-bar { height: 6px; border-radius: 4px; background: color-mix(in srgb, #d4a72c 40%, var(--line)); overflow: hidden; }
.basis-bar span { display: block; height: 100%; background: var(--accent); }
.profit-tbl tr.clickable { cursor: pointer; }
.fvc { height: 6px; background: transparent; margin: 3px 0; } .fvc span { display: block; height: 100%; border-radius: 3px; }
.fvc .f, .pcols .f, .lg.f { background: var(--accent); } .fvc .c, .pcols .c, .lg.c { background: #e07b39; }
.pbars { display: flex; gap: 12px; align-items: flex-end; margin: 6px 0; overflow-x: auto; }
.pbar { display: grid; justify-items: center; gap: 4px; min-width: 52px; }
.pcols { display: flex; gap: 4px; align-items: flex-end; height: 110px; } .pcols span { width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 2px 0 8px; }
.hb { flex: 1; min-width: 120px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; } .hb span { display: block; height: 100%; background: var(--accent); } .hb span.over { background: var(--danger); }

/* Review & QA (public/review.js) */
.review-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #f6f8f7); border: 1px solid var(--line); }
.qa-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.qa-row .seg button.on.pass { background: var(--ok); } .qa-row .seg button.on.fail { background: var(--danger); } .qa-row .seg button.on.na { background: var(--ink-3); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.review-round { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.qa-list { margin: 8px 0; padding-left: 18px; display: grid; gap: 3px; }
.reason-bar { display: grid; grid-template-columns: 1fr 120px 30px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.reason-bar .bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .reason-bar .bar span { display: block; height: 100%; background: #e07b39; }
.card.stat.bad .n { color: var(--danger); }

/* onboarding (public/kickoff.js) */
.ko-box { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--ok, #0f5a44) 5%, transparent); display: grid; gap: 6px; }
.ko-preview { display: grid; gap: 4px; }
.ko-group { margin-top: 6px; }
.ko-step { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ko-step > span:first-child { min-width: 0; }
.ko-step > span:last-child { white-space: nowrap; }
.ko-done, .ko-done a { color: var(--muted, #7b838a); text-decoration: line-through; }
.ko-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.ko-bar span { display: block; height: 100%; background: var(--ok, #0f5a44); border-radius: 4px; transition: width .3s; }
.ko-kick + .ko-kick { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ko-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 6px 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ko-mini { width: 60px; } .ko-mini .ko-bar { margin: 0; height: 6px; }
.ko-items { padding: 0 0 8px 10px; display: grid; gap: 2px; }
.ko-edit { display: grid; gap: 6px; margin-bottom: 8px; }
.ko-edit-row { display: grid; grid-template-columns: 1fr 175px 70px auto; gap: 6px; align-items: center; }
@media (max-width: 600px) { .ko-edit-row { grid-template-columns: 1fr 1fr 60px auto; } .ko-edit-row input:first-child { grid-column: 1 / -1; } }

/* terms & renewals (public/terms.js) */
.tm-head { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.tm-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin-bottom: 8px; }
.tm-facts > div { display: grid; gap: 1px; }
.tm-scope { display: grid; gap: 6px; margin-bottom: 6px; }
.tm-scope-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 6px; align-items: center; }
@media (max-width: 600px) { .tm-scope-row { grid-template-columns: 1fr auto; } .tm-scope-row input { grid-column: 1 / -1; grid-row: 2; } }
.tm-scope-view { display: grid; gap: 4px; margin: 8px 0; }
.tm-scope-view ul { margin: 2px 0 4px; padding-left: 18px; }
.tm-hist { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tm-flag.on { border-color: #e07b39; background: color-mix(in srgb, #e07b39 7%, transparent); }

/* performance analysis (public/analysis.js) */
.an { display: grid; gap: 14px; }
.an-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.an-form { display: grid; gap: 4px; }
.an-run h3 { margin-bottom: 8px; }
.an-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; font-size: 13px; color: var(--ink-3); }
.an-steps .done { color: var(--ok); } .an-steps .now { color: var(--ink); font-weight: 600; }
.an-meta { margin: 2px 0 8px; }
.an-secs { margin-bottom: 12px; overflow-x: auto; flex-wrap: nowrap; }
.an-sec { display: grid; gap: 14px; }
.an-headline { font-size: 17px; font-weight: 600; line-height: 1.45; border-left: 4px solid var(--accent); }
.an-list { margin: 6px 0; padding-left: 18px; display: grid; gap: 6px; }
.an-health { display: grid; grid-template-columns: 74px 120px 1fr; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .an-health { grid-template-columns: 74px 1fr; } .an-health .small { grid-column: 1 / -1; } }
.an-row { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.an-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.an-grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.an-grid2 > .card h3, .an-grid2 > div > h3 { margin-top: 0; }
.an-tile { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 4px; }
.an-ev { margin: 4px 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); }
.an-ev li::marker { content: '▸ '; color: var(--accent); }
.an-chart svg { width: 100%; height: auto; display: block; }
.an-grid { stroke: var(--line); stroke-width: 1; } .an-cursor { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.an-tick { font-size: 11px; fill: var(--ink-3); }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; margin: 4px 0; }
.an-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.an-bars { display: grid; gap: 5px; }
.an-bar { display: grid; grid-template-columns: minmax(80px, 160px) 1fr 70px; gap: 8px; align-items: center; font-size: 12.5px; }
.an-bar:has(.an-bar-x) { grid-template-columns: minmax(80px, 150px) 1fr 64px minmax(90px, 170px); }
.an-bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-t { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; } .an-bar-t span { display: block; height: 100%; border-radius: 5px; }
.an-bar-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; } .an-bar-x { color: var(--ink-3); font-size: 12px; }
@media (max-width: 600px) { .an-bar:has(.an-bar-x) { grid-template-columns: 1fr 60px; } .an-bar-t { grid-column: 1 / -1; grid-row: 2; } .an-bar-x { grid-column: 1 / -1; } }
.an-heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; font-size: 10px; color: var(--ink-3); }
.an-heat-c { aspect-ratio: 1; background: var(--accent); border-radius: 2px; min-height: 8px; }
.an-heat-h { text-align: center; } .an-heat-d { align-self: center; }
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.an-persona ul { margin: 2px 0 6px; padding-left: 16px; }
.an-find { border-left: 4px solid var(--blue); }
.an-pairs { display: grid; gap: 6px; }
.an-pair { display: grid; grid-template-columns: minmax(160px, 1fr) 140px 46px minmax(90px, 140px); gap: 8px; align-items: center; font-size: 13px; }
@media (max-width: 600px) { .an-pair { grid-template-columns: 1fr 46px; } .an-r { grid-column: 1 / -1; } }
.an-r { position: relative; height: 10px; background: var(--line); border-radius: 5px; }
.an-r::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink-3); }
.an-r span { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 5px; }
.an-move { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.an-amt { font-weight: 700; color: var(--accent-ink, var(--accent)); }
.an-fix { white-space: pre-wrap; background: var(--surface-2, var(--bg)); padding: 6px 8px; border-radius: 8px; }
.an-qs { display: flex; flex-wrap: wrap; gap: 6px; }
.an-qs-i { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }
.an-qs-i b { margin-right: 3px; } .qg b { color: var(--ok); } .qw b { color: var(--warn); } .qb b { color: var(--danger); }
.an-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 10px; }
.an-ad { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.an-ad img, .an-ad .mt-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--line); }
.an-ad-b { padding: 8px 10px; display: grid; gap: 4px; }
.an-ad-k { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; font-size: 10.5px; color: var(--ink-3); text-align: center; }
.an-ad-k b { display: block; font-size: 12.5px; color: var(--ink); }
.an-ad-copy { max-height: 6.5em; overflow: hidden; color: var(--ink-2); }
.an-newad { display: grid; gap: 6px; align-content: start; }
.an-mock { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 4px; background: var(--surface-2, var(--bg)); }
.an-mock-hook { font-weight: 600; } .an-mock-h { font-weight: 700; color: var(--blue); }
.an-mock-cta { justify-self: start; font-size: 12px; padding: 3px 10px; border-radius: 6px; background: var(--line); font-weight: 600; }
.an-copyline { display: grid; grid-template-columns: 1fr 28px auto; gap: 8px; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.an-gauge { position: relative; width: 74px; display: grid; justify-items: center; gap: 2px; }
.an-gauge svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.an-gauge path { fill: none; stroke-width: 3.2; } .an-gauge .bg { stroke: var(--line); } .an-gauge .fg { stroke-linecap: round; }
.an-gauge.qg .fg { stroke: var(--ok); } .an-gauge.qw .fg { stroke: var(--warn); } .an-gauge.qb .fg { stroke: var(--danger); }
.an-gauge b { position: absolute; top: 18px; font-size: 15px; }
.an-action { display: grid; gap: 2px; }
.seg-tabs.xs button { font-size: 12px; padding: 4px 10px; }

/* emailing a client (EmailModal in public/success.js) */
.em-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 8px; }
.em-chip { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--ink-2); cursor: pointer; }
.em-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.em-chip.team:not(.on) { border-style: dashed; }
.em-ai { border: 1px solid var(--accent-soft); background: color-mix(in srgb, var(--accent) 5%, transparent); border-radius: 10px; padding: 8px; margin: 4px 0 8px; }
.em-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.em-file { font-size: 12px; padding: 3px 4px 3px 9px; border-radius: 8px; background: var(--line); display: inline-flex; gap: 6px; align-items: center; }
.em-file button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 11px; }

/* bank reconciliation (public/bankrec.js) */
.br-accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.br-acct { text-align: left; font: inherit; color: inherit; cursor: pointer; display: grid; gap: 4px; border: 1px solid var(--line); }
.br-acct.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.br-acct-k { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); } .br-acct-k b { display: block; font-size: 17px; color: var(--ink); }
.br-acct-k b.ok, .small.ok { color: var(--ok); }
.br-amt { white-space: nowrap; font-variant-numeric: tabular-nums; } .br-amt.in { color: var(--ok); } .br-amt.out { color: var(--ink); }
.br-line { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.br-line-h { display: grid; grid-template-columns: 86px 1fr auto; gap: 10px; align-items: baseline; }
.br-desc { min-width: 0; overflow-wrap: anywhere; }
.br-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 96px; }
@media (max-width: 600px) { .br-line-h { grid-template-columns: 1fr auto; } .br-date { grid-column: 1 / -1; } .br-sugg { padding-left: 0; } }
.br-chip { font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface, #fff); cursor: pointer; text-align: left; }
.br-chip.exact { border-color: var(--ok); background: var(--ok-soft); } .br-chip.pay { border-style: dashed; }
.br-form { margin-left: 96px; padding: 10px; border-radius: 10px; background: var(--surface-2, var(--bg)); }
@media (max-width: 600px) { .br-form { margin-left: 0; } }
.br-books { padding-left: 96px; color: var(--ink-2); display: grid; gap: 2px; }
.br-pv { display: grid; gap: 8px; margin-top: 10px; }
.br-map { display: flex; flex-wrap: wrap; gap: 6px 14px; } .br-map select { width: auto; max-width: 180px; }

/* files hub (public/files.js) */
.fh { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
@media (max-width: 760px) { .fh { grid-template-columns: 1fr; } .fh-side { display: flex; flex-wrap: wrap; gap: 4px; } }
.fh-side { display: grid; gap: 2px; padding: 10px; }
.fh-folder { display: flex; justify-content: space-between; gap: 6px; font: inherit; font-size: 13px; text-align: left; padding: 6px 8px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.fh-folder.on { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); font-weight: 600; }
.fh-drop { display: grid; gap: 2px; place-items: center; text-align: center; padding: 18px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; background: var(--surface, #fff); }
.fh-drop.on { border-color: var(--accent); background: var(--accent-soft); }
.fh-list { display: grid; }
.fh-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fh-thumb, .fh-icon { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--line); flex: none; }
.fh-icon { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--ink-3); }
.fh-info { flex: 1; min-width: 180px; }
.fh-name { font-weight: 600; overflow-wrap: anywhere; font-size: 14px; }
.fh-acts { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; } .fh-move { width: auto; }
.fh-tag { cursor: pointer; border: 0; } .fh-shared { background: var(--ok-soft); color: var(--ok); }
.fh-kit { display: grid; gap: 8px; margin-bottom: 12px; }
.fh-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.fh-swatch { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; background: none; font: inherit; cursor: pointer; text-align: left; }
.fh-swatch i { width: 34px; height: 34px; border-radius: 7px; border: 1px solid rgba(0,0,0,.08); }
.fh-kit-edit { display: grid; gap: 6px; }

/* Client health (public/health.js) */
.hs-spark { display: block; overflow: visible; }
.hs-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.hs-trend { width: 100%; height: 90px; display: block; border-radius: 8px; overflow: hidden; }
.hs-band.good { fill: color-mix(in srgb, var(--ok) 10%, transparent); }
.hs-band.watch { fill: color-mix(in srgb, var(--warn) 10%, transparent); }
.hs-band.risk { fill: color-mix(in srgb, var(--danger) 9%, transparent); }
.hs-groups { display: grid; gap: 5px; margin: 12px 0 6px; }
.hs-g { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; font-size: 12.5px; }
.hs-g b { text-align: right; font-variant-numeric: tabular-nums; }
.hs-bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.hs-bar i { display: block; height: 100%; border-radius: 99px; transition: width .5s ease; }
.hs-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.hs-sec-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.hs-quote { font-size: 13px; margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--line); }
.hs-alert { margin: 10px 0 4px; padding: 9px 11px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.hs-alert-card { margin-bottom: 10px; border-left: 4px solid var(--danger); }
.hs-tbl td.neg { color: var(--danger); font-weight: 600; }
.hs-tbl td.pos { color: var(--ok); font-weight: 600; }
.tbl td.neg { color: var(--danger); }

/* Meeting intelligence (public/calls.js) */
.call-card { margin-bottom: 10px; }
.call-card.waiting { border-left: 4px solid var(--warn); }
.call-sec { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.call-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.call-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.call-act-main { flex: 1; min-width: 220px; }

/* Performance & growth (public/performance.js) */
.pf-cols { align-items: start; }
.pf-score { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pf-bar { flex: 1; height: 7px; min-width: 60px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 99px; }
.pf-kpis td { vertical-align: top; }
.pf-okr { margin-bottom: 10px; }
.pf-kr { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); margin-top: 6px; }
.pf-krin { display: grid; grid-template-columns: 1fr 80px 80px 70px; gap: 6px; margin-bottom: 6px; }
.pf-f { display: block; margin-bottom: 8px; }
.pf-f > span { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.pf-rev { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pf-path { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pf-item { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.pf-group { margin-top: 8px; }
.pf-gh { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.pf-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 640px) { .pf-krin { grid-template-columns: 1fr 1fr; } }

/* Talent Surge (public/talent.js) */
.ts-grid td { vertical-align: middle; }
.ts-grid input.in { padding: 5px 8px; }
tr.dim td { opacity: .55; }

/* Recruitment (public/recruit.js) */
.rc-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.rc-job { display: grid; gap: 6px; }
.rc-counts { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.rc-counts span { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.rc-counts b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-board { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.rc-col { background: color-mix(in srgb, var(--line) 35%, transparent); border-radius: 12px; padding: 8px; min-height: 120px; }
.rc-col-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 2px 4px 8px; }
.rc-card { padding: 10px 11px; margin-bottom: 8px; }
.rc-cols { align-items: start; }
.rc-fit { font-size: 26px; font-weight: 800; min-width: 52px; text-align: center; border-radius: 12px; padding: 4px 8px; }
.rc-fit.ok { color: var(--ok); background: var(--ok-soft); } .rc-fit.warn { color: var(--warn); background: var(--warn-soft); } .rc-fit.bad { color: var(--danger); background: var(--danger-soft); }
.rc-mh { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.rc-cv { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: #fff; }
.rc-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.rc-ev { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* Contracts & e-signature (public/contracts.js) */
.ct-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
@media (max-width: 980px) { .ct-split { grid-template-columns: 1fr; } }
.ct-paper { background: #fff; color: #1f2937; border: 1px solid var(--line); border-radius: 12px; padding: 30px 34px; box-shadow: 0 1px 3px rgba(0,0,0,.05); max-height: calc(100vh - 140px); overflow: auto; }
@media (max-width: 640px) { .ct-paper { padding: 18px 16px; max-height: none; } }
.ct-paper.sticky-top { position: sticky; top: 12px; }
@media (max-width: 980px) { .ct-paper.sticky-top { position: static; } }
.ct-doc { font-size: 13.5px; line-height: 1.65; }
.ct-doc h2 { font-size: 19px; color: #0f5a44; margin: 0 0 12px; } .ct-doc h3 { font-size: 14px; margin: 16px 0 4px; }
.ct-doc p { margin: 0 0 8px; } .ct-doc ul { margin: 0 0 8px; padding-left: 20px; }
.ct-blank { background: #fde68a; color: #92400e; border-radius: 4px; padding: 0 3px; }
.ct-need { border-color: #f59e0b !important; background: #fffbeb; }
.ct-warn { background: #fdf3dc; color: #a16207; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; }
.ct-ok { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.ct-signer { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin: 8px 0; display: grid; gap: 6px; }
.ct-row { padding: 7px 0; border-bottom: 1px solid var(--line); gap: 8px; align-items: center; }
.ct-ev { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ct-hash { font-size: 11px; word-break: break-all; }
.ct-src { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ct-chips .btn { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.ct-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ct-tpl { display: grid; gap: 5px; } .ct-tpl.off { opacity: .6; }
.ct-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--line); }
.ct-dot.good { background: var(--ok); } .ct-dot.warn { background: #f59e0b; } .ct-dot.bad { background: var(--danger); }
.ct-sig { font: italic 24px/1.3 'Brush Script MT', 'Segoe Script', 'Snell Roundhand', cursive; color: #14336f; margin-top: 6px; }
.ct-tbl td { vertical-align: top; }

/* Capacity alerts (public/workviews.js) */
.cap-box { margin-bottom: 12px; display: grid; gap: 8px; }
.cap-a { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 5px; }
.cap-a.done { opacity: .6; }
.cap-sug { display: grid; gap: 4px; padding-left: 10px; border-left: 2px solid var(--line); }
.cap-t { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Manager review of reports (public/success.js ReportEditor) */
.rep-review { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 4px; }

/* ---------- Agentic SEO (module "seo", public/seo.js) ---------- */
.seo-top { justify-content: space-between; margin: 12px 0 8px; gap: 10px; }
.seo-nav { flex-wrap: wrap; max-width: 100%; margin-bottom: 4px; }
.seo-nav button { padding: 6px 11px; font-size: 13px; }
.seo-count { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.seo-count.soft { background: var(--line-2, var(--line)); color: var(--ink-2); }
.seo-nav button.on .seo-count { background: #fff; color: var(--accent); }
.seo .card { margin-bottom: 12px; }
.seo .card.stat[role="button"] { cursor: pointer; }
.seo .card.stat.warn .n { color: var(--warn); }
.seo-setup .seo-step { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.seo-setup .seo-step.ok { color: var(--ink-3); }
.seo-tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.seo-step.ok .seo-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.seo-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0; }
.seo-bar span { display: block; height: 100%; background: var(--accent); transition: width .4s var(--ease); }
.seo-events { display: flex; flex-direction: column; }
.seo-ev { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.seo-ev:first-child { border-top: 0; }
.seo-up { color: var(--ok); font-weight: 600; }
.seo-down { color: var(--danger); }
.seo-rec .seo-prio { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.seo-rec-act { display: flex; flex-direction: column; gap: 6px; flex: none; }
.seo-evidence { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.seo-ev-box { margin-bottom: 6px; overflow-wrap: anywhere; }
.seo-url { overflow-wrap: anywhere; }
.seo-url-cell { max-width: 340px; overflow-wrap: anywhere; }
.seo-code { font-size: 11px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.seo-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
.seo-diff-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.seo-serp { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: arial, sans-serif; }
.seo-serp .t { color: #1a0dab; font-size: 17px; line-height: 1.3; }
.seo-serp .u { color: #4d5156; font-size: 12px; margin: 2px 0; }
.seo-serp .d { color: #4d5156; font-size: 13px; line-height: 1.45; }
.seo-diffrows { margin: 6px 0; display: grid; gap: 6px; }
.seo-del { background: var(--danger-soft, #fdecec); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); padding: 2px 6px; border-radius: 4px; margin-top: 2px; }
.seo-ins { background: var(--ok-soft); padding: 2px 6px; border-radius: 4px; margin-top: 2px; }
.seo-verify { border-radius: 8px; padding: 8px 10px; margin: 8px 0; border: 1px solid var(--line); }
.seo-verify.ok { background: var(--ok-soft); border-color: transparent; }
.seo-verify.bad { background: var(--warn-soft); border-color: transparent; }
.seo-brief-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; align-items: start; }
.seo-brief-cols h4 { margin: 12px 0 4px; }
.seo-outline { padding-left: 18px; }
.seo-outline ul { padding-left: 16px; color: var(--ink-2); }
.seo-kw { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin: 2px 4px 2px 0; font-size: 12px; }
.seo-kw i { color: var(--ink-3); font-style: normal; font-size: 10px; }
.seo-flags { margin: 8px 0; display: grid; gap: 4px; }
.seo-flag { padding: 4px 8px; border-radius: 6px; background: var(--surface-2); }
.seo-flag.missing_fact, .seo-flag.prohibited_claim { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.seo-flag.unsupported_claim { background: var(--warn-soft); color: var(--warn); }
.seo-h1 { margin: 12px 0 6px; font-size: 22px; }
.seo-md { line-height: 1.6; font-size: 14px; }
.seo-md h3 { margin: 16px 0 4px; } .seo-md h4 { margin: 12px 0 4px; }
.seo-missing { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); padding: 0 3px; border-radius: 3px; }
.seo-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.seo-chart svg { width: 100%; height: auto; display: block; }
.seo-chart .ax { stroke: var(--line); }
.seo-chart .l1 { fill: none; stroke: var(--accent); stroke-width: 2; }
.seo-chart .l2 { fill: none; stroke: var(--blue, #2563eb); stroke-width: 1.6; stroke-dasharray: 4 3; }
.seo-chart .mk { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 2 3; }
.seo-chart .tx { font-size: 10px; fill: var(--ink-3); }
.seo-key { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 5px; }
.seo-key.l2 { border-top: 2px dashed var(--blue, #2563eb); } .seo-key.mk { border-top: 2px dotted var(--warn); }
.seo-radio { align-items: flex-start; gap: 8px; padding: 6px 0; }
.seo-auto { margin: 4px 0 8px 26px; }
.seo-caps td { padding-top: 4px; padding-bottom: 4px; }
.seo-steps li { margin-bottom: 6px; }
.seo-panel p { margin-top: 4px; }
@media (max-width: 760px) {
  .seo-diff, .seo-brief-cols { grid-template-columns: 1fr; }
  .seo-ev { grid-template-columns: 1fr; gap: 2px; }
  .seo-rec .row { flex-wrap: wrap; }
  .seo-rec-act { flex-direction: row; flex-wrap: wrap; }
}
.seo-pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 8px 0; }
.seo-stars { color: #f5a623; letter-spacing: 1px; font-size: 13px; } .seo-stars .off { color: var(--line); }
.seo-local-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; margin-top: 10px; }
.seo-local-stats { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.seo-local-stats .n { font-size: 30px; font-weight: 700; }
.seo-review { border-top: 1px solid var(--line); padding: 10px 0; }
.seo-reply { margin: 6px 0 0 14px; padding: 6px 10px; border-left: 3px solid var(--accent-soft); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.seo-review-q { color: var(--ink-2); }
@media (max-width: 760px) { .seo-local-grid { grid-template-columns: 1fr; } }
.seo-agent-steps { display: grid; gap: 3px; margin: 8px 0; }
.seo-agent-form { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; max-width: 420px; }
.seo-anchor { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink); padding: 0 2px; border-radius: 3px; }
.seo-quote { font-style: italic; color: var(--ink-2); margin: 3px 0; }

/* SEO: AI visibility */
.seo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 8px 0; }
.seo-tile { margin: 0; }
.seo-tile .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.seo-answer { white-space: pre-wrap; max-height: 50vh; overflow: auto; background: var(--surface-2, var(--bg)); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0; overflow-wrap: anywhere; }
/* SEO: keywords and rankings */
.seo-spark { color: var(--accent, #0d9488); vertical-align: middle; transform: none; }
.seo-kw.won { background: var(--ok-soft, #e6f6ef); color: var(--ok); }
tr.seo-mine td { background: var(--accent-soft); }
.tbl-wrap { overflow-x: auto; }
/* SEO: local map grids */
.seo-grid-block { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.seo-grid-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.seo-grid { display: grid; gap: 4px; width: min(100%, 320px); }
.seo-cell { aspect-ratio: 1; border: 0; border-radius: 50%; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; min-width: 26px; }
.seo-legend .seo-cell { width: auto; min-width: 34px; white-space: nowrap; aspect-ratio: auto; border-radius: 10px; padding: 2px 6px; margin-right: 4px; cursor: default; font-size: 11px; }
.seo-cell.g-top { background: #15803d; } .seo-cell.g-mid { background: #ca8a04; } .seo-cell.g-low { background: #ea580c; } .seo-cell.g-none { background: #b91c1c; } .seo-cell.g-wait { background: var(--line); color: var(--muted, #888); }
.seo-cell.center { outline: 2px solid var(--text, #111); outline-offset: 1px; }
.seo-legend { margin-top: 6px; }
.sv-box { margin-top: 8px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--ink) 15%, transparent); }
/* proposals editor */
.pp-ed .card { margin-bottom: 14px; }
.pp-bar { position: sticky; top: 8px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; }
.pp-row { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.pp-ed .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .pp-ed .grid2 { grid-template-columns: 1fr; } }

/* Team survey (public/teamsurvey.js) */
.mpill.ok { background: var(--ok-soft); color: var(--ok); }
.ts-card { max-width: 680px; }
.ts-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin: 6px 0 2px; }
.ts-n { padding: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card, #fff); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.ts-n.on { background: var(--brand, #0d9488); border-color: var(--brand, #0d9488); color: #fff; }
.ts-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ts-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ts-stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ts-stat b { font-size: 24px; line-height: 1.1; }
.ts-stat span { font-size: 13px; }
.ts-stat em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.ts-ok { color: var(--ok); } .ts-warn { color: var(--warn); } .ts-bad { color: var(--danger); } .ts-muted { color: var(--ink-3); }
.ts-c { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--line); background: color-mix(in srgb, var(--line) 30%, transparent); border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.ts-trend { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; }
.ts-col { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; }
.ts-barbox { height: 90px; width: 22px; display: flex; align-items: flex-end; }
.ts-barbox i { display: block; width: 100%; border-radius: 4px 4px 0 0; }
.ts-bg-ok { background: var(--ok); } .ts-bg-warn { background: var(--warn); } .ts-bg-bad { background: var(--danger); } .ts-bg-muted { background: var(--line); }
@media (max-width: 520px) { .ts-scale { grid-template-columns: repeat(6, 1fr); } }

/* 1:1s (public/oneonones.js) */
.ooo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.ooo-ctx { background: color-mix(in srgb, var(--ok-soft) 50%, transparent); }
.ooo-priv { background: color-mix(in srgb, var(--warn-soft) 60%, transparent); }
.ooo-past { border-top: 1px solid var(--line); }
.ooo-ph { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 0; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.ooo-pb { padding: 0 0 10px; }
.ooo-pb .ooo-priv { padding: 6px 8px; border-radius: 6px; }

/* Quarterly reviews (public/qbr.js) */
.qbr .card { margin-bottom: 12px; }
.grid-qbr { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .grid-qbr { grid-template-columns: 1fr; } }

/* Phone polish (UX sweep, 29 Oct 2026): nothing may widen the page on a phone. */
.cols > *, .ws-cols > *, .grid2 > *, .grid-qbr > * { min-width: 0; }
.act { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  div:has(> table.tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  .filters { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  /* The page title needs the room: Surge AI stays one tap away in the menu (Surge AI page); the help "?" folds
     into the title row; the clock keeps its button but not its label. */
  .topbar .ai-fab { display: none; }
  .topbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .topbar h1 { flex: 1 1 auto; min-width: 72px; }
  .topbar .topclock .tc-l { display: none; }
  .seg-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg-tabs::-webkit-scrollbar { display: none; }
  .seg-tabs button { white-space: nowrap; flex: none; }
}
.toast { max-width: min(560px, calc(100vw - 32px)); cursor: pointer; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 640px) { .toast { bottom: calc(16px + env(safe-area-inset-bottom)); } }
@media (max-width: 900px) {
  /* Ticket on a phone: the title, then status / assignee / due (the side panel), then the rest. */
  .tk { gap: 0; }
  .tk > div:first-child { display: contents; }
  .tk > div:first-child > * { order: 2; }
  .tk > div:first-child > .row:first-child, .tk > div:first-child > .tp-away, .tk > div:first-child > .tk-title, .tk > div:first-child > .tk-edit-title { order: 0; }
  .tk > .side-props { order: 1; margin: 10px 0 4px; }
  /* Tickets list on a phone: the project tree folds into one line above the list. */
  .wtree .wt-phone { display: flex; }
  .wtree:not(.p-open) > :not(.wt-phone) { display: none; }
  .wtree { max-height: none; padding: 4px; }
}
.wt-phone { display: none; width: 100%; align-items: center; gap: 6px; padding: 8px 10px; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.wt-phone b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-more { display: none; }
@media (max-width: 900px) {
  .side-props:not(.all) .p-x { display: none; }
  .side-props .sp-more { display: block; order: 49; margin: 6px 0 2px; text-align: left; }
  .side-props .p-x { order: 50; }
  .side-props { display: flex; flex-direction: column; }
}
.tk-filters .f-toggle { display: none; }
@media (max-width: 640px) {
  .tk-filters { flex-wrap: wrap; }
  .tk-filters > input:first-child { flex: 1; min-width: 0; }
  .tk-filters .f-toggle { display: inline-flex; }
  .tk-filters:not(.f-open) > :not(input:first-child):not(.f-toggle) { display: none; }
}

/* Keyboard users: a visible focus ring on everything you can tab to, and a skip link past the menu. */
:where(button, a, [tabindex]:not([tabindex="-1"]), summary, .chip, .seg button, .seg-tabs button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#page-content:focus { outline: none; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 600; }
.skip-link:focus { top: 8px; }

/* Home → Needs you today */
.today-card { margin-bottom: 16px; }
.today-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.today-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; background: var(--surface); transition: border-color .15s, background .15s; }
.today-item:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.today-item .td-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.today-item .td-tag { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 99px; min-width: 64px; text-align: center; }
.today-item.td-1 .td-tag { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.today-item.td-2 .td-tag { background: var(--warn-soft); color: var(--warn); }
.today-item.td-3 .td-tag { background: var(--line); color: var(--ink-3); }
.today-item .td-go { color: var(--ink-3); flex: none; }
@media (max-width: 520px) { .today-item { gap: 8px; padding: 9px 10px; } .today-item .td-tag { min-width: 0; } }
.perm-row.planned > span:first-child { opacity: .65; }

/* View as (src/viewas.js) */
.viewas-bar { position: sticky; top: 0; z-index: 30; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fef3c7; color: #78350f; border: 1px solid #f59e0b; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 13.5px; }
@media (prefers-color-scheme: dark) { .viewas-bar { background: #3b2a0a; color: #fde68a; border-color: #b45309; } }
/* Search polish (29 Oct 2026): close button, kind chips, highlights, full screen on phones */
.search-top { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.search-top .search-in { flex: 1; width: auto; margin: 0; border-bottom: 0; }
.search-x { margin-right: 12px; color: var(--ink-3); }
.search-kinds { display: flex; gap: 6px; padding: 8px 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.search-kinds .chip { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; }
.search-kinds .chip.on { background: var(--brand, #0d9488); border-color: var(--brand, #0d9488); color: #fff; }
.search-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-ink, #0e6b52); cursor: pointer; font: inherit; text-transform: none; letter-spacing: 0; font-size: 12px; text-decoration: underline; }
.search-it mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-it { min-height: 44px; justify-content: center; }
@media (max-width: 760px) {
  .search-veil { padding: 0; }
  .search-box { width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .search-foot { display: none; }
}
.search-top .search-in:focus { box-shadow: none; outline: none; }
/* Copy a ticket to projects */
.copy-projects { max-height: 300px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.copy-proj { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.copy-proj:hover { background: var(--surface-2, rgba(0,0,0,.04)); }
.copy-proj .key { min-width: 54px; }
.copy-proj span:nth-child(3) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Agency / parent client: connect an existing client as an account */
.ag-mode-seg { display: flex; margin-bottom: 12px; }
.ag-mode-seg button { flex: 1; }
.ag-cands { max-height: 320px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.ag-cand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
button.ag-cand:hover { background: var(--surface-2, rgba(0,0,0,.04)); }
.ag-cand.off { opacity: .6; cursor: default; }
.ag-picked { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.ag-what { margin: 12px 0 0; padding-left: 18px; line-height: 1.6; color: var(--ink-2, inherit); }
.ag-twin { margin-bottom: 10px; }
/* "A new version is ready" (startUpdateCheck in app.js) */
.update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2000; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: var(--surface, #fff); color: var(--ink, #111); border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 14px; max-width: calc(100vw - 32px); }
/* Chat: images waiting to be sent show as previews (public/chat.js Composer) */
.cthumb { position: relative; display: inline-block; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.cthumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.cthumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer; }
.cthumb-busy { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; text-align: center; padding: 3px 0; }
.czoom { display: grid; place-items: center; cursor: zoom-out; }
.czoom img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

/* Newsletter editor (public/newsletter.js): fields and a live preview side by side on wide screens. */
@media (min-width: 1100px) { .nl-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .nl-preview { position: sticky; top: 76px; align-self: start; } }

/* Mail (public/mail.js): list and email side by side; one at a time on a phone */
.content.mail-mode { padding: 12px 16px 12px; max-width: none; }
.mail-app { display: grid; grid-template-columns: 210px minmax(300px, 390px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 92px); min-height: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.mail-side { border-right: 1px solid var(--line); background: var(--surface-2); padding: 12px 10px; overflow-y: auto; min-height: 0; }
.mail-new { width: 100%; justify-content: center; margin-bottom: 8px; }
.mail-ib { display: flex; width: 100%; align-items: center; gap: 6px; background: none; border: 0; border-radius: 8px; padding: 7px 9px; cursor: pointer; color: var(--ink-2); font: inherit; text-align: left; }
.mail-ib span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mail-ib b { font-size: 11px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: #fff; }
.mail-ib:hover { background: var(--surface); }
.mail-ib.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.mail-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3, #888); padding: 12px 9px 4px; }
.mail-note { padding: 0 9px 6px; }
.mail-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.mail-phone-top { display: none; }
.mail-tools { display: flex; gap: 8px; align-items: center; padding: 8px 10px 0; flex-wrap: wrap; }
.mail-tools .seg-tabs { border-bottom: 0; margin: 0; }
.mail-tools .seg-tabs button { padding: 7px 9px; }
.mail-search { flex: 1; min-width: 120px; }
.mail-bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; margin: 8px 8px 0; border-radius: 10px; background: var(--accent-soft); font-size: 13px; animation: fadeUp .15s var(--ease); }
.mail-list { overflow-y: auto; flex: 1; min-height: 0; margin-top: 8px; border-top: 1px solid var(--line); }
.mail-empty { margin: 30px 12px; text-align: center; }
.mail-hint { padding: 6px 12px 8px; border-top: 1px solid var(--line); }
.mail-swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.mail-swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 20px; font-weight: 700; color: #fff; }
.mail-swipe-bg.left { background: var(--accent); justify-content: flex-end; } .mail-swipe-bg.right { background: #3b82f6; }
.mail-row { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px 10px 8px; cursor: pointer; background: var(--surface); transition: background var(--t-fast); outline: none; }
.mail-row:hover { background: var(--surface-2); }
.mail-row.current { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-row.focus { box-shadow: inset 0 0 0 2px var(--accent); }
.mail-row.sel { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.mail-row .avatar { width: 32px; height: 32px; font-size: 12px; margin-top: 1px; }
.mail-check { display: flex; align-items: center; justify-content: center; width: 18px; height: 34px; opacity: 0; transition: opacity var(--t-fast); cursor: pointer; }
.mail-check input { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent); }
.mail-row:hover .mail-check, .mail-row.sel .mail-check, .mail-row.selecting .mail-check, .mail-bulk .mail-check { opacity: 1; }
.mail-row-main { min-width: 0; }
.mail-row-top { display: flex; align-items: baseline; gap: 6px; }
.mail-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mail-time { margin-left: auto; white-space: nowrap; font-size: 11.5px; color: var(--ink-3); }
.mail-subj { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.mail-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
.mail-row.unread .mail-who, .mail-row.unread .mail-subj { font-weight: 700; color: var(--ink); }
.mail-row.unread .mail-who::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.mail-tag { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.mail-tag.ok { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.mail-count { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.mail-row-acts { position: absolute; right: 8px; top: 7px; display: none; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); }
.mail-row-acts button { width: 28px; height: 26px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.mail-row-acts button:hover { background: var(--accent-soft); color: var(--accent-ink); }
@media (hover: hover) { .mail-row:hover .mail-row-acts { display: flex; } }
.mail-more { display: block; width: 100%; padding: 12px; border: 0; background: none; color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.mail-more:hover { background: var(--surface-2); }
.mail-read { overflow-y: auto; min-height: 0; background: var(--bg); container-type: inline-size; }
.mail-col { container-type: inline-size; }
@container (max-width: 620px) { .mail-thread .mail-lbl { display: none; } .mail-thread-acts .btn { padding: 7px 10px; } .mail-thread-acts select.in { max-width: 140px; } }
@container (max-width: 470px) { .mail-thread .mail-wide-only, .mx-tool.mail-lbl-tool, .mail-thread .mx-lbl { display: none; } }
@container (max-width: 360px) { .mail-row .mail-lbl, .mail-row .mail-wide-only { display: none; } }
.mail-blank { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); text-align: center; padding: 20px; }
.mail-fab { display: none; }
.mail-thread { padding: 14px 22px 40px; max-width: 980px; margin: 0 auto; }
.mail-thread-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 4px 0 10px; }
.mail-thread-acts { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.mail-nav { display: inline-flex; gap: 2px; } .mail-nav .btn { padding: 7px 10px; }
.mail-back { display: none; }
.mail-thread-subj { margin: 4px 0 10px; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mail-msgs { display: grid; gap: 8px; }
.mail-msg { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.mail-msg.out { border-left: 3px solid var(--accent); }
.mail-msg-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; }
.mail-msg-head .avatar { width: 34px; height: 34px; flex: none; }
.mail-msg-who { min-width: 0; flex: 1; }
.mail-msg-to, .mail-msg-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg.open .mail-msg-to { white-space: normal; }
.mail-msg-time { white-space: nowrap; padding-top: 2px; }
.mail-msg-acts { display: flex; gap: 2px; }
.mail-msg-body { padding: 0 12px 12px; }
.mail-paper { background: #fff; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.mail-html { display: block; width: 100%; height: 48px; border: 0; background: #fff; }
.mail-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; padding: 4px 2px; }
.mail-atts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mail-att { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--surface-2); color: var(--ink); max-width: 260px; }
.mail-att > span:last-child { display: grid; min-width: 0; } .mail-att b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.mail-att:hover { border-color: var(--accent); }
.mail-more-msgs { border: 1px dashed var(--line); border-radius: 10px; background: none; padding: 7px; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px; }
.mail-more-msgs:hover { border-color: var(--accent); color: var(--accent-ink); }
.mail-reply { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px; box-shadow: var(--shadow); }
.mail-reply:focus-within { border-color: var(--accent); }
.mail-reply-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
/* the writing box */
.mx-editor { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.mx-editor:focus-within { border-color: var(--accent); }
.mx-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.mx-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.mx-tool { min-width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; }
.mx-tool.big { font-size: 18px; } .mx-tool.wide { padding: 0 9px; }
.mx-tool:hover, .mx-tool[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.mx-area { min-height: 110px; max-height: 50vh; overflow-y: auto; padding: 10px 12px; outline: none; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.mx-area.tall { min-height: 220px; }
.mx-area:empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; }
.mx-area p { margin: 0 0 10px; } .mx-area ul, .mx-area ol { margin: 0 0 10px; padding-left: 22px; }
.mx-area blockquote { margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--ink-2); }
.mx-area a { color: var(--accent-ink); text-decoration: underline; }
.mx-link { display: flex; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mx-link .in { flex: 1; }
.mx-actions { display: flex; gap: 4px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.mx-draft { margin-left: 6px; }
.mx-send { margin-left: auto; display: flex; gap: 8px; }
.mx-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mx-pop { position: relative; display: inline-flex; }
.mx-menu { position: absolute; bottom: calc(100% + 6px); left: 0; width: min(340px, 86vw); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 20; display: grid; gap: 8px; animation: fadeUp .15s var(--ease); }
.mx-menu-list { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; }
.mx-menu-item { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding-right: 6px; }
.mx-menu-item:hover { background: var(--surface-2); }
.mx-menu-use { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; padding: 7px 8px; cursor: pointer; font: inherit; color: inherit; }
.mx-menu-use span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-menu-foot { border-top: 1px solid var(--line); padding-top: 6px; }
.mx-compose { display: grid; gap: 8px; }
.mx-field { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.mx-field label { width: 58px; flex: none; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.mx-field .in { border: 0; background: none; padding: 6px 2px; box-shadow: none; }
.mx-field .in:focus { outline: none; }
.mail-undo { position: fixed; left: 20px; bottom: 20px; z-index: 70; display: none; align-items: center; gap: 12px; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: toastUp .22s cubic-bezier(.2,.8,.2,1); }
.mail-undo button { border: 0; background: none; color: #6ee7b7; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; padding: 4px 6px; border-radius: 6px; }
.mail-undo button.ghost { color: inherit; opacity: .7; font-weight: 500; }
.mail-undo button:hover { background: rgba(255,255,255,.12); }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); color: var(--ink-2); }
@media (max-width: 1200px) { .mail-app { grid-template-columns: 180px minmax(270px, 330px) minmax(0, 1fr); } }
/* phone and small tablet: one column at a time, big tap targets */
@media (max-width: 900px) {
  .content.mail-mode { padding: 0; }
  .mail-app { display: block; height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--bg); }
  .mail-side { display: none; }
  .mail-col { border-right: 0; }
  .mail-app.reading .mail-col { display: none; }
  .mail-app:not(.reading) .mail-read { display: none; }
  .mail-read { overflow: visible; background: var(--bg); }
  .mail-phone-top { display: block; padding: 10px 12px 0; }
  .mail-phone-top .in { font-weight: 600; }
  .mail-tools { padding: 8px 12px 0; }
  .mail-search { flex-basis: 100%; order: -1; }
  .mail-list { overflow: visible; background: var(--surface); }
  .mail-row { padding: 12px 14px 12px 8px; }
  .mail-row .avatar { width: 38px; height: 38px; }
  .mail-check { opacity: 1; width: 22px; }
  .mail-check input { width: 18px; height: 18px; }
  .mail-hint { display: none; }
  .mail-thread { padding: 8px 12px 90px; }
  .mail-thread-bar { position: static; padding: 8px 0 4px; flex-wrap: nowrap; }
  .mail-thread-acts { flex-wrap: nowrap; }
  .mail-row .mail-wide-only { display: none; }
  .mail-back { display: inline-flex; }
  .mail-thread-subj { font-size: 18px; }
  .mail-msg-head .avatar { width: 32px; height: 32px; }
  .mail-msg-body { padding: 0 8px 10px; }
  .mx-tool { min-width: 38px; height: 38px; font-size: 15px; }
  .mx-send .btn { padding: 10px 16px; }
  .mail-fab { display: flex; position: fixed; right: 18px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 22px; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 40; cursor: pointer; }
  .mail-app.reading .mail-fab { display: none; }
  .mail-undo { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; }
  .overlay .modal:has(.mx-compose) { width: 100%; max-width: none; height: 100%; max-height: 100%; border-radius: 0; padding: 14px; }
  .mx-menu { position: fixed; left: 10px; right: 10px; bottom: 10px; width: auto; }
}

/* Client Intelligence (client_intel.js) */
.ci-list { list-style: none; margin: 0; padding: 0; }
.ci-list li + li { border-top: 1px solid var(--line, #eee); }

/* Charts (charts.js) */
.heat { border-collapse: separate; border-spacing: 2px; }
.heat td { width: 18px; height: 16px; border-radius: 3px; border: 1px solid var(--line); }
.heat th { font-weight: 500; color: var(--ink-3); font-size: 10px; padding: 0 3px; text-align: right; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.ad-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--surface); }
.ad-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: 6px; background: var(--surface-2); }
.concept-mark { position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }

/* Huddles (public/huddle.js): the call window, incoming-call card and chat buttons */
.hd-root { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.hd-root > * { pointer-events: auto; }
.hd-root audio { display: none; }
.hd-win { width: 320px; background: #14181b; color: #f3f5f6; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; animation: scaleIn .2s var(--ease); }
.hd-win.full { position: fixed; inset: 14px; width: auto; z-index: 90; border-radius: 18px; }
.hd-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.hd-live { width: 8px; height: 8px; border-radius: 50%; background: #34c08f; box-shadow: 0 0 0 0 rgba(52,192,143,.6); animation: hdPulse 1.6s infinite; flex: none; }
@keyframes hdPulse { 70% { box-shadow: 0 0 0 7px rgba(52,192,143,0); } 100% { box-shadow: 0 0 0 0 rgba(52,192,143,0); } }
.hd-title { flex: 1; min-width: 0; background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding: 0; }
.hd-time { font-size: 12px; color: rgba(255,255,255,.65); font-variant-numeric: tabular-nums; }
.hd-icon { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.hd-icon:hover { background: rgba(255,255,255,.1); color: #fff; }
.hd-grid { display: grid; gap: 6px; padding: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hd-grid.n1 { grid-template-columns: 1fr; }
.hd-win.full .hd-grid { flex: 1; min-height: 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-auto-rows: minmax(160px, 1fr); padding: 12px; gap: 10px; }
.hd-win.full .hd-grid.n1, .hd-win.full .hd-grid.n2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.hd-grid.sharing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hd-grid.sharing .hd-tile.big { grid-column: 1 / -1; }
.hd-win.full .hd-grid.sharing { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) 130px; grid-auto-rows: 130px; }
.hd-tile { position: relative; background: #22292e; border-radius: 12px; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; overflow: hidden; outline: 2px solid transparent; transition: outline-color .15s; min-height: 0; }
.hd-win.full .hd-tile { aspect-ratio: auto; }
.hd-tile.talking { outline-color: #34c08f; }
.hd-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.hd-tile.screen video { object-fit: contain; }
.hd-tile video.mirror { transform: scaleX(-1); }
.hd-face { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #0e6b52, #34c08f); color: #fff; font-weight: 700; letter-spacing: .02em; }
.hd-tile.talking .hd-face { box-shadow: 0 0 0 3px rgba(52,192,143,.45); }
.hd-name { position: absolute; left: 6px; bottom: 6px; font-size: 11.5px; padding: 2px 7px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; max-width: calc(100% - 40px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-muted { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: #e5484d; color: #fff; display: flex; align-items: center; justify-content: center; }
.hd-wait { text-align: center; font-size: 12.5px; color: rgba(255,255,255,.7); padding: 0 10px 6px; }
.hd-bar { display: flex; justify-content: center; gap: 10px; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.hd-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255,255,255,.12); color: #fff; transition: background .15s, transform .1s; }
.hd-btn:hover { background: rgba(255,255,255,.2); } .hd-btn:active { transform: scale(.94); }
.hd-btn.off { background: #f3f5f6; color: #14181b; }
.hd-btn.on { background: #34c08f; color: #0b1f18; }
.hd-btn.end { background: #e5484d; } .hd-btn.end:hover { background: #d13a3f; }
.hd-btn.go { background: #22a06b; } .hd-btn.go:hover { background: #1c8a5b; }
.hd-ring { width: 320px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #14181b; color: #f3f5f6; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35); animation: scaleIn .2s var(--ease); }
.hd-ring-pulse { border-radius: 50%; animation: hdPulse 1.4s infinite; flex: none; }
.hd-ring-t { flex: 1; min-width: 0; display: grid; } .hd-ring-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hd-ring-t span { font-size: 12.5px; color: rgba(255,255,255,.7); }
.hd-ring-a { display: flex; gap: 8px; }
.hd-start.live { background: #22a06b; border-color: #22a06b; color: #fff; }
.hd-start span { margin-left: 4px; font-weight: 600; }
.hd-banner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.hd-banner .btn { margin-left: auto; }
@media (max-width: 640px) {
  .hd-root { left: 10px; right: 10px; bottom: 10px; justify-items: stretch; }
  .hd-win, .hd-ring { width: auto; }
  .hd-win.full { inset: 0; border-radius: 0; }
  .hd-win.full .hd-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(140px, 1fr); }
  .hd-win.full .hd-grid.sharing { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) 100px; grid-auto-rows: 100px; }
  .hd-btn { width: 50px; height: 50px; }
}

/* Brands (public/brands.js) */
.brand-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.brand-card { padding: 14px; }
.brand-dot { width: 14px; height: 14px; border-radius: 99px; flex: none; margin-top: 5px; border: 1px solid var(--line); }
.brand-facts { display: grid; gap: 3px; margin-top: 10px; }
.brand-facts .muted { display: inline-block; min-width: 72px; }
.brand-setup { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.brand-recs { display: grid; gap: 8px; }
.brand-rec { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; min-width: 0; }
.brand-kv { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.brand-kv code { font-size: 12px; overflow-wrap: anywhere; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.brand-form { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .brand-form { grid-template-columns: 1fr; } .brand-kv { grid-template-columns: 1fr auto; } .brand-kv > span:first-child { grid-column: 1 / -1; } }
.mail-lock { font-size: 12px; color: var(--ink-3); }
/* Agency workspace bar (public/tenant.js) */
.tn-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 16px; margin: 0 0 10px; border-radius: 10px; background: #eef8f7; border: 1px solid #cfe9e6; color: #134e4a; font-size: 13px; }
.tn-bar span { flex: 1 1 260px; }
.tn-bar.locked { background: #fff4ed; border-color: #fed7aa; color: #7c2d12; }
.tn-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #0f766e; color: #fff; font-weight: 700; font-size: 15px; }
.tn-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
@media (prefers-color-scheme: dark) { .tn-bar { background: #0f2f2d; border-color: #1f4d49; color: #ccfbf1; } .tn-bar.locked { background: #3b1d0e; border-color: #7c2d12; color: #fed7aa; } }
