/* Sam: design system and screens.
   Geist and Geist Mono · zinc neutrals · one desaturated accent (steel blue) · motion on transform and opacity. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #111113;
  --bg-2: #141416;
  --panel: #161618;
  --card: #19191c;
  --card-2: #1f1f23;
  --field: #131315;
  --hover: #232327;
  --line: #26262b;
  --line-2: #313137;
  --line-3: #43434b;
  --text: #f4f4f5;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #7c7c85;
  --ghost: #56565e;

  --accent: #a6bad6;
  --accent-hi: #bccbe1;
  --accent-ink: #0f141b;
  --accent-soft: rgb(166 186 214 / .1);
  --accent-ring: rgb(166 186 214 / .22);
  --accent-line: rgb(166 186 214 / .34);

  --warn: #dcb57f;
  --warn-soft: rgb(220 181 127 / .09);
  --warn-line: rgb(220 181 127 / .3);
  --danger: #e59d92;
  --danger-soft: rgb(229 157 146 / .09);
  --danger-line: rgb(229 157 146 / .32);

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 24px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --inset: inset 0 1px 0 rgb(255 255 255 / .035);
  --shadow-pop: 0 24px 64px -24px rgb(9 9 11 / .9), 0 2px 10px -2px rgb(9 9 11 / .5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
strong { font-weight: 560; }
::selection { background: rgb(166 186 214 / .3); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.small { font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.optional { font-weight: 400; color: var(--faint); }

* { scrollbar-width: thin; scrollbar-color: #34343a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #2c2c31; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #3a3a41; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 450;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.display {
  font-size: clamp(2.75rem, 1.55rem + 2.55vw, 4.35rem);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.048em;
  color: var(--text);
}
.h1 { font-size: clamp(2rem, 1.45rem + 1.5vw, 2.75rem); line-height: 1.05; font-weight: 500; letter-spacing: -.042em; }
.h2 { font-size: clamp(1.625rem, 1.35rem + .7vw, 2rem); line-height: 1.1; font-weight: 500; letter-spacing: -.035em; }
.h3 { font-size: 1.125rem; line-height: 1.3; font-weight: 560; letter-spacing: -.02em; }
.lede { font-size: 15.5px; line-height: 1.65; color: var(--muted); max-width: 54ch; letter-spacing: -.008em; }
.accent-text { color: var(--accent); }

/* ---------- Icons ---------- */
.i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.primary, .outline, .ghost, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 530;
  letter-spacing: -.01em;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .28); }
.primary:hover:not(:disabled) { background: var(--accent-hi); }
.outline { border: 1px solid var(--line-2); background: var(--card); color: var(--text-2); box-shadow: var(--inset); }
.outline:hover:not(:disabled) { background: var(--hover); border-color: var(--line-3); color: var(--text); }
.ghost { color: var(--muted); padding: 0 10px; }
.ghost:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.primary .i, .outline .i, .ghost .i { width: 17px; height: 17px; }
.full { width: 100%; }
.lg { min-height: 46px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.text-button { color: var(--accent); font-size: 13px; font-weight: 500; border-radius: 4px; }
.text-button:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
:is(.primary, .outline, .ghost, .btn, .icon-btn, .choice-card, .navitem, .sidebar-task, .lesson-option, .suggestion-option, .text-button, .chip-label, .inline-action, .teach, .send, .paperclip, .share-option, .reveal, .toast-action):active:not(:disabled) { transform: scale(.98); }
:is(.primary, .outline, .ghost, .btn, .icon-btn, .teach, .send, .inline-action):disabled { opacity: .42; cursor: not-allowed; }
[aria-busy="true"]:disabled { opacity: .9; cursor: progress; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; margin: 0 0 18px; min-width: 0; }
.field > label, .label, .stage-label { font-size: 13px; font-weight: 520; color: var(--text-2); letter-spacing: -.005em; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  background: var(--field);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-shadow: var(--inset);
}
textarea { line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ghost); }
input:hover:not(:disabled), textarea:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--line-3); }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger-line); }
input[aria-invalid="true"]:focus-visible, textarea[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px var(--danger-soft); border-color: var(--danger); }
input[type=file] { width: 100%; font-size: 13px; color: var(--muted); padding: 10px; border: 1px dashed var(--line-3); border-radius: var(--r-md); background: var(--field); }
input[type=file]::file-selector-button { margin-right: 12px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card-2); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.field-error { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--danger); }
.field-error .i { width: 15px; height: 15px; margin-top: 1.5px; }
.form-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  margin: 0 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: #f0c8c1;
  font-size: 13.5px;
  line-height: 1.5;
  animation: rise .35s var(--ease) both;
}
.form-alert .i { width: 17px; height: 17px; margin-top: 1px; color: var(--danger); }
.form-alert[data-tone="info"], .form-alert[data-tone="success"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text-2); }
.form-alert[data-tone="info"] .i, .form-alert[data-tone="success"] .i { color: var(--accent); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px !important; }
.reveal {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--faint);
}
.reveal:hover { color: var(--text); background: var(--hover); }

.policy { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.policy li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--faint); }
.policy li .i { width: 14px; height: 14px; opacity: .35; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.policy li.met { color: var(--text-2); }
.policy li.met .i { color: var(--accent); opacity: 1; }
.policy.show-missing li:not(.met) { color: var(--danger); }

.code-input { font-family: var(--mono) !important; font-size: 21px !important; letter-spacing: .45em !important; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: #34343a; }

.check { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.check input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; }
.check-box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1px solid var(--line-3);
  border-radius: 6px;
  background: var(--field);
}
.check-box .i { width: 14px; height: 14px; color: var(--accent-ink); opacity: 0; transform: scale(.5); transition: transform .35s var(--ease), opacity .2s var(--ease); }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box .i { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input[aria-invalid="true"] + .check-box { border-color: var(--danger); }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; }
.select-wrap .i { position: absolute; right: 14px; top: 50%; margin-top: -9px; color: var(--faint); pointer-events: none; }

/* ---------- Pills and states ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill.accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.pill.warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.pill.danger { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.state-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.state-icon .i { width: 20px; height: 20px; }
.state-icon.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.state-icon.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: -.04em; color: var(--text); line-height: 1; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-mark rect { fill: var(--accent); }
.brand-mark path { fill: none; stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-sub { font-size: 13px; font-weight: 400; letter-spacing: -.005em; color: var(--faint); margin-left: 2px; }

/* ---------- Skeletons ---------- */
.sk { position: relative; overflow: hidden; background: #1c1c20; border-radius: var(--r-sm); }
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .045), transparent);
  animation: shimmer 1.8s var(--ease) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; border-radius: 6px; }
.sk-line.thin { height: 9px; }
.sk-line.gap { margin-top: 18px; }
.w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; }
.sk-row { height: 44px; border-radius: var(--r-sm); margin-bottom: 6px; }
.sk-row.short { width: 72%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: max(68px, calc(env(safe-area-inset-top) + 64px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(540px, calc(100vw - 32px));
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: #222226;
  border: 1px solid var(--line-3);
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  transform: translateX(-50%);
}
.toast .i { color: var(--accent); }
.toast[data-tone="error"] .i { color: var(--danger); }
.toast-text { padding-right: 4px; }
.toast-action { margin-left: auto; padding: 7px 11px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 550; white-space: nowrap; }
.toast.is-entering { animation: toastIn .45s var(--ease) both; }
.toast.is-leaving { animation: toastOut .22s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -6px); } }

/* ---------- Dialogs ---------- */
.dialog {
  position: fixed;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  width: min(480px, calc(100% - 32px));
  max-height: min(88dvh, 820px);
  overflow: auto;
  padding: 28px;
  box-shadow: var(--shadow-pop), var(--inset);
}
.dialog[open] { animation: dialogIn .45s var(--ease) both; }
.dialog::backdrop { background: rgb(9 9 11 / .7); backdrop-filter: blur(3px); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.dialog > .close { position: absolute; top: 14px; right: 14px; }
.dialog h2 { font-size: 22px; line-height: 1.2; font-weight: 550; letter-spacing: -.03em; margin: 8px 40px 8px 0; }
.dialog > p:not(.eyebrow), .dialog form > p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.6; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Screens and motion ---------- */
.screen { min-height: 100dvh; }
.rise { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.screen-enter { animation: screenIn .5s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Boot (restoring a session) ---------- */
/* No stored session: show sign-in from the first paint (js/preboot.js; session.js removes the class). */
.no-session #boot { display: none !important; }
.no-session #login { display: grid !important; }
.boot { position: relative; }
.boot-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.boot-nav { display: flex; flex-direction: column; gap: 12px; padding: 22px 16px; background: var(--panel); border-right: 1px solid var(--line); }
.sk-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 12px; }
.sk-mark { width: 28px; height: 28px; border-radius: 9px; }
.sk-brand .sk-line { flex: 1; max-width: 60px; }
.sk-button { height: 40px; border-radius: var(--r-md); margin-bottom: 14px; }
.boot-main { display: flex; flex-direction: column; min-width: 0; }
.boot-top { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); }
.boot-top .sk-line { width: 180px; }
.sk-pill { width: 92px; height: 34px; border-radius: var(--r-md); }
.boot-body { flex: 1; width: min(760px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 0; display: grid; align-content: start; gap: 28px; }
.sk-msg { display: flex; gap: 12px; }
.sk-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.sk-lines { flex: 1; display: grid; gap: 10px; }
.sk-bubble { width: 58%; height: 64px; justify-self: end; border-radius: 14px 14px 4px 14px; }
.sk-card { height: 150px; border-radius: var(--r-lg); margin-top: 4px; }
.sk-composer { width: min(760px, calc(100% - 48px)); height: 118px; margin: 0 auto 22px; border-radius: 16px; }
.boot-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(17 17 19 / .82); backdrop-filter: blur(2px); }
.boot-error-card { width: min(420px, 100%); padding: 28px; border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); display: grid; gap: 12px; animation: rise .5s var(--ease) both; }
.boot-error-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.boot-error-card .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 34px 48px 30px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.login-copy { margin-top: clamp(40px, 8vh, 92px); }
.login-copy .display { margin: 18px 0 22px; }
.orbital { position: relative; flex: 1; min-height: 300px; display: grid; place-items: center; margin: 20px 0 12px; isolation: isolate; }
.orbit { position: absolute; width: 268px; height: 268px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .06); z-index: -1; }
.orbit.two { width: 420px; height: 222px; transform: rotate(-22deg); border-color: rgb(255 255 255 / .05); }
.orbit.three { width: 392px; height: 196px; transform: rotate(31deg); border-color: rgb(166 186 214 / .16); }
.orbital-portrait { width: 172px; height: 172px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-3); background: var(--card); }
.orbit-label {
  position: absolute;
  left: 3%;
  top: 16%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 11px;
  background: rgb(25 25 28 / .92);
  border: 1px solid var(--line-2);
  box-shadow: var(--inset);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.orbit-label .i { width: 16px; height: 16px; color: var(--accent); }
.orbit-label.bottom { left: auto; top: auto; right: 2%; bottom: 14%; }
.login-footer { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--faint); }
.login-form-area { display: grid; place-items: center; padding: 48px 32px; }
.login-box { width: 100%; max-width: 384px; animation: rise .6s var(--ease) both; }
.login-title { margin: 12px 0 10px; }
.login-intro { color: var(--muted); line-height: 1.6; margin-bottom: 28px; }
.login-intro strong { color: var(--text-2); font-weight: 520; overflow-wrap: anywhere; }
.login-options { display: flex; justify-content: flex-end; margin: -8px 0 22px; }
.login-note { margin-top: 22px; font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.login-note .text-button { font-size: 12.5px; }
.back-link { margin: 18px 0 0 -10px; min-height: 34px; font-size: 13.5px; }
.back-link.top { margin: 0 0 26px -10px; }

/* ---------- First run: shared header ---------- */
.firstrun { display: flex; flex-direction: column; }
.firstrun-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.setup-steps li { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--faint); border: 1px solid transparent; }
.setup-steps li .mono { font-size: 11px; color: var(--ghost); }
.setup-steps li.is-current { color: var(--text); border-color: var(--line-2); background: var(--card); }
.setup-steps li.is-current .mono { color: var(--accent); }
.setup-steps li.is-done { color: var(--muted); }

/* ---------- Agreement ---------- */
.agreement-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 44px 32px 40px;
}
.agreement-aside { position: sticky; top: 32px; align-self: start; display: grid; gap: 18px; padding-top: 8px; }
.agreement-aside .h1 { max-width: 13ch; }
.meta-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.meta-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.meta-list dt { color: var(--faint); }
.meta-list dd { color: var(--text-2); text-align: right; }
.agreement-accept { display: grid; gap: 14px; margin-top: 6px; padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--inset); }
.agreement-accept .primary { justify-self: start; }
.agreement-doc { position: relative; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); overflow: hidden; }
.agreement-doc::after { content: ''; position: absolute; left: 0; right: 10px; bottom: 0; height: 64px; background: linear-gradient(to bottom, rgb(22 22 24 / 0), var(--panel)); pointer-events: none; }
.agreement-scroll { max-height: calc(100dvh - 170px); min-height: 420px; overflow: auto; padding: 36px 44px 64px; overscroll-behavior: contain; }
.agreement-scroll:focus-visible { outline-offset: -3px; }
.agr-skeleton { display: grid; gap: 12px; }
.agr-doc { color: var(--text-2); font-size: 14.5px; line-height: 1.72; }
.agr-head { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.agr-head h2 { font-size: 21px; line-height: 1.25; font-weight: 560; letter-spacing: -.028em; color: var(--text); }
.agr-head .agr-version { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.agr-intro { margin-top: 20px; color: var(--text-2); max-width: 66ch; }
.agr-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.agr-section h3 { display: flex; gap: 14px; align-items: baseline; font-size: 16px; line-height: 1.35; font-weight: 560; letter-spacing: -.018em; color: var(--text); margin-bottom: 10px; }
.agr-section h3 .num { font-family: var(--mono); font-size: 11.5px; font-weight: 450; color: var(--accent); letter-spacing: .02em; min-width: 20px; }
.agr-section p { margin: 8px 0 0 34px; max-width: 66ch; }
.agr-section ul { margin: 10px 0 0 34px; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 66ch; }
.agr-section li { position: relative; padding-left: 18px; }
.agr-section li::before { content: ''; position: absolute; left: 2px; top: .78em; width: 5px; height: 1px; background: var(--faint); }
.agr-section li strong { color: var(--text); font-weight: 560; }
.agr-lines { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; overflow-x: auto; }
.agr-error { display: grid; gap: 12px; justify-items: start; padding: 8px 0; color: var(--muted); }

/* ---------- Download ---------- */
.download-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 48px 32px;
}
.download-copy .h1 { margin: 16px 0 18px; max-width: 15ch; }
.install-steps { list-style: none; margin: 30px 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 540px; }
.install-steps li { display: grid; grid-template-columns: 46px minmax(0, 1fr); padding: 15px 0; border-bottom: 1px solid var(--line); }
.install-steps .num { font-size: 12px; color: var(--accent); padding-top: 2px; }
.install-steps strong { display: block; font-size: 15px; font-weight: 540; letter-spacing: -.015em; }
.install-steps div span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.download-panel { display: grid; gap: 14px; }
.download-card { display: grid; gap: 18px; padding: 24px; border-radius: var(--r-2xl); border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--inset); }
.download-card-head { display: flex; align-items: center; gap: 14px; }
.os-tile { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--accent); }
.os-tile .i { width: 22px; height: 22px; }
.download-card-title { min-width: 0; flex: 1; display: grid; gap: 3px; }
.download-card-title strong { font-size: 16px; font-weight: 560; letter-spacing: -.02em; }
.download-card-title .mono { font-size: 12px; color: var(--faint); }
.download-note { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.download-status { font-size: 13px; color: var(--muted); line-height: 1.5; min-height: 0; }
.download-status:empty { display: none; }
.download-status[data-tone="error"] { color: var(--danger); }
.download-status[data-tone="success"] { color: var(--text-2); }
.mac-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.mac-note .i { margin-top: 1px; color: var(--faint); }
.mac-note strong { color: var(--text-2); font-weight: 540; }
.download-actions { display: flex; justify-content: flex-end; padding-top: 6px; }

/* ---------- Welcome ---------- */
.welcome { display: flex; flex-direction: column; padding: 22px 36px 26px; }
.welcome-header { display: flex; align-items: center; justify-content: space-between; }
.welcome-split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 28px 0;
}
.welcome-portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 440px);
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #17171a;
}
.welcome-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.welcome-portrait::after { content: ''; position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(to top, rgb(17 17 19 / .88), rgb(17 17 19 / 0)); pointer-events: none; }
.avatar-presence {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgb(24 24 27 / .82);
  border: 1px solid var(--line-3);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: var(--text-2);
}
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.welcome-copy { max-width: 470px; }
.welcome-title { margin: 18px 0 18px; font-size: clamp(2.75rem, 1.7rem + 2.6vw, 4.25rem); line-height: .98; font-weight: 500; letter-spacing: -.05em; }
.welcome-title.compact { font-size: clamp(2.1rem, 1.5rem + 1.6vw, 3rem); letter-spacing: -.042em; line-height: 1.04; }
.welcome-copy .lede { font-size: 17px; }
.welcome-next { margin-top: 32px; min-width: 150px; }
.welcome-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--card);
  box-shadow: var(--inset);
  text-align: left;
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.choice-card:hover { border-color: var(--line-3); background: var(--card-2); transform: translateY(-2px); }
.choice-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px; border-radius: 11px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); }
.choice-card strong { font-size: 17px; font-weight: 560; letter-spacing: -.022em; }
.choice-card > span:last-child { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.welcome-footer { color: var(--faint); font-size: 12px; text-align: center; }

/* ---------- Workspace shell ---------- */
.workspace { height: 100dvh; min-height: 0; display: grid; grid-template-columns: 256px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.nav { display: flex; flex-direction: column; min-height: 0; padding: 16px 12px 12px; background: var(--panel); border-right: 1px solid var(--line); }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 18px; }
.nav-close { display: none; }
.new-task { width: 100%; justify-content: flex-start; gap: 10px; margin-bottom: 22px; padding: 0 12px; }
.navlabel { padding: 0 10px; margin: 0 0 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ghost); }
.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: transform .3s var(--ease);
}
.navitem:hover { background: var(--hover); color: var(--text); }
.navitem.active { background: var(--card-2); color: var(--text); box-shadow: var(--inset); }
.navitem .count { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.navitem .trailing { margin-left: auto; width: 15px; height: 15px; opacity: .5; }
#all-task-unread { margin-left: 6px; }
.recent { flex: 1; min-height: 0; overflow: auto; margin: 22px -6px 10px; padding: 0 6px; }
.nav-bottom { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; padding: 10px 4px 2px 8px; margin-top: 6px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.user-copy { min-width: 0; flex: 1; }
#user-name { font-size: 13px; font-weight: 520; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#user-email { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.task-menu { display: none; margin-left: -8px; }
.breadcrumb { flex: 1; min-width: 0; font-size: 13.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb span { margin: 0 6px; color: var(--ghost); }
.breadcrumb strong { color: var(--text-2); font-weight: 500; }
.teach {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 530;
  box-shadow: var(--inset);
  transition: transform .3s var(--ease);
}
.teach .i { width: 16px; height: 16px; color: var(--accent); }
.teach:hover { background: var(--hover); border-color: var(--line-3); color: var(--text); }
.chat-scroll { flex: 1; min-height: 0; overflow: auto; padding: 34px 24px 28px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
#extra-messages { max-width: 760px; margin: 0 auto; }
.footer-chat { flex-shrink: 0; padding: 0 24px 18px; }
.composer { max-width: 760px; margin: 0 auto; }

/* ---------- Teach Sam ---------- */
.teaching { display: flex; flex-direction: column; padding: 20px 32px 24px; }
.teaching-header { display: flex; align-items: center; justify-content: space-between; }
.teaching-main { width: min(780px, 100%); margin: 52px auto 40px; flex: 1; }
.teaching-title { display: flex; align-items: center; gap: 22px; margin-bottom: 44px; }
.teacher-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-3); flex-shrink: 0; }
.teaching-title .h1 { margin: 10px 0 6px; }
.teaching-flow { position: relative; display: grid; gap: 34px; }
.teaching-stage { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 18px; }
.stage-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--accent); font-size: 11.5px; }
.stage-content { min-width: 0; padding-top: 5px; }
.stage-label { display: block; margin: 0 0 14px; font-size: 16.5px !important; font-weight: 540 !important; letter-spacing: -.02em !important; color: var(--text) !important; }
.lesson-options { display: grid; gap: 8px; }
.lesson-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--card);
  text-align: left;
  box-shadow: var(--inset);
  transition: transform .3s var(--ease);
}
.lesson-option:hover { background: var(--card-2); border-color: var(--line-3); }
.lesson-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.lesson-symbol { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.lesson-option[aria-pressed="true"] .lesson-symbol { color: var(--accent); border-color: var(--accent-line); }
.lesson-option .lesson-copy { display: grid; gap: 2px; min-width: 0; }
.lesson-option strong { font-size: 14.5px; font-weight: 530; letter-spacing: -.012em; }
.lesson-option small { font-size: 12.5px; color: var(--faint); }
.lesson-option .lesson-check { margin-left: auto; color: var(--accent); opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease); transform: scale(.8); }
.lesson-option[aria-pressed="true"] .lesson-check { opacity: 1; transform: none; }
#new-lesson-field { margin: 16px 0 0; }
.tax-client-context { margin-left: 52px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--card); }
.tax-client-context strong { display: block; margin: 8px 0 4px; font-size: 16px; font-weight: 550; letter-spacing: -.018em; }
.tax-client-context #tax-client-files { font-size: 13px; color: var(--muted); }
.tax-client-context button { flex-shrink: 0; }
.record-panel { padding: 22px; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--inset); }
.record-panel.recording { border-color: var(--danger-line); }
.record-summary { display: flex; gap: 14px; align-items: flex-start; }
.record-symbol { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--accent); }
.record-symbol .i { width: 21px; height: 21px; }
.record-panel.recording .record-symbol { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.record-summary strong { font-size: 16px; font-weight: 550; letter-spacing: -.018em; overflow-wrap: anywhere; }
.record-summary p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; max-width: 60ch; }
.record-controls { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.record-button { min-width: 128px; }
.record-dot { width: 9px; height: 9px; border-radius: 50%; background: #b0414a; box-shadow: 0 0 0 3px rgb(176 65 74 / .2); }
.record-clock { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.record-clock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
#record-status { margin-top: 16px; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
#record-preview { width: 100%; max-height: 320px; margin: 18px 0 14px; border-radius: var(--r-md); background: #0d0d0f; border: 1px solid var(--line); }
#download-recording { display: inline-flex; }
#record-result > .small { margin-top: 12px; }
.training-review, .client-approval { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.review-sam { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.review-sam img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-3); flex-shrink: 0; }
.review-sam strong { font-size: 15px; font-weight: 550; }
.review-sam p { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 3px; }
.training-review .h3 { margin-bottom: 6px; }
.review-note { font-size: 12.5px; line-height: 1.6; color: var(--faint); margin: 6px 0 14px; }
.review-note:empty { display: none; }
#training-plan-form { margin-top: 18px; }
#training-steps { min-height: 150px; }
#confirm-training { margin: 4px 0 12px; }
.client-choice { display: flex; gap: 10px; align-items: center; padding: 11px 12px; margin-top: 8px; border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: 14px; cursor: pointer; }
.client-choice input { width: 16px; height: 16px; accent-color: var(--accent); }
.client-choice span { overflow-wrap: anywhere; }
.approval-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.teaching-footer { color: var(--faint); text-align: center; font-size: 12px; }

/* ---------- Client dialog ---------- */
.client-dialog { width: min(620px, calc(100% - 28px)); }
.client-dialog form { margin-top: 20px; }
.client-pick-row { display: flex; gap: 8px; }
.client-pick-row input { flex: 1; min-width: 0; }
.client-pick-row select[hidden] { display: none; }
.client-pick-row button { flex-shrink: 0; }
.client-dialog .label { display: block; margin-bottom: 8px; }
.client-dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px 16px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-3);
  background: var(--field);
  text-align: center;
  cursor: pointer;
}
.client-dropzone:hover, .client-dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.client-dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--accent); }
.client-dropzone strong { font-size: 14px; font-weight: 530; }
.client-dropzone > span:not(.dropzone-icon) { font-size: 12.5px; color: var(--faint); }
.client-dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.client-file-list { display: grid; margin-top: 10px; }
.client-storage-note { margin-top: 10px; }
#client-save-status { margin-top: 12px; }
#client-save-status:empty { display: none; }

/* Upload rows (client dialog and elsewhere) */
.file-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-glyph { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.file-glyph .i { width: 16px; height: 16px; }
.file-row.is-error .file-glyph { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.file-main { min-width: 0; display: grid; gap: 4px; }
.file-main strong { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.file-row.is-error .file-meta { color: var(--danger); font-family: var(--font); font-size: 12.5px; }
.file-actions { display: flex; gap: 4px; align-items: center; }
.progress { height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform .3s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 228px minmax(0, 1fr); }
  .boot-shell { grid-template-columns: 228px minmax(0, 1fr); }
  .login-art { padding: 30px 34px 26px; }
  .orbit.two { width: 360px; }
  .orbit.three { width: 340px; }
}

@media (max-width: 767px) {
  body { font-size: 15px; }
  .boot-shell { grid-template-columns: 1fr; }
  .boot-nav { display: none; }
  .boot-top { padding: 0 16px; }
  .boot-body, .sk-composer { width: calc(100% - 32px); }

  .login { grid-template-columns: 1fr; }
  .login-art { padding: 20px 16px 26px; border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .login-copy { margin-top: 30px; padding-right: 108px; }
  .login-copy .display { font-size: 38px; margin: 12px 0 0; }
  .login-copy .lede, .login-footer { display: none; }
  .orbital { position: absolute; right: -6px; bottom: 18px; width: 128px; min-height: 0; height: 128px; margin: 0; flex: none; }
  .orbital-portrait { width: 96px; height: 96px; }
  .orbit { width: 124px; height: 124px; }
  .orbit.two, .orbit.three, .orbit-label { display: none; }
  .login-form-area { padding: 30px 16px 40px; place-items: start stretch; }
  .login-box { max-width: none; }
  .policy { grid-template-columns: 1fr; }

  .firstrun-header { padding: 14px 16px; }
  .setup-steps { display: none; }
  .agreement-layout { grid-template-columns: 1fr; padding: 24px 16px 32px; gap: 22px; }
  .agreement-aside { position: static; display: contents; }
  .agreement-aside > .eyebrow { order: 1; }
  .agreement-aside > .h1 { order: 2; }
  .agreement-aside > .lede { order: 3; }
  .agreement-aside > .meta-list { order: 4; }
  .agreement-doc { order: 5; }
  .agreement-accept { order: 6; position: sticky; bottom: 0; z-index: 5; margin: 0 -16px -32px; border-radius: 18px 18px 0 0; border-left: 0; border-right: 0; border-bottom: 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: rgb(25 25 28 / .97); backdrop-filter: blur(10px); }
  .agreement-accept .primary { justify-self: stretch; }
  .agreement-scroll { max-height: 56dvh; min-height: 300px; padding: 22px 18px 48px; }
  .agr-section p, .agr-section ul { margin-left: 0; }

  .download-layout { grid-template-columns: 1fr; padding: 26px 16px 36px; gap: 26px; align-items: start; }
  .download-actions .outline { width: 100%; }

  .welcome { padding: 16px 16px 22px; }
  .welcome-split { grid-template-columns: 1fr; gap: 26px; padding: 18px 0; align-items: start; align-content: start; }
  .welcome-portrait { justify-self: stretch; width: 100%; aspect-ratio: 16 / 13; border-radius: 22px; }
  .welcome-portrait img { object-position: 50% 22%; }
  .welcome-title { font-size: 44px; margin: 12px 0 14px; }
  .welcome-title.compact { font-size: 34px; }
  .welcome-copy .lede { font-size: 16px; }
  .welcome-next { width: 100%; margin-top: 24px; }
  .welcome-actions { grid-template-columns: 1fr; margin-top: 22px; }
  .welcome-footer { margin-top: 8px; }

  .workspace { display: block; position: relative; }
  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform .45s var(--ease);
    box-shadow: var(--shadow-pop);
    visibility: hidden;
  }
  .nav.mobile-open { transform: none; visibility: visible; }
  .nav-close { display: inline-grid; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgb(9 9 11 / .6); animation: screenIn .3s var(--ease) both; }
  .main { height: 100dvh; }
  .topbar { height: 56px; padding: 0 12px 0 16px; gap: 8px; }
  .task-menu { display: inline-grid; }
  .breadcrumb { font-size: 13px; }
  .chat-scroll { padding: 22px 16px 20px; }
  .footer-chat { padding: 0 12px max(12px, env(safe-area-inset-bottom)); }

  .teaching { padding: 14px 16px 20px; }
  .teaching-main { margin: 28px auto 32px; }
  .teaching-title { gap: 14px; margin-bottom: 30px; align-items: flex-start; }
  .teacher-avatar { width: 56px; height: 56px; }
  .teaching-stage { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .stage-number { width: 28px; height: 28px; font-size: 10.5px; }
  .tax-client-context { margin-left: 40px; flex-direction: column; align-items: stretch; }
  .record-panel { padding: 16px; }

  .dialog { padding: 22px 18px; width: calc(100% - 20px); }
  .client-pick-row { flex-wrap: wrap; }
  .client-pick-row button { width: 100%; }
}

@media (hover: none) {
  .choice-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* /backoffice/: the page that points to the accountants site */
.moved { width: min(520px, 100% - 32px); margin: 14vh auto 0; display: grid; gap: 14px; color: var(--muted); line-height: 1.6; }
.moved .h2 { color: var(--text); }

/* ---------- Sign in with Microsoft / Google, and the /auth/callback/ page ---------- */
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 12px; color: var(--faint); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.federated { display: grid; gap: 10px; }
.federated-button .provider-logo { width: 18px; height: 18px; flex-shrink: 0; }
.callback { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.callback-card { width: min(420px, 100%); padding: 28px; border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); display: grid; gap: 12px; }
.callback-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
