/* Team portal, v2 restyle (28 Nov 2026), built to "Team Portal v2.dc.html" and DESIGN-SPEC.md.
   Every colour comes from the tokens in /portal/brand.css. Shared components first, then the screens' own parts.
   Layout decisions use the content width (the .main container), not the device name. */
:root {
  --bg: var(--canvas);
  --mute: var(--muted);
  --text2: var(--ink-2);
  --wash: var(--mint);
  --track: var(--line);
  --stone: var(--line-input);
  --side-w: 276px;
}
html, body { background: var(--canvas); }
body { font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; color: var(--ink); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--pine); text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.head { font-family: var(--head); }
button, input, select, textarea { font-family: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ================= AppShell: deep pine sidebar, top bar, scrolling main ================= */
.app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); transition: grid-template-columns .25s ease; }
.app.rail { --side-w: 84px; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--pine-deep); color: var(--white); display: flex; flex-direction: column; padding: 22px 14px 18px; gap: 24px; z-index: 45; min-width: 0; }
.side .mark-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.side .mark-bg img { position: absolute; left: -50px; bottom: 24px; width: 260px; opacity: .05; }
.side .s-top { height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 6px; position: relative; }
.side .brand { display: flex; align-items: center; min-width: 0; }
.side .brand:hover { text-decoration: none; }
.side .brand .full { max-height: 44px; max-width: 160px; width: auto; }
.side .brand .mk { display: none; max-width: 44px; max-height: 30px; width: auto; height: auto; object-fit: contain; }
.app.rail .side .brand .full { display: none; }
.app.rail .side .brand .mk { display: block; }
.app.rail .side .s-top { justify-content: center; padding: 0; }
.side .s-x { display: none; margin-left: auto; width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--white); align-items: center; justify-content: center; cursor: pointer; }
.side-toggle { position: absolute; top: 36px; right: -18px; width: 36px; height: 36px; border-radius: 8px; background: #EEF2F0; border: 1px solid var(--line-box); box-shadow: 0 3px 8px rgba(20, 37, 31, .16); display: flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; z-index: 46; padding: 0; }
.side-toggle svg { width: 18px; height: 18px; stroke-width: 2; }
.side-toggle:focus-visible, .side .nv:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.side nav { display: flex; flex-direction: column; gap: 4px; position: relative; overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.side .nv { height: 46px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--white); font-size: 17px; cursor: pointer; text-align: left; min-width: 0; width: 100%; text-decoration: none; }
.side .nv:hover { background: rgba(255, 255, 255, .07); color: var(--white); text-decoration: none; }
.side .nv.on { background: var(--pine-active); }
.side .nv.child { padding-left: 40px; }
.side .nv .lb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .nv .chev { width: 16px; height: 16px; stroke-width: 1.8; transition: transform .2s; }
.side .grp[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.side .grp[aria-expanded="false"] + .sub { display: none; }
.side .sub { display: flex; flex-direction: column; gap: 4px; }
.side .nv .badge { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--sea); color: var(--pine-deep); font: 700 15px/22px var(--head); text-align: center; }
.side .nv .badge:empty { display: none; }
.app.rail .side .nv { justify-content: center; padding: 0; position: relative; }
.app.rail .side .nv .lb, .app.rail .side .nv .chev, .app.rail .side .grp { display: none; }
.app.rail .side .grp + .sub { display: flex; }
.app.rail .side .nv .badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 14px; line-height: 18px; }
.side .s-client { position: relative; height: 50px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--white); font-size: 17px; min-width: 0; }
.side .s-client:hover { background: rgba(255, 255, 255, .13); color: var(--white); text-decoration: none; }
.side .s-client .ic { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--sea); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.side .s-client .ic svg { width: 15px; height: 15px; stroke-width: 2; }
.side .s-client .lb { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .s-client > svg:last-child { width: 16px; height: 16px; stroke-width: 2; }
.app.rail .side .s-client { justify-content: center; padding: 0; }
.app.rail .side .s-client .lb, .app.rail .side .s-client > svg:last-child { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; container-type: inline-size; container-name: main; }
.topbar { height: 76px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 2.4vw, 32px) 0 clamp(28px, 3vw, 40px); background: var(--canvas); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; min-width: 0; }
.topbar .tb-mark { display: none; max-width: 64px; max-height: 26px; width: auto; height: auto; object-fit: contain; flex: none; }
.topnav { display: flex; align-items: center; gap: 8px; flex: none; }
.tbtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; min-width: 44px; justify-content: center; padding: 0 14px; border-radius: 10px; border: 0; background: var(--white); color: var(--ink); font-size: 17px; font-weight: 400; white-space: nowrap; box-shadow: var(--shadow); cursor: pointer; }
.tbtn:hover { background: var(--mint); color: var(--pine-deep); text-decoration: none; }
.tbtn:focus-visible, .wsp:focus-visible, .tb-search:focus-within, .bell:focus-visible, .prof:focus-visible, .due:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.tbtn.ghost { background: transparent; box-shadow: none; }
.tbtn.ghost:hover { background: var(--white); }
.tbtn.primary { background: var(--pine); color: var(--white); padding: 0 18px; }
.tbtn.primary:hover { background: var(--pine-hover); color: var(--white); }
.wsp { height: 44px; min-width: 0; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--white); font-size: 17px; cursor: pointer; box-shadow: var(--shadow); }
.wsp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsp svg { width: 16px; height: 16px; stroke-width: 1.8; }
.tb-search { flex: 1 1 200px; max-width: 360px; min-width: 180px; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
.tb-search svg { width: 18px; height: 18px; stroke-width: 2; color: var(--muted); }
.tb-search input { flex: 1; min-width: 0; border: 0 !important; outline: none; background: transparent !important; font-size: 17px; height: 40px; padding: 0 !important; min-height: 0 !important; }
.tb-search-btn { display: none; }
.tb-end { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.due { height: 44px; flex: none; white-space: nowrap; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--hl-bg); color: var(--hl); font-size: 17px; font-weight: 700; }
.due:hover { color: var(--hl); text-decoration: none; filter: brightness(.98); }
.due .n { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--hl-dot); display: flex; align-items: center; justify-content: center; font-size: 15px; font-family: var(--head); }
.tm-chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 6px; background: var(--chip-neutral-bg); color: var(--chip-neutral); font-size: 16px; font-weight: 600; white-space: nowrap; }
.tm-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sea); }
.bell { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 0; background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--ink); box-shadow: var(--shadow); }
.bell:hover { background: var(--mint); color: var(--ink); }
.bell svg { width: 19px; height: 19px; }
.bell .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-dot); }
.prof { flex: none; display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; white-space: nowrap; cursor: pointer; min-height: 44px; text-align: left; }
.prof .av { width: 38px; height: 38px; font-size: 16px; }
.prof .pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prof .pt b { font-size: 17px; font-weight: 600; }
.prof .pt span { font-size: 16px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.prof svg { width: 16px; height: 16px; stroke-width: 1.8; }
.pmenu { position: absolute; right: clamp(16px, 2.4vw, 32px); top: 70px; z-index: 55; width: min(300px, calc(100vw - 24px)); background: var(--white); border: 1px solid var(--line-card); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.pmenu .pm-h { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-row); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.pmenu .pm-h b { font-size: 17px; }
.pmenu .pm-h span { font-size: 16px; color: var(--muted); overflow-wrap: anywhere; }
.pmenu a, .pmenu button.pm-i { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 17px; cursor: pointer; text-align: left; width: 100%; }
.pmenu a:hover, .pmenu button.pm-i:hover { background: var(--mint); text-decoration: none; color: var(--ink); }
.pmenu label { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; font-size: 16px; font-weight: 600; color: var(--muted); }
.pmenu .tm-chip { margin: 6px 12px; align-self: flex-start; }
.menu-btn, .scrim { display: none; }
.page { width: 100%; max-width: 1600px; padding: clamp(20px, 2.6vw, 36px) clamp(18px, 2.6vw, 36px) 40px; display: flex; flex-direction: column; gap: clamp(18px, 2.2vw, 28px); }

/* Top bar labels hide as the content narrows (as in the master file) */
@container main (max-width: 1099px) { .prof .pt, .prof > svg { display: none; } .prof { padding: 2px; border-radius: 8px; } .tb-end .tm-chip { display: none; } }
@container main (max-width: 1199px) { .tb-search { display: none; } .tb-search-btn { display: inline-flex; } }
@container main (max-width: 979px) { .tbtn.primary { padding: 0; width: 44px; } .tbtn.primary span { display: none; } }
@container main (max-width: 859px) { .topnav .tbtn span { display: none; } .topnav .tbtn { padding: 0; width: 44px; } }
@container main (max-width: 759px) { .wsp { display: none; } }
/* Inner pages carry Back plus Home: drop Home, then the office pill, before anything spills (28 Nov) */
@container main (max-width: 1399px) { .topnav .tbtn.ghost { display: none; } }
@container main (max-width: 1279px) { .wsp { display: none; } }
@container main (max-width: 619px) { .due .lb { display: none; } }

/* ================= PageHeader ================= */
.ph { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.ph .t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ph .crumb { font-size: 16px; color: var(--muted); }
.ph .crumb a { color: var(--muted); }
.ph .crumb a:hover { color: var(--pine); }
.ph h1 { font-family: var(--head); font-size: var(--fs-title); font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.15; overflow-wrap: anywhere; }
.ph .sub { font-size: clamp(15px, 1.3vw, 17px); color: var(--muted); line-height: 1.45; }
.ph .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ph .acts select { width: auto; }
/* Split button: primary action plus a chevron for more */
.split-btn { display: inline-flex; height: 46px; flex: none; border-radius: var(--r-btn); overflow: hidden; background: var(--pine); }
.split-btn > :first-child { display: flex; align-items: center; gap: 8px; padding: 0 18px; border: 0; background: transparent; color: var(--white); font-size: 17px; cursor: pointer; white-space: nowrap; }
.split-btn > :first-child:hover { background: var(--pine-hover); color: var(--white); text-decoration: none; }
.split-btn > .sep { width: 1px; background: rgba(255, 255, 255, .3); }
.split-btn > .more { width: 44px; border: 0; background: transparent; color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ================= Card ================= */
.box { background: var(--white); border: 1px solid var(--line-card); border-radius: var(--r-card); padding: var(--pad-card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.box > h2, .box .bh { font-family: var(--head); font-size: var(--fs-card); font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.box .bh h2 { font: inherit; margin: 0; }
.box.dark { background: var(--pine-deep); color: var(--white); border-color: var(--pine-deep); }
.box.dark h2 { color: var(--white); }
.box.tint { background: var(--soft-2); }
.eyebrow { font-size: 15px; font-weight: 700; color: var(--muted); }
.box.dark .eyebrow { color: var(--sea); }
.cols { display: grid; gap: var(--gap); align-items: start; }
.cols.c2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cols.c64 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.cols.c46 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.cols.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols.auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.rows > * { border-top: 1px solid var(--line-row); }
.kvr { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-row); font-size: 17px; }
.kvr > :first-child { color: var(--muted); }
.kvr > :last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }

/* Overview rows: tinted row, coloured icon tile, label, big number */
.ov { display: flex; align-items: center; gap: 16px; padding: 10px 14px 10px 10px; border-radius: var(--r-tile); background: var(--ov-green-bg); border: 0; text-align: left; min-width: 0; color: var(--ink); width: 100%; cursor: pointer; font: inherit; }
.ov:hover { text-decoration: none; color: var(--ink); filter: brightness(.985); }
.ov .ti { width: 48px; height: 48px; flex: none; border-radius: 11px; background: var(--ov-green-tile); color: var(--ov-green); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 rgba(20, 37, 31, .06); }
.ov .ti svg { width: 22px; height: 22px; }
.ov .lb { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov .n { flex: none; font-family: var(--head); font-size: 26px; font-weight: 500; color: var(--ov-green); }
.ov.yellow { background: var(--ov-yellow-bg); } .ov.yellow .ti { background: var(--ov-yellow-tile); color: var(--ov-yellow); } .ov.yellow .n { color: var(--ov-yellow); }
.ov.red { background: var(--ov-red-bg); } .ov.red .ti { background: var(--ov-red-tile); color: var(--ov-red); } .ov.red .n { color: var(--ov-red); }
.ov.blue { background: var(--ov-blue-bg); } .ov.blue .ti { background: var(--ov-blue-tile); color: var(--ov-blue); } .ov.blue .n { color: var(--ov-blue); }

/* ================= Buttons ================= */
.btn { min-height: 44px; height: auto; padding: 0 18px; border-radius: var(--r-btn); border: 1.5px solid var(--pine); background: var(--pine); color: var(--white); font-size: 17px; font-weight: 500; line-height: 1.2; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { color: var(--white); background: var(--pine-hover); border-color: var(--pine-hover); text-decoration: none; }
.btn.secondary, .btn.line { background: var(--white); color: var(--ink); border-color: var(--line-input); }
.btn.secondary:hover, .btn.line:hover { background: var(--canvas); color: var(--ink); border-color: var(--line-box); }
.btn.sea { background: var(--sea); border-color: var(--sea); color: var(--pine-deep); }
.btn.sea:hover { background: #63b571; border-color: #63b571; color: var(--pine-deep); }
.btn.soft { background: var(--mint); color: var(--pine-deep); border-color: var(--mint); }
.btn.soft:hover { background: var(--mint-hover); border-color: var(--mint-hover); color: var(--pine-deep); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--mint); color: var(--pine-deep); border-color: var(--mint); }
.btn.danger { background: var(--chip-overdue-bg); border-color: var(--chip-overdue-bg); color: var(--chip-overdue); font-weight: 700; }
.btn.danger:hover { background: #F8CFC5; border-color: #F8CFC5; color: var(--chip-overdue); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 16px; }
.btn.big { min-height: 48px; font-size: 18px; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[disabled] { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, .chip:focus-visible, button:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
/* IconButton: 36 px pale mint (44 px on touch). Delete turns pale red on hover. */
.ibtn { width: 36px; height: 36px; flex: none; border: 0; border-radius: 6px; background: var(--mint); color: var(--pine-icon); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ibtn:hover { background: var(--mint-hover); color: var(--pine-icon); text-decoration: none; }
.ibtn.del:hover { background: var(--danger-hover-bg); color: var(--danger-hover); }
.ibtn svg { width: 17px; height: 17px; }
@media (pointer: coarse) { .ibtn { width: 44px; height: 44px; border-radius: 8px; } }

/* ================= Form fields ================= */
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], input[type=password], input[type=file], select, textarea {
  font-size: 17px; color: var(--ink); background: var(--white); border: 1.5px solid var(--line-input); border-radius: var(--r-input); padding: 10px 14px; width: 100%; outline: none; min-height: 46px; max-width: 100%;
}
select { height: 46px; padding: 0 14px; }
textarea { line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--pine-icon); }
input[readonly], textarea[readonly] { background: var(--canvas); }
input.err, select.err, textarea.err, .err-field input, .err-field textarea { border-color: var(--chip-overdue); }
.err-msg { font-size: 16px; color: var(--chip-overdue); }
label.lbl { display: block; font-size: 16px; font-weight: 600; margin: 0 0 8px; }
label.lbl > input, label.lbl > select, label.lbl > textarea { margin-top: 8px; font-weight: 400; }
.field-row { display: flex; flex-direction: column; gap: 8px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input[type=search], .filters input[type=text] { width: auto; flex: 1 1 200px; min-width: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--pine); width: 20px; height: 20px; }

/* ================= StatusChip, pills, avatars ================= */
.st { display: inline-flex; align-items: center; height: 28px; max-width: 100%; padding: 0 12px; border-radius: 6px; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--chip-neutral-bg); color: var(--chip-neutral); }
.st.sm { height: 24px; padding: 0 10px; font-size: 15px; }
.st.pending { background: var(--chip-pending-bg); color: var(--chip-pending); }
.st.active { background: var(--chip-active-bg); color: var(--chip-active); }
.st.overdue { background: var(--chip-overdue-bg); color: var(--chip-overdue); }
.st.info { background: var(--chip-info-bg); color: var(--chip-info); }
.st.review { background: var(--chip-review-bg); color: var(--chip-review); }
.st.neutral { background: var(--chip-neutral-bg); color: var(--chip-neutral); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
/* Filter chips and the pill tab bar share one look: mint when chosen */
.chip { min-height: 40px; padding: 0 14px; border-radius: 6px; border: 0; background: var(--mint-2); color: var(--ink-2); font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--mint-hover); }
.chip.on { background: var(--pine); color: var(--white); }
.chip .n { font-weight: 400; margin-left: 4px; }
.chip:disabled { opacity: .45; cursor: default; }
.chip.sm { min-height: 32px; padding: 0 11px; font-size: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 15px; font-weight: 600; background: var(--chip-neutral-bg); color: var(--chip-neutral); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill.sea, .pill.solid { background: var(--chip-active-bg); color: var(--chip-active); }
.pill.dark { background: var(--pine); color: var(--white); }
.pill.line, .pill.ring { background: var(--white); border: 1.5px solid var(--line-input); color: var(--ink-2); }
.pill.warn { background: var(--chip-pending-bg); color: var(--chip-pending); }
.pill.bad { background: var(--chip-overdue-bg); color: var(--chip-overdue); }
.pill.info { background: var(--chip-info-bg); color: var(--chip-info); }
.pill.review { background: var(--chip-review-bg); color: var(--chip-review); }
.av { width: 40px; height: 40px; border-radius: 8px; background: var(--av1-bg); color: var(--av1); font-size: 16px; font-weight: 700; display: grid; place-items: center; flex: none; font-family: var(--font); }
.av.sm { width: 30px; height: 30px; font-size: 15px; }
.av.c2 { background: var(--av2-bg); color: var(--av2); } .av.c3 { background: var(--av3-bg); color: var(--av3); }
.av.c4 { background: var(--av4-bg); color: var(--av4); } .av.c5 { background: var(--av5-bg); color: var(--av5); }
.av.dark { background: var(--pine); color: var(--white); }
.av.sea { background: var(--sea); color: var(--pine-deep); }
.empty { color: var(--muted); font-size: 16px; padding: 12px 4px; }
.lock { background: var(--soft); border-radius: 12px; padding: 14px 16px; color: var(--ink-2); font-size: 17px; }
.note { font-size: 16px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--pine); }
.soon-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--chip-info-bg); color: var(--chip-info); font-size: 15px; font-weight: 600; }

/* ================= DataTable ================= */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 17px; }
.tbl th { text-align: left; font-weight: 700; color: var(--ink-2); font-size: 15px; height: 50px; padding: 0 12px; background: var(--thead); white-space: nowrap; }
.tbl th:first-child { border-radius: 8px 0 0 8px; } .tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { height: 64px; padding: 10px 12px; border-bottom: 1px solid var(--line-row); vertical-align: middle; }
.tbl td .nm { font-weight: 600; }
.tbl td .sm:not(.av) { font-size: 16px; color: var(--muted); }
.tbl tr.hl td { background: var(--soft-2); }
.tbl a:not(.btn):not(.ibtn) { text-decoration: none; color: var(--ink); }
.tbl a:hover .nm { text-decoration: underline; }
.tbl td.acts, .tbl td:has(> .ibtn) { white-space: nowrap; }
.tbl td.acts > * + * { margin-left: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; color: var(--ink-2); }
.pager .pg { display: flex; gap: 6px; }
/* Below 900 px of content width, tables turn into stacked rows: name and chip, then the other cells, then actions. */
@container main (max-width: 899px) {
  table.tbl:not(.keep), table.tbl:not(.keep) tbody { display: block; }
  table.tbl:not(.keep) thead { display: none; }
  table.tbl:not(.keep) tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 2px; border-top: 1px solid var(--line-row); }
  table.tbl:not(.keep) td { display: block; height: auto; padding: 0; border: 0; min-width: 0; font-size: 16px; color: var(--ink-2); }
  table.tbl:not(.keep) td:first-child { flex: 1 1 100%; font-size: 18px; color: var(--ink); }
  table.tbl:not(.keep) td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  table.tbl:not(.keep) td.acts, table.tbl:not(.keep) td:last-child:has(.btn, .ibtn) { flex: 1 1 100%; display: flex; gap: 8px; flex-wrap: wrap; }
  table.tbl:not(.keep) td.acts > * + * { margin-left: 0; }
  table.tbl:not(.keep) tr:empty { display: none; }
}

/* ================= Dashboard: stat tiles, legend, KanbanBoard ================= */
.tile { background: var(--white); border: 1px solid var(--line-card); border-radius: var(--r-card); padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile.dark { background: var(--ov-red-bg); border-color: var(--ov-red-tile); color: var(--ov-red); }
.tile .l { font-size: 16px; font-weight: 600; }
.tile .v { font-family: var(--head); font-size: 32px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.tile .n { font-size: 16px; color: var(--muted); }
.legend { display: flex; gap: 10px 18px; align-items: center; font-size: 16px; color: var(--muted); flex-wrap: wrap; }
.legend b { color: var(--ink); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend i.k1 { background: var(--chip-overdue-bg); border: 1.5px solid var(--chip-overdue); } .legend i.k2 { background: var(--chip-pending-bg); border: 1.5px solid var(--chip-pending); } .legend i.k3 { background: var(--chip-active-bg); border: 1.5px solid var(--chip-active); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 300px; gap: 16px; overflow-x: auto; padding-bottom: 10px; align-items: start; scroll-snap-type: x mandatory; scrollbar-width: thin; overscroll-behavior-x: contain; }
.col { --cb: var(--col1-bg); --ct: var(--col1); background: var(--cb); border-radius: var(--r-col); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; scroll-snap-align: start; }
.col:nth-child(8n+2) { --cb: var(--col2-bg); --ct: var(--col2); } .col:nth-child(8n+3) { --cb: var(--col3-bg); --ct: var(--col3); }
.col:nth-child(8n+4) { --cb: var(--col4-bg); --ct: var(--col4); } .col:nth-child(8n+5) { --cb: var(--col5-bg); --ct: var(--col5); }
.col:nth-child(8n+6) { --cb: var(--col6-bg); --ct: var(--col6); } .col:nth-child(8n+7) { --cb: var(--col7-bg); --ct: var(--col7); }
.col:nth-child(8n+8) { --cb: var(--col8-bg); --ct: var(--col8); }
.col .ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 4px 2px; font-family: var(--head); font-size: 18px; font-weight: 600; color: var(--ct); min-width: 0; }
.col .ch > :first-child, .col .ch .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col .ch .n { flex: none; font-size: 16px; min-width: 26px; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, .7); display: grid; place-items: center; padding: 0 7px; color: var(--ct); }
.col .empty { color: var(--ct); opacity: .8; }
.kc { text-decoration: none; border-radius: var(--r-kc); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--white); color: var(--ink); border: 1px solid transparent; box-shadow: 0 1px 2px rgba(20, 37, 31, .06); transition: transform .15s, box-shadow .15s; min-width: 0; }
.kc:hover { color: var(--ink); text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20, 37, 31, .1); }
.kc .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kc .nm { font-size: 17px; font-weight: 600; line-height: 1.3; display: block; overflow-wrap: anywhere; }
.kc .pl { font-size: 16px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc .ck { font-size: 16px; font-weight: 600; }
.kc .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.kc.soon { border-color: var(--hl-dot); }
.kc.over { border-color: var(--chip-overdue); }
.kc .bar > i.sea { background: var(--sea); }
.kc.over .bar > i { background: var(--chip-overdue); }

/* Deadline clocks are StatusChips: on time green, due soon yellow, overdue red, paused or done neutral */
.clk { display: inline-flex; align-items: center; height: 28px; font-size: 16px; font-weight: 600; padding: 0 12px; border-radius: 6px; background: var(--chip-active-bg); color: var(--chip-active); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.clk.soon { background: var(--chip-pending-bg); color: var(--chip-pending); }
.clk.over { background: var(--chip-overdue-bg); color: var(--chip-overdue); }
.clk.calm { background: var(--chip-neutral-bg); color: var(--chip-neutral); }
.clk.big { font-size: 17px; height: 40px; padding: 0 16px; }

/* ================= RM home ================= */
.call-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; background: var(--soft-2); margin-top: 8px; }
.call-row .tm { font-family: var(--head); font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--chip-info); }
.call-row .tm span { display: block; font-family: var(--font); font-size: 16px; font-weight: 400; color: var(--muted); }
.call-row .nm { font-size: 17px; font-weight: 600; }
.call-row .dt { font-size: 16px; color: var(--muted); }
.ask { padding: 16px 0; border-top: 1px solid var(--line-row); display: flex; flex-direction: column; gap: 10px; }
.ask .who { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; flex-wrap: wrap; }
.ask .who b { font-weight: 600; }
.ask .q { font-size: 17px; line-height: 1.5; }
.ask textarea { min-height: 80px; font-size: 17px; resize: vertical; }
.ask .done { font-size: 17px; background: var(--chip-active-bg); color: var(--chip-active); border-radius: 10px; padding: 10px 14px; }

/* ---------- Client record ---------- */
.rec-head { background: var(--white); border-bottom: 1px solid var(--line); padding: 22px 32px 0; display: flex; flex-direction: column; gap: 16px; }
.rec-head .ph { align-items: flex-start; }
.stat { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.stat .k { font-size: 14px; color: var(--mute); }
.stat .v { font-size: 17px; font-weight: 700; }
.stat .bar { height: 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { height: 46px; padding: 0 18px; border: 0; background: transparent; font-size: 17px; color: var(--teal); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { font-weight: 700; border-bottom-color: var(--teal); }
.stages { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.stages div { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.stages i { height: 6px; border-radius: 3px; background: var(--track); }
.stages .done i { background: var(--teal); }
.stages .now { font-weight: 700; }
.stages .now i { background: var(--sea); }
.person { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.person .nm { font-size: 17px; font-weight: 700; display: block; }
.person .rl { font-size: 16px; color: var(--mute); display: block; }
.person .ct { font-size: 16px; text-align: right; }
.next .t { font-family: var(--head); font-size: 23px; font-weight: 800; margin: 4px 0; }
.next p { margin: 0 0 6px; font-size: 16px; line-height: 1.5; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 9px 14px; font-size: 16px; font-weight: 600; color: var(--teal); cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button.on { background: var(--teal); color: var(--white); }
.form-mini { display: flex; flex-direction: column; gap: 12px; }

/* Call form: tick list, theme cards, still-missing panel */
.savebar { position: sticky; top: 64px; z-index: 12; background: var(--teal); color: var(--white); padding: 12px 32px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.savebar .live { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.savebar .live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sea); }
.savebar .ver { font-family: var(--head); font-size: 20px; font-weight: 800; }
.savebar .hint { font-size: 16px; }
.save-state { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--sea); }
.save-state.err { color: var(--white); background: rgba(255, 255, 255, .15); padding: 3px 10px; border-radius: 6px; }
.form-layout { padding: 24px 32px 60px; display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.ticks { position: sticky; top: 136px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 150px); overflow: auto; }
.ticks .eyebrow { padding: 0 10px 8px; }
.ticks a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 10px; border-radius: 8px; color: var(--teal); text-decoration: none; font-size: 16px; line-height: 1.3; }
.ticks a:hover { background: var(--white); color: var(--teal); }
.ticks .tk { flex: none; width: 18px; height: 18px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--white); font-size: 14px; color: var(--white); display: grid; place-items: center; transition: background .25s, border-color .25s; }
.ticks a.done .tk { background: var(--sea); border-color: var(--sea); }
.ticks a.part .tk { border-color: var(--sea); background: linear-gradient(90deg, var(--sea-light) 50%, var(--white) 50%); }
.ticks .ct { margin-left: auto; font-size: 15px; color: var(--mute); font-family: var(--head); }
.ticks .prot { font-size: 14px; background: var(--wash); border-radius: 4px; padding: 1px 5px; }
.theme { background: var(--white); border-radius: var(--r-card); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; scroll-margin-top: 140px; }
.theme + .theme { margin-top: 14px; }
.theme:focus-within { border-color: var(--sea); }
.theme .th { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.theme .th .num { font-family: var(--head); font-size: 17px; font-weight: 800; color: var(--sea); }
.theme .th h2 { font-family: var(--head); font-size: 22px; font-weight: 700; margin: 0; }
.theme .th .sec { margin-left: auto; font-size: 15px; color: var(--mute); }
.field { margin-top: 14px; }
.field .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.field .top label { font-weight: 600; font-size: 17px; }
.field textarea { font-size: 19px; line-height: 1.55; min-height: 64px; resize: vertical; padding: 12px 16px; border-radius: 12px; }
.field .quick { display: flex; gap: 6px; flex: none; }
.field .quick button { border: 1.5px solid var(--line); background: var(--white); color: var(--mute); border-radius: 6px; padding: 3px 11px; font-size: 15px; font-weight: 600; cursor: pointer; }
.field .quick button.on { background: var(--teal); border-color: var(--teal); color: var(--white); }
.field.special textarea { background: var(--bg); color: var(--mute); }
.crore { display: flex; align-items: center; gap: 8px; }
.crore input { font-size: 22px; max-width: 160px; }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 10px; }
.missing { position: sticky; top: 136px; gap: 4px; max-height: calc(100vh - 150px); overflow: auto; }
.missing h2 { margin-bottom: 0; }
.problems { list-style: none; margin: 8px 0 0; padding: 0; }
.problems li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.4; }
.problems li::before { content: ""; flex: none; margin-top: 1px; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line); }
.hw-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 130px 150px 36px; gap: 8px; align-items: center; margin-top: 8px; }
.hw-row input[type=checkbox] { width: 18px; height: 18px; }

/* Journey timeline grouped by day */
.jday { display: flex; flex-direction: column; }
.jday > .eyebrow { padding: 6px 0 10px; font-size: 16px; }
.jev { display: grid; grid-template-columns: 56px 34px minmax(0, 1fr); gap: 12px; }
.jev .tm { font-size: 16px; color: var(--mute); padding-top: 16px; text-align: right; font-family: var(--head); }
.jev .rail { display: flex; flex-direction: column; align-items: center; }
.jev .rail::before, .jev .rail::after { content: ""; width: 2px; background: var(--line); }
.jev .rail::before { height: 14px; } .jev .rail::after { flex: 1; }
.jev .ic { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; font-weight: 700; display: grid; place-items: center; background: var(--wash); border: 1.5px solid var(--wash); font-family: var(--head); }
.jev .ic.k-payment { background: var(--teal); color: var(--white); border-color: var(--teal); }
.jev .ic.k-message { background: var(--white); border-color: var(--teal); }
.jev .ic.k-call { background: var(--sea); border-color: var(--sea); }
.jev .ic.k-file, .jev .ic.k-conversation { background: var(--white); border-color: var(--sea); }
.jev .card { margin: 8px 0; background: var(--white); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); min-width: 0; }
.jev .card .t { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 17px; font-weight: 700; }
.jev .card .t small { font-size: 15px; color: var(--mute); font-weight: 400; }
.jev .card .d { font-size: 16px; line-height: 1.5; color: var(--text2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Files */
.files-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 140px 120px 110px; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.files-grid.hd { font-size: 15px; color: var(--mute); padding: 12px 0; }
.files-grid .fn { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 700; }
.files-grid .fn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext { flex: none; width: 38px; height: 38px; border-radius: 8px; background: var(--wash); font-size: 14px; font-weight: 700; display: grid; place-items: center; }

/* Score rows (brief) */
.score-big { font-family: var(--head); font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score-big small { font-family: var(--font); font-size: 17px; font-weight: 400; color: var(--mute); letter-spacing: 0; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) 40px 96px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.srow b { font-family: var(--head); text-align: right; }
.band { justify-self: start; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 6px; white-space: nowrap; }
.band.strong { background: var(--teal); color: var(--white); }
.band.developing { background: var(--sea); color: var(--teal); }
.band.to_build { background: var(--white); border: 1.5px solid var(--teal); padding: 1px 9px; }
.plan-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.plan-row .n { font-family: var(--head); font-size: 20px; font-weight: 800; color: var(--sea); }
.plan-row .nm { font-weight: 700; }
.plan-row .d { font-size: 16px; color: var(--text2); }
.mind { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.mind div { background: var(--mint); border-radius: 6px; padding: 10px 12px; font-size: 16px; font-weight: 600; line-height: 1.5; }
.mind div small { display: block; font-weight: 400; color: var(--sea-light); font-size: 15px; }

/* Research */
.run-banner { background: var(--teal); color: var(--white); border-radius: var(--r-card); padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.run-banner .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.run-banner .t { font-family: var(--head); font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.run-banner .nums { display: flex; gap: 32px; }
.run-banner .nums div { display: flex; flex-direction: column; }
.run-banner .nums b { font-family: var(--head); font-size: 30px; font-weight: 800; line-height: 1.1; }
.run-banner .nums span { font-size: 15px; }
.run-banner .bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); }
.run-banner .bar > i { background: var(--sea); }
.steps { list-style: none; margin: 6px 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.steps li::after { content: ""; position: absolute; left: 10px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::after { background: var(--sea); }
.steps .dot { width: 22px; height: 22px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--white); font-size: 14px; font-weight: 700; display: grid; place-items: center; z-index: 1; font-family: var(--head); }
.steps li.done .dot { background: var(--sea); border-color: var(--sea); color: var(--teal); }
.steps li.now .dot { background: var(--teal); border-color: var(--teal); color: var(--white); }
.steps li.failed .dot { background: var(--white); border: 2px solid var(--teal); }
.steps .lb { font-size: 16px; }
.steps li.now .lb { font-weight: 700; }
.steps .sm { font-size: 15px; color: var(--mute); }
.fact { padding: 12px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; }
.fact .tp { font-size: 14px; color: var(--mute); font-weight: 700; }
.fact .tx { font-size: 16px; line-height: 1.5; grid-column: 1; }
.fact .src { font-size: 15px; color: var(--mute); grid-column: 1; overflow-wrap: anywhere; }
.fact .tag { grid-column: 2; grid-row: 1; justify-self: end; }

/* Dialogs (approve, refund, invite, ask a question) */
dialog.dlg { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; box-shadow: 0 24px 64px rgba(51, 82, 70, .25); color: var(--teal); }
dialog.dlg.wide { width: min(880px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(51, 82, 70, .28); }
.dlg .dh { padding: 22px 26px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); }
.dlg .dh h2 { font-family: var(--head); font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.dlg .dh .sub { font-size: 16px; color: var(--mute); }
.dlg .db { padding: 20px 26px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow: auto; }
.dlg .df { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dlg .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dlg .split > div { padding: 20px 26px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dlg .split > div + div { background: var(--bg); }
.checkrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; cursor: pointer; }
.checkrow input { width: 20px; height: 20px; margin: 0; flex: none; }
.bubble { background: var(--white); border-radius: 14px; padding: 14px 16px; font-size: 16px; line-height: 1.6; white-space: pre-wrap; box-shadow: 0 2px 10px rgba(51, 82, 70, .06); overflow-wrap: anywhere; }
.bubble b { display: block; font-size: 16px; margin-bottom: 4px; }
.bubble .foot { display: block; text-align: right; font-size: 14px; color: var(--mute); margin-top: 6px; }
.amount { background: var(--bg); border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.amount b { font-family: var(--head); font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; display: block; }

/* Toggle switch (settings) */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--track); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 8px; background: var(--white); transition: transform .2s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(18px); }
/* Score cut-offs: ten square blocks numbered 1 to 10, coloured by band, the band named under its blocks */
.cut10 { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.cut10 .b { min-height: 36px; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 16px; border-radius: 3px; }
.cut10 .l { font-size: 15px; font-weight: 600; padding-top: 4px; }
.cut10 .to_build { background: var(--coral-wash); color: var(--coral-ink); }
.cut10 .developing { background: var(--amber-wash); color: var(--amber-ink); }
.cut10 .strong { background: var(--green-wash); color: var(--green-ink); }
.cut10 .l.to_build, .cut10 .l.developing, .cut10 .l.strong { background: transparent; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--teal); color: var(--white); padding: 10px 18px; border-radius: 12px; font-size: 16px; box-shadow: var(--shadow); z-index: 60; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }


/* ================= v2 for the screens' own parts (overrides the older rules above) ================= */
/* Client record: PageHeader plus a pill tab bar (Settings tab style) */
.rec-head { background: var(--canvas); border-bottom: 0; padding: clamp(20px, 2.6vw, 36px) clamp(18px, 2.6vw, 36px) 0; gap: 18px; }
.rec-head > * { max-width: 1600px; margin-inline: 0; }
.stat { border: 1px solid var(--line-card); background: var(--white); border-radius: 12px; padding: 10px 14px; min-width: 130px; }
.stat .k { font-size: 15px; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 17px; font-weight: 600; }
.tabs { display: flex; gap: 4px; background: var(--white); border: 1px solid var(--line-card); border-radius: 16px; padding: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 17px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { background: var(--soft); }
.tabs button.on { background: var(--mint); color: var(--pine-deep); font-weight: 600; border: 0; }
.rec-head .tabs { margin-bottom: 4px; }
.stages i { height: 6px; }
.stages .done i { background: var(--pine-active); }
.person { border-top: 1px solid var(--line-row); }
.person .nm { font-weight: 600; }
.next .t { font-weight: 600; }
.seg { display: inline-flex; border: 0; border-radius: 10px; padding: 3px; background: var(--soft); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; min-height: 38px; padding: 0 14px; border-radius: 8px; font-size: 16px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 37, 31, .1); border: 1px solid var(--line-input); }
/* Live call form: sticky save bar */
.savebar { top: 76px; background: var(--pine-deep); padding: 12px clamp(18px, 2.6vw, 36px); }
.save-state.err { background: var(--chip-overdue-bg); color: var(--chip-overdue); }
.form-layout { padding: 24px clamp(18px, 2.6vw, 36px) 60px; }
.ticks, .missing { top: 150px; }
.ticks a { color: var(--ink); min-height: 40px; }
.ticks a:hover { text-decoration: none; }
.theme { border: 1px solid var(--line-card); }
.theme:focus-within { border-color: var(--pine-icon); }
.theme .th h2 { font-weight: 600; }
.theme .th .num { color: var(--pine-active); }
.field textarea { border-radius: var(--r-input); }
.field .quick button { min-height: 32px; border: 0; background: var(--soft); color: var(--ink-2); }
.field .quick button.on { background: var(--pine); color: var(--white); }
.field.special textarea { background: var(--canvas); }
.problems li::before { border-color: var(--line-box); }
.jev .card { border-color: var(--line-card); }
.jev .ic { background: var(--mint); border-color: var(--mint); color: var(--pine-deep); }
.jev .ic.k-payment { background: var(--chip-active-bg); color: var(--chip-active); border-color: var(--chip-active-bg); }
.jev .ic.k-message { background: var(--chip-info-bg); color: var(--chip-info); border-color: var(--chip-info-bg); }
.jev .ic.k-call { background: var(--chip-pending-bg); color: var(--chip-pending); border-color: var(--chip-pending-bg); }
.jev .ic.k-file, .jev .ic.k-conversation { background: var(--chip-review-bg); color: var(--chip-review); border-color: var(--chip-review-bg); }
.files-grid { border-bottom-color: var(--line-row); font-size: 17px; }
.files-grid.hd { background: var(--thead); border-radius: 8px; padding: 0 12px; height: 50px; font-size: 15px; font-weight: 700; color: var(--ink-2); border: 0; }
.files-grid:not(.hd) { padding: 12px; min-height: 64px; }
.ext { background: var(--mint); color: var(--pine-icon); }
/* Score bands keep their names; colours are the chip pairs */
.band { font-size: 15px; font-weight: 600; padding: 3px 10px; }
.band.strong { background: var(--chip-active-bg); color: var(--chip-active); }
.band.developing { background: var(--chip-pending-bg); color: var(--chip-pending); }
.band.to_build { background: var(--chip-overdue-bg); color: var(--chip-overdue); border: 0; padding: 3px 10px; }
.score-big { font-weight: 700; }
.plan-row .n { color: var(--pine-active); }
.mind div { border-left-color: var(--sea); }
.run-banner { background: var(--pine-deep); }
.steps .dot { border-color: var(--line-box); }
.steps li.done .dot { background: var(--chip-active-bg); border-color: var(--chip-active-bg); color: var(--chip-active); }
.steps li.done::after { background: var(--chip-active-bg); }
.steps li.now .dot { background: var(--pine); border-color: var(--pine); }
.steps li.failed .dot { background: var(--chip-overdue-bg); border: 0; color: var(--chip-overdue); }
.fact { border-top-color: var(--line-row); }
/* Modal: dark pine backdrop at 58 %, 18 px radius, 720 to 820 px wide, scrolls inside on short screens */
dialog.dlg { border-radius: 18px; width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-pop); color: var(--ink); }
dialog.dlg.wide { width: min(820px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: var(--backdrop); }
.dlg .dh { padding: clamp(20px, 3vw, 30px) clamp(20px, 3.5vw, 36px) 14px; border-bottom: 0; align-items: center; }
.dlg .dh h2 { font-size: clamp(20px, 2vw, 24px); font-weight: 600; }
.dlg .dh .sub { font-size: 16px; }
.dlg .db { padding: 8px clamp(20px, 3.5vw, 36px) 20px; }
.dlg .df { padding: 6px clamp(20px, 3.5vw, 36px) clamp(20px, 3vw, 30px); border-top: 0; justify-content: flex-start; flex-direction: row-reverse; }
.dlg .df .btn { min-height: 46px; padding: 0 22px; }
.dlg .df .btn.soft, .dlg .df .btn.ghost { background: var(--white); border: 1.5px solid var(--line-input); color: var(--ink); }
.dlg .split > div + div { background: var(--canvas); }
.dlg-x { width: 44px; height: 44px; flex: none; border: 0; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 10px; }
.dlg-x:hover { background: var(--soft); }
.checkrow { border-bottom-color: var(--line-row); font-size: 17px; }
.bubble { box-shadow: none; border: 1px solid var(--line-card); }
.amount { background: var(--soft); }
.amount b { font-weight: 700; }
/* Toggle: 48 by 28 pill switch */
.switch { width: 48px; height: 28px; }
.switch span { border-radius: 6px; background: var(--line-box); }
.switch span::after { top: 3px; left: 3px; width: 22px; height: 22px; box-shadow: 0 1px 3px rgba(20, 37, 31, .2); }
.switch input:checked + span { background: var(--pine); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--sea); outline-offset: 2px; }
.toast { background: var(--pine-deep); border-radius: 12px; box-shadow: var(--shadow-pop); font-size: 17px; }
/* Settings-style layout: tab list on the left, a horizontal tab row on narrow content */
.set-layout { display: flex; flex-wrap: wrap; gap: clamp(14px, 1.8vw, 24px); align-items: flex-start; min-width: 0; }
.set-layout > .tabs { flex: 0 0 240px; flex-direction: column; position: sticky; top: 96px; }
.set-layout > .tabs button { text-align: left; }
.set-layout > :not(.tabs) { flex: 1 1 420px; min-width: 0; }
@container main (max-width: 819px) { .set-layout > .tabs { flex: 1 1 100%; flex-direction: row; position: static; } }
/* PermissionMatrix */
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 17px; }
.matrix th { background: var(--thead); font-size: 15px; color: var(--ink-2); height: 50px; padding: 0 12px; text-align: center; }
.matrix th:first-child { text-align: left; border-radius: 8px 0 0 8px; } .matrix th:last-child { border-radius: 0 8px 8px 0; }
.matrix td { height: 56px; padding: 0 12px; border-bottom: 1px solid var(--line-row); text-align: center; }
.matrix td:first-child { text-align: left; font-weight: 600; }
.matrix .na { color: var(--faint); }

/* ---------- Sign in: deep pine panel with the logo and one line, white form on the right ---------- */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.signin .l { background: var(--pine-deep); color: var(--white); padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.signin .l img { height: 64px; width: auto; align-self: flex-start; }
.signin .l .pitch { display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
.signin .l .pitch .k { font-size: 16px; color: var(--sea); font-weight: 600; }
.signin .l .pitch h1 { font-family: var(--head); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 700; color: var(--white); margin: 0; }
.signin .l .pitch p { font-size: 18px; line-height: 1.55; margin: 0; }
.signin .l .foot { font-size: 16px; }
.signin .r { background: var(--white); display: flex; align-items: center; justify-content: center; padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 40px); }
.signin form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.signin h2 { font-family: var(--head); font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; margin: 0; }
.signin label { display: flex; flex-direction: column; gap: 8px; font-size: 16px; font-weight: 600; }
.signin input { height: 48px; font-size: 18px; padding: 0 14px; font-weight: 400; }
.signin .roles button { min-height: 44px; padding: 0 14px; border-radius: 6px; border: 0; background: var(--mint-2); color: var(--ink-2); font-size: 16px; font-weight: 600; cursor: pointer; }
.signin .roles button.on { background: var(--pine); color: var(--white); }
.signin .msg { font-size: 16px; background: var(--soft); border-radius: 12px; padding: 12px 14px; }

/* ---------- Content width: grids collapse by the space they actually have ---------- */
.rec-head .tabs { flex-wrap: nowrap; }
:has(> table.tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cols.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cols.g-call { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cols.g-side { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
.ph > *, .ph .acts > * { max-width: 100%; }
.ph > .filters { min-width: 0; }
@container main (max-width: 1023px) {
  .cols.c2, .cols.c64, .cols.c46, .form-layout, .meta-grid, .dlg .split { grid-template-columns: minmax(0, 1fr); }
  .cols.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticks, .missing { position: static; max-height: none; }
  .form-layout > .ticks { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .form-layout > .ticks .eyebrow { display: none; }
  .form-layout > .ticks a { flex: none; min-height: 44px; background: var(--white); border-radius: 6px; padding: 4px 14px 4px 10px; white-space: nowrap; }
  .hw-row { grid-template-columns: 24px 1fr; }
  .pe-row { grid-template-columns: 1fr 1fr; grid-template-areas: "nm rel" "role x" "join note"; }
}
/* Call form on smaller laptops: the tick list and the still-missing panel share the left column */
@container main (min-width: 1024px) and (max-width: 1279px) {
  .form-layout { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .form-layout > .ticks { grid-column: 1; grid-row: 1; position: static; max-height: none; }
  .form-layout > .missing { grid-column: 1; grid-row: 2; align-self: start; }
  .form-layout > :not(.ticks):not(.missing) { grid-column: 2; grid-row: 1 / span 2; }
}
@container main (max-width: 599px) {
  .cols.g3, .cols.g-call, .cols.g-side, .meta-grid, .set .pair, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .call-row { grid-template-columns: 60px minmax(0, 1fr); }
  .call-row > :nth-child(n+3) { grid-column: 1 / -1; justify-self: start; }
  .person { grid-template-columns: 40px minmax(0, 1fr); }
  .person .ct { grid-column: 2; text-align: left; }
  .files-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .files-grid.hd { display: none; }
  .files-grid > :nth-child(n+2):not(:last-child) { font-size: 16px; color: var(--muted); }
  .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 10px; }
  .fact { grid-template-columns: minmax(0, 1fr); }
  .fact .tag { grid-column: 1; grid-row: auto; justify-self: start; }
  .jev { grid-template-columns: 42px 28px minmax(0, 1fr); gap: 8px; }
  .jev .ic { width: 28px; height: 28px; font-size: 9px; }
}

/* ---------- Tablet (768 to 1199 px): the sidebar starts as an 84 px icon rail (set in staff.js, the choice is remembered) ---------- */
/* ---------- Phone (below 768 px): the sidebar becomes a 280 px slide-in drawer with a dark backdrop ---------- */
@media (max-width: 767px) {
  .app, .app.rail { --side-w: 280px; grid-template-columns: minmax(0, 1fr); }
  .app.rail .side .brand .full { display: block; } .app.rail .side .brand .mk { display: none; }
  .app.rail .side .s-top { justify-content: flex-start; padding: 0 6px; }
  .app.rail .side .nv { justify-content: flex-start; padding: 0 12px; }
  .app.rail .side .nv.child { padding-left: 40px; }
  .app.rail .side .nv .lb, .app.rail .side .nv .chev { display: block; }
  .app.rail .side .grp { display: flex; }
  .app.rail .side .grp[aria-expanded="false"] + .sub { display: none; }
  .app.rail .side .nv .badge { position: static; }
  .app.rail .side .s-client { justify-content: flex-start; padding: 0 12px; }
  .app.rail .side .s-client .lb, .app.rail .side .s-client > svg:last-child { display: block; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 280px; transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .app.nav-open .side { transform: none; visibility: visible; transition: transform .25s ease; }
  .side .s-x { display: flex; }
  .side-toggle { display: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-lock { overflow: hidden; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 10px; border: 0; background: var(--white); color: var(--ink); cursor: pointer; padding: 0; box-shadow: var(--shadow); }
  .menu-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }
  .topbar { height: 68px; padding: 0 12px; gap: 8px; }
  .topbar .tb-mark { display: block; }
  .topnav .tbtn.ghost { display: none; }
  .pmenu { top: 62px; right: 12px; }
  .page { padding: 18px 14px 32px; gap: 18px; }
  .rec-head { padding: 18px 14px 0; gap: 14px; }
  .savebar { top: 68px; padding: 8px 14px; gap: 4px 10px; }
  .savebar .ver { font-size: 18px; }
  .savebar .hint { order: 3; flex-basis: 100%; font-size: 16px; line-height: 1.4; }
  .form-layout { padding: 16px 14px 48px; gap: 16px; }
  .ph .acts { width: 100%; }
  .ph .acts select { flex: 1 1 160px; min-width: 0; }
  .box, .theme { padding: 18px 16px; }
  .tile { padding: 14px 16px; }
  .tile .v { font-size: 30px; }
  .board { grid-auto-columns: minmax(260px, 84%); margin-right: -12px; padding-right: 12px; }
  /* Tap targets */
  .btn { white-space: normal; text-align: center; padding-top: 8px; padding-bottom: 8px; }
  .btn.small { min-height: 44px; }
  .chip, .chip.sm, .seg button, .field .quick button { min-height: 44px; }
  .ph .crumb a, .jev .card .t a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  select, input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], input[type=password] { font-size: 18px; }
  .checkrow input { width: 22px; height: 22px; }
  .signin { grid-template-columns: 1fr; }
  .signin .l { padding: 28px 20px; gap: 24px; }
  .signin .l img { height: 48px; }
  .srow { grid-template-columns: minmax(0, 1fr) 34px 90px; }
  .score-big { font-size: 44px; }
  .amount b { font-size: 30px; }
  .access-code { font-size: 30px; min-width: 0; }
  .run-banner { padding: 18px; }
  .run-banner .nums { gap: 18px; flex-wrap: wrap; }
  /* Modals: nearly full width, the whole dialog scrolls */
  dialog.dlg, dialog.dlg.wide { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .dlg .dh { gap: 10px; flex-wrap: wrap; }
  .dlg .db { max-height: none; overflow: visible; }
  .dlg .df .btn { flex: 1 1 auto; }
  .toast { left: 12px; right: 12px; transform: none; text-align: center; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
dialog.dlg:focus, dialog.dlg:focus-visible { outline: none; }
.bar > i.sea { background: var(--sea); }

/* ---------- Call form: the family list (t02) ---------- */
.people-ed { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pe-rows { display: grid; gap: 8px; }
.pe-row { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 36px; grid-template-areas: "nm rel role x" "join note note note"; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg); }
.pe-row > :nth-child(1) { grid-area: nm; } .pe-row > :nth-child(2) { grid-area: rel; } .pe-row > :nth-child(3) { grid-area: role; }
.pe-row > :nth-child(4) { grid-area: join; } .pe-row > :nth-child(5) { grid-area: note; } .pe-row > :nth-child(6) { grid-area: x; }
.pe-row input[type=text], .pe-row select { height: 40px; font-size: 16px; }
.pe-join { display: flex; align-items: center; gap: 6px; font-size: 16px; white-space: nowrap; }
@media (max-width: 1100px) { .pe-row { grid-template-columns: 1fr 1fr; grid-template-areas: "nm rel" "role x" "join note"; } }
.plan-row.timed { grid-template-columns: 28px minmax(0,1fr) auto; }
.plan-row .mins { text-align: right; font-size: 16px; display: grid; gap: 2px; align-content: start; }
.plan-row .mins b { font-family: var(--head); }
.plan-row .mins span { color: var(--mute); font-size: 15px; }

/* ---------- Call transcripts ---------- */
.field.from-t textarea, .field.from-t input { border-color: var(--sea); background: var(--sea-wash); }
.from-tag { font-size: 14px; font-weight: 700; color: var(--teal); background: var(--wash); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.rec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.rec-row .nm { font-weight: 700; }
.rec-row .sm { font-size: 16px; color: var(--mute); }
.rec-row .acts { display: flex; gap: 8px; }


/* ---------- Owner and manager tools (28 Nov): payments panel, scores editor, delete dialog, add a client ---------- */
.del-dlg .del-h, .pay-box h3 { font-family: var(--head); font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.del-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.del-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.del-list li b { font-family: var(--head); flex: none; }
.del-dlg input[type=text] { margin-top: 6px; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pay-row .nm { font-weight: 700; }
.pay-row .sm { font-size: 16px; color: var(--mute); }
.pay-row .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.pay-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 96px 92px; gap: 6px 12px; align-items: center; }
.sc-grid .hd { font-size: 15px; color: var(--mute); font-weight: 700; }
.sc-grid select { height: 40px; }
.sc-grid .changed { font-weight: 700; }
.sc-sum { display: flex; flex-wrap: wrap; gap: 8px 20px; background: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: 16px; margin: 12px 0; }
.sc-sum b { font-family: var(--head); }
.sc-hint { font-size: 16px; color: var(--teal); background: var(--wash); border-radius: 10px; padding: 8px 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.req-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.req-row .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .sc-grid { grid-template-columns: minmax(0, 1fr) 84px; }
  .sc-grid .band, .sc-grid .hd.bd { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .req-row { grid-template-columns: minmax(0, 1fr); }
  .req-row .acts { justify-content: flex-start; }
  .pay-row .acts .btn, .pay-acts .btn, .req-row .acts .btn { min-height: 44px; }
}
.req-row.stack1 { grid-template-columns: minmax(0, 1fr); }
.req-row.stack1 .acts { justify-content: flex-start; }
.req-row.stack1 .acts select { width: auto; max-width: 100%; flex: 1 1 200px; }

/* ---------- Dashboard parts (v2): calls today, notes, recent clients, schedule ---------- */
.box > .ov + .ov { margin-top: 8px; }
.box > h2 + .ov { margin-top: 0; }
.crow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft-2); min-width: 0; color: var(--ink); margin-top: 8px; }
.crow:hover { background: var(--mint); text-decoration: none; color: var(--ink); }
.crow .av { width: 42px; height: 42px; }
.crow .tx, .rc-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crow .tx b, .rc-row .tx b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .tx span { font-size: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes-well { flex: 1; min-height: 160px; background: var(--soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.note-add { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 4px 6px; }
.note-add svg { width: 16px; height: 16px; }
.note-add input { border: 0 !important; background: transparent !important; min-height: 36px; padding: 0 !important; }
.rc-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-row); color: var(--ink); min-width: 0; }
.rc-row:hover { text-decoration: none; color: var(--ink); }
.rc-row:hover b { text-decoration: underline; }
.rc-row .meta { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--muted); min-width: 0; }
.rc-row .meta > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-day { font-family: var(--head); font-size: 22px; font-weight: 600; color: var(--link); margin: -2px 0 10px; }
.sched-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: stretch; padding: 6px 0; border-top: 1px solid var(--line-row); color: var(--ink); }
.sched-row:hover { text-decoration: none; color: var(--ink); }
.sched-row .when { font-size: 16px; color: var(--ink-2); padding-top: 10px; }
.sched-row .ev { border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; background: var(--chip-info-bg); color: var(--chip-info); }
.sched-row.active .ev { background: var(--chip-active-bg); color: var(--chip-active); }
.sched-row .ev b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-row .ev span { font-size: 16px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.tabs button svg.i { width: 18px; height: 18px; margin-right: 10px; vertical-align: -4px; }
.set-layout > .tabs button { display: flex; align-items: center; }
/* Phones under 480 px: the top bar keeps menu, back, search, reports due, bell and profile; the logo mark and the
   add button move out (both are in the menu). */
@media (max-width: 479px) { .topbar .tb-mark, .tb-end .tbtn.primary { display: none; } .topbar { gap: 6px; } .tb-end { gap: 6px; } }
/* Step 3 checks: every tap target at least 44 px at every width (icon buttons stay 36 px with a fine pointer, as the spec allows) */
.btn.small, .chip, .chip.sm, .seg button, .field .quick button, .ticks a, .tabs button { min-height: 44px; }
.chip.sm { padding: 0 12px; }
.note-add input { min-height: 44px !important; }
.matrix .na { color: var(--muted); }
.rc-row .tx, .crow .tx { overflow: hidden; }
.rc-row > .clk, .crow > .st { flex: 0 1 auto; max-width: 42%; }
.rc-row, .crow, .sched-row { overflow: clip; overflow-clip-margin: 4px; }
.rc-row .meta .st { flex: none; }

/* ---------- Dashboard: pipelines at a glance (28 Nov) ---------- */
.glance { display: grid; gap: 10px; }
.gl-row { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line-card); border-radius: 14px; background: var(--soft-2); color: var(--ink); text-decoration: none; min-width: 0; }
.gl-row:hover { background: var(--mint); text-decoration: none; color: var(--ink); }
.gl-h { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gl-h b { font-family: var(--head); font-size: 18px; font-weight: 600; }
.gl-n { font-size: 16px; color: var(--muted); }
.gl-steps { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.gl-s { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 6px 0 10px; border-radius: 6px; background: var(--white); border: 1px solid var(--line); font-size: 16px; color: var(--muted); }
.gl-s i { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--soft); display: inline-grid; place-items: center; font-weight: 700; color: var(--ink-2); }
.gl-s.on { color: var(--ink); border-color: var(--line-box); }
.gl-s.on i { background: var(--chip-active-bg); color: var(--chip-active); }
@container main (max-width: 699px) { .gl-row { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

/* ======================================================================
   Human design pass (founder, 28 Nov 2026; portal/design-v2/HUMAN-DESIGN-RULES.md)
   Bigger type, space instead of boxes, pills only for status, plain numbers.
   ====================================================================== */
body { font-size: 18px; line-height: 1.55; }
.side .nv { height: 50px; font-size: 17px; }
.side .nv .badge { min-width: 26px; height: 26px; line-height: 26px; padding: 0 8px; font-size: 15px; }
.app.rail .side .nv .badge { min-width: 22px; height: 22px; line-height: 22px; font-size: 15px; padding: 0 5px; }
.ph .sub { font-size: 18px; color: var(--muted); }
.box { border-color: var(--line-row); box-shadow: none; }
.box h2, .box .bh h2 { font-size: var(--fs-card); }
.note { font-size: 16px; }
.eyebrow { font-size: 16px; letter-spacing: 0; text-transform: none; font-weight: 600; }

/* Tables: plain sentence-case headings on a thin line, roomy rows */
.tbl th { font-size: 16px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); background: transparent; border-bottom: 1px solid var(--line); height: 48px; }
.tbl th:first-child, .tbl th:last-child { border-radius: 0; }
.tbl td { font-size: 17px; }

/* Status pills: a little larger, used once per row at most */
.st { height: 32px; padding: 0 14px; font-size: 15px; }
.st.sm { height: 28px; padding: 0 11px; font-size: 15px; }
.chip { font-size: 16px; }

/* Number rows (Overview, Needs your attention): a word and a big number, no icon tiles or tinted blocks.
   Colour only marks the exception: red for overdue, amber for due soon. */
.ov { background: transparent; border-radius: 0; padding: 16px 2px; gap: 14px; border-bottom: 1px solid var(--line-row); }
.ov:last-child { border-bottom: 0; }
.ov:hover { filter: none; background: var(--soft-2); }
.ov .ti { display: none; }
.ov .lb { font-size: 18px; white-space: normal; }
.ov .n, .ov.yellow .n, .ov.blue .n { font-size: 34px; font-weight: 600; color: var(--ink); line-height: 1; }
.ov.yellow, .ov.red, .ov.blue { background: transparent; }
.ov.red .n { color: var(--chip-overdue); }
.ov.yellow .n { color: var(--chip-pending); }
.ov-grid .ov { flex-direction: column; align-items: flex-start; gap: 6px; border-bottom: 0; padding: 4px 2px; }
.ov-grid .ov .n { order: -1; font-size: 40px; }

/* Board cards: bigger names, quieter details */
.kc .nm { font-size: 18px; }
.kc .pl { font-size: 16px; }
.col .ch { font-size: 18px; }

/* Pipelines at a glance, written as sentences */
.gl-row { background: transparent; border: 0; border-bottom: 1px solid var(--line-row); border-radius: 0; padding: 18px 2px; grid-template-columns: minmax(170px, 240px) minmax(0, 1fr); }
.gl-row:last-child { border-bottom: 0; }
.gl-row:hover { background: var(--soft-2); }
.gl-h b { font-size: 20px; }
.gl-n { font-size: 16px; }
.gl-line { font-size: 18px; color: var(--ink-2); line-height: 1.5; }
.gl-line b { color: var(--ink); font-weight: 600; }
.gl-line .quiet { color: var(--muted); }

/* Needs your attention: plain sentences with an arrow */
.attn-row { display: flex; align-items: center; gap: 14px; padding: 16px 2px; border-bottom: 1px solid var(--line-row); color: var(--ink); text-decoration: none; font-size: 18px; min-height: 56px; }
.attn-row:last-child { border-bottom: 0; }
.attn-row:hover { background: var(--soft-2); text-decoration: none; color: var(--ink); }
.attn-row b { font-family: var(--head); font-size: 30px; font-weight: 600; min-width: 44px; }
.attn-row.red b { color: var(--chip-overdue); }
.attn-row .go { margin-left: auto; color: var(--faint); }
.calm { font-size: 18px; color: var(--muted); margin: 6px 0 0; }

.side .nv.child { font-size: 17px; padding-left: 38px; }
@container main (max-width: 699px) { .gl-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

.chip { display: inline-flex; align-items: center; line-height: 1.2; }
.side .nv.child { font-size: 16px; }

/* Top bar never spills (founder, 28 Nov): the least needed items drop out first as the content narrows,
   and the profile can shrink with its name cut by an ellipsis instead of running off screen. */
.tb-end { min-width: 0; flex: 0 1 auto; }
.prof { flex: 0 1 auto; min-width: 0; }
.prof .pt b { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
@container main (max-width: 1599px) { .topnav .tbtn.ghost { display: none; } .prof .pt span { display: none; } }
@container main (max-width: 1499px) { .wsp { display: none; } }
@container main (max-width: 1279px) { .tb-search { display: none; } .tb-search-btn { display: inline-flex; } .tb-end .tm-chip { display: none; } }

/* Phones and small tablets: same big text, less padding around it, so lines are not squeezed (28 Nov) */
@container main (max-width: 599px) {
  .page { padding: 16px 12px 32px; gap: 14px; }
  .box { --pad-card: 16px; border-radius: 16px; }
  .ph h1 { font-size: 30px; }
  .ov .n { font-size: 30px; }
  .tbl td { padding-left: 0; padding-right: 0; }
  .btn { min-height: 48px; }
}

/* Phones (28 Nov): filters take the full width, the client's facts stack without dots, progress steps get room */
@container main (max-width: 599px) {
  .ph .acts { width: 100%; }
  .ph .acts select { flex: 1 1 100%; width: 100%; }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 14px; }
}

/* Fit line (28 Nov) */
.fit-line { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; color: var(--ink-2); }
.fit-line i { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------- Colour with a job (founder, 28 Nov: vibrant, still W2W) ----------
   --tone / --tone-ink / --tone-wash come from W2W.toneStyle(): the stage or card colour. */
.box.tone-top > h2:first-child, .box.tone-top > .bh h2 { color: var(--tone-ink); }
.gl-row { padding-left: 2px; }
.gl-row .gl-h b { color: var(--tone-ink, var(--ink)); }
.gl-line b { color: var(--tone-ink, var(--ink)); }
.chip.tone-chip { background: var(--tone-wash); color: var(--tone-ink); border: 1.5px solid transparent; }
.chip.tone-chip.on { background: var(--tone); color: var(--white); }
.chip.tone-chip:hover { border-color: var(--tone); }
.ph.tone-head h1 { color: var(--tone-ink); }

/* Overview numbers: each row its own colour */
.ov.red .n { color: var(--coral-ink); }
.ov.yellow .n { color: var(--amber-ink); }
.ov.blue .n { color: var(--sky-ink); }
.ov:not(.red):not(.yellow):not(.blue) .n { color: var(--green-ink); }
.attn-row.red b { color: var(--coral-ink); }
.attn-row b { color: var(--amber-ink); }
/* Sidebar: active item gets the bright sea edge */


/* Progress steps as numbered squares, not thin rounded bars (founder, 28 Nov) */
.stages { counter-reset: st; }
.stages div { counter-increment: st; align-items: flex-start; }
.stages i { width: 34px; height: 34px !important; border-radius: 6px; background: var(--white); border: 1.5px solid var(--line-box); display: grid; place-items: center;
  font-style: normal; font-family: var(--head); font-weight: 700; font-size: 16px; color: var(--muted); }
.stages i::before { content: counter(st); }
.stages .done i { background: var(--pine); border-color: var(--pine); color: var(--white); }
.stages .now i { background: var(--sea); border-color: var(--pine); color: var(--pine-deep); }
.kc .bar { display: none; }

/* The bell's count and panel (founder, 29 Nov). A square count, not a round pill. */
.bell .bell-n { position: absolute; top: 3px; right: 2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--chip-overdue); color: var(--white);
  font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.bpanel { position: absolute; right: clamp(16px, 2.4vw, 32px); top: 70px; z-index: 56; width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 640px); overflow-y: auto;
  background: var(--white); border: 1px solid var(--line-card); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 8px 8px 12px; }
.bp-h { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px 8px; }
.bp-h b { font-family: var(--head); font-size: 20px; }
.bp-h span { font-size: 16px; color: var(--muted); }
.bp-list { display: flex; flex-direction: column; }
.bp-i { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 10px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-row); }
.bp-list .bp-i:first-child { border-top: 0; }
.bp-i:hover { background: var(--mint); }
.bp-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bp-t b, .bp-i > b { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.bp-t span, .bp-i > span { font-size: 16px; color: var(--ink-2); }
.bp-i.urgent .bp-t b { color: var(--chip-overdue); }
.bp-i.soon .bp-t b { color: var(--chip-pending); }
.bp-i.soon { flex-direction: row; }
a.bp-i.soon:not(:has(.bp-t)) { flex-direction: column; align-items: flex-start; }
.bp-empty { margin: 0; padding: 12px; font-size: 17px; color: var(--muted); }
@media (max-width: 767px) { .bpanel { top: 62px; right: 12px; } }

/* First sign in tour: a card at the bottom and a calm outline on the control it talks about. */
.tour { position: fixed; z-index: 90; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(480px, calc(100vw - 24px));
  background: var(--white); border: 1px solid var(--line-card); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.tour h2 { margin: 0; font-size: 24px; }
.tour p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.tour-n { font-size: 15px; font-weight: 700; color: var(--muted); }
.tour-b { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.tour-nav { display: flex; gap: 8px; }
.tour-lit { outline: 3px solid var(--sea) !important; outline-offset: 3px; border-radius: 12px; }
.tour .link { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-size: 17px; font-weight: 600; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Engagement score: the band word in its colour and the number (founder, 29 Nov). No pill, plain text. */
.int { font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.int b { font-weight: 700; }
.int.active b { color: var(--chip-active); } .int.pending b { color: var(--chip-pending); } .int.neutral b { color: var(--muted); }
.pf-int { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.int-why { display: flex; flex-direction: column; }
.int-r { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-row); font-size: 17px; }
.int-r b { color: var(--chip-active); font-variant-numeric: tabular-nums; }
.warm-list { display: flex; flex-direction: column; }
.warm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-row); color: var(--ink); text-decoration: none; }
.warm-row:first-child { border-top: 0; }
.warm-row:hover { background: var(--mint); }
.warm-nm { display: flex; flex-direction: column; min-width: 0; }
.warm-nm b { font-size: 17px; }
