/* DPDPA Vault — tenant staff app. Calm, plain, one brand accent set by the tenant. */
:root {
  color-scheme: light;
  --bg: #F1F4F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --ink: #15202B;
  --muted: #566170;
  --line: #D9DEE4;
  --brand: #1E5AA8;          /* overwritten by tenant theme */
  --brand-ink: #FFFFFF;
  --brand-soft: #E8EFF8;
  --red: #B42318;  --red-bg: #FDEDEB;
  --amber: #8F5600; --amber-bg: #FFF3DC;
  --green: #1D7238; --green-bg: #E6F4EA;
  --focus: #1E5AA8;
  --c-blue: #2563B0;   --c-blue-soft: #E6EFFA;
  --c-teal: #0E7C76;   --c-teal-soft: #DFF3F1;
  --c-violet: #6A4BC4; --c-violet-soft: #EEE9FB;
  --c-amber: #A35D00;  --c-amber-soft: #FFF0D6;
  --c-green: #1D7238;  --c-green-soft: #E2F3E7;
  --c-rose: #B4235A;   --c-rose-soft: #FCE6EE;
  --c-cyan: #0A6F95;   --c-cyan-soft: #DFF1F8;
  --c-indigo: #3F51B5; --c-indigo-soft: #E7E9F8;
  --c-red: #B42318;    --c-red-soft: #FDEBE8;
  --r-tile: 14px; --r-card: 10px; --r-ctl: 7px;
  --rail: 92px;
  --top: 60px;
  --font: "Noto Sans", "Noto Sans Telugu", system-ui, -apple-system, "Segoe UI", sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12171D; --surface: #1A2129; --surface-2: #1F2731; --ink: #E7ECF1; --muted: #A3AEBB; --line: #2F3944;
    --brand-soft: #1D2B3D; --red: #FF8A7E; --red-bg: #3A1F1D; --amber: #F2B65C; --amber-bg: #3A2D16;
    --green: #6FD08F; --green-bg: #183223; --focus: #8DB7F0;
    --c-blue: #8DB7F0; --c-blue-soft: #1C2A3D; --c-teal: #6FD3CB; --c-teal-soft: #15302E;
    --c-violet: #B7A3F3; --c-violet-soft: #2A2340; --c-amber: #F2B65C; --c-amber-soft: #3A2D16;
    --c-green: #7AD69A; --c-green-soft: #183223; --c-rose: #F49AB9; --c-rose-soft: #3A1E2A;
    --c-cyan: #7CCBEB; --c-cyan-soft: #15303B; --c-indigo: #A9B4F2; --c-indigo-soft: #232A45;
    --c-red: #FF8A7E; --c-red-soft: #3A1F1D;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12171D; --surface: #1A2129; --surface-2: #1F2731; --ink: #E7ECF1; --muted: #A3AEBB; --line: #2F3944;
  --brand-soft: #1D2B3D; --red: #FF8A7E; --red-bg: #3A1F1D; --amber: #F2B65C; --amber-bg: #3A2D16;
  --green: #6FD08F; --green-bg: #183223; --focus: #8DB7F0;
    --c-blue: #8DB7F0; --c-blue-soft: #1C2A3D; --c-teal: #6FD3CB; --c-teal-soft: #15302E;
    --c-violet: #B7A3F3; --c-violet-soft: #2A2340; --c-amber: #F2B65C; --c-amber-soft: #3A2D16;
    --c-green: #7AD69A; --c-green-soft: #183223; --c-rose: #F49AB9; --c-rose-soft: #3A1E2A;
    --c-cyan: #7CCBEB; --c-cyan-soft: #15303B; --c-indigo: #A9B4F2; --c-indigo-soft: #232A45;
    --c-red: #FF8A7E; --c-red-soft: #3A1F1D;
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(var(--top) + env(safe-area-inset-top, 0px)); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
:lang(te) body, html[lang="te"] body { line-height: 1.7; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-ctl); z-index: 50; }
.skip:focus { top: 12px; }

/* Top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 20px 0 calc(var(--rail) + 20px);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-badge { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); border: 1px solid currentColor; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 5px 11px; cursor: pointer; font-size: 14px; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: var(--r-ctl); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 10px 30px rgba(15, 25, 40, .14); padding: 8px; }
.user-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.user-menu button:hover { background: var(--surface-2); }
.user-menu button[aria-current="true"] { font-weight: 600; background: var(--brand-soft); }
.menu-role { margin: 4px 10px 8px; color: var(--muted); font-size: 14px; }
.menu-label { margin: 8px 10px 4px; font-size: 13px; color: var(--muted); }
.menu-demo { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; padding: 4px 0; }

/* Rail */
.rail {
  position: fixed; left: 0; top: env(safe-area-inset-top, 0px); bottom: 0; width: var(--rail); z-index: 25;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; padding: calc(var(--top) + 12px) 8px 12px;
}
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 13px; text-align: center; }
.rail-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.rail-item:hover { background: var(--surface-2); color: var(--ink); }
.rail-item.is-active { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.rail-item.is-active svg { stroke: var(--brand); }

/* Main */
.main { margin-left: var(--rail); padding: 24px 28px 48px; max-width: 1240px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.sub { margin: 2px 0 0; color: var(--muted); }

/* Quick actions: the one bold element */
.quick { margin: 22px 0 32px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.05fr); gap: 12px; }
.qa {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  min-height: 132px; padding: 18px; border-radius: var(--r-tile);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.qa:hover { border-color: var(--brand); }
.qa:active { transform: scale(.985); }
.qa-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); }
.qa-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qa-title { font-size: 18px; font-weight: 600; line-height: 1.3; }
.qa-sub { font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: -4px; }
.qa.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.qa.primary .qa-icon { background: rgba(255,255,255,.18); }
.qa.primary .qa-icon svg { stroke: var(--brand-ink); }
.qa.primary .qa-sub { color: var(--brand-ink); opacity: .85; }
.qa.danger { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.qa.danger:hover { border-color: var(--red); }
.qa.danger .qa-icon { background: var(--surface); }
.qa.danger .qa-icon svg { stroke: var(--red); }
.qa.danger .qa-title { color: var(--red); }

/* Board */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head h2 { font-size: 19px; font-weight: 600; }
.board-tools, .edit-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: var(--r-ctl); cursor: pointer; font-size: 14px; font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.edit-hint { margin: -4px 0 14px; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px 18px; min-width: 0; position: relative; }
.widget.wide { grid-column: span 2; }
.widget.full { grid-column: 1 / -1; }
.w-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.w-head h3 { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; }
.w-tools { display: none; gap: 4px; }
.handle { display: none; cursor: grab; border: 0; background: transparent; padding: 4px 2px; color: var(--muted); touch-action: none; }
.handle svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 13px; color: var(--muted); line-height: 1.4; }
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.icon-btn:disabled { opacity: .4; cursor: default; }

.editing .widget { border-style: dashed; border-color: var(--muted); }
.editing .w-tools, .editing .handle { display: flex; }
.editing .w-body { pointer-events: none; opacity: .75; }
.widget.dragging { box-shadow: 0 14px 34px rgba(15, 25, 40, .22); border-style: solid; border-color: var(--brand); opacity: .95; z-index: 5; }
.widget.dragging .handle { cursor: grabbing; }

.tray { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r-card); background: var(--surface-2); }
.tray h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.tray-items { display: flex; gap: 8px; flex-wrap: wrap; }
.tray-items p { margin: 0; color: var(--muted); font-size: 14px; }

/* Widget content */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat-n { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 14px; color: var(--muted); }
.stat.red .stat-n { color: var(--red); }
.stat.amber .stat-n { color: var(--amber); }
.ok { display: flex; align-items: center; gap: 8px; color: var(--green); margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 8px; flex: none; background: var(--line); }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); }
.li-main { flex: 1; min-width: 0; }
.li-meta { font-size: 13px; color: var(--muted); }
.li-meta.red { color: var(--red); }
.pill { font-size: 13px; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; align-self: center; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 4px 10px; align-items: center; font-size: 14px; }
.bar { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); }
.bar-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.score { display: flex; align-items: baseline; gap: 10px; }
.score .stat-n { font-size: 36px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--green); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.subhead { font-size: 14px; font-weight: 600; margin: 14px 0 4px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 15px; max-width: calc(100% - 32px); }

/* Tablet */
@media (max-width: 1100px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa.danger { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
  .qa.danger .qa-sub { margin-top: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.wide { grid-column: 1 / -1; }
}
/* Phone: rail becomes a bottom bar */
@media (max-width: 720px) {
  :root { --rail: 0px; --top: 56px; }
  .topbar { padding: 0 14px; }
  .brand-name { max-width: 40vw; }
  .user-name { display: none; }
  .rail { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); }
  .rail-item { flex: 1; padding: 6px 2px; font-size: 12px; }
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .page-head h1 { font-size: 22px; }
  .qa { min-height: 112px; padding: 14px; }
  .qa-title { font-size: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .widget.wide, .widget.full { grid-column: auto; }
  .w-tools .size-btn { display: none; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Colour tones: one soft accent per card and quick action */
.tone-blue   { --accent: var(--c-blue);   --accent-soft: var(--c-blue-soft); }
.tone-teal   { --accent: var(--c-teal);   --accent-soft: var(--c-teal-soft); }
.tone-violet { --accent: var(--c-violet); --accent-soft: var(--c-violet-soft); }
.tone-amber  { --accent: var(--c-amber);  --accent-soft: var(--c-amber-soft); }
.tone-green  { --accent: var(--c-green);  --accent-soft: var(--c-green-soft); }
.tone-rose   { --accent: var(--c-rose);   --accent-soft: var(--c-rose-soft); }
.tone-cyan   { --accent: var(--c-cyan);   --accent-soft: var(--c-cyan-soft); }
.tone-indigo { --accent: var(--c-indigo); --accent-soft: var(--c-indigo-soft); }
.tone-red    { --accent: var(--c-red);    --accent-soft: var(--c-red-soft); }

.widget[class*="tone-"] { border-top: 3px solid var(--accent); }
.editing .widget[class*="tone-"] { border-top-style: solid; }
.w-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft, var(--surface-2)); display: grid; place-items: center; flex: none; }
.w-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--accent, var(--muted)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.widget[class*="tone-"] .bar i, .widget[class*="tone-"] .meter i { background: var(--accent); }
.widget[class*="tone-"] .bar { background: var(--accent-soft); border-color: transparent; }
.widget[class*="tone-"] .meter { background: var(--accent-soft); border-color: transparent; }
.widget.tone-green .score .stat-n { color: var(--accent); }

.qa[class*="tone-"] .qa-icon { background: var(--accent-soft); }
.qa[class*="tone-"] .qa-icon svg { stroke: var(--accent); }
.qa[class*="tone-"]:hover { border-color: var(--accent); }

/* Powered by DPDPA Office */
.powered { margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.powered a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 13px; }
.powered a:hover .pw-mark b { color: var(--brand); }
.pw-mark { display: inline-flex; align-items: baseline; gap: 3px; color: var(--ink); }
.pw-mark small { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.pw-mark b { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

/* Sign-in page */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 14px; padding: 28px 26px; }
.auth-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 10px; }
.auth-card p { margin: 0 0 12px; color: var(--muted); }
.auth-card p[lang="te"] { color: var(--ink); }
.auth-err { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.auth .powered { margin-top: 24px; border-top: 0; }

/* ================= Slice 2: daily-work screens ================= */
.loading { color: var(--muted); padding: 24px 0; }
.err { color: var(--red); }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }
.muted { color: var(--muted); }
.red { color: var(--red); } .amber-t { color: var(--amber); }
.nowrap { white-space: nowrap; }
.li-link, .block-link { color: inherit; text-decoration: none; display: block; }
.li-link:hover, .block-link:hover { color: var(--brand); }
a.stat { color: inherit; text-decoration: none; border-radius: 8px; padding: 4px; margin: -4px; }
a.stat:hover { background: var(--surface-2); }
a.qa { text-decoration: none; color: inherit; position: relative; }
a.qa.primary { color: var(--brand-ink); }
.qa-badge { position: absolute; top: 14px; right: 14px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--c-teal); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head h1 { font-size: 24px; font-weight: 600; outline: none; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 4px; }
.back:hover { color: var(--brand); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin-bottom: 16px; min-width: 0; }
.panel h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.panel.narrow { max-width: 640px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols > .panel { margin-bottom: 0; }
.cols + .panel, .panel + .cols { margin-top: 16px; }
.cols.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.sticky { position: sticky; top: calc(var(--top) + 16px); }

.btn.big { padding: 11px 20px; font-size: 16px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.full { width: 100%; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.is-busy { cursor: progress; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; color: inherit; }
a.btn.primary, a.btn.danger { color: #fff; }
a.btn.primary { color: var(--brand-ink); }
.linkbtn { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; text-decoration: underline; font-size: inherit; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea, .search-in {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus, .search-in:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field input.otp { font-size: 26px; letter-spacing: .4em; text-align: center; max-width: 260px; font-variant-numeric: tabular-nums; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { color: var(--red); background: var(--red-bg); padding: 8px 12px; border-radius: 8px; font-size: 14px; margin: 6px 0 0; }
.info { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 15px; }
.info.strong { font-weight: 600; }
.note.warn { color: var(--amber); } .note.good { color: var(--green); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }

.stepper { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.progress { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.notice-box { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px; background: var(--surface-2); }
.notice-box p { margin: 12px 0; }

.toggles { display: grid; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg-text { flex: 1; display: grid; gap: 2px; }
.tg-text span { font-size: 14px; color: var(--muted); }
.switch { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.toggle input:checked ~ .switch { background: var(--green); }
.toggle input:checked ~ .switch::after { left: 23px; }
.toggle:has(input:checked) { border-color: var(--green); background: var(--green-bg); }
.toggle:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.choice-list { display: grid; gap: 8px; margin: 8px 0 14px; }
.choice { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-decoration: none; color: inherit; font: inherit; }
.choice:hover { border-color: var(--brand); }
.choice span { font-size: 14px; color: var(--muted); }

.success { text-align: center; }
.success .actions { justify-content: center; }
.big-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: 34px; display: grid; place-items: center; margin: 4px auto 10px; }
.yesno { list-style: none; padding: 0; margin: 14px auto; display: inline-grid; gap: 6px; text-align: left; }
.yesno li { display: flex; gap: 10px; align-items: center; }
.yesno span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.yesno .yes span { background: var(--green-bg); color: var(--green); }
.yesno .no span { background: var(--surface-2); color: var(--muted); }

.consent-list { list-style: none; padding: 0; margin: 0; }
.consent-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.consent-list li:first-child { border-top: 0; }
.consent-list .yes, .consent-list .no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.consent-list .yes { background: var(--green-bg); color: var(--green); }
.consent-list .no { background: var(--surface-2); color: var(--muted); }
.cl-name { flex: 1; }
.list.compact li { padding: 7px 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.chip.st-delivered { background: var(--c-blue-soft); color: var(--c-blue); border-color: transparent; }
.chip.st-read, .chip.st-closed, .chip.st-ready { background: var(--green-bg); color: var(--green); border-color: transparent; }
.chip.st-failed, .chip.st-open { background: var(--red-bg); color: var(--red); border-color: transparent; }
.chip.st-registered { background: var(--amber-bg); color: var(--amber); border-color: transparent; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr[data-href]:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { border-bottom: 0; padding: 6px 10px; }
.tbl tfoot .total td { font-weight: 700; font-size: 17px; border-top: 2px solid var(--ink); padding-top: 10px; }
.search input { font-size: 17px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; }
.tab.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px; background: var(--surface-2); color: var(--ink); font-size: 13px; text-align: center; }
.tab.is-on .count { background: var(--bg); }
.work { list-style: none; padding: 0; margin: 0; }
.work li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.work li:first-child { border-top: 0; }
.work li.late { box-shadow: inset 3px 0 0 var(--red); padding-left: 12px; }
.work a { color: inherit; }
.wk-main { flex: 1; min-width: 220px; }
.wk-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.test-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; margin-top: 10px; padding-right: 2px; }
.test { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.test input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.test:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.test.locked { opacity: .6; }
.test-name { flex: 1; display: grid; }
.test-name small { color: var(--muted); font-size: 13px; }
.test-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.sel { list-style: none; padding: 0; margin: 6px 0 12px; }
.sel li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.sel li.empty { color: var(--muted); border: 0; }
.grand { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; margin: 6px 0; }
.grand b { font-size: 26px; }
.results input { min-width: 90px; }
.unit-in { display: flex; align-items: center; gap: 6px; }
.unit-in input { width: 120px; font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.unit-in span { color: var(--muted); font-size: 13px; }

.incident.is-open { border-left: 4px solid var(--red); }
.inc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.clocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.clock { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.clock-l { font-size: 13px; color: var(--muted); }
.clock-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.clock.done { background: var(--green-bg); border-color: transparent; } .clock.done .clock-v { color: var(--green); }
.clock.run { background: var(--c-blue-soft); border-color: transparent; }
.clock.soon { background: var(--amber-bg); border-color: transparent; } .clock.soon .clock-v { color: var(--amber); }
.clock.late { background: var(--red-bg); border-color: transparent; } .clock.late .clock-v { color: var(--red); }
.clock .btn { justify-self: start; margin-top: 4px; }
.drafts { margin-top: 12px; }
.drafts summary { cursor: pointer; color: var(--brand); }
.draft { white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.more-card { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); text-decoration: none; color: inherit; }
a.more-card:hover { border-color: var(--brand); }
.more-card span { color: var(--muted); font-size: 14px; }
.more-card.soon { opacity: .6; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(15, 22, 32, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--surface); border-radius: 14px; padding: 22px 24px; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-card.wide { max-width: 760px; }
.modal-card h2 { font-size: 19px; margin-bottom: 8px; }
.has-modal { overflow: hidden; }
.bill-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 12px; }
.bill-head p, .bill-meta p { margin: 2px 0; font-size: 14px; color: var(--muted); }
.bill-meta { text-align: right; }

/* Demo phone */
.phone-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--c-teal); background: var(--c-teal-soft); color: var(--c-teal); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 14px; font-weight: 600; position: relative; }
.phone-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.phone-count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 5px; }
.phone { position: fixed; right: 16px; top: calc(var(--top) + 12px + env(safe-area-inset-top, 0px)); bottom: 16px; width: 360px; z-index: 40; }
.phone-frame { height: 100%; display: flex; flex-direction: column; background: #E9E2D6; border: 10px solid #1C232B; border-radius: 34px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.phone-top { display: flex; justify-content: space-between; align-items: center; background: #075E54; color: #fff; padding: 12px 14px; }
.phone-top .icon-btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.phone-help { margin: 0; padding: 8px 12px; font-size: 12px; color: #4A4A4A; background: #F3EEE6; }
.phone-list { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; display: grid; gap: 12px; align-content: start; }
.pm-to { font-size: 12px; color: #444; margin: 0 0 3px 4px; }
.pm-to span { color: #777; }
.bubble { background: #fff; color: #111; border-radius: 0 10px 10px 10px; padding: 8px 10px 6px; box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: 14px; line-height: 1.45; }
.bubble p { margin: 0; word-break: break-word; }
.bubble a { color: #027EB5; }
.pm.is-new .bubble { outline: 2px solid #25D366; }
.otp-big { font-size: 26px; font-weight: 700; letter-spacing: .2em; color: #075E54; }
.pdf { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px; border-radius: 8px; background: #F0F2F5; text-decoration: none; color: #111 !important; font-weight: 600; }
.pdf span { background: #E53935; color: #fff; font-size: 11px; padding: 3px 5px; border-radius: 4px; }
.pm-meta { text-align: right; font-size: 11px; color: #777; margin-top: 2px; }
.tk { color: #8A8A8A; font-weight: 700; letter-spacing: -2px; margin-left: 4px; }
.tk.read { color: #34B7F1; }
.tk.fail { color: var(--red); letter-spacing: 0; }
.pm .btn.small { margin: 4px 0 0 4px; background: #fff; color: #111; }
.phone-open .main { margin-right: 392px; }

/* Patient-facing pages */
.doc-page { background: var(--bg); }
.doc, .choices { max-width: 820px; margin: 0 auto; padding: 24px 16px 40px; }
.choices { max-width: 560px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 24px; padding: 28px; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--brand); padding-bottom: 12px; margin-bottom: 16px; }
.doc-head h1 { font-size: 22px; }
.doc-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.doc-title { font-weight: 700; color: var(--brand); white-space: nowrap; }
.doc-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin-bottom: 18px; }
.doc-meta span { display: block; font-size: 12px; color: var(--muted); }
.doc-sign { margin-top: 18px; }
.ch-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.choices h1 { font-size: 22px; margin-bottom: 8px; }
.choices h2 { font-size: 17px; margin: 18px 0 8px; }
.flash { background: var(--green-bg); color: var(--green); padding: 10px 14px; border-radius: 8px; font-weight: 600; }

@media (max-width: 1100px) {
  .phone-open .main { margin-right: 0; }
}
@media (max-width: 900px) {
  .cols, .cols.wide-left { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 720px) {
  .phone-btn span[data-i18n] { display: none; }
  .phone { inset: calc(var(--top) + env(safe-area-inset-top, 0px)) 0 0 0; width: auto; }
  .phone-frame { border-width: 0; border-radius: 0; }
  .row2 { grid-template-columns: 1fr; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
  .doc { padding: 18px; margin-top: 0; border-radius: 0; }
  .panel { padding: 16px; }
}

/* Print: bill modal and report only */
@media print {
  body { background: #fff; }
  .topbar, .rail, .main, .phone, .toast, .no-print, .powered { display: none !important; }
  .modal { position: static; background: none; padding: 0; display: block; }
  .modal-card { box-shadow: none; max-height: none; max-width: none; padding: 0; }
  .doc-page .powered { display: flex !important; }
  .doc { border: 0; margin: 0; padding: 0; }
  body.has-modal .main { display: none !important; }
  body:not(.has-modal) .main { display: block !important; }
}

/* ================= Slice 3: owner screens ================= */
a.tab { text-decoration: none; color: inherit; }
.colour-row { display: flex; gap: 10px; align-items: center; }
.colour-row input[type=color] { width: 54px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.colour-row input[name=hex] { max-width: 130px; font-family: inherit; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.brand-prev { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 14px; background: var(--surface-2); }
.bp-top { display: flex; align-items: center; gap: 10px; }
.bp-top .logo { color: #fff; }
.bp-btn { padding: 12px 16px; border-radius: 10px; font-weight: 600; width: max-content; }
.bp-line { border-bottom: 3px solid; padding-bottom: 6px; font-weight: 600; }
.tbl tr.off td { color: var(--muted); }
.meter.big { height: 12px; border-radius: 6px; }
.ready-list { list-style: none; padding: 0; margin: 0; }
.ready-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ready-list li:first-child { border-top: 0; }
.rd-tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; }
.ready-list li.done .rd-tick { background: var(--green); border-color: var(--green); color: #fff; }
.ready-list .btn { flex: none; }
.evidence .tbl td { padding: 6px 8px; }
@media print {
  .view-actions, .back, .tabs { display: none !important; }
  .evidence .panel { break-inside: avoid; border-color: #ccc; }
  .cols { grid-template-columns: 1fr 1fr; }
}

/* ================= Slice 4 ================= */
.outbox { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.outbox li { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.ob-to { font-size: 14px; color: var(--muted); }
.ob-text { background: #DCF8C6; color: #111; border-radius: 8px; padding: 8px 10px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.outbox a.wa.primary { background: #1FA855; border-color: #1FA855; color: #fff; justify-content: center; }
.ob-done { margin: 0; color: var(--green); font-weight: 600; }
.chip.st-pending { background: var(--amber-bg); color: var(--amber); border-color: transparent; }

/* ================= Slice 5: Today board and journey ================= */
.rail-new { color: var(--brand); }
.rail-new svg { stroke: var(--brand); stroke-width: 2.4; }
.today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.today-head h1 { font-size: 26px; font-weight: 600; outline: none; }
.new-btn { font-size: 17px; padding: 13px 22px; border-radius: 12px; gap: 8px; }
.needs { margin-bottom: 20px; }
.needs h2, .board .col-head h2 { font-size: 15px; font-weight: 600; color: var(--muted); text-transform: none; }
.needs h2 { margin-bottom: 8px; }
.needs-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.need { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--amber-bg); border: 1px solid transparent; text-decoration: none; color: var(--ink); }
.need.late { background: var(--red-bg); }
.need:hover { border-color: var(--ink); }
.need-k { font-weight: 600; }
.need-t { font-size: 14px; color: var(--muted); }
.need.late .need-t { color: var(--red); }
.need-a { font-size: 14px; font-weight: 600; color: var(--brand); margin-top: 4px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--r-card); padding: 10px; min-height: 160px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.col-head h2 { color: var(--ink); }
.col-body { display: grid; gap: 8px; }
.col-empty { margin: 4px; font-size: 14px; color: var(--muted); }
.pcard { display: grid; gap: 4px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.pcard:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(15, 25, 40, .08); }
.pcard.attn { border-color: var(--amber); }
.pc-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pc-top .muted { font-size: 13px; }
.pc-time { margin-left: auto; font-size: 12px; color: var(--muted); }
.pc-sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pc-act { font-size: 14px; font-weight: 600; color: var(--accent); }
.pc-st { margin-top: 2px; }

.journey .view-head { margin-bottom: 12px; }
.stepper-bar { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stepper-bar li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; min-width: 0; }
.sb-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-2); flex: none; }
.sb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper-bar li.done { color: var(--green); border-color: transparent; background: var(--green-bg); }
.stepper-bar li.done .sb-dot { background: var(--green); color: #fff; }
.stepper-bar li.now { color: var(--ink); border-color: var(--brand); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand); }
.stepper-bar li.now .sb-dot { background: var(--brand); color: var(--brand-ink); }
.stage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.consent-mini { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.consent-mini span { padding: 3px 10px; border-radius: 999px; }
.consent-mini .yes { background: var(--green-bg); color: var(--green); }
.consent-mini .no { background: var(--surface-2); color: var(--muted); }
.add-inline { margin-top: 10px; font-weight: 600; text-decoration: none; }
.inline-form { margin-top: 10px; padding: 12px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--brand-soft); }
.inline-form .field input { background: var(--surface); }
.who { list-style: none; padding: 0; margin: 6px 0 4px; display: grid; gap: 8px; text-align: left; }
.who li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.who li > span:first-child { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.who .yes > span:first-child { background: var(--green); color: #fff; }
.who .no > span:first-child { background: var(--line); color: var(--muted); }
.who .warn > span:first-child { background: var(--amber); color: #fff; }
.success .who { max-width: 460px; margin: 10px auto; }
.wa-btn, a.wa { background: #1FA855 !important; border-color: #1FA855 !important; color: #fff !important; justify-content: center; }
.full { width: 100%; }

@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .col { min-height: 0; }
  .stepper-bar { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .stepper-bar li { flex-direction: column; padding: 8px 2px; gap: 4px; font-size: 11px; text-align: center; }
  .sb-l { white-space: normal; }
  .new-btn { width: 100%; justify-content: center; }
  .rail-item span { font-size: 11px; }
}

/* ================= Slice 6: flows and the request box ================= */
.today-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.says-btn { border-color: var(--c-amber); color: var(--c-amber); background: var(--c-amber-soft); font-size: 16px; padding: 12px 18px; border-radius: 12px; }
.prob-btn { border-color: var(--c-red); color: var(--c-red); background: var(--c-red-soft); font-size: 16px; padding: 12px 18px; border-radius: 12px; }
.flow-steps { list-style: none; padding: 0; margin: 0 0 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.flow-steps li { font-size: 13px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.flow-steps li.done { background: var(--green-bg); color: var(--green); border-color: transparent; }
.flow-steps li.now { border-color: var(--brand); color: var(--ink); font-weight: 600; }
.flow-card h2 { font-size: 20px; margin-bottom: 14px; }
.flow-card textarea, .flow-card input:not([type=checkbox]):not(.search-in) { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 11px 12px; font-size: 17px; }
.flow-card .num-in { max-width: 200px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.opt { display: grid; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.opt b { font-size: 16px; }
.opt span { font-size: 13px; color: var(--muted); }
.opt:hover, .opt.is-on { border-color: var(--brand); background: var(--brand-soft); }
.opt.tone-red b { color: var(--red); }
.opt.tone-red:hover { border-color: var(--red); background: var(--red-bg); }
.choice.is-on { border-color: var(--brand); background: var(--brand-soft); }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--green); background: var(--green-bg); border-radius: 10px; }
.tbl.review th { width: 38%; color: var(--muted); font-weight: 500; text-align: left; vertical-align: top; }

.cmd { position: relative; flex: 1; max-width: 560px; margin: 0 auto 0 12px; }
.cmd-ico { position: absolute; left: 11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
#cmd { width: 100%; font: inherit; font-size: 15px; padding: 8px 64px 8px 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
#cmd:focus { outline: 2px solid var(--brand); background: var(--surface); }
.cmd-k { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 11px/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; pointer-events: none; }
.cmd-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 25, 40, .18); max-height: 60vh; overflow: auto; }
.cmd-list li { display: grid; gap: 2px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.cmd-list li.is-sel, .cmd-list li:hover { background: var(--brand-soft); }
.ci-t { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.ci-i { width: 22px; text-align: center; }
.ci-p { font-size: 14px; }
.ci-s { font-size: 13px; color: var(--muted); }
.ci-empty { color: var(--muted); font-size: 14px; cursor: default; }
.cmd-open { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }
.cmd-open svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
@media (max-width: 900px) { .cmd-k { display: none; } #cmd { padding-right: 12px; } }
@media (max-width: 720px) {
  .cmd { display: none; }
  .cmd.open { display: block; position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); margin: 0; max-width: none; padding: 9px 12px; background: var(--surface); z-index: 50; border-bottom: 1px solid var(--line); }
  .cmd.open .cmd-ico { left: 23px; }
  .cmd.open .cmd-list { left: 8px; right: 8px; }
  .cmd-open { display: inline-flex; margin-left: auto; }
  .topbar-right { margin-left: 8px; }
  .today-acts { width: 100%; }
  .today-acts .btn { flex: 1 1 100%; justify-content: center; }
}

/* ================= Slice 7: Flow designer ================= */
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dz-card { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); text-decoration: none; color: var(--ink); }
.dz-card:hover { border-color: var(--brand); }
.dz-card span { font-size: 14px; }
.dz-how { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 15px; }
.dz-h2 { margin-top: 18px; }
.dz-list { list-style: none; padding: 0; margin: 0; }
.dz-step { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dz-step.locked { background: var(--surface-2); }
.dz-step.added { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.dz-n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.dz-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.dz-main .muted { font-size: 13px; }
.dz-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dz-add { text-align: center; padding: 4px 0; }
.dz-add .linkbtn { font-size: 13px; text-decoration: none; opacity: .75; }
.dz-add .linkbtn:hover { opacity: 1; }
.dz-opt { margin-bottom: 8px; }
.dz-opt input { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.dz-optr { display: flex; gap: 6px; }
.stepper-bar li.x .sb-dot { border: 2px dashed var(--brand); background: var(--surface); }
.stepper-bar li.x.done .sb-dot { border: 0; background: var(--green); }
.cards.yn { grid-template-columns: repeat(2, minmax(0, 160px)); }
input[type=date] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); }
@media (max-width: 720px) { .dz-step { flex-wrap: wrap; } .dz-acts { width: 100%; justify-content: flex-start; } }

/* ================= Slice 8: flow map ================= */
.fmap { margin: 0 0 16px; overflow-x: auto; padding-bottom: 4px; }
.fm { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 0; min-width: max-content; }
.fm-seg { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 0 22px 0 0; }
.fm-seg:not(:last-child)::after { content: ""; position: absolute; right: 2px; top: 50%; width: 18px; height: 3px; background: var(--line); border-radius: 2px; }
.fm-seg.done::after { background: var(--green); }
.fm-fork { padding: 8px 22px 8px 10px; border-left: 2px dashed var(--line); border-radius: 10px 0 0 10px; }
.fm-fork.done { border-left-color: var(--green); }
.fm-cap { font-size: 12px; color: var(--muted); }
.fm-node { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-size: 14px; color: var(--muted); cursor: default; white-space: nowrap; max-width: 260px; }
.fm-l { overflow: hidden; text-overflow: ellipsis; }
.fm-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface-2); flex: none; }
.fm-node.done { border-color: var(--green); background: var(--green-bg); color: var(--green); cursor: pointer; }
.fm-node.done .fm-dot { background: var(--green); color: #fff; font-size: 13px; }
.fm-node.now { border-color: var(--brand); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 4px var(--brand-soft); cursor: pointer; }
.fm-node.now .fm-dot { background: var(--brand); color: var(--brand-ink); }
.fm-node.na { opacity: .45; border-style: dashed; }
.fm-node.added:not(.done) { border-style: dashed; border-color: var(--brand); }
.fm-more { border: 0; background: none; color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; text-align: left; padding: 2px 4px; }
.need.draft { background: var(--c-blue-soft); }
@media (max-width: 720px) {
  .fm { flex-direction: column; min-width: 0; }
  .fm-seg { padding: 0 0 18px 0; }
  .fm-seg:not(:last-child)::after { right: auto; left: 22px; top: auto; bottom: 3px; width: 3px; height: 13px; }
  .fm-fork { padding: 8px 8px 18px 10px; }
  .fm-node { max-width: 100%; white-space: normal; }
}
@media (prefers-reduced-motion: no-preference) { .fm-node.now { transition: box-shadow .2s; } }

/* ================= Slice 9: Home with central prompt ================= */
.ask { text-align: center; padding: 36px 0 28px; max-width: 760px; margin: 0 auto; }
.ask h1 { font-size: 28px; font-weight: 600; margin-bottom: 18px; outline: none; }
.ask-box { position: relative; text-align: left; }
.ask-box > svg { position: absolute; left: 20px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
#homeAsk { width: 100%; font: inherit; font-size: 18px; padding: 17px 20px 17px 54px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: 0 6px 22px rgba(15, 25, 40, .08); }
#homeAsk:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), 0 6px 22px rgba(15, 25, 40, .08); }
.ask .cmd-list { top: calc(100% + 8px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.chips.left { justify-content: flex-start; margin-top: 0; }
.chip-a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
.chip-a:hover { border-color: var(--brand); background: var(--brand-soft); }
.chip-a.warn { border-color: var(--amber); background: var(--amber-bg); }
.chip-a.ghost { border-style: dashed; color: var(--brand); }
.ask-hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.board-title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 6px 0 10px; }
.search-in.big { font-size: 17px; padding: 13px 16px; margin-bottom: 10px; }
.warnbox { background: var(--amber-bg); }
body.on-home .topbar .cmd { visibility: hidden; }
.rail-ask svg { stroke: var(--brand); stroke-width: 2.2; }
.rail-ask { color: var(--brand); }
@media (max-width: 720px) {
  .ask { padding: 18px 0 18px; }
  .ask h1 { font-size: 22px; }
  #homeAsk { font-size: 16px; padding: 14px 16px 14px 46px; }
  .ask-box > svg { left: 16px; }
  body.on-home .cmd-open { display: none; }
  .rail-ask svg { width: 30px; height: 30px; }
}

/* ================= Slice 10: staff app refinements ================= */
/* Centre the working area on wide screens instead of hugging the rail. */
.main { max-width: none; padding-inline: max(28px, calc((100vw - var(--rail) - 1240px) / 2)); }
.main > * { max-width: 1240px; }
@media (max-width: 720px) { .main { padding-inline: 14px; } }

/* Insights dashboard (was clashing with the Today board's .board grid). */
.dash { display: block; }

/* Rail: a clear active marker, not just a tint. */
.rail-item { position: relative; transition: background .15s, color .15s; }
.rail-item.is-active::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.rail-ask svg { stroke-width: 1.9; }
@media (max-width: 720px) { .rail-item.is-active::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; } }

/* Home: one consistent icon set; suggestions (live counts) stand out, shortcuts stay quiet. */
.ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ask { padding-top: 28px; max-width: 920px; }
.ask-box { max-width: 760px; margin: 0 auto; }
.ask .chips + .chips { margin-top: 10px; }
.chip-a { transition: border-color .15s, background .15s; min-height: 38px; }
.chip-a .ico { color: var(--muted); }
.chip-a:hover .ico { color: var(--brand); }
.chip-a.sug { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-soft); font-weight: 600; }
.chip-a.sug .ico { color: var(--brand); }
.chip-a.sug.warn { border-color: var(--amber); background: var(--amber-bg); }
.chip-a.sug.warn .ico { color: var(--amber); }
.chips.quiet .chip-a { background: transparent; }
.chips.quiet .chip-a:hover { background: var(--surface); }
.chip-a.danger .ico { color: var(--red); }
.chip-a.danger:hover { border-color: var(--red); background: var(--red-bg); }

/* "Needs you now": icon + side stripe so urgency isn't carried by colour alone. */
.needs h2 { display: flex; align-items: center; gap: 4px; }
.needs h2 .count { background: var(--red-bg); color: var(--red); font-weight: 600; }
.need { position: relative; padding: 12px 14px 12px 17px; gap: 3px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.need::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--amber); }
.need.late::before { background: var(--red); }
.need.draft::before { background: var(--c-blue); }
.need, .need.late, .need.draft { background: var(--surface); }
.need:hover { border-color: var(--muted); box-shadow: 0 2px 10px rgba(15, 25, 40, .07); }
.need-k { display: flex; align-items: flex-start; gap: 8px; }
.need-i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--amber-bg); color: var(--amber); flex: none; margin-top: -1px; }
.need.late .need-i { background: var(--red-bg); color: var(--red); }
.need-t, .need-a { padding-left: 34px; }
.need-a { margin-top: 2px; }

/* Today board: columns read as lanes, counts as pills. */
.board-title { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.col { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface-2)); }
.col-head .count { background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.pcard { transition: border-color .15s, box-shadow .15s; }
.pcard.attn { box-shadow: inset 3px 0 0 var(--amber); }
.pc-top b { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .rail-item, .chip-a, .need, .pcard { transition: none; } }
/* Flows as a conversation */
.flow.chat { max-width: 760px; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.turn { display: grid; gap: 8px; }
.turn .q { display: flex; align-items: flex-start; gap: 10px; }
.bot-av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.bot-av svg { width: 17px; height: 17px; fill: none; stroke: var(--brand); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.turn.done .q { color: var(--muted); font-size: 14px; align-items: center; }
.turn.done .bot-av { width: 24px; height: 24px; background: var(--surface-2); }
.turn.done .bot-av svg { width: 13px; height: 13px; stroke: var(--muted); }
.turn .a { justify-self: end; max-width: 85%; display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: flex-end; text-align: right;
  padding: 9px 14px; border-radius: 16px 16px 4px 16px; background: var(--brand); color: var(--brand-ink); border: 0; cursor: pointer; font: inherit; font-size: 15px; }
.turn .a:hover .a-edit, .turn .a:focus-visible .a-edit { opacity: 1; text-decoration: underline; }
.a-v { font-weight: 600; word-break: break-word; }
.a-edit { font-size: 12px; opacity: .75; }
.turn.now { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 18px; box-shadow: 0 4px 18px rgba(15, 25, 40, .06); }
.turn.now.review { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.turn.now h2 { font-size: 19px; font-weight: 600; margin: 0; outline: none; }
.q-n { display: block; font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.a-host { padding-left: 40px; min-width: 0; }
.turn.now .form-err { margin: 0 0 0 40px; }
.turn.now .actions { padding-left: 40px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.a-host textarea, .a-host input:not([type=checkbox]):not([type=date]):not(.search-in):not(.otp) { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 11px 12px; font-size: 17px; }
.a-host .num-in { max-width: 200px; }
.chat-note { margin-top: 14px; }
/* Owners: process map above the conversation */
.flow.chat.with-map { max-width: 1040px; }
.flow.chat.with-map .thread, .flow.chat.with-map .chat-note { max-width: 760px; }
.map-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 18px; }
.map-box > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; }
.map-box > summary::-webkit-details-marker { display: none; }
.map-box > summary::before { content: "▸"; font-size: 12px; transition: transform .15s; }
.map-box[open] > summary::before { transform: rotate(90deg); }
.map-box[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.map-box .fmap { margin-bottom: 12px; }
.turn.review .tbl.review { display: none; }   /* the answers are already in the thread above */
.turn.review .a-host:empty, .turn.review .a-host:not(:has(.info)) { display: none; }
@media (max-width: 720px) {
  .a-host, .turn.now .actions { padding-left: 0; }
  .turn.now .form-err { margin-left: 0; }
  .turn.now { padding: 14px; }
  .turn .a { max-width: 92%; }
  .turn.now .actions .btn.primary { flex: 1; }
}

/* Owner pages: to-do on Home, Centre task cards, Records places — same look as Today */
.ok-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 14px; color: var(--green); }
.ok-row span { display: inline-flex; align-items: center; gap: 6px; }
.owner-todo .need-i .ico, .ok-row .ico { width: 16px; height: 16px; }
.count.warn { background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.page-ask { max-width: 760px; margin: 0 0 22px; }
.page-ask input { width: 100%; font: inherit; font-size: 16px; padding: 13px 18px 13px 50px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: 0 4px 16px rgba(15, 25, 40, .06); }
.page-ask input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.page-ask > svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.page-ask.has-mic input { padding-right: 56px; }
.task-group { margin: 0 0 24px; }
.task-group > h2, .ico-h { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.tg-i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); flex: none; }
.tg-i .ico, .tc-i .ico { width: 17px; height: 17px; }
.tg-i svg, .tc-i svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.task-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; min-height: 56px; }
.task-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(15, 25, 40, .07); }
.tc-i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--brand); flex: none; }
.tc-t { font-size: 15px; font-weight: 500; line-height: 1.3; }
.tc-n { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; }
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.place-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.place-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(15, 25, 40, .07); }
.place-card > span:last-child { display: grid; gap: 2px; min-width: 0; }
.place-card b { font-size: 15px; font-weight: 600; }
.place-card span span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pc-n { font-style: normal; font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--muted); }
.pc-n.warn { color: var(--amber); } .pc-n.late { color: var(--red); }
#rr { margin: -12px 0 18px; max-width: 760px; }
@media (max-width: 720px) { .task-grid { grid-template-columns: 1fr 1fr; } .task-card { padding: 10px; gap: 8px; } .tc-t { font-size: 14px; } .place-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .task-card, .place-card { transition: none; } }

/* Users and access */
.us-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.us-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.us-list li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.us-list li.off { opacity: .6; }
.us-main { min-width: 0; flex: 1; display: grid; gap: 4px; }
.us-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.us-act { display: flex; gap: 6px; flex-wrap: wrap; }
.acc { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.acc-owner { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.acc-auditor { background: var(--c-indigo-soft); color: var(--c-indigo); border-color: transparent; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--muted); color: var(--muted); }
.fchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); }
.fchip .ico { width: 13px; height: 13px; }
.us-lbl { font-weight: 600; margin: 14px 0 6px; }
.acc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acc-cards .opt { cursor: pointer; }
.us-sets { margin-bottom: 8px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-bottom: 14px; }
.feat { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.feat:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.feat input { margin-top: 4px; }
.feat-i { color: var(--brand); flex: none; } .feat-i .ico { width: 18px; height: 18px; }
.feat > span:last-child { display: grid; gap: 2px; } .feat b { font-size: 14px; } .feat span span { font-size: 12px; color: var(--muted); }
pre.sql { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 720px) { .acc-cards { grid-template-columns: 1fr; } }

/* Grievance desk */
.gd-contact { display: flex; gap: 12px; align-items: center; }
.gv-who { background: var(--surface-2, #F4F7FB); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0 16px; }
.gv-who p { margin: 0 0 4px; }
.gd-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.gd-stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gd-h { font-size: 14px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.tag-new { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); }
@media (max-width: 720px) { .gd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Draft privacy policy */
.policy h2 { font-size: 20px; } .policy h3 { font-size: 16px; margin: 18px 0 6px; } .policy ul { margin: 0; padding-left: 20px; } .policy li { margin: 3px 0; }
.adult-g { margin: 4px 0 10px; }

/* Training quiz and evidence extras */
.training .q-n { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.training h2 { font-size: 20px; margin: 14px 0 8px; }
.tq { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 6px; margin: 0 0 12px; }
.tq legend { font-weight: 600; padding: 0 4px; }
.tq .check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.ropa h3 { font-size: 15px; margin: 14px 0 6px; }
.ropa ul { margin: 0; padding-left: 18px; }

/* Copy of personal data (access request) */
.copy-doc h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; }
.copy-doc ul { margin: 0; padding-left: 18px; }
.copy-doc p { margin: 4px 0; }

/* Patient check: confirm a guessed patient, same-name and near-spelling warnings */
.who-card { display: grid; gap: 2px; padding: 14px 16px; border: 2px solid var(--brand); border-radius: 12px; background: var(--brand-soft); margin: 8px 0 10px; }
.who-card b { font-size: 18px; }
.who-card span { font-size: 15px; }
.who-card .muted { font-size: 13px; }
.dupe-warn { margin: 12px 0 6px; padding: 8px 12px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); font-size: 14px; font-weight: 600; }
.choice.dupe { border-color: var(--amber); }

/* Prompt answers and "didn't understand" */
.cmd-list li.ci-answer { background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 4px; gap: 6px; }
.cmd-list li.ci-answer.is-sel, .cmd-list li.ci-answer:hover { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.an-tag { font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); }
.an-row, .an-agreed { display: flex; flex-wrap: wrap; gap: 6px; }
.an-s { font-size: 14px; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.an-s.an-red { color: var(--red); background: var(--red-bg); border-color: transparent; font-weight: 600; }
.an-s.an-amber { color: var(--amber); background: var(--amber-bg); border-color: transparent; font-weight: 600; }
.an-s.an-green { color: var(--green); background: var(--green-bg); border-color: transparent; }
.ci-miss { display: grid; gap: 2px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; border-radius: 0; }
.ci-miss b { color: var(--ink); font-weight: 600; }

/* Voice typing */
.mic-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.mic-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mic-btn:hover { background: var(--brand-soft); color: var(--brand); }
.has-mic #homeAsk { padding-right: 56px; }
.cmd.has-mic .cmd-k { display: none; }
.cmd.has-mic #cmd { padding-right: 44px; }
.cmd .mic-btn { width: 32px; height: 32px; right: 4px; }
.cmd .mic-btn svg { width: 17px; height: 17px; }
.listening .mic-btn { background: var(--red); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .listening .mic-btn { animation: mic-pulse 1.4s ease-out infinite; } }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* Phone: each chip group is one swipeable row so "Needs you now" stays near the top. */
@media (max-width: 720px) {
  .ask .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -14px; padding: 2px 14px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .ask .chips::-webkit-scrollbar { display: none; }
  .ask .chips .chip-a { flex: none; white-space: nowrap; scroll-snap-align: start; }
  .ask-hint { display: none; }
  .demo-badge { font-size: 11px; padding: 1px 7px; }
  .brand-name { max-width: 34vw; }
}

/* ================= v29: vendors, hosting, poster, coverage map, two-step ================= */
.vd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vd-list li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; flex-wrap: wrap; }
.vd-list .chips { margin-top: 6px; }
.checks { display: grid; gap: 6px; margin: 4px 0 12px; }
.ts-qr { background: #fff; display: inline-block; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.ts-qr svg { display: block; max-width: 100%; height: auto; }
.ts-steps { margin: 8px 0; padding-left: 20px; }
.cv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.cv-stats .panel { margin: 0; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 640px) { .cv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.cv-list li:first-child { border-top: 0; }
.cv-n { font-weight: 700; color: var(--muted); text-align: right; padding-top: 1px; }
.cv-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.cv-todo .cv-n { color: #B4235A; }
.cv-na { opacity: .7; }
.cv-note { font-style: italic; }
@media (max-width: 560px) { .cv-list li { grid-template-columns: 28px minmax(0, 1fr); } .cv-act { grid-column: 2; align-items: flex-start; flex-direction: row; } }
.poster { background: #fff; color: #111; border: 2px solid var(--brand, #1E5AA8); border-radius: 14px; padding: 28px; max-width: 760px; margin: 0 auto 16px; }
.poster h1 { margin: 0 0 4px; font-size: 28px; color: var(--brand, #1E5AA8); }
.poster h2 { margin: 0 0 16px; font-size: 20px; }
.po-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 15px; line-height: 1.55; }
.po-cols ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.po-foot { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 20px; border-top: 1px solid #ccc; padding-top: 16px; }
.po-qr { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.po-qr svg { width: 180px; height: 180px; }
.po-qr small { font-size: 11px; word-break: break-all; max-width: 200px; text-align: center; }
.po-small { font-size: 12px; color: #555; }
@media (max-width: 640px) { .po-cols, .po-foot { grid-template-columns: 1fr; } .poster { padding: 18px; } }
@media print {
  .poster { border-width: 3px; max-width: none; margin: 0; }
  .poster ~ *, .view-head, .info, .warnbox { display: none !important; }
  .cv-list li { break-inside: avoid; }
  .cv-sec { break-inside: auto; }
  .chips.left, .cv-act .btn { display: none !important; }
}