/* Copyright (c) 2026 Jake Fourie. All rights reserved. Proprietary and confidential.
   No part of this software may be copied, modified or distributed without written permission. Build mark: pf-a6fcd73d219f7009 */
/* Clarimap layer, loaded after portal.css. Layout: brand band across the top, a section menu down the left
   (a scrolling strip on phones), the working area on the right. Three interface styles per practice: dark, light, follow device. */

.app { --ui: var(--accent); --on-ui: #ffffff; display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); background: var(--bg); color: var(--ink); --cm-1: #0f9f8c; --cm-2: #101826; }
.app > .demo, .app > .band { grid-column: 1 / -1; }
.app > .tabs { grid-column: 1; grid-row: 3; flex-direction: column; gap: 1px; overflow: auto; border-bottom: 0; border-right: 1px solid var(--line); padding: 10px 10px 12px; }
.app > .work { grid-column: 2; grid-row: 3; min-width: 0; }

.app[data-look="dark"] {
  --bg: #070b14; --surface: #0c1422; --raised: #131d30; --ink: #e9eef7; --ink-soft: #9aa7bd; --line: #202e47; --link: #3d5277;
  --ok: #5fd6a0; --warn: #f0c067; --bad: #ff9080; --idle: #7c8aa3; --ok-bg: #0f2e25; --warn-bg: #33280f; --bad-bg: #3b1a17;
  --shadow: 0 0 0 1px rgba(120, 220, 255, 0.05), 0 14px 44px rgba(0, 0, 0, 0.55);
  --accent-ink: color-mix(in srgb, var(--accent) 58%, #ffffff); --cm-1: #38e0c8; --cm-2: #f4f7fb; color-scheme: dark;
}
.app[data-look="light"] {
  --bg: #f2f3f5; --surface: #fbfbfc; --raised: #ffffff; --ink: #1b1f24; --ink-soft: #5c6470; --line: #dfe2e7; --link: #c3c8d0;
  --ok: #2f6f4f; --warn: #a36a12; --bad: #a8402f; --idle: #8a8f98; --ok-bg: #e3efe6; --warn-bg: #f6ead2; --bad-bg: #f6e0da;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.08); color-scheme: light;
}
@media (prefers-color-scheme: dark) { .app[data-look="auto"] { --cm-1: #38e0c8; --cm-2: #f4f7fb; --accent-ink: color-mix(in srgb, var(--accent) 58%, #ffffff); } }

/* Dark style: depth from a soft glow in the practice's accent colour, thin luminous edges, glass panels. */
.app[data-look="dark"] .main { background: radial-gradient(900px 420px at 85% -8%, rgba(70, 120, 255, 0.13), transparent 70%), radial-gradient(700px 380px at -5% 105%, rgba(56, 224, 200, 0.08), transparent 70%), var(--bg); }
.app[data-look="dark"] .band { background: linear-gradient(100deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #070b14) 70%); border-bottom-color: color-mix(in srgb, var(--ui) 55%, transparent); position: relative; z-index: 3; }
.app[data-look="dark"] .card, .app[data-look="dark"] .tile, .app[data-look="dark"] .callout, .app[data-look="dark"] .drop { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.app[data-look="dark"] .tile { border-top-color: var(--ui); background: linear-gradient(180deg, var(--raised), var(--surface)); }
.app[data-look="dark"] .tile:hover { border-color: var(--ui); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5); }
/* Controls: a solid fill in the practice accent (lightened in code until it reads on dark), with dark text. Never a tint of the accent over navy, which turns warm colours muddy. */
.app[data-look="dark"] .btn { background: var(--ui); border-color: var(--ui); color: var(--on-ui); }
.app[data-look="dark"] .btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ui) 86%, #ffffff); box-shadow: 0 0 18px color-mix(in srgb, var(--ui) 35%, transparent); }
.app[data-look="dark"] .btn.alt { background: transparent; border-color: #34466a; color: var(--ink); }
.app[data-look="dark"] .btn.alt:hover:not(:disabled) { border-color: var(--ui); background: rgba(255, 255, 255, 0.05); box-shadow: none; }
.app[data-look="dark"] .btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.app[data-look="dark"] .seg button[aria-pressed="true"], .app[data-look="dark"] .cal .day.today .dn, .app[data-look="dark"] .tab .ct, .app[data-look="dark"] .item.top3 .rk { background: var(--ui); color: var(--on-ui); box-shadow: none; }
.app[data-look="dark"] .tab:hover { background: rgba(255, 255, 255, 0.05); }
.app[data-look="dark"] .tab[aria-current="page"] { background: rgba(255, 255, 255, 0.07); border-left-color: var(--ui); }
.app[data-look="dark"] .demo { background: #0c1422; border-bottom-color: var(--line); color: var(--ink-soft); }
.app[data-look="dark"] .demo b { color: var(--warn); }
.app[data-look="dark"] .accent-ink, .app[data-look="dark"] .links a, .app[data-look="dark"] .crumbs button, .app[data-look="dark"] a { color: var(--ui); }
.app[data-look="dark"] .preset[aria-pressed="true"], .app[data-look="dark"] .chip.ms { border-color: var(--ui); box-shadow: none; }
.app[data-look="dark"] .callout { border-left-color: var(--ui); }
.app[data-look="dark"] .callout.warn { border-left-color: var(--warn); }
.app[data-look="dark"] .prog i { background: var(--ui); }
:focus-visible { outline-color: var(--ui); }
.app[data-look="dark"] .stage { background-image: radial-gradient(color-mix(in srgb, var(--link) 70%, transparent) 1px, transparent 1px); }
.app[data-look="dark"] .node-main { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.app[data-look="dark"] .node.root .node-main { background: var(--raised); color: var(--ink); border: 1px solid var(--ui); box-shadow: 0 0 24px color-mix(in srgb, var(--ui) 25%, transparent); }
.app[data-look="dark"] .node.root .meta { color: var(--ink-soft); }
.app[data-look="dark"] .node.top .node-main { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 78%, #ffffff 0%), color-mix(in srgb, var(--c) 62%, #05080f)); border-color: color-mix(in srgb, var(--c) 60%, #ffffff); }
.app[data-look="dark"] .canvas path { stroke: var(--link); }
.app[data-look="dark"] .toast { background: var(--raised); color: var(--ink); border: 1px solid var(--ui); }
.app[data-look="dark"] .logo-box { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.app[data-look="dark"] .eyebrow { color: var(--cm-1); }
.app[data-look="dark"] dialog::backdrop { background: rgba(3, 6, 12, 0.7); }

h1 { font-size: 1.7rem; letter-spacing: -0.02em; }
.btn, .tab, .tile, .preset, .node-main, .chip, .pickbtn, .logoopt { transition: background-color 0.18s, border-color 0.18s, box-shadow 0.22s, color 0.18s, transform 0.18s; }
.tile:hover { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Section menu */
.tab { text-align: left; border: 0; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; padding: 7px 10px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--accent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, transparent), transparent); }
.tab .ct { margin-left: auto; }
.navh { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); padding: 12px 10px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navh:first-child { padding-top: 2px; }
.navfoot { margin-top: auto; padding: 14px 10px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft); }
.cmlogo { flex: none; display: block; }

/* Client picker */
.pick { position: relative; }
.pickbtn { display: flex; gap: 8px; align-items: baseline; background: color-mix(in srgb, var(--on-brand) 10%, transparent); color: var(--on-brand); border: 1px solid color-mix(in srgb, var(--on-brand) 30%, transparent); border-radius: 6px; padding: 6px 10px; max-width: 100%; }
.pickbtn span { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-brand-soft); }
.pickbtn b { font-weight: 600; }
.pickbtn i { font-style: normal; font-size: 0.7rem; }
.pickpanel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: min(320px, calc(100vw - 32px)); background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 10px; display: grid; gap: 8px; }
.pickpanel input { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; width: 100%; }
.picklist { display: grid; gap: 2px; max-height: 280px; overflow: auto; }
.picklist button { display: grid; gap: 1px; text-align: left; background: none; border: 0; border-radius: 4px; padding: 6px 8px; }
.picklist button[hidden] { display: none; }
.picklist button:hover, .picklist button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.picklist span { font-size: 0.76rem; color: var(--ink-soft); }
.app[data-band="light"] .pickbtn { background: var(--surface); color: var(--ink); border-color: var(--line); }
.app[data-band="light"] .pickbtn span { color: var(--ink-soft); }
.viewing { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); font-size: 0.8rem; color: var(--ink-soft); padding-block: 6px; }
.viewing b { color: var(--ink); }

/* Next steps */
.item { grid-template-columns: auto auto 1fr auto; }
.item .rk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--line); color: var(--ink); }
.item.top3 .rk { background: var(--brand-2); color: var(--on-brand); }
.item > input[type="checkbox"]:first-child { grid-column: 2; }
.item > span:first-child:not(.rk) { grid-column: 1 / 3; }
.item .t { grid-column: 3; }
.item .pr { grid-column: 4; display: flex; gap: 4px; align-items: center; }
.item .s { grid-column: 3 / 5; }
.item select.pill { border: 0; padding: 3px 6px; font-weight: 600; font-size: 0.74rem; cursor: pointer; }
.mv { background: none; border: 1px solid var(--line); border-radius: 4px; width: 26px; height: 26px; padding: 0; font-size: 0.6rem; color: var(--ink-soft); }
.mv:hover { color: var(--ink); border-color: var(--accent); }
.msrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.msrow select, .msrow input { background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }

/* Shared pieces */
.pad { padding: 14px; display: grid; gap: 12px; }
.pad0 { display: grid; gap: 12px; }
.field { position: relative; }
.field input[type="number"], .field input[type="search"], .acts input[type="search"], .addline input[type="search"] { background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; width: 100%; }
.acts { align-items: center; }
.acts .grow { flex: 1; min-width: 180px; width: auto; }
.micb { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); padding: 0; }
.micb:hover { color: var(--ink); border-color: var(--accent); }
.micb.live { background: var(--bad); border-color: var(--bad); color: #fff; animation: cm-pulse 1.2s infinite; }
.field textarea { padding-right: 42px; }
.callout.warn { border-left-color: var(--warn); }
tr[hidden] { display: none; }
tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
.card ul, .sum ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
audio { width: 100%; }
.reclive { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; color: var(--bad); font-variant-numeric: tabular-nums; }
.reclive i { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: cm-pulse 1.2s infinite; }
h2 .pill { vertical-align: middle; margin-left: 6px; font-family: var(--body); letter-spacing: 0; }
.agtext { background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-size: 0.9rem; max-height: 260px; overflow: auto; }
.chip.ext { border-style: dashed; border-color: var(--cm-1); color: var(--ink-soft); background: color-mix(in srgb, var(--cm-1) 8%, transparent); }
.touchhint { display: none; }
@media (pointer: coarse) { .touchhint { display: block; position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 10px; font-size: 0.72rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; pointer-events: none; } }

/* Programme and tools */
.pg { overflow: hidden; }
.pghead { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 12px 14px; }
.pghead .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--line); }
.pg.isdone .pghead .num { background: var(--ok-bg); color: var(--ok); }
.pghead .tt { display: grid; gap: 2px; margin-right: auto; min-width: 0; }
.pghead[aria-expanded="true"] { border-bottom: 1px solid var(--line); }
.pgbody { padding: 14px; display: grid; gap: 12px; }
.pgbody p { margin: 0; }
.tile.tool { border-top-width: 1px; cursor: default; }
.tile.tool:hover { transform: none; }
.tile.tool .tt { font-size: 1.02rem; }

/* Platform console */
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.logoopt { display: grid; gap: 6px; justify-items: center; padding: 18px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); }
.logoopt[aria-pressed="true"] { border-color: var(--cm-1); box-shadow: 0 0 0 1px var(--cm-1), 0 0 28px color-mix(in srgb, var(--cm-1) 25%, transparent); }
.logoopt .wm { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.logoopt b { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }

/* Modal notice */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(3, 6, 12, 0.66); display: grid; place-items: center; padding: 16px; }
.mbox { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 20px; width: min(460px, 100%); display: grid; gap: 12px; }
.mbox p { margin: 0; color: var(--ink-soft); }

/* Movement. Entrance effects run once when a screen opens, never on each keystroke. All motion stops for people who ask for reduced motion (rule in portal.css). */
@keyframes cm-rise { from { opacity: 0; transform: translateY(16px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cm-pop { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: none; } }
@keyframes cm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cm-pulse { 50% { opacity: 0.45; } }
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }
.main.enter .page > * { animation: cm-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.main.enter .page > *:nth-child(2) { animation-delay: 0.06s; } .main.enter .page > *:nth-child(3) { animation-delay: 0.12s; } .main.enter .page > *:nth-child(4) { animation-delay: 0.18s; }
.main.enter .page > *:nth-child(5) { animation-delay: 0.24s; } .main.enter .page > *:nth-child(n+6) { animation-delay: 0.3s; }
.main.enter .tile { animation: cm-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.main.enter .tile:nth-child(2) { animation-delay: 0.07s; } .main.enter .tile:nth-child(3) { animation-delay: 0.14s; } .main.enter .tile:nth-child(4) { animation-delay: 0.21s; } .main.enter .tile:nth-child(n+5) { animation-delay: 0.28s; }
.main.enter .node { animation: cm-pop 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--d, 0) * 90ms); }
.main.enter .canvas path { stroke-dasharray: 1; animation: cm-draw 0.7s 0.12s ease-out both; }
.toast { animation: cm-rise 0.3s both; }
.pickpanel, .mbox { animation: cm-pop 0.18s both; }
.modal { animation: cm-fade 0.18s both; }

/* Opening screen */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(700px 480px at 50% 42%, #10233a, #05080f 70%); color: #f4f7fb; transition: opacity 0.5s, transform 0.5s; --cm-1: #38e0c8; --cm-2: #f4f7fb; font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif; }
.splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.sp-in { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 24px; }
.sp-in img { max-height: 64px; max-width: 220px; }
.sp-w { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; background: linear-gradient(90deg, #f4f7fb 30%, #38e0c8); -webkit-background-clip: text; background-clip: text; color: transparent; animation: cm-rise 0.7s 0.55s both; }
.sp-w.sm { font-size: clamp(1.5rem, 5vw, 2.2rem); animation-delay: 0.15s; }
.sp-t { font-size: 0.95rem; color: #9fb0c8; letter-spacing: 0.02em; animation: cm-rise 0.7s 0.8s both; }
.sp-p { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; color: #9fb0c8; animation: cm-rise 0.7s 0.5s both; }
.splash .cmlogo { filter: drop-shadow(0 0 18px rgba(56, 224, 200, 0.45)); }
.splash .cmlogo .l { stroke-dasharray: 1; animation: cm-draw 0.9s ease-out both; }
.splash .cmlogo .n { transform-box: fill-box; transform-origin: center; animation: cm-pop 0.5s 0.5s both; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); }
  .app > .tabs { grid-column: 1; grid-row: 3; flex-direction: row; align-items: center; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line); padding: 4px max(12px, env(safe-area-inset-right, 0px)) 4px max(12px, env(safe-area-inset-left, 0px)); }
  .app > .work { grid-column: 1; grid-row: 4; }
  .tab { border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; white-space: nowrap; padding: 9px 10px 7px; flex: none; }
  .tab[aria-current="page"] { border-bottom-color: var(--accent); background: none; }
  .navh { flex: none; padding: 0 4px 0 12px; font-size: 0.6rem; max-width: 9rem; border-left: 1px solid var(--line); }
  .navh:first-child { padding-left: 0; border-left: 0; }
  .navfoot { display: none; }
  .demo span:not(.sp) { display: none; }
  .band { gap: 8px 12px; padding-block: 8px; }
  .brandmark .tg { display: none; }
  .pickpanel { right: auto; left: 0; }
}
@media (max-width: 860px) {
  .item { grid-template-columns: auto auto 1fr; }
  .item .pr { grid-column: 3; justify-self: start; }
  .item .s { grid-column: 3; }
  .item > .pill { grid-column: 3; }
}

/* Help */
.helpt { padding: 0; }
.helpt summary { padding: 12px 14px; font-weight: 600; cursor: pointer; }
.helpt[open] summary { border-bottom: 1px solid var(--line); }
.helpt ol, .mbox ol { margin: 0; padding: 12px 14px 12px 34px; display: grid; gap: 6px; }
.mbox ol { padding: 0 0 0 20px; }
.helpt .note { padding: 0 14px 12px; }
.diag { display: grid; gap: 6px; font-size: 0.88rem; }
.diag div { display: grid; grid-template-columns: auto 11rem 1fr; gap: 10px; align-items: center; }
@media (max-width: 600px) { .diag div { grid-template-columns: auto 1fr; } .diag div span:last-child { grid-column: 2; } }
.addline input[type="search"] { flex: 1; }

/* ---- Clarimap brand pass: navy, teal and white, flat surfaces and clean lines. No glows, no blur, one border weight. ---- */
.app[data-look="dark"] { --bg: #080d18; --surface: #0d1626; --raised: #131e33; --line: #22304a; --link: #3a4d70; }
.app[data-look="dark"] .main { background: var(--bg); }
.app[data-look="dark"] .band { background: var(--brand); border-bottom: 1px solid var(--line); box-shadow: none; }
.app[data-look="dark"] .card, .app[data-look="dark"] .tile, .app[data-look="dark"] .callout, .app[data-look="dark"] .drop { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.app[data-look="dark"] .tile { background: var(--surface); border-top: 3px solid var(--ui); }
.app[data-look="dark"] .tile:hover, .app[data-look="dark"] .btn:hover:not(:disabled) { box-shadow: none; }
.app[data-look="dark"] .node-main { box-shadow: none; }
.app[data-look="dark"] .node.root .node-main { box-shadow: none; border-width: 2px; }
.app[data-look="dark"] .node.top .node-main { background: var(--c); border-color: var(--c); }
.app[data-look="dark"] .stage { background-image: radial-gradient(#1a2740 1px, transparent 1px); }
.app[data-look="dark"] .viewing { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card, .callout, .drop, .cal, dialog, .mbox, .pickpanel { border-radius: 10px; }
.tile, .logoopt { border-radius: 12px; }
.btn, .tab, .x, .preset, .field input, .field select, .field textarea, .addline input, .seg, .band select, .band .ghost, .pickbtn, .node-main, .chip, .stepper button, .mv, .crumbs, .legend, .toast { border-radius: 8px; }
.btn { padding: 8px 14px; font-weight: 600; }
.btn.sm { padding: 5px 10px; }
.tab { border-radius: 0 8px 8px 0; }
.eyebrow { letter-spacing: 0.14em; }
.logoopt[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--cm-1); }
.splash { background: #080d18; }
.splash .cmlogo { filter: none; }
.sp-w { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #f4f7fb; }
.navh { padding: 14px 10px 8px; line-height: 1.2; }
.navh:first-child { padding-top: 4px; }
.tile.new { border-top: 2px dashed var(--line); }
@media (max-width: 900px) { .navh, .navh:first-child { padding: 0 4px 0 12px; } .navh:first-child { padding-left: 0; } }

.linkb { background: none; border: 0; padding: 0; margin-left: 8px; color: var(--ui); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tile[hidden] { display: none; }

/* Back button and breadcrumb trail */
.navbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 7px; font-size: 0.8rem; }
.navbar .crumbs { margin-right: auto; background: none; border: 0; padding: 0; font-size: 0.84rem; }
.navbar .own { color: var(--ink-soft); }
.navbar .own b { color: var(--ink); }
.backb { white-space: nowrap; font-weight: 600; }
.crumbs button { color: var(--ui); }
.maptools .backb { background: var(--surface); }

/* Menu items keep their height when the menu is taller than the screen: the menu scrolls instead of squashing headings. */
.app > .tabs > * { flex: none; }

/* ---- Phones ---- */
/* Keep clear of the camera cut-out, status bar and home indicator when installed to the home screen. */
.app { padding-top: env(safe-area-inset-top, 0px); }
.main { padding-bottom: env(safe-area-inset-bottom, 0px); }
.splash { padding-top: env(safe-area-inset-top, 0px); }
@media (max-width: 700px) {
  /* Prototype strip: one slim row that scrolls sideways, labels dropped. */
  .demo { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-block: 5px; scrollbar-width: none; }
  .demo::-webkit-scrollbar { display: none; }
  .demo > * { flex: none; }
  .demo .sp { display: none; }
  .demo label { font-size: 0; gap: 0; }
  .demo select, .demo button { font-size: 0.74rem; max-width: 46vw; }
  .band { padding-block: 8px; }
  .brandmark .nm { font-size: 1rem; }
  .band .who { font-size: 0.74rem; }
  .band select, .band .ghost, .pickbtn { padding: 5px 8px; font-size: 0.82rem; }
  .app > .tabs { scrollbar-width: none; }
  .app > .tabs::-webkit-scrollbar { display: none; }
  .navbar { padding-block: 6px; gap: 6px 10px; }
  .navbar .own { flex-basis: 100%; font-size: 0.74rem; }
  .page { padding-block: 16px 40px; gap: 14px; }
  h1 { font-size: 1.4rem; }
  .lede { font-size: 0.92rem; }
  .acts .btn, .acts .grow { flex: 1 1 100%; text-align: center; }
  .stats { gap: 4px 16px; font-size: 0.84rem; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  /* Tables: one card per row, each value beside its column heading. Nothing scrolls sideways. */
  .card.scroll { overflow: visible; }
  .card.scroll table, .card.scroll tbody, .card.scroll td { display: block; }
  .card.scroll thead { display: none; }
  .card.scroll tr:not([hidden]) { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .card.scroll tr:last-child { border-bottom: 0; }
  .card.scroll td { border: 0; padding: 3px 0; text-align: left; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
  .card.scroll td.num { text-align: left; }
  .card.scroll td[data-label]::before { content: attr(data-label); flex: 0 0 34%; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
  .card.scroll td[data-label=""]::before { display: none; }
  .card.scroll td:first-child { font-weight: 600; font-size: 0.98rem; }
  .card.scroll td:empty { display: none; }
  .card.scroll td .btn { flex: 1; }
  .card.scroll td select { max-width: 100%; }
  .diag div { grid-template-columns: auto 1fr; }
  .maptools { top: 8px; gap: 6px; }
  .maptools .crumbs { order: 3; flex-basis: 100%; margin-right: 0; }
  .zoom { margin-left: auto; }
}

/* Clients on a phone: a bottom bar with the four screens they use most, and "More" for the rest. */
.botbar { display: none; }
@media (max-width: 700px) {
  .app[data-role="client"] { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .app[data-role="client"] > .tabs { display: none; }
  .app[data-role="client"] > .work { grid-row: 3; }
  .app[data-role="client"] .main { padding-bottom: 0; }
  .app[data-role="client"] > .botbar { grid-column: 1; grid-row: 4; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 31; }
  .botbar button { background: none; border: 0; border-top: 2px solid transparent; padding: 7px 2px 6px; display: grid; justify-items: center; gap: 2px; font-size: 0.66rem; font-weight: 600; color: var(--ink-soft); min-height: 54px; }
  .botbar button[aria-current="page"] { color: var(--ui); border-top-color: var(--ui); }
  .botbar span { white-space: nowrap; }
  /* "More" opens the full menu as a sheet above the bar. */
  .app[data-role="client"][data-more="1"] > .tabs { display: flex; flex-direction: column; align-items: stretch; position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); max-height: 62vh; overflow: auto; z-index: 30; padding: 10px 12px 14px; background: var(--raised); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.5); }
  .app[data-role="client"][data-more="1"] > .tabs .tab { border-bottom: 0; border-left: 2px solid transparent; border-radius: 8px; padding: 12px 12px; font-size: 0.95rem; }
  .app[data-role="client"][data-more="1"] > .tabs .tab[aria-current="page"] { border-left-color: var(--ui); background: rgba(255, 255, 255, 0.06); }
  .app[data-role="client"][data-more="1"] > .tabs .navh { border-left: 0; padding: 8px 12px 4px; max-width: none; }
  .app[data-role="client"] .toast { bottom: 12px; }
}
/* Dark style: notices and private notes use a neutral panel with a coloured edge, never a brown fill. */
.app[data-look="dark"] .private { background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 8px; }
.app[data-look="dark"] .pill.p3 { background: rgba(240, 192, 103, 0.14); color: var(--warn); }
.app[data-look="dark"] .pill.p4 { background: rgba(255, 144, 128, 0.14); color: var(--bad); }
.app[data-look="dark"] .pill.ok { background: rgba(95, 214, 160, 0.14); color: var(--ok); }

/* Signed-in account bar */
.demo.acct b { color: var(--cm-1); letter-spacing: 0.02em; text-transform: none; font-size: 0.86rem; }
#live-status { color: var(--ink-soft); font-size: 0.76rem; }
@media (max-width: 700px) { .demo.acct span:not(.sp) { display: inline; font-size: 0.72rem; } }

/* Guided questionnaire, styled after the Life Check on jakefourie.com: one statement at a time, big score, large touch targets. */
.qcard, .qprompt { gap: 10px; }
.qprompt { border-left: 3px solid var(--ui); }
.page.quiz { max-width: 680px; gap: 16px; }
.qprog { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.qprog i { display: block; height: 100%; background: var(--ui); transition: width 0.3s; }
.qmeta { display: flex; justify-content: space-between; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.qtext { font-family: var(--display); font-size: clamp(1.3rem, 3.6vw, 1.75rem); font-weight: var(--hw); line-height: 1.3; letter-spacing: -0.01em; margin: 6px 0 0; }
h1.qtext { margin: 0; }
.qscore { font-size: 3rem; font-weight: 700; line-height: 1; color: var(--ui); text-align: center; font-variant-numeric: tabular-nums; min-height: 3rem; }
.qscore.unset { font-size: 1rem; color: var(--ink-soft); font-weight: 500; display: grid; place-items: center; }
.qrange { width: 100%; accent-color: var(--ui); height: 32px; }
.qticks { display: grid; gap: 4px; }
.qtick { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 0; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.qtick:hover { border-color: var(--ui); color: var(--ink); }
.qtick.on { background: var(--ui); border-color: var(--ui); color: var(--on-ui); }
.qscale { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); }
.qnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.qnav .btn { padding: 10px 18px; font-size: 0.95rem; }
.stack2 { display: grid; gap: 12px; align-content: start; }
.lowcard { border-left: 3px solid var(--warn); }
.lowcard p { margin: 4px 0 0; color: var(--ink-soft); }
@media (max-width: 700px) { .qtick { padding: 11px 0; font-size: 0.86rem; } .qnav .btn { flex: 1; } }
