/* Copperbrook HQ: the owner's console. A standard work platform: a deep-teal sidebar in the Copperbrook
   colours, a light work area, data tables, and a record panel that slides in from the right. Every colour
   is a token (light and dark). Figtree is served from our own files (no third-party requests). */
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4f6f5; --surface: #ffffff; --surface-2: #f8faf9; --hover: #eef3f1; --line: #e2e8e6; --line-strong: #cfd8d5;
  --ink: #17221f; --ink-2: #3c4b47; --muted: #66756f; --faint: #8a9893;
  --brand: #1f4e4a; --brand-ink: #ffffff; --brand-soft: #e3eeeb; --brand-text: #1d5a54;
  --copper: #b4632e; --copper-soft: #f6e7db; --copper-text: #93501f;
  --side: #102b28; --side-2: #173a36; --side-ink: #e6efed; --side-muted: #93aba6; --side-line: #24443f;
  --good: #23764a; --good-soft: #e1f2e8; --warn: #9a5a00; --warn-soft: #fbefd8; --bad: #b3352b; --bad-soft: #fbe6e3; --info: #2d5f9a; --info-soft: #e5eef9;
  --shadow: 0 1px 2px rgb(16 43 40 / 6%), 0 8px 28px rgb(16 43 40 / 8%); --shadow-panel: -12px 0 40px rgb(16 43 40 / 16%);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 10px; --r-sm: 7px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1513; --surface: #151f1d; --surface-2: #192522; --hover: #1d2b28; --line: #263632; --line-strong: #33463f;
  --ink: #e7eeec; --ink-2: #c3d0cc; --muted: #93a39e; --faint: #6f807b;
  --brand: #3f8f86; --brand-ink: #ffffff; --brand-soft: #1b3431; --brand-text: #7cc7bd;
  --copper: #d98a52; --copper-soft: #3a2719; --copper-text: #eba579;
  --side: #0a1211; --side-2: #13201e; --side-ink: #e1ebe8; --side-muted: #8aa29d; --side-line: #1d2c29;
  --good: #6fd09a; --good-soft: #15301f; --warn: #f0b552; --warn-soft: #33270f; --bad: #ff8f84; --bad-soft: #3a1714; --info: #8db8ee; --info-soft: #172840;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 30%); --shadow-panel: -12px 0 40px rgb(0 0 0 / 45%); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0e1513; --surface: #151f1d; --surface-2: #192522; --hover: #1d2b28; --line: #263632; --line-strong: #33463f;
  --ink: #e7eeec; --ink-2: #c3d0cc; --muted: #93a39e; --faint: #6f807b;
  --brand: #3f8f86; --brand-ink: #ffffff; --brand-soft: #1b3431; --brand-text: #7cc7bd;
  --copper: #d98a52; --copper-soft: #3a2719; --copper-text: #eba579;
  --side: #0a1211; --side-2: #13201e; --side-ink: #e1ebe8; --side-muted: #8aa29d; --side-line: #1d2c29;
  --good: #6fd09a; --good-soft: #15301f; --warn: #f0b552; --warn-soft: #33270f; --bad: #ff8f84; --bad-soft: #3a1714; --info: #8db8ee; --info-soft: #172840;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 30%); --shadow-panel: -12px 0 40px rgb(0 0 0 / 45%); color-scheme: dark }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* --- the frame ------------------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side .brand img { width: 30px; height: 30px; border-radius: 8px; }
.side .brand b { font-weight: 700; font-size: 15px; letter-spacing: .01em; } .side .brand small { display: block; color: var(--side-muted); font-size: 12px; margin-top: 1px; }
.side .search { margin: 4px 14px 10px; position: relative; }
.side .search input { width: 100%; background: var(--side-2); border: 1px solid var(--side-line); color: var(--side-ink); border-radius: var(--r-sm); padding: 8px 10px 8px 32px; font-size: 13.5px; }
.side .search input::placeholder { color: var(--side-muted); }
.side .search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--side-muted); }
.nav { padding: 4px 10px 16px; display: grid; gap: 1px; }
.nav h6 { margin: 14px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--side-ink); font-weight: 500; font-size: 14px; text-decoration: none; position: relative; }
.nav a svg { color: var(--side-muted); }
.nav a:hover { background: var(--side-2); }
.nav a.on { background: var(--side-2); } .nav a.on svg { color: var(--copper); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--copper); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--copper); color: #fff; border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.nav .count.quiet { background: var(--side-line); color: var(--side-ink); }
.side .foot { margin-top: auto; padding: 12px 14px 16px; border-top: 1px solid var(--side-line); display: grid; gap: 10px; font-size: 13px; }
.agents-state { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px rgb(111 208 154 / 18%); }
.dot.off { background: var(--warn); box-shadow: 0 0 0 3px rgb(240 181 82 / 18%); }
.side .foot .row2 { display: flex; justify-content: space-between; color: var(--side-muted); }
.side .foot .row2 b { color: var(--side-ink); font-weight: 600; }
.side .foot button { background: var(--side-2); border: 1px solid var(--side-line); color: var(--side-ink); border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; font-size: 13px; }
.side .foot button:hover { border-color: var(--side-muted); }
.side .foot .btns { display: flex; gap: 6px; } .side .foot .btns > * { flex: 1; } .side .foot form { display: flex; }  .side .foot form button { flex: 1; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .in { display: flex; align-items: center; gap: 14px; padding: 14px 28px; min-height: 64px; }
.topbar h1 { font-size: 19px; font-weight: 600; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
.page { padding: 24px 28px 48px; display: grid; gap: 20px; align-content: start; max-width: 1480px; width: 100%; }

/* --- building blocks --------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 7px 12px; font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg.i { width: 16px; height: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .hd h2 { font-size: 15px; font-weight: 600; } .card > .hd .hint { margin-left: auto; }
.card > .bd { padding: 16px 18px; } .card > .bd.flush { padding: 0; }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 4px; cursor: default; }
.kpi[data-go] { cursor: pointer; } .kpi[data-go]:hover { border-color: var(--line-strong); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12.5px; color: var(--muted); }
.kpi.attention { border-color: var(--copper); background: linear-gradient(var(--copper-soft), var(--copper-soft)) padding-box; }
.kpi.attention .value { color: var(--copper-text); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.plain::before { display: none; }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); } .pill.brand { background: var(--brand-soft); color: var(--brand-text); } .pill.copper { background: var(--copper-soft); color: var(--copper-text); }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr[data-open] { cursor: pointer; } table.t tbody tr[data-open]:hover td { background: var(--hover); }
table.t td.r, table.t th.r { text-align: right; } table.t td.num { font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 600; color: var(--ink); } .cell-sub { color: var(--muted); font-size: 12.5px; }
.clip { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 240px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; } .who > div { min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; background: var(--brand-soft); color: var(--brand-text); }
.avatar.round { border-radius: 50%; }
.avatar.c1 { background: var(--copper-soft); color: var(--copper-text); } .avatar.c2 { background: var(--info-soft); color: var(--info); } .avatar.c3 { background: var(--good-soft); color: var(--good); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.empty svg.i { width: 28px; height: 28px; color: var(--faint); }

/* toolbar: search, filters */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { position: relative; } .field svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.field input, .field input[type=search] { padding-left: 32px; min-width: 260px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], input:not([type]), select, textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 10px; width: 100%; font-size: 13.5px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.chip:hover { background: var(--hover); } .chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip b { font-weight: 600; margin-left: 4px; opacity: .7; }
.form { display: grid; gap: 12px; } .form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.form .row-end { display: flex; gap: 8px; align-items: center; }
.msg { font-size: 13px; color: var(--muted); } .msg.ok { color: var(--good); } .msg.err { color: var(--bad); }

/* the pipeline board and the task board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-width: 0; }
.lane > .hd { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; font-weight: 600; font-size: 13.5px; }
.lane > .hd .n { color: var(--muted); font-weight: 500; } .lane > .hd .v { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 500; }
.lane > .hd i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.lane .items { padding: 0 10px 10px; display: grid; gap: 8px; overflow-y: auto; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; display: grid; gap: 6px; cursor: pointer; box-shadow: 0 1px 1px rgb(16 43 40 / 4%); }
.tile:hover { border-color: var(--line-strong); }
.tile .t1 { font-weight: 600; font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; } .tile .t1 span { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.tile .t2 { color: var(--muted); font-size: 12.5px; }
.tile .t3 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tile.due { border-left: 3px solid var(--copper); }
.tile.blocked { border-left: 3px solid var(--bad); }

/* the record panel (slides in from the right) */
.scrim { position: fixed; inset: 0; background: rgb(10 20 18 / 32%); z-index: 20; animation: fade .15s ease; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: var(--surface); z-index: 21; box-shadow: var(--shadow-panel); display: flex; flex-direction: column; animation: slide .2s ease; }
.panel > .hd { padding: 18px 22px 0; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.panel .title { display: flex; gap: 12px; align-items: flex-start; }
.panel .title h2 { font-size: 19px; font-weight: 600; } .panel .title .sub { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel .title .close { margin-left: auto; }
.panel .quick { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; margin-top: 2px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13.5px; }
.tabs button:hover { color: var(--ink); } .tabs button.on { color: var(--ink); border-bottom-color: var(--copper); }
.tabs button b { font-weight: 600; margin-left: 4px; color: var(--faint); }
.panel > .bd { overflow-y: auto; padding: 20px 22px 32px; display: grid; gap: 22px; align-content: start; flex: 1; }
.section { display: grid; gap: 10px; } .section > h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.section > h3 .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
dl.facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13.5px; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.note-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: grid; gap: 6px; }
.callout { border-radius: var(--r-sm); padding: 10px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.callout svg.i { margin-top: 1px; } .callout.good { background: var(--good-soft); color: var(--good); } .callout.bad { background: var(--bad-soft); color: var(--bad); } .callout.warn { background: var(--warn-soft); color: var(--warn); } .callout.info { background: var(--brand-soft); color: var(--brand-text); }
.steps { display: flex; gap: 4px; flex-wrap: wrap; }
.steps span { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); }
.steps span.done { background: var(--good-soft); color: var(--good); } .steps span.now { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.progress { height: 6px; background: var(--hover); border-radius: 999px; overflow: hidden; min-width: 90px; } .progress i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* email threads and conversations */
.thread { display: grid; gap: 10px; }
.mail { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.mail > .mh { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mail > .mh b { font-weight: 600; } .mail > .mh .when { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mail.in { border-left: 3px solid var(--info); } .mail.out { border-left: 3px solid var(--copper); }
.mail .subj { padding: 10px 14px 0; font-weight: 600; font-size: 13.5px; }
.mail pre { margin: 0; padding: 8px 14px 12px; white-space: pre-wrap; font: inherit; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.feed .ico.out { background: var(--copper-soft); color: var(--copper-text); } .feed .ico.in { background: var(--info-soft); color: var(--info); } .feed .ico.paid { background: var(--good-soft); color: var(--good); } .feed .ico.quote { background: var(--brand-soft); color: var(--brand-text); }
.feed .ico svg.i { width: 16px; height: 16px; }
.feed .l1 { font-size: 13.5px; } .feed .l1 b { font-weight: 600; } .feed .l2 { font-size: 12.5px; color: var(--muted); }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.list-plain li:last-child { border-bottom: 0; } .list-plain li[data-open] { cursor: pointer; } .list-plain li[data-open]:hover { background: var(--hover); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }

/* conversations (team channels) */
.chat { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 150px); }
.chat .chans { border-right: 1px solid var(--line); padding: 10px; display: grid; gap: 2px; align-content: start; overflow-y: auto; }
.chat .chans button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); font-weight: 500; }
.chat .chans button:hover { background: var(--hover); } .chat .chans button.on { background: var(--brand-soft); color: var(--brand-text); }
.chat .chans small { color: var(--faint); font-weight: 400; }
.chat .pane { display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 150px); }
.chat .msgs { list-style: none; margin: 0; padding: 16px 20px; display: grid; gap: 14px; overflow-y: auto; flex: 1; align-content: start; }
.chat .msgs li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.chat .msgs .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; } .chat .msgs .meta b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.chat .msgs .txt { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.chat .msgs li.direct .txt { background: var(--brand-soft); border-radius: var(--r-sm); padding: 8px 12px; color: var(--ink); }
.chat .msgs li.mine .txt { background: var(--copper-soft); border-radius: var(--r-sm); padding: 8px 12px; color: var(--ink); }
.chat form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat form select { width: auto; }

/* the brain */
.brain { display: grid; grid-template-columns: 220px 260px minmax(0, 1fr); min-height: calc(100vh - 150px); }
.brain > div { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 150px); } .brain > div:last-child { border-right: 0; }
.brain .folders, .brain .notes { padding: 10px; display: grid; gap: 2px; align-content: start; }
.brain .folders button, .brain .notes button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); }
.brain .folders button:hover, .brain .notes button:hover { background: var(--hover); } .brain button.on { background: var(--brand-soft); color: var(--brand-text); }
.brain .notes button { flex-direction: column; gap: 1px; } .brain .notes small, .brain .folders small { color: var(--faint); font-size: 12px; }
.brain .note { padding: 20px 26px; display: grid; gap: 12px; align-content: start; }
.md { font-size: 14px; line-height: 1.65; color: var(--ink-2); display: grid; gap: 8px; }
.md h2, .md h3, .md h4 { color: var(--ink); font-weight: 600; margin-top: 8px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; } .md h4 { font-size: 14px; }
.md ul { margin: 0; padding-left: 20px; display: grid; gap: 3px; } .md code { font-family: var(--mono); font-size: 12.5px; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.md a.missing { color: var(--faint); text-decoration: underline dotted; }

/* approvals: drafted emails as an editable message */
.approval { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; }
.approval > .hd { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.approval > .hd h2 { font-size: 15px; font-weight: 600; } .approval > .hd .by { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.approval .compose { display: grid; }
.approval .compose .line { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.approval .compose .line span { color: var(--muted); }
.approval .compose input { border: 0; padding: 4px 0; box-shadow: none !important; font-weight: 600; background: transparent; }
.approval .compose textarea { border: 0; border-radius: 0; padding: 14px 18px; min-height: 200px; box-shadow: none !important; background: transparent; font-size: 14px; }
.approval .details { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.approval .evidence { padding: 12px 18px; border-top: 1px solid var(--line); }
.approval .evidence summary { cursor: pointer; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.approval .evidence .t td { font-size: 13px; }
.approval .ft { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.approval .ft input { max-width: 320px; }
.approval .ft .spacer { flex: 1; }

/* charts */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; height: 170px; padding-top: 10px; }
.bars .b { display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; }
.bars .b i { display: block; width: 100%; max-width: 46px; border-radius: 6px 6px 2px 2px; background: var(--brand); min-height: 3px; }
.bars .b.now i { background: var(--copper); }
.bars .b span { font-size: 12px; color: var(--muted); } .bars .b em { font-style: normal; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.funnel { display: grid; gap: 10px; }
.funnel .f { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
.funnel .f .track { height: 10px; background: var(--hover); border-radius: 999px; overflow: hidden; } .funnel .f .track i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.funnel .f b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* modal (add a business) */
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal .box { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal .box > .hd { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); } .modal .box > .hd h2 { font-size: 16px; font-weight: 600; } .modal .box > .hd .btn { margin-left: auto; }
.modal .box > .bd { padding: 18px 20px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r-sm); font-size: 13.5px; z-index: 40; box-shadow: var(--shadow); animation: fade .2s ease; }

@keyframes slide { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- smaller screens ----------------------------------------------------------------------------------- */
@media (max-width: 1100px) { .g-main, .g3 { grid-template-columns: minmax(0, 1fr); } .brain { grid-template-columns: 180px 220px minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 25; width: 264px; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .side { transform: none; box-shadow: var(--shadow-panel); }
  .menu-btn { display: inline-flex; }
  .topbar .in { padding: 12px 16px; } .page { padding: 16px 16px 40px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .chat, .brain { grid-template-columns: minmax(0, 1fr); } .chat .chans, .brain > div { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .field input { min-width: 0; } .form .two { grid-template-columns: 1fr; } dl.facts { grid-template-columns: 110px minmax(0, 1fr); }
}

/* sign-in and setup pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.auth-box { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: min(400px, 100%); padding: 28px; display: grid; gap: 16px; }
.auth-brand { display: flex; gap: 10px; align-items: center; } .auth-brand img { border-radius: 8px; } .auth-brand b { display: block; font-size: 15px; } .auth-brand small { color: var(--muted); font-size: 12.5px; }
.auth h1 { font-size: 20px; font-weight: 600; }
.auth .btn.primary { justify-content: center; padding: 10px 14px; }
.auth-error { background: var(--bad-soft); color: var(--bad); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13.5px; margin: 0; }
.side .foot .me { display: flex; gap: 10px; align-items: center; } .side .foot .me .avatar { width: 30px; height: 30px; font-size: 12px; } .side .foot .me b { display: block; font-weight: 600; font-size: 13.5px; } .side .foot .me small { color: var(--side-muted); font-size: 12px; }
.locked { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }

/* the Calendar page: a week grid (an agenda list on phones) */
.cal { --hour: 52px; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); min-width: 760px; }
.cal-wrap { overflow-x: auto; }
.cal .dh { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: center; font-size: 12.5px; color: var(--muted); }
.cal .dh b { display: block; font-size: 17px; color: var(--ink); font-weight: 600; } .cal .dh.today b { color: var(--surface); background: var(--copper); border-radius: 999px; width: 30px; height: 30px; line-height: 30px; margin: 2px auto 0; }
.cal .allday { border-bottom: 1px solid var(--line); padding: 4px; display: grid; gap: 3px; min-height: 28px; align-content: start; }
.cal .gutter { position: relative; border-right: 1px solid var(--line); } .cal .gutter span { position: absolute; right: 8px; font-size: 11.5px; color: var(--faint); transform: translateY(-50%); }
.cal .col { position: relative; border-right: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--hour); }
.cal .col.today { background-color: color-mix(in srgb, var(--copper-soft) 35%, transparent); }
.cal .ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; background: var(--brand-soft); color: var(--brand-text); border-left: 3px solid var(--brand); cursor: default; }
.cal .ev b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cal .ev span { opacity: .85; }
.cal .ev.call { background: var(--copper-soft); color: var(--copper-text); border-left-color: var(--copper); cursor: pointer; }
.cal .ev.free { background: transparent; border: 1px dashed var(--line-strong); border-left: 3px dashed var(--faint); color: var(--muted); }
.cal .chip-ev { font-size: 11.5px; border-radius: 5px; padding: 2px 6px; background: var(--brand-soft); color: var(--brand-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--copper); z-index: 1; } .cal .now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--copper); }
.agenda { display: none; }
@media (max-width: 860px) { .cal-wrap { display: none; } .agenda { display: grid; gap: 14px; } }
.agenda h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }

/* Front Desk: the profile editor's rows and hours, the report's figures, and a conversation's transcript */
.chip.static { cursor: default; padding: 2px 9px; font-size: 12px; } .chip.static:hover { background: var(--surface); }
[data-out]:empty { display: none; }
.fd-rows { display: grid; gap: 8px; }
.fd-row { display: grid; grid-template-columns: 1fr 1.6fr 140px auto; gap: 8px; align-items: center; } .fd-row.faq { grid-template-columns: 1fr 1.6fr auto; }
.fd-hours { display: grid; grid-template-columns: 100px 1fr 1fr auto; gap: 8px 10px; align-items: center; font-size: 13.5px; }
.fd-kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; } .fd-kpis .kpi { padding: 10px 12px; } .fd-kpis .value { font-size: 20px; }
details.mail > summary { cursor: pointer; list-style: none; } details.mail > summary::-webkit-details-marker { display: none; }
details.mail:not([open]) > summary { border-bottom: 0; }
.fd-collected { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fd-transcript { display: grid; gap: 8px; padding: 10px 14px 12px; }
.fd-msg { display: grid; gap: 2px; max-width: 85%; padding: 7px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.fd-msg.out { justify-self: end; background: var(--copper-soft); } .fd-msg .cell-sub { white-space: normal; }
@media (max-width: 860px) { .fd-row, .fd-row.faq { grid-template-columns: 1fr auto; } .fd-row input:not(:first-child) { grid-column: 1; } .fd-hours { grid-template-columns: 1fr 1fr 1fr; } .fd-hours > span { grid-column: 1 / -1; } }

/* two-factor sign-in (twofactor.js, qr.js; the code and setup pages in core/auth.js) */
.tfa { display: grid; gap: 12px; max-width: 460px; font-size: 14px; }
.tfa .row-end { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tfa-qr { justify-self: start; background: #fff; padding: 6px; border-radius: var(--r-sm); border: 1px solid var(--line); line-height: 0; }
.tfa-qr svg { width: 216px; height: 216px; max-width: 100%; }
.tfa-manual summary, .auth-more summary, .tfa-off summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.tfa-secret { display: block; margin-top: 6px; font-size: 15px; letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.tfa-codes { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.tfa-codes code { font-size: 14.5px; letter-spacing: .04em; }
.auth-more { display: grid; gap: 10px; } .auth-more[open] summary { margin-bottom: 4px; }
.auth-out { justify-self: start; }
