/* Clearlyst portal — iOS-style app shell. Grouped lists, large titles, a
   bottom tab bar on phones and a top bar on desktop. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --ink: #111114;
  --ink-2: #3c3c43;
  --muted: #8a8a8e;
  --line: rgba(60, 60, 67, 0.16);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --ok: #248a3d;
  --ok-soft: rgba(36, 138, 61, 0.12);
  --warn: #b25000;
  --warn-soft: rgba(255, 149, 0, 0.14);
  --blur: rgba(249, 249, 251, 0.82);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --ink: #f5f5f7; --ink-2: #d1d1d6;
    --muted: #98989f; --line: rgba(84, 84, 88, 0.6); --accent: #0a84ff; --accent-soft: rgba(10, 132, 255, 0.18);
    --ok: #30d158; --ok-soft: rgba(48, 209, 88, 0.16); --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, 0.16);
    --blur: rgba(22, 22, 24, 0.82); color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--accent); }
.wordmark { display: block; font-family: "Inter", var(--font); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.wordmark.big { font-size: 40px; }

/* Splash and sign in */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.splash .wordmark { animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.45; } to { opacity: 1; } }
.auth { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 20px;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.auth-logo { font-size: 34px; text-align: center; }
.card { width: 100%; max-width: 400px; display: grid; gap: 14px; padding: 24px 20px; background: var(--surface); border-radius: 20px; }
.card h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.auth-foot { font-size: 14px; color: var(--muted); }

/* Fields */
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select, .input {
  width: 100%; min-height: 46px; padding: 11px 14px; font-size: 17px; color: var(--ink);
  background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; outline: none; }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--accent); background: var(--surface); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.msg { margin: 0; font-size: 14px; color: #d70015; }
.msg.ok { color: var(--ok); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px;
  border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
  transition: transform 0.15s var(--ease), opacity 0.15s; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn.gray { background: var(--surface-2); color: var(--ink); }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.block { width: 100%; }
.link { border: 0; background: none; padding: 6px 0; color: var(--accent); cursor: pointer; font-size: 16px; }
.link.strong { font-weight: 600; }
.link.danger, .danger { color: #d70015; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--accent); cursor: pointer; }

/* Shell */
.shell { min-height: 100dvh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line); }
.top-logo { font-size: 20px; }
.top-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { background: var(--accent-soft); font-size: 15px; font-weight: 700; }
.back svg { width: 26px; height: 26px; stroke-width: 2.4; }
.views { max-width: 760px; margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.view { display: grid; gap: 22px; animation: in 0.28s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.large { margin: 10px 0 0; font-size: 32px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }
.sub { margin: -14px 0 0; color: var(--muted); font-size: 15px; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--line); }
.tab { position: relative; flex: 1; max-width: 110px; display: grid; justify-items: center; gap: 2px; padding: 4px 0;
  border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 500; cursor: pointer; }
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--accent); }
.badge { position: absolute; top: 0; left: 55%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
@media (min-width: 900px) {
  .tabbar { top: 0; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: auto; gap: 4px;
    padding: calc(env(safe-area-inset-top) + 8px) 0 8px; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 21; }
  .tab { grid-auto-flow: column; align-items: center; gap: 6px; max-width: none; padding: 6px 12px; border-radius: 10px; font-size: 14px; }
  .tab svg { width: 20px; height: 20px; }
  .tab[aria-current="page"] { background: var(--accent-soft); }
  .badge { position: static; }
  .top-title { visibility: hidden; }
  .views { padding-bottom: 48px; }
}

/* Grouped lists */
.group { display: grid; gap: 8px; }
.group-title { margin: 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; }
.group-title .link { font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 500; padding: 0; }
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px; border: 0;
  background: none; text-align: left; cursor: default; position: relative; }
button.item, a.item { cursor: pointer; color: inherit; text-decoration: none; }
button.item:active, a.item:active { background: var(--surface-2); }
.item + .item::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; border-top: 0.5px solid var(--line); }
.item.plain + .item.plain::before, .item.noicon + .item.noicon::before { left: 14px; }
.ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; flex: none; }
.ico svg { width: 18px; height: 18px; stroke-width: 2; }
.ico.gray { background: #8e8e93; } .ico.green { background: #34c759; } .ico.blue { background: #007aff; }
.ico.orange { background: #ff9500; } .ico.purple { background: #af52de; } .ico.teal { background: #30b0c7; }
.item-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.item-main strong { font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main small { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main small.wrap { white-space: normal; }
.item-end { flex: none; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.chev { width: 16px; height: 16px; color: #c4c4c7; stroke-width: 2.4; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 15px; }

/* Pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

/* Journey */
.journey { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.journey::-webkit-scrollbar { display: none; }
.step { flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 6px; width: 74px; font-size: 11.5px; color: var(--muted); text-align: center; }
.step i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--muted); font-style: normal; }
.step i svg { width: 20px; height: 20px; }
.step.done i { background: var(--ok); color: #fff; }
.step.now i { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.step.now { color: var(--ink); font-weight: 600; }

.next { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--accent); color: #fff; }
.next small { opacity: 0.85; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.next strong { font-size: 20px; line-height: 1.25; }
.next .btn { background: #fff; color: var(--accent); justify-self: start; min-height: 40px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px; background: var(--surface); border-radius: var(--radius); display: grid; gap: 2px; }
.stat small { font-size: 13px; color: var(--muted); }
.stat b { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Segmented control */
.seg { display: flex; padding: 2px; background: var(--surface-2); border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Proposal */
.option { display: grid; gap: 10px; padding: 16px; background: var(--surface); border-radius: 18px; border: 2px solid transparent; }
.option.chosen { border-color: var(--ok); }
.option h3 { margin: 0; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 8px 0; border-top: 0.5px solid var(--line); }
.line:first-of-type { border-top: 0; }
.line span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.total { padding: 10px; background: var(--surface-2); border-radius: 12px; }
.total small { display: block; font-size: 12px; color: var(--muted); }
.total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.compare { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ok-soft); color: var(--ok); border-radius: 12px; font-size: 14px; font-weight: 500; }
.prose { white-space: pre-wrap; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.doc { max-height: 46dvh; overflow-y: auto; padding: 14px; background: var(--surface-2); border-radius: 12px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }

/* Progress */
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width 0.5s var(--ease); }
.check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #c7c7cc; background: none; color: #fff; padding: 0; flex: none; cursor: pointer; }
.check svg { width: 15px; height: 15px; stroke-width: 3; }
.check.on { background: var(--ok); border-color: var(--ok); }
.check:disabled { cursor: default; opacity: 0.6; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 6px; min-height: 50dvh; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 18px; font-size: 16px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; background: var(--surface); align-self: flex-start; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble time { display: block; margin-top: 3px; font-size: 11px; opacity: 0.6; }
.composer { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 8px 0; background: var(--bg); }
.composer textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); resize: none; font-size: 16px; }
.composer .btn { min-height: 40px; width: 40px; padding: 0; border-radius: 50%; }
@media (min-width: 900px) { .composer { bottom: 0; } }

/* Sheet */
/* Phone: the sheet is a full-screen page (always fully visible, keyboard-safe). Larger screens: centred card. */
.sheet { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: env(safe-area-inset-top) 0 0;
  border: 0; border-radius: 0; background: var(--bg); color: var(--ink); overflow: hidden; display: none; }
.sheet[open] { display: flex; flex-direction: column; animation: up 0.3s var(--ease); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
@media (min-width: 640px) {
  .sheet { inset: auto; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 48px)); height: auto; max-height: 85dvh;
    padding: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
  .sheet[open] { animation: pop 0.25s var(--ease); }
  @keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }
  .sheet-grab { display: none; }
}
.sheet-grab { display: none; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 6px 16px; flex: none; border-bottom: 0.5px solid var(--line); background: var(--blur); }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-head .link:first-child { justify-self: start; }
.sheet-head .link:last-child { justify-self: end; }
.sheet-body { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 14px;
  padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 14px; background: rgba(30, 30, 32, 0.94); color: #fff;
  font-size: 15px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); animation: in 0.25s var(--ease); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.sheet .field input, .sheet .field textarea, .sheet .field select { background: var(--surface); border: 1px solid var(--line); }
.sheet .field span { font-size: 14px; color: var(--muted); }
.sheet-body { padding-top: 16px; }
.brain-chat { padding-bottom: 4px; }
.bubble .changes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .changes .pill { font-size: 12px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.bubble .changes .pill { white-space: normal; max-width: 100%; text-align: left; }
.wordmark { display: inline-flex; align-items: center; gap: 0.32em; }
.wordmark img { width: 1.3em; height: 1.3em; flex: none; }
.auth-logo { display: flex; justify-content: center; }
.splash .wordmark { flex-direction: column; gap: 14px; }
.splash .wordmark img { width: 2.2em; height: 2.2em; }

/* ── iOS page sheet (2026-11 refresh) ───────────────────────────────── */
:root { --spring: cubic-bezier(0.32, 0.72, 0, 1); }
.sheet:focus, .confirm:focus { outline: none; }
.sheet :focus:not(:focus-visible) { outline: none; }
.shell { background: var(--bg); transition: transform .42s var(--spring), border-radius .42s var(--spring), filter .42s var(--spring); transform-origin: 50% 0; }
body.sheet-open { overflow: hidden; background: #000; }
@media (max-width: 639px) {
  body.sheet-open .shell { transform: translateY(calc(env(safe-area-inset-top) + 2px)) scale(0.93); border-radius: 14px; overflow: hidden; filter: brightness(.82); }
  .sheet { inset: auto 0 0 0; top: calc(env(safe-area-inset-top) + 14px); height: auto; padding: 0; border-radius: 14px 14px 0 0;
    background: var(--bg); box-shadow: 0 -6px 30px rgba(0,0,0,.18); transition: transform .38s var(--spring); }
  .sheet[open] { animation: sheetUp .5s var(--spring); }
  .sheet.closing { animation: sheetDown .26s ease-in forwards; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  @keyframes sheetDown { to { transform: translateY(100%); } }
  .sheet-grab { display: block !important; width: 38px; height: 5px; margin: 7px auto 0; border-radius: 3px; background: var(--line); flex: none; }
  .sheet-head { border-bottom: 0; background: transparent; min-height: 46px; }
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.3); animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet.closing::backdrop { opacity: 0; transition: opacity .25s; }
@media (min-width: 640px) { .sheet.closing { animation: popOut .2s ease-in forwards; } @keyframes popOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } } }
.sheet-head .link { font-size: 17px; }
#sheetDone { font-weight: 600; transition: opacity .2s; }
#sheetDone:disabled { opacity: .35; cursor: default; }
#sheetDone.busy { opacity: .5; }
.sheet .field input, .sheet .field textarea, .sheet .field select { min-height: 48px; font-size: 17px; border-radius: 12px; }
.sheet .field textarea { min-height: 110px; }

/* Action sheet */
.confirm { position: fixed; inset: auto 0 0 0; width: min(100% - 16px, 420px); margin: 0 auto calc(10px + env(safe-area-inset-bottom)); padding: 0; border: 0; background: transparent; overflow: visible; }
.confirm[open] { display: grid; gap: 8px; animation: sheetUp .4s var(--spring); }
.confirm.closing { animation: sheetDown .2s ease-in forwards; }
.confirm::backdrop { background: rgba(0, 0, 0, 0.35); animation: fadeIn .25s ease; }
.confirm-card { display: grid; border-radius: 14px; overflow: hidden; background: var(--blur); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); text-align: center; }
.confirm-title { margin: 0; padding: 16px 16px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.confirm-msg { margin: 0; padding: 0 16px 14px; font-size: 13px; color: var(--muted); }
.confirm-title:only-child, .confirm-msg[hidden] + .confirm-ok { }
.confirm-ok, .confirm-cancel { min-height: 57px; border: 0; font-size: 20px; cursor: pointer; color: var(--accent); background: transparent; }
.confirm-ok { border-top: .5px solid var(--line); }
.confirm-ok.danger { color: #ff3b30; }
.confirm-cancel { border-radius: 14px; background: var(--surface); font-weight: 600; }
@media (min-width: 640px) { .confirm { inset: 0; margin: auto; height: fit-content; } }

/* Success HUD */
.hud { position: fixed; z-index: 100; top: 50%; left: 50%; display: grid; justify-items: center; gap: 8px; min-width: 150px; padding: 22px 26px 18px; border-radius: 18px;
  transform: translate(-50%, -50%) scale(.85); opacity: 0; pointer-events: none; color: var(--ink); background: var(--blur);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: 0 10px 40px rgba(0,0,0,.18); transition: transform .3s var(--spring), opacity .25s; }
.hud.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.hud svg { width: 44px; height: 44px; stroke-width: 2.4; color: var(--accent); }
.hud.show svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .4s .08s ease-out forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
.hud span { font-size: 15px; font-weight: 600; }
.toast.error { background: #ff3b30; }

/* Taps feel physical */
.item, .btn, .tab, .chip, .seg button { transition: transform .12s ease, background .2s; }
.item:active, .btn:active, .chip:active { transform: scale(.98); }

/* Profile */
.avatar { overflow: hidden; padding: 0; }
.avatar img, .avatar-lg img, .avatar-xl img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
#avatarText, .avatar-lg, .avatar-xl { display: grid; place-items: center; width: 100%; height: 100%; }
.profile-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--surface); text-align: left; cursor: pointer; }
.profile-card .item-main strong { font-size: 19px; }
.avatar-lg { width: 60px; height: 60px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.photo-pick { display: grid; justify-items: center; gap: 8px; padding: 8px 0 4px; }
.avatar-xl { width: 104px; height: 104px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 36px; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.photo-pick .link { font-weight: 600; }
/* iOS switch */
.switch { position: relative; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 31px; background: var(--line); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
#faceIdBtn { margin-top: -4px; }

/* ══════════════════════════════════════════════════════════════════════
   Clearlyst 2026 design (approved Nov 14): dark, floating bubble bar,
   round action button, rings, card lists. Overrides everything above.
   ══════════════════════════════════════════════════════════════════════ */
:root, :root:not([data-x]) {
  --bg: #0b0d12; --surface: #161a22; --surface-2: #1c212b; --surface-3: #262c37;
  --ink: #f5f7fa; --ink-2: #d4d9e1; --muted: #9aa3b2; --faint: #6f7888;
  --line: rgba(255, 255, 255, 0.07); --accent: #0a84ff; --accent-2: #4da3ff; --accent-soft: rgba(10, 132, 255, 0.16);
  --ok: #30d158; --ok-soft: rgba(48, 209, 88, 0.16); --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, 0.16);
  --danger: #ff453a; --blur: rgba(22, 26, 34, 0.86); color-scheme: dark;
}
html, body { background: var(--bg); color: var(--ink); }
a { color: var(--accent-2); }
.danger { color: var(--danger) !important; }

/* Top row: logo + date (tab roots) or back + title (detail) */
.top { background: transparent; border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; min-height: 56px; transition: background .25s; }
.top.scrolled { background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--line); }
.top-logo img { width: 26px; height: 26px; }
.top-date { font-size: 15px; font-weight: 600; color: var(--muted); }
.top .back { color: var(--accent-2); width: auto; padding: 0 6px 0 0; gap: 2px; font-size: 17px; display: inline-flex; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #2997ff, #0a5fd1); color: #fff; border: 2px solid rgba(255,255,255,.12); font-size: 14px; }
.avatar b { font-weight: 700; }
.views { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.large { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); display: grid; place-items: center; cursor: pointer; }
.round-btn svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2.4; }

/* Floating bubble bar + orb (phones and desktop) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: auto; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.tabbar::before { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(180deg, rgba(11,13,18,0), var(--bg) 62%); pointer-events: none; z-index: -1; }
.capsule { pointer-events: auto; flex: 1; display: flex; align-items: center; justify-content: space-around; height: 66px; padding: 0 6px; border-radius: 33px; background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 12px 40px rgba(0,0,0,.5); max-width: 520px; }
.tabbar .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 7px 10px; border: 0; border-radius: 24px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; cursor: pointer; transition: background .3s var(--spring), color .2s; }
.tabbar .tab svg { width: 24px; height: 24px; }
.tabbar .tab[aria-current="page"] { background: rgba(10,132,255,.18); color: var(--accent-2); font-weight: 600; padding: 7px 16px; animation: bub .45s var(--spring); }
@keyframes bub { from { transform: scale(.82); } }
.tabbar .badge { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.orb { pointer-events: auto; position: relative; flex: none; width: 66px; height: 66px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: radial-gradient(circle at 30% 25%, #64d2ff, #0a84ff 55%, #0a4fb0); display: grid; place-items: center; cursor: pointer; animation: orbGlow 3s ease-in-out infinite; }
.orb svg { width: 29px; height: 29px; stroke: #fff; stroke-width: 1.7; }
.orb[aria-current="page"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; border-top-color: #9fd0ff; border-right-color: rgba(159,208,255,.4); animation: spin 6s linear infinite; }
.orb .badge { position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
@keyframes orbGlow { 0%, 100% { box-shadow: 0 8px 26px rgba(10,132,255,.45); } 50% { box-shadow: 0 8px 34px rgba(100,210,255,.7); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 900px) { .tabbar { justify-content: center; } .shell { padding-top: 0; } .tabbar .tab { flex-direction: column; } }

/* Cards, stats, rings */
.cards { display: grid; gap: 10px; }
.ccard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.ccard:active { transform: scale(.98); }
.tile { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; }
.tile svg { width: 22px; height: 22px; }
.tile.blue { background: rgba(10,132,255,.16); color: var(--accent-2); } .tile.green { background: var(--ok-soft); color: var(--ok); }
.tile.orange { background: var(--warn-soft); color: var(--warn); } .tile.purple { background: rgba(191,90,242,.16); color: #d39af7; }
.tile.gray { background: var(--surface-3); color: var(--muted); } .tile.teal { background: rgba(100,210,255,.14); color: #64d2ff; }
.ccard .item-main strong { font-size: 16px; } .ccard .item-main small { font-size: 13px; color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-stats div { padding: 12px; border-radius: 18px; background: var(--surface); }
.mini-stats small { display: block; font-size: 12px; color: var(--muted); } .mini-stats b { display: block; font-size: 20px; font-weight: 700; margin-top: 4px; }
.rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 18px 8px; border-radius: 24px; background: var(--surface); }
.ring { display: grid; justify-items: center; gap: 8px; }
.ring-svg { position: relative; width: 84px; height: 84px; }
.ring-svg svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring-svg circle { fill: none; stroke-width: 7; }
.ring-svg .track { stroke: var(--surface-3); }
.ring-svg .val { stroke-linecap: round; stroke-dasharray: 226; animation: ringIn 1.2s var(--spring) both; }
@keyframes ringIn { from { stroke-dashoffset: 226; } }
.ring-svg b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.ring > span { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #c4cbd6; text-transform: uppercase; }
.panel { padding: 16px; border-radius: 22px; background: var(--surface); }
.panel-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: #c4cbd6; text-transform: uppercase; margin: 0 0 12px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #0a84ff, #64d2ff); animation: grow 1s var(--spring) both; }
@keyframes grow { from { width: 0; } }
.group-title { color: #c4cbd6; }
.list { background: var(--surface); }
.item { border-color: var(--line); }

/* Next-step hero, journey dots */
.next { position: relative; overflow: hidden; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, #0a84ff, #0a5fd1 60%, #4b2bd8); }
.next::after { content: ""; position: absolute; top: 0; bottom: 0; width: 80px; left: 0; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.18), rgba(255,255,255,0)); transform: skewX(-20deg); animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(520%) skewX(-20deg); } }
.next small { font-size: 12px; font-weight: 700; letter-spacing: .08em; opacity: .85; text-transform: uppercase; }
.next strong { font-size: 21px; } .next .btn { background: #fff; color: #0a5fd1; border-radius: 999px; font-weight: 700; }
.dots { display: flex; align-items: center; }
.dots .dot { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 13px; font-weight: 700; }
.dots .dot svg { width: 16px; height: 16px; stroke-width: 3; }
.dots .dot.done { background: var(--ok); color: #fff; }
.dots .dot.now { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px rgba(10,132,255,.25); }
.dots .link-line { flex: 1; height: 3px; background: var(--surface-3); }
.dots .link-line.done { background: var(--ok); }
.dot-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted); }
.dot-labels .now { color: var(--accent-2); font-weight: 600; }

/* Client file hero + quick actions */
.hero { display: flex; align-items: center; gap: 14px; }
.hero .initials { width: 60px; height: 60px; flex: none; border-radius: 18px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; }
.hero h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer; }
.quick svg { width: 22px; height: 22px; }
.seg { background: var(--surface); border-radius: 12px; padding: 3px; }
.seg button { color: var(--muted); border-radius: 9px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: #2a303c; color: var(--ink); font-weight: 600; box-shadow: none; }
.pill { background: var(--surface-3); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.accent { background: var(--accent-soft); color: var(--accent-2); } .pill.warn { background: var(--warn-soft); color: #ffb340; }

/* Proposal (client) */
.opt-card { padding: 16px; border-radius: 22px; background: var(--surface); display: grid; gap: 12px; }
.opt-card h3 { margin: 0; font-size: 19px; }
.checks { display: grid; gap: 10px; }
.checks div { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.checks svg { width: 20px; height: 20px; flex: none; stroke: var(--ok); stroke-width: 2.4; }
.totals .total { background: #10131a; border-radius: 14px; }
.due-card { padding: 18px; border-radius: 24px; background: linear-gradient(150deg, #1d2a3f, var(--surface) 70%); border: 1px solid rgba(77,163,255,.25); display: grid; gap: 6px; }
.due-card .amount { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.btn.white { background: #fff; color: #0b0d12; }
.banner-ok { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--ok-soft); border: 1px solid rgba(48,209,88,.3); animation: dropIn .5s var(--spring) both; }
@keyframes dropIn { from { transform: translateY(-20px); opacity: 0; } }
.sig-pad { position: relative; height: 110px; border-radius: 16px; background: #f5f7fa; overflow: hidden; touch-action: none; }
.sig-pad canvas { width: 100%; height: 100%; display: block; }
.sig-pad span { position: absolute; right: 12px; top: 8px; font-size: 12px; color: #6f7888; pointer-events: none; }
.sig-pad button { position: absolute; left: 10px; top: 6px; border: 0; background: none; color: #0a5fd1; font-size: 13px; font-weight: 600; cursor: pointer; }
.sig-pad::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 26px; height: 1px; background: #c4cbd6; pointer-events: none; }
.sheet { background: #12151c; }
.sheet .field input, .sheet .field textarea, .sheet .field select { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.dropzone { display: grid; justify-items: center; gap: 8px; padding: 20px; border-radius: 20px; border: 1.5px dashed rgba(255,255,255,.15); color: var(--muted); font-size: 14px; cursor: pointer; }
.dropzone svg { width: 28px; height: 28px; stroke: var(--accent-2); }

/* Auth: sign in + welcome */
.auth { background: radial-gradient(420px 320px at 50% 0%, rgba(41,151,255,.22), rgba(11,13,18,0) 70%), var(--bg); }
.auth-mark { width: 84px; height: 84px; border-radius: 24px; background: #fff; display: grid; place-items: center; margin: 0 auto; box-shadow: 0 18px 40px rgba(10,132,255,.35); }
.auth-mark img { width: 60px; height: 60px; }
.auth-head { text-align: center; display: grid; gap: 8px; }
.auth-head h1 { margin: 6px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.auth-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.auth .card { background: rgba(28,33,43,.72); border: 1px solid rgba(255,255,255,.06); border-radius: 24px; box-shadow: none; }
.auth .card h1 { display: none; }
.auth .field input { background: #10131a; border-color: rgba(255,255,255,.08); color: var(--ink); }
#faceIdBtn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 58px; border-radius: 18px; background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(10,132,255,.35); margin: 0; }
#faceIdBtn svg { width: 26px; height: 26px; stroke: #fff; }
#loginBtn { background: #f5f7fa; color: #0b0d12; }
.strength { display: flex; gap: 6px; } .strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); transition: background .2s; }
.strength i.on { background: var(--ok); }

/* Face ID offer card */
.biocard { position: fixed; inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px; margin: 0; width: auto; max-width: 480px; max-height: none; height: auto; padding: 32px 22px 18px; border: 1px solid rgba(255,255,255,.07); border-radius: 36px; background: var(--surface-2); color: var(--ink); text-align: center; box-shadow: 0 -10px 60px rgba(0,0,0,.5); }
.biocard[open] { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: sheetUp .5s var(--spring); }
.biocard::backdrop { background: rgba(0,0,0,.55); }
@media (min-width: 520px) { .biocard { inset: 0; margin: auto; } }
.bio-icon { position: relative; width: 108px; height: 108px; border-radius: 32px; background: linear-gradient(160deg, #2997ff, #0a5fd1); display: grid; place-items: center; overflow: hidden; box-shadow: 0 16px 40px rgba(10,132,255,.4); }
.bio-icon svg { width: 66px; height: 66px; stroke: #fff; stroke-width: 1.5; }
.bio-icon i { position: absolute; left: 14px; right: 14px; height: 2px; border-radius: 2px; background: #9fd0ff; box-shadow: 0 0 12px #9fd0ff; animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateY(-26px); opacity: .2; } 50% { transform: translateY(26px); opacity: 1; } }
.biocard h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.02em; }
.biocard p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; max-width: 320px; }
.bio-facts { display: grid; gap: 8px; width: 100%; margin-top: 6px; text-align: left; }
.bio-facts div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); font-size: 14px; color: var(--ink-2); }
.bio-facts svg { width: 22px; height: 22px; flex: none; }
.biocard .btn { width: 100%; height: 56px; border-radius: 18px; margin-top: 6px; }
.biocard .link { font-size: 16px; padding: 8px 20px; }

/* Action sheet: content always hugs the bottom, never stretches */
.confirm { top: auto !important; height: auto !important; max-height: none !important; }
.confirm[open] { display: flex !important; flex-direction: column; justify-content: flex-end; gap: 8px; }
.confirm-card { background: rgba(44,50,62,.94); }
.confirm-cancel { background: #2c323e; color: var(--accent-2); }
.confirm-ok { color: var(--accent-2); }
.hud { background: rgba(44,50,62,.9); color: var(--ink); }
.hud svg { color: var(--ok); }
.toast { background: rgba(44,50,62,.96); }
.profile-card { background: var(--surface); }
.splash { background: var(--bg); }
.seg { display: flex; overflow: hidden; }
.seg button { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Admin side rail: Agency (clients) and Services (outreach) ── */
.rail { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 232px; display: flex; flex-direction: column; gap: 2px;
  padding: calc(env(safe-area-inset-top) + 18px) 12px calc(18px + env(safe-area-inset-bottom)); background: var(--surface);
  border-right: .5px solid var(--line); transform: translateX(-100%); transition: transform .32s var(--spring); overflow-y: auto; }
.rail.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.5); }
.rail-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.45); }
.rail-brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 10px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.rail-brand img { width: 26px; height: 26px; }
.rail-group { margin: 16px 10px 6px; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.rail-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px;
  background: none; color: var(--ink-2); font-size: 16px; text-align: left; cursor: pointer; }
.rail-item:hover { background: var(--surface-2); }
.rail-item svg { width: 21px; height: 21px; }
.rail-item[aria-current="page"] { background: rgba(10,132,255,.18); color: var(--accent-2, var(--accent)); font-weight: 600; }
.top .menu { color: var(--ink); }
/* A service (e.g. Outreach) fills the screen next to the rail. */
.shell.service .views { max-width: none; padding: 0; }
.shell.service .view { gap: 0; animation: none; }
.service-frame { display: block; width: 100%; height: calc(100dvh - 56px - env(safe-area-inset-top)); border: 0; background: var(--bg); }
@media (min-width: 900px) {
  .shell.has-rail { padding-left: 232px; }
  .shell.has-rail .rail { transform: none; box-shadow: none; }
  .shell.has-rail .tabbar { left: 232px; right: 0; top: auto; bottom: 0; transform: none; width: auto; }
  .shell.has-rail .tabbar::before { left: 232px; }
  .shell.has-rail .top .menu, .rail-scrim { display: none !important; }
  .shell.service .top { display: none; }
  .service-frame { height: 100dvh; }
}
/* Continue with Google */
.btn.google { width: 100%; background: #fff; color: #1f1f1f; border: 1px solid rgba(0,0,0,.12); font-weight: 600; }
.btn.google svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 10px; margin: 2px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: .5px; background: var(--line); }
