/* Retro's interface: one system for every screen, on a desktop, a phone and
   in the app (DESIGN.md, PRODUCT.md). Written whole for the "Sakin" (calm)
   direction chosen in October 2026: an evening study desk with Reti on it.
   - Type: Figtree for the interface (Source Sans 3 behind it for the
     scripts Figtree lacks: Cyrillic, Greek, Vietnamese); Pixelify Sans only
     where Reti speaks.
   - Colour: deep green paper, near-white ink, one warm sand accent for the
     one thing to press and for what is chosen; Reti's mint for what is done.
     The learner's own theme (Appearance) repaints the same tokens.
   - Shape: soft. Pills for buttons and tabs, 16px for rows and fields, 24px
     for the one big panel of a screen. Depth: in the dark, what is closer is
     lighter (no shadows); in the light, one soft shadow for what floats.
   - Motion: colour and opacity in 150ms; nothing lifts or bounces. Reti's own
     movements are Reti's (buddy.css).
   - Phone first: 44px targets, 16px inputs, safe areas, the tab bar and the
     session's controls in the thumb's reach, dialogs as sheets.
   Every screen's rules are in this file; nothing else overrides them. */

/* ── Fonts, served from this site (no third party) ─────────────────── */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/fonts/figtree-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/fonts/figtree-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/source-sans-3-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/source-sans-3-cyrillic-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/source-sans-3-greek-wght-normal.woff2) format('woff2');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/source-sans-3-vietnamese-wght-normal.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/pixelify-sans-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/pixelify-sans-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/pixelify-sans-cyrillic-600-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

/* ── Tokens ─────────────────────────────────────────────────────────── */
/* The colour tokens are the ones Appearance (js/appearance.js) derives from
   a theme's three colours, so a theme of their own repaints all of this. */
:root {
  color-scheme: dark;
  --surface-0: #10221c;            /* the page */
  --surface-1: #17302a;            /* panels */
  --surface-2: #1f3a33;            /* fields, chips, what floats */
  --surface-3: #0c1a15;            /* sunk: the session */
  --surface-hover: #1c3730;
  --surface-nav: #10221c;
  --line: rgba(234, 242, 238, .10);
  --line-strong: rgba(234, 242, 238, .18);
  --line-subtle: rgba(234, 242, 238, .06);
  --fill-subtle: rgba(234, 242, 238, .06);
  --fill-hover: rgba(234, 242, 238, .05);
  --press-overlay: rgba(234, 242, 238, .05);
  --scrim: rgba(3, 10, 8, .64);
  --text-primary: #eaf2ee;
  --text-main: #eaf2ee;
  --text-secondary: #bfd1c9;
  --text-muted: #96afa5;
  --accent: #f2c48d;
  --accent-light: #f7d6ad;
  --accent-contrast: #10221c;
  --accent-soft: rgba(242, 196, 141, .16);
  --accent-line: rgba(242, 196, 141, .36);
  --accent-glow: rgba(242, 196, 141, .10);
  --marker-bg: rgba(242, 196, 141, .14);
  --marker-fg: #f7d6ad;
  --marker-line: rgba(242, 196, 141, .30);
  --good: #7fcfb8;                 /* Reti's mint: what is done, who is here */
  --danger: #f2998c;
  --success: #7fcfb8;
  --warning: #f2c48d;

  --font-ui: 'Figtree', 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-reti: 'Pixelify Sans', var(--font-ui);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* spacing: tight, medium, generous */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  /* type */
  --fs-xs: 13px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 36px;
  /* shape */
  --r-s: 12px; --r-m: 16px; --r-l: 24px; --r-pill: 999px;
  --t: 150ms ease-out;
  --float: none;
  /* the frame */
  --rail-w: 104px; --bar-h: 64px; --tabs-h: 68px; --page-max: 1040px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --z-bar: 50; --z-pop: 3000; --z-modal: 20000; --z-toast: 30000;
  /* the segments that count (minutes, topics, the week) */
  --seg-off: rgba(234, 242, 238, .09);
  /* the names the study room and Appearance still use */
  --bg-primary: var(--surface-0); --bg-secondary: var(--surface-2); --bg-card: var(--surface-1); --bg-input: var(--surface-2);
  --on-accent: var(--accent-contrast); --border: var(--line);
  --transition-fast: 150ms ease-out; --transition: 200ms ease-out; --focus-ring: 0 0 0 3px var(--accent-soft);
  --shadow-sm: var(--float); --shadow-overlay: var(--float);
  --success-bg: color-mix(in srgb, var(--success) 14%, transparent); --danger-bg: color-mix(in srgb, var(--danger) 14%, transparent);
  --warning-bg: color-mix(in srgb, var(--warning) 14%, transparent); --info: var(--text-secondary); --info-bg: var(--fill-subtle);
}
:root[data-theme="light"] {
  color-scheme: light;
  --surface-0: #f3efe6;
  --surface-1: #fbfaf6;
  --surface-2: #ffffff;
  --surface-3: #ebe5d8;
  --surface-hover: #ede8dc;
  --surface-nav: #f3efe6;
  --line: rgba(21, 41, 33, .12);
  --line-strong: rgba(21, 41, 33, .22);
  --line-subtle: rgba(21, 41, 33, .07);
  --fill-subtle: rgba(21, 41, 33, .06);
  --fill-hover: rgba(21, 41, 33, .045);
  --press-overlay: rgba(21, 41, 33, .05);
  --scrim: rgba(21, 41, 33, .36);
  --text-primary: #152921;
  --text-main: #152921;
  --text-secondary: #3c5148;
  --text-muted: #5a6d65;
  --accent: #1f5c49;
  --accent-light: #2a7560;
  --accent-contrast: #f7f3ea;
  --accent-soft: rgba(31, 92, 73, .10);
  --accent-line: rgba(31, 92, 73, .28);
  --accent-glow: rgba(31, 92, 73, .06);
  --marker-bg: rgba(31, 92, 73, .08);
  --marker-fg: #1f5c49;
  --marker-line: rgba(31, 92, 73, .2);
  --good: #2f8a6f;
  --danger: #b4432f;
  --success: #2f8a6f;
  --warning: #9a5b14;
  --float: 0 8px 24px rgba(21, 41, 33, .12);
  --seg-off: rgba(21, 41, 33, .10);
}

/* ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--surface-0); }
body { margin: 0; min-height: 100dvh; background: var(--surface-0); color: var(--text-primary); font-family: var(--font-ui);
  font-size: var(--fs-md); line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; color: var(--text-primary); text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
small { font-size: var(--fs-sm); color: var(--text-muted); }
::selection { background: var(--accent); color: var(--accent-contrast); }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); font-size: var(--fs-sm); }
.tnum { font-variant-numeric: tabular-nums; }
.ico { flex: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.screen { display: none; }
/* A reload: the page as last seen, laid over the fresh one while it is drawn (study.js cover). It is alive (the
   background and Reti move on) and a press goes through it; nothing in it plays again. */
.snap-cover { position: fixed; inset: 0; z-index: var(--z-bar); pointer-events: none; overflow: hidden; }
.snap-cover * { animation: none !important; transition: none !important; }
.screen.active { display: block; }
.logo-for-light { display: none !important; }
:root[data-theme="light"] .logo-for-light { display: block !important; }
:root[data-theme="light"] .logo-for-dark { display: none !important; }
#loading-screen.active { display: grid; place-items: center; min-height: 100dvh; }
.loading-logo { height: 32px; width: auto; opacity: .9; }

/* Text links and quiet text buttons. */
.link { display: inline; padding: 0; border: 0; background: none; color: var(--text-primary); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); cursor: pointer;
  transition: text-decoration-color var(--t), color var(--t); }
.link:hover { text-decoration-color: currentColor; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r-pill); background: transparent; color: var(--text-primary);
  font: 600 var(--fs-md)/1.1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .ico { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover:not(:disabled) { background: var(--accent-light); }
.btn-outline { border-color: var(--line-strong); }
.btn-outline:hover:not(:disabled) { background: var(--fill-hover); border-color: var(--text-muted); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--fill-subtle); color: var(--text-primary); }
.btn-danger, .btn.is-danger { color: var(--danger); }
.btn-primary.btn-danger { background: var(--danger); color: var(--surface-0); }
.btn-outline.is-danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: var(--fs-sm); }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: var(--fs-lg); }
.btn-full { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; }
.btn .spinner-small { margin: 0 auto; }
/* One round icon button for the frame and the screens. */
.app-icon { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); text-decoration: none; cursor: pointer;
  transition: background-color var(--t), color var(--t); }
.app-icon:hover { background: var(--fill-subtle); color: var(--text-primary); }
.app-icon.is-quiet { color: var(--text-muted); }
.is-pressing { background-color: var(--press-overlay); }
.spinner-small { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Fields ─────────────────────────────────────────────────────────── */
.text-input { width: 100%; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface-2); color: var(--text-primary); font: 400 var(--fs-md)/1.4 var(--font-ui); outline: none;
  transition: border-color var(--t), background-color var(--t); appearance: none; -webkit-appearance: none; }
textarea.text-input { min-height: 96px; resize: vertical; }
select.text-input { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396afa5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.text-input::placeholder { color: var(--text-muted); }
.text-input:focus { border-color: var(--accent); }
.text-input:disabled { opacity: .6; }
input[type="date"].text-input, input[type="time"].text-input { color-scheme: inherit; }
.form-group, .field { display: grid; gap: 8px; margin-bottom: var(--sp-4); }
.form-group > label, .field > label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-secondary); }
.form-error, .error-box { color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.error-box, .info-box { padding: 12px 14px; border-radius: var(--r-s); background: color-mix(in srgb, currentColor 10%, transparent); margin-bottom: var(--sp-4); }
.info-box { color: var(--text-secondary); font-size: var(--fs-sm); }
.pdf-analysis__error { color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.checkbox-container { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--text-secondary); font-size: var(--fs-sm); }
.checkbox-container input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.checkbox-custom { display: none; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .text-input { padding-right: 52px; }
.pw-eye { position: absolute; top: 50%; right: 4px; width: 44px; height: 44px; margin-top: -22px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye:hover { color: var(--text-primary); }

/* A segmented control: course parts, sign in / sign up, short choices. */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-1); }
.seg__item { flex: 1 1 0; min-width: 0; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px;
  border: 0; border-radius: var(--r-pill); background: none; color: var(--text-secondary); font: 600 var(--fs-sm)/1.1 var(--font-ui);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: background-color var(--t), color var(--t); }
.seg__item:hover { color: var(--text-primary); }
.seg__item.is-on, .seg__item.active, .seg__item[aria-selected="true"] { background: var(--accent); color: var(--accent-contrast); }

/* Small labels that say a state in words. */
.meta-chip, .cx-chip, .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--fill-subtle); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tone-success { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tone-accent { color: var(--accent); background: var(--accent-soft); }
.tone-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

/* Initials, where a person has no creature. */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; overflow: hidden; }
.avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.avatar--md { width: 44px; height: 44px; font-size: 16px; }
.avatar--xl { width: 72px; height: 72px; font-size: 26px; }

/* The segments that count: minutes today, topics done, the plan's questions.
   Each is one part of the whole, filled in the accent; what they count is
   always said beside them in words. */
.sq { display: flex; gap: 3px; flex: 1 1 0; min-width: 48px; }
.sq i { flex: 1 1 0; min-width: 2px; height: 6px; border-radius: 3px; background: var(--seg-off); transition: background-color .6s ease-out; }
.sq i.is-on { background: var(--accent); }
.sq--lg i { height: 8px; border-radius: 4px; }
.meter { display: flex; align-items: center; gap: var(--sp-3); }
.meter > span:not(.sq), .meter > small { flex: none; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Loading: the shape of what comes, quiet. */
.skeleton { display: block; border-radius: 8px; background: var(--fill-subtle); }
.skeleton-line { height: 14px; margin: 10px 0; }
.skeleton-line:nth-child(3n) { width: 70%; }
.skeleton-line:nth-child(3n+2) { width: 88%; }

/* Empty states: one line of what is true, a way on. */
.empty-state { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-secondary); }
.empty-state__mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--fill-subtle); color: var(--text-muted); }
.empty-state__mark svg { width: 22px; height: 22px; }
.empty-state__title { font-weight: 700; color: var(--text-primary); }
.empty-state__body { max-width: 40ch; font-size: var(--fs-sm); }
.empty-state__action { margin-top: var(--sp-2); }
.empty-state-sm { padding: var(--sp-4); }

/* Panels: the one surface a group of things sits on. Never one in another. */
.panel, .card { border-radius: var(--r-l); background: var(--surface-1); padding: var(--sp-5); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.card-header h2, .card-header h3, .panel__head h3 { font-size: var(--fs-md); font-weight: 700; color: var(--text-secondary); letter-spacing: 0; }
.card-body { display: grid; gap: var(--sp-2); }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.panel__head .link { font-size: var(--fs-sm); }
:root[data-theme="light"] .panel, :root[data-theme="light"] .card { border: 1px solid var(--line-subtle); }
/* Rows inside a panel: split by space and a hairline, not boxes. */
.rows > li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding: 12px 0; border-top: 1px solid var(--line-subtle); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows small { flex: none; }

/* Reti's words: its own pixel face, wherever it speaks on a page. */
.reti-say, .say { font: 600 var(--fs-md)/1.5 var(--font-reti); color: var(--text-primary); letter-spacing: .01em; }
.say.is-wait::after { content: '▍'; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.say-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
/* A page to read, under Reti's words: a link of its own line. */
.say-link { flex: 1 0 100%; display: flex; align-items: center; min-height: 44px; color: var(--text-primary); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.hero__reti { flex-wrap: wrap; }
.hero__reti > .say-acts { flex: 1 0 100%; margin-top: 0; }

/* ══ The frame ═══════════════════════════════════════════════════════
   Phone, tablet, the app: the top bar (where they are, the bell; in a
   course a way back and its parts) and the tab bar with the five places.
   A wide screen: the rail of places on the left; the top bar stays. */
.app-bar { position: relative; z-index: var(--z-bar); padding: var(--safe-t) max(var(--sp-4), var(--safe-r)) 0 max(var(--sp-4), var(--safe-l));
  background: transparent; touch-action: manipulation; }
/* Part of the page, not a box over it: clear, and it scrolls away with the page. */
.app-bar__row { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--bar-h); }
.app-bar__back { margin-left: -10px; color: var(--text-primary); }
.app-bar__title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.app-bar__title > span { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar__title > small { font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); line-height: 1.3; }
/* In a course with others beside it: its name opens the list of their courses. */
.app-bar__switch { flex: 0 1 auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 4px; min-height: 44px; padding: 0 8px 0 0;
  border: 0; background: none; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-s); }
.app-bar__switch .ico { flex: none; color: var(--text-muted); transition: transform 150ms; }
.app-bar__switch[aria-expanded="true"] .ico { transform: rotate(180deg); }
.app-bar__switch:hover .ico, .app-bar__switch:focus-visible .ico { color: var(--text-primary); }
.app-bar__row .app-bar__switch + * { margin-left: auto; }
.course-menu { position: fixed; z-index: var(--z-pop); width: min(320px, calc(100vw - 24px)); max-height: min(60dvh, 480px); overflow-y: auto;
  padding: var(--sp-2); border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--float); }
.course-menu__item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); width: 100%; min-height: 48px;
  padding: 0 var(--sp-3); border: 0; border-radius: var(--r-s); background: none; color: var(--text-primary); font: inherit; font-weight: 600;
  text-align: left; text-decoration: none; cursor: pointer; }
.course-menu__item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-menu__item:hover, .course-menu__item:focus-visible { background: var(--fill-subtle); }
.course-menu__item.is-on { color: var(--accent); }
.course-menu__new { justify-content: flex-start; margin-top: var(--sp-1); border-top: 1px solid var(--line-subtle); border-radius: 0 0 var(--r-s) var(--r-s);
  color: var(--text-secondary); font-weight: 500; }
.app-bar .notif-btn { margin-right: -6px; }
.app-sub { margin: 0 0 var(--sp-3); }
.notif-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-contrast); font: 700 11px/18px var(--font-ui); text-align: center; pointer-events: none; }
.notif-badge[hidden] { display: none; }

/* As many equal columns as there are places (a fixed six left a gap once Dersler was gone). */
.app-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 6px max(6px, var(--safe-r)) calc(6px + var(--safe-b)) max(6px, var(--safe-l)); background: var(--surface-0); border-top: 1px solid var(--line-subtle); }
.app-nav__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px;
  padding: 0 2px; border: 0; background: none; color: var(--text-muted); text-decoration: none; font: 600 11.5px/1.1 var(--font-ui); cursor: pointer;
  transition: color var(--t); }
.app-nav__ico { display: grid; place-items: center; width: min(56px, 100%); height: 30px; border-radius: var(--r-pill); transition: background-color var(--t); }
.app-nav__label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-nav__item:hover { color: var(--text-primary); }
.app-nav__item.is-on { color: var(--accent); }
.app-nav__item.is-on .app-nav__ico { background: var(--accent-soft); }
.app-nav__item .cs-entry__badge { top: 0; right: calc(50% - 26px); }

.app-rail { display: none; }
/* On a phone a course's name had room for a word ("Motosikl…") beside the bar's icons:
   it may take two lines there, a little smaller. */
@media (max-width: 599.98px) {
  .app-bar__row:has(.app-bar__back) .app-bar__title > span { font-size: var(--fs-lg); line-height: 1.15; white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
}
/* A link in running text is pressed by a finger too: what takes the press reaches
   44px high round it, the page's lines unchanged ("Bütün yol haritası" was 21px). */
@media (pointer: coarse) {
  :is(.panel, .hero, .block) a:not(.btn):not(.day__main):not(.app-icon) { position: relative; }
  :is(.panel, .hero, .block) a:not(.btn):not(.day__main):not(.app-icon)::before { content: ''; position: absolute; left: -6px; right: -6px;
    top: 50%; height: 44px; min-height: 100%; transform: translateY(-50%); }
}
@media (max-width: 1023.98px) {
  body.has-frame { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
  body.is-focus { padding-bottom: var(--safe-b); }
  body.is-focus .app-tabs, body.is-focus .app-bar { display: none; }
}
@media (min-width: 1024px) {
  .app-tabs { display: none; }
  .app-rail:not([hidden]) { position: fixed; top: 0; bottom: 0; left: 0; z-index: var(--z-bar); width: var(--rail-w); display: flex; flex-direction: column;
    align-items: center; gap: var(--sp-2); padding: var(--sp-5) 0 var(--sp-4); background: var(--surface-0); border-right: 1px solid var(--line-subtle); }
  .app-rail__brand { display: grid; place-items: center; height: 44px; margin-bottom: var(--sp-4); }
  .app-rail__brand img { height: 22px; width: auto; }
  .app-rail .app-nav { display: flex; flex-direction: column; gap: var(--sp-2); width: 100%; padding: 0 8px; }
  .app-rail .app-nav__item { min-height: 64px; font-size: 12px; }
  /* Signing out: at the bottom of the rail, away from the places. */
  .app-rail__foot { margin-top: auto; }
  body.has-frame { padding-left: var(--rail-w); }
  .app-bar { padding: var(--sp-5) var(--sp-6) var(--sp-2); }
  .app-bar__row { min-height: 72px; }
  .app-bar__row, .app-sub { max-width: var(--page-max); margin-left: auto; margin-right: auto; }
  .app-sub { max-width: min(var(--page-max), 640px); margin-left: max(0px, calc((100% - var(--page-max)) / 2)); }
  .app-bar__title > span { font-size: var(--fs-2xl); }
  body.is-focus .app-bar { display: none; }
}

/* A session going on, from anywhere else: back to it in one press. */
.sess-pill { position: fixed; z-index: calc(var(--z-bar) + 1); left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 12px);
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-contrast); font: 600 var(--fs-sm)/1 var(--font-ui); box-shadow: var(--float); cursor: pointer; }
.sess-pill b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.sess-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sess-pill__dot.is-paused { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
@media (min-width: 1024px) { .sess-pill { bottom: var(--sp-5); left: calc(50% + var(--rail-w) / 2); } }

@media (min-width: 1440px) { :root { --page-max: 1200px; } }

/* ── Pages ──────────────────────────────────────────────────────────── */
.page-wrap { max-width: calc(var(--page-max) + 2 * var(--sp-4)); margin: 0 auto; padding: var(--sp-2) max(var(--sp-4), var(--safe-r)) var(--sp-7) max(var(--sp-4), var(--safe-l)); }
/* On a phone the end of a page scrolls clear of Reti's button over the tab bar (a list's last date was under it). */
@media (max-width: 1023.98px) { .page-wrap { padding-bottom: calc(var(--sp-7) + 56px); } }
@media (min-width: 1024px) { .page-wrap { max-width: calc(var(--page-max) + 2 * var(--sp-6)); padding: var(--sp-2) var(--sp-6) var(--sp-5); } .page-head { margin: 0 0 var(--sp-4); } }
.page-head { margin: var(--sp-2) 0 var(--sp-5); }
.page-head:has(h1:empty) { display: none; }
.page-head h1 { font-size: var(--fs-2xl); }
.page-head__sub { margin-top: var(--sp-2); color: var(--text-secondary); }
.page-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* With no line under it the head takes no room, but its h1 is still read out (the page's name). */
.page-head:not(:has(.page-head__sub:not(:empty))) { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); }
.page { display: grid; gap: var(--sp-5); }
.page-note { color: var(--text-muted); font-size: var(--fs-sm); }
.tab-panel { display: grid; gap: var(--sp-4); align-content: start; }
.tab-panel > * { min-width: 0; }
.block > h2, .page h2.block__title { margin-bottom: var(--sp-3); font-size: var(--fs-lg); }

/* ══ Things that float: dialogs, sheets, menus, toasts ═══════════════ */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  background: var(--scrim); overscroll-behavior: contain; }
.modal.hidden { display: none; }
.modal-content { position: relative; width: min(560px, 100%); max-height: min(88dvh, 860px); overflow: auto; overscroll-behavior: contain;
  padding: var(--sp-6) var(--sp-5) var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); box-shadow: var(--float); }
.modal-content.dialog-sm { width: min(440px, 100%); }
.modal-content > h2 { font-size: var(--fs-xl); margin: 0 48px var(--sp-4) 0; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--fill-subtle); color: var(--text-primary); }
@media (max-width: 767.98px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-content, .modal-content.dialog-sm { width: 100%; max-height: calc(100dvh - var(--safe-t) - var(--sp-5)); border-radius: var(--r-l) var(--r-l) 0 0;
    padding: var(--sp-6) max(var(--sp-4), var(--safe-r)) calc(var(--sp-5) + var(--safe-b)) max(var(--sp-4), var(--safe-l)); }
}
.confirm h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-xl); }
.confirm p:not(:empty) { color: var(--text-secondary); margin-bottom: var(--sp-4); }
.confirm #confirm-input-container { margin-bottom: var(--sp-4); }
.confirm__acts { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.confirm__acts .btn { flex: 1 1 0; }

#toast-stack { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: calc(var(--sp-5) + var(--safe-b));
  display: grid; gap: var(--sp-2); width: min(440px, calc(100vw - 2 * var(--sp-4))); pointer-events: none; }
body.has-frame:not(.is-focus) #toast-stack { bottom: calc(var(--tabs-h) + var(--safe-b) + var(--sp-3)); }
@media (min-width: 1024px) { body.has-frame:not(.is-focus) #toast-stack { bottom: var(--sp-5); left: calc(50% + var(--rail-w) / 2); } }
.toast { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 10px 18px 10px 12px; border-radius: var(--r-m);
  background: var(--surface-2); color: var(--text-primary); font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--float); pointer-events: auto;
  border: 1px solid var(--line); animation: fade-in .15s ease-out; }
.toast.is-leaving { opacity: 0; transition: opacity .15s; }
.toast--action { cursor: pointer; }
.toast__mark { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--fill-subtle); color: var(--text-secondary); }
.toast__mark svg { width: 14px !important; height: 14px !important; }
.toast--success .toast__mark { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.toast--error .toast__mark { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.account-menu { position: fixed; z-index: var(--z-pop); width: 260px; padding: var(--sp-2); border-radius: var(--r-m); background: var(--surface-2);
  border: 1px solid var(--line); box-shadow: var(--float); }
.account-menu__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line-subtle); margin-bottom: var(--sp-1); }
.account-menu__who { min-width: 0; }
.account-menu__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu__sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu__item { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-s);
  background: none; color: var(--text-primary); font-weight: 500; text-align: left; cursor: pointer; }
.account-menu__item:hover { background: var(--fill-subtle); }
.account-menu__item.is-danger { color: var(--danger); }

.notif-panel { position: fixed; z-index: var(--z-pop); top: 72px; right: 16px; width: min(380px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 96px));
  display: flex; flex-direction: column; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--float); overflow: hidden; }
.notif-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-2) var(--sp-2) var(--sp-4); }
.notif-panel__head strong { font-size: var(--fs-lg); }
.notif-panel__acts { display: flex; }
.notif-panel__acts .btn { min-height: 40px; padding: 0 10px; font-size: var(--fs-xs); }
.notif-list { flex: 1; overflow: auto; padding: 0 var(--sp-2) var(--sp-2); }
.notif-item { position: relative; display: grid; gap: 2px; padding: 12px 48px 12px 14px; border-radius: var(--r-s); cursor: pointer; }
.notif-item:hover { background: var(--fill-hover); }
.notif-item.is-unread .notif-item__text { font-weight: 700; }
.notif-item.is-unread::before { content: ''; position: absolute; left: 3px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.notif-item__text { font-size: var(--fs-sm); }
.notif-item__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.notif-del { position: absolute; top: 4px; right: 2px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.notif-del:hover { color: var(--text-primary); background: var(--fill-subtle); }
.notif-empty { padding: var(--sp-5) var(--sp-4); color: var(--text-muted); text-align: center; font-size: var(--fs-sm); }
.notif-more { margin: 0 var(--sp-2) var(--sp-2); padding: 0 var(--sp-4); text-align: center; min-height: 44px; border: 0; border-radius: var(--r-s); background: var(--fill-subtle); color: var(--text-secondary); font-weight: 600; cursor: pointer; }
@media (max-width: 767.98px) { .notif-panel { left: 8px !important; right: 8px !important; width: auto; top: calc(var(--bar-h) + var(--safe-t) + 4px) !important; bottom: auto !important; } }

.palette { position: fixed; inset: 0; z-index: var(--z-pop); display: grid; justify-items: center; align-items: start; padding: 14vh var(--sp-4) 0; }
.palette__scrim { position: absolute; inset: 0; background: var(--scrim); }
.palette__panel { position: relative; width: min(600px, 100%); border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--float); overflow: hidden; }
.palette__input { width: 100%; min-height: 60px; padding: 0 var(--sp-5); border: 0; border-bottom: 1px solid var(--line); background: none; font-size: var(--fs-lg); outline: none; }
.palette__list { max-height: 50vh; overflow: auto; padding: var(--sp-2); }
.palette__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-3); border-radius: var(--r-s); cursor: pointer; }
.palette__item.is-active { background: var(--accent-soft); }
.palette__icon { color: var(--text-muted); display: grid; place-items: center; width: 20px; }
.palette__icon svg { width: 18px; height: 18px; }
.palette__label { flex: 1; min-width: 0; display: grid; }
.palette__sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.palette__group { padding: var(--sp-3) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.palette__empty { padding: var(--sp-5); text-align: center; color: var(--text-muted); }
.palette__foot { display: flex; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-muted); }
.palette__foot kbd { font: inherit; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; margin-right: 2px; }

/* ══ Sign in ═════════════════════════════════════════════════════════
   Reti says hello; under it (beside it on a wide screen) the form. */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--sp-5);
  max-width: 1040px; margin: 0 auto; padding: calc(var(--sp-3) + var(--safe-t)) max(var(--sp-4), var(--safe-r)) calc(var(--sp-6) + var(--safe-b)) max(var(--sp-4), var(--safe-l)); }
.login__top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.login__logo { height: 22px; width: auto; }
.login__tools { display: flex; align-items: center; gap: var(--sp-1); margin-right: -8px; }
.login__lang { min-width: 52px; }
/* The page's main part (a landmark for screen readers) without a box of its own: the grid stays as it was. */
.login__main { display: contents; }
.login__intro { display: grid; justify-items: start; gap: var(--sp-3); }
.login__reti { margin-bottom: var(--sp-1); }
.login__say { padding: 12px 16px; border-radius: var(--r-m) var(--r-m) var(--r-m) 4px; background: var(--surface-1); }
.login__title { margin-top: var(--sp-3); font-size: var(--fs-2xl); letter-spacing: -0.025em; }
.login__pitch { color: var(--text-secondary); max-width: 46ch; }
@media (max-width: 599.98px) { .login__pitch { font-size: var(--fs-sm); } .login__title { font-size: var(--fs-xl); } }
.login__card { padding: var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); }
.login__tabs { margin-bottom: var(--sp-5); background: var(--surface-2); }
#auth-panel h2 { font-size: var(--fs-xl); }
.login-hint { margin: var(--sp-1) 0 var(--sp-4); color: var(--text-secondary); font-size: var(--fs-sm); }
.login-footer { margin-top: var(--sp-5); display: grid; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-xs); }
.login-footer-link { color: var(--text-secondary); font-weight: 600; text-underline-offset: 3px; }
.login-forgot { margin-top: var(--sp-3); text-align: center; }
/* The sign-in fits the screen: no scrolling to reach its button. */
#auth-panel .form-group { margin-bottom: var(--sp-3); }
#auth-panel .login-hint { margin-bottom: var(--sp-3); }
.login .login-footer { margin-top: var(--sp-3); }
.login .login-forgot { margin-top: var(--sp-2); }
.login__tabs { margin-bottom: var(--sp-4); }
@media (max-width: 899.98px) {
  .login { gap: var(--sp-3); padding-bottom: calc(var(--sp-3) + var(--safe-b)); }
  /* Reti beside its hello, small; the tabs already say sign in or create. */
  .login__intro { grid-template-columns: auto minmax(0, 1fr); align-items: end; column-gap: var(--sp-3); row-gap: var(--sp-2); }
  .login__reti { margin: 0; }
  .login__reti .cs-av { --cs-size: 64px !important; }
  .login__reti svg { width: 64px !important; height: auto !important; }
  .login__title, .login__pitch { grid-column: 1 / -1; margin-top: 0; }
  .login__card { padding: var(--sp-4); }
  #auth-panel > h2, #auth-panel > .login-hint { display: none; }
  .login .btn-lg { min-height: 52px; }
}
/* Confirming the e-mail: no sign-in tabs, the code big and easy to type. */
.is-verify .login__tabs, .is-verify .login__title, .is-verify .login__pitch { display: none; }
.verify { display: grid; gap: var(--sp-3); }
#auth-panel .verify > * { margin: 0; }
.verify form { display: grid; gap: var(--sp-2); }
.verify .form-group { margin: 0; }
.verify-code { min-height: 56px; font-size: 1.75rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
/* A short screen: the greeting's title gives way to the form. */
@media (max-width: 899.98px) and (max-height: 720px) { .login__title { display: none; } .login__top { min-height: 44px; } }
@media (min-width: 900px) and (max-height: 820px) { .login__card { padding: var(--sp-5) !important; } .login .login-footer { display: none; } }
@media (min-width: 900px) {
  .login { grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px); grid-template-rows: auto 1fr; column-gap: var(--sp-8); align-content: stretch;
    padding-bottom: calc(var(--sp-4) + var(--safe-b)); }
  .login__top { grid-column: 1 / -1; }
  .login__intro { align-self: center; }
  .login__title { font-size: 44px; }
  .login__card { align-self: center; padding: var(--sp-6); }
}

/* ══ Home ════════════════════════════════════════════════════════════
   Reti's words and today's topic in one panel with the one big button;
   the other courses as rows; the week; the box to ask Reti, in the
   thumb's reach. */
.home { gap: var(--sp-4); }
.hero { display: grid; gap: var(--sp-5); padding: var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); }
.hero__reti { display: flex; align-items: flex-end; gap: var(--sp-3); }
.hero__reti .say { flex: 1 1 auto; min-width: 0; padding-bottom: 6px; }
.hero__focus { display: grid; gap: var(--sp-3); }
.hero__course { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.hero__course a { color: inherit; text-decoration: none; }
.hero__course a:hover { text-decoration: underline; }
.hero__focus h2 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.hero__focus .btn { margin-top: var(--sp-2); }
.hero__sub { color: var(--text-secondary); max-width: 60ch; }
.day-list { display: grid; gap: var(--sp-2); }
.day { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-4); border-radius: var(--r-m); background: var(--surface-1); }
.day__main { display: grid; gap: 2px; min-width: 0; text-decoration: none; }
.day__main strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day__main span { color: var(--text-secondary); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day__meter { grid-column: 1; grid-row: 2; }
.day__go { grid-column: 2; grid-row: 1 / span 2; width: 52px; height: 52px; background: var(--accent); color: var(--accent-contrast); }
.day__go:hover { background: var(--accent-light); color: var(--accent-contrast); }
.day.is-met .day__go { background: var(--surface-2); color: var(--text-primary); }
/* Home's course cards: the whole card opens the course; ▶ starts a session on it. */
.home-courses .day { position: relative; transition: background 150ms; }
.home-courses .day:hover { background: var(--surface-hover); }
.home-courses .day__main::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.home-courses .day__go { position: relative; z-index: 1; }
.day__when { margin-left: var(--sp-2); font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
.day__when.is-near { color: var(--accent); }
.day--new { grid-template-columns: 1fr; padding-block: var(--sp-3); background: transparent; border: 1px dashed var(--line); }
.day--new .day__main { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; color: var(--text-secondary); }
.home-week .panel__head h3 { color: var(--text-primary); font-size: var(--fs-md); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-4); }
.week__day { display: grid; justify-items: center; gap: 6px; }
.week__bar { display: flex; align-items: flex-end; width: 100%; max-width: 36px; height: 88px; border-radius: 8px; background: var(--seg-off); overflow: hidden; }
.week__bar i { display: block; width: 100%; border-radius: 8px; background: color-mix(in srgb, var(--accent) 55%, var(--surface-1)); }
.week__day.is-today .week__bar i { background: var(--accent); }
.week__day small { font-size: var(--fs-xs); }
.week__day.is-today small { color: var(--text-primary); font-weight: 700; }
.home-week__facts { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line-subtle); }
.home-week__facts > div { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 32px; }
.home-week__facts dt { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-secondary); font-size: var(--fs-sm); }
.home-week__facts dt .ico { color: var(--text-muted); }
.home-week__facts dd { font-weight: 600; font-size: var(--fs-sm); text-align: right; }
.home-week__facts a { color: var(--text-primary); text-underline-offset: 3px; }
/* The box to ask Reti: on a phone it stays above the tab bar. */
.ask { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 18px; border-radius: var(--r-pill); background: var(--surface-1);
  border: 1px solid var(--line); flex-wrap: wrap; }
.ask__in { flex: 1 1 100px; min-width: 0; min-height: 44px; border: 0; outline: 0; background: none; font: inherit; font-size: var(--fs-md);
  line-height: 1.45; padding: 11px 0; resize: none; overflow-y: hidden; color: inherit; }
/* A question of more than a line: the box is a card, its buttons stay at its foot. */
.ask.is-tall { align-items: flex-end; justify-content: flex-end; border-radius: var(--r-l); padding: 6px 6px 6px 18px; }
.ask.is-tall .ask__in { flex-basis: 100%; padding-right: 12px; }
.ask__in::placeholder { color: var(--text-muted); }
.ask:focus-within { border-color: var(--accent); }
.ask__photo { position: relative; flex: 0 0 100%; order: -1; padding: 6px 0 4px; }
.ask__photo img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-s); }
.ask__photo button { position: absolute; top: 0; left: 52px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-primary); }
@media (max-width: 1023.98px) {
  .home__main, .home__side { display: contents; }
  .home .ask { order: 9; position: sticky; bottom: calc(var(--tabs-h) + var(--safe-b) + var(--sp-3)); z-index: 2; box-shadow: 0 0 0 8px var(--surface-0); }
  body.has-sess-pill .home .ask { bottom: calc(var(--tabs-h) + var(--safe-b) + 72px); }
  body.has-sess-pill .page-wrap { padding-bottom: 96px; }
}
/* Today's plan across courses: a wide screen has room for it. */
.home-plan { display: none; }
.plan-list { display: grid; gap: 2px; }
.plan-list a { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-s); text-decoration: none; }
.plan-list a:hover { background: var(--fill-hover); }
.plan-list__t { display: grid; min-width: 0; }
.plan-list__t span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-list li.is-done .plan-list__t span { color: var(--text-muted); text-decoration: line-through; }
@media (min-width: 1024px) {
  .home { gap: var(--sp-5); }
  .home__main { display: grid; gap: var(--sp-4); }
  /* Reti beside its words, the day's topic beside it: one short panel. */
  .home .hero { padding: var(--sp-5) var(--sp-6); }
  .hero__focus h2 { font-size: var(--fs-3xl); }
  .home__side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); align-items: start; }
  .home__side > .block { display: grid; gap: var(--sp-3); }
  .home__side > .block > h2 { margin: 0; }
  .home-plan { display: block; }
  /* The other courses, compact: a name, its minutes and the play button. */
  .home__side .day { padding: var(--sp-3) var(--sp-4); gap: 2px var(--sp-3); }
  .home__side .day__main span { display: none; }
  .home__side .day__go { width: 44px; height: 44px; }
}

/* Reti's village (Ben): a pixel house per finished session, on one ground line. */
.village { display: grid; gap: var(--sp-2); }
.village__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 6px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.village__row li { display: flex; align-items: flex-end; }
.village .v-roof { fill: var(--accent); } .village .v-wall { fill: var(--surface-3); } .village .v-door { fill: var(--text-muted); }
.village .v-win { fill: var(--good); } .village .v-pole { fill: var(--text-secondary); } .village .v-flag { fill: var(--good); }

/* ══ Courses ═════════════════════════════════════════════════════════ */
.course-list { display: grid; gap: var(--sp-3); }
@media (min-width: 768px) { .course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .course-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } .course-list .course { padding: var(--sp-4) var(--sp-5); } }
.course { display: grid; gap: var(--sp-3); padding: var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); text-decoration: none; transition: background-color var(--t); }
.course:hover { background: var(--surface-hover); }
.course__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.course__head strong { font-size: var(--fs-lg); font-weight: 700; }
.course__when { flex: none; font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.course__when.is-near, .is-near { color: var(--accent); }
.course__meter { display: flex; align-items: center; gap: var(--sp-3); }
.course__meter small { flex: none; }
.course__meter .sq { flex: 1 1 0; }
.course__today { color: var(--text-secondary); font-size: var(--fs-sm); }
.empty-page { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-4); text-align: center; }
.empty-page h2 { font-size: var(--fs-xl); }
.empty-page p { color: var(--text-secondary); max-width: 40ch; }
.empty-page .btn { margin-top: var(--sp-2); }

/* ══ Profilim ═════════════════════════════════════════════════════════
   Its parts (overview, settings, appearance, notifications, account) are
   drawn in the page itself. A phone: the name, the parts as a row of chips
   that scrolls sideways, then the part. A computer: the name and the parts
   on the left, the part beside them. */
.me { gap: var(--sp-4); max-width: 640px; width: 100%; margin-inline: auto; }
.me-nav { min-width: 0; }
.me-nav .menu-list { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding: 0; background: none; border-radius: 0;
  margin-inline: calc(-1 * var(--sp-4)); padding-inline: var(--sp-4); scroll-snap-type: x proximity; }
.me-nav .menu-list::-webkit-scrollbar { display: none; }
.me-nav li { flex: none; scroll-snap-align: start; }
.me-nav .menu-row { min-height: 44px; width: auto; padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--surface-1); white-space: nowrap; }
.me-nav .menu-row.is-on { background: var(--accent-soft); color: var(--text-primary); }
.me-nav .menu-row.is-on .ico { color: var(--accent); }
.me-part { display: grid; gap: var(--sp-4); align-content: start; min-width: 0; }
.me-part > .settings-sec { display: grid; }
.me-part > *, .me-look .ap, .ap--inline .ap__panel, .ap--inline .ap__body { min-width: 0; }
.me-part .pw-form { display: grid; gap: var(--sp-3); max-width: 420px; }
.me-part .pw-form .btn { justify-self: start; }
@media (min-width: 1024px) {
  .me { max-width: 1040px; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; column-gap: var(--sp-6); }
  .me > .me-head { grid-column: 1; }
  .me > .me-nav { grid-column: 1; grid-row: 2; }
  .me > .me-part { grid-column: 2; grid-row: 1 / span 2; }
  .me-nav .menu-list { display: grid; gap: 2px; overflow: visible; margin: 0; padding: var(--sp-2); background: var(--surface-1); border-radius: var(--r-l); }
  .me-nav .menu-row { width: 100%; border-radius: var(--r-m); background: none; min-height: 52px; }
  .me-nav .menu-row.is-on { background: var(--accent-soft); }
}
/* Reti's own page: its settings, and beside them (under them on a phone)
   the day's questions, what it remembers and its journal. */
.reti { max-width: 1040px; width: 100%; margin-inline: auto; gap: var(--sp-4); }
.reti-page__lead { color: var(--text-secondary); font-size: var(--fs-sm); max-width: 70ch; }
.reti-page__grid { display: grid; gap: var(--sp-4); }
.reti-page__main, .reti-page__side { display: grid; gap: var(--sp-4); align-content: start; min-width: 0; }
.reti-page__main > .settings-sec, .reti-page__side > .settings-sec { display: grid; }
/* On Reti's page the panel is the card: its settings sit in it with no second card of their own. */
.reti-page__main > .settings-sec { padding: 0; background: none; }
@media (min-width: 1024px) { .reti-page__grid { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); align-items: start; } }
.me-head { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-2) 0; }
.me-head h1 { font-size: var(--fs-2xl); }
.me-head p { color: var(--text-muted); font-size: var(--fs-sm); }
.plan-card { display: grid; gap: var(--sp-3); padding: var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); }
.plan-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.plan-card__head span { font-size: var(--fs-sm); color: var(--text-muted); }
.plan-card p { color: var(--text-secondary); font-size: var(--fs-sm); }
/* The three plans (Profilim): one list, the learner's own row marked with the accent's hairline. */
.plans { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }
.plan-list { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
.plan-list__item { display: grid; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-m); background: var(--surface-1); border: 1px solid transparent; }
.plan-list__item.is-on { border-color: var(--accent); }
.plan-list__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.plan-list__head span { font-size: var(--fs-sm); color: var(--text-muted); }
.plan-list__item.is-on .plan-list__head span { color: var(--accent); }
.plan-list__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); color: var(--text-secondary); font-size: var(--fs-sm); }
@media (min-width: 720px) { .plan-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.menu-list { border-radius: var(--r-l); background: var(--surface-1); padding: var(--sp-2); }
a.menu-row { text-decoration: none; color: inherit; }
.menu-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-m);
  background: none; color: var(--text-primary); font-weight: 600; text-align: left; cursor: pointer; position: relative; }
.menu-row:hover { background: var(--fill-hover); }
.menu-row .ico { color: var(--text-muted); }
.menu-row.is-danger, .menu-row.is-danger .ico { color: var(--danger); }
.menu-row .notif-badge { position: static; margin-left: auto; }

/* ══ Friends ═════════════════════════════════════════════════════════ */
.friends-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 900px) { .friends-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }
.friends-main, .friends-list { display: grid; gap: var(--sp-4); }
.fkey { display: grid; gap: var(--sp-3); padding: var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); }
.fkey h2, .friends-sec h2 { font-size: var(--fs-md); color: var(--text-secondary); }
.fkey__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.fkey__code { font: 600 30px/1.1 var(--font-reti); letter-spacing: .08em; color: var(--accent); }
.fkey p { color: var(--text-secondary); font-size: var(--fs-sm); }
.fkey .link { justify-self: start; font-size: var(--fs-sm); color: var(--text-secondary); min-height: 32px; }
.add-friend { display: grid; gap: var(--sp-2); padding: var(--sp-5); border-radius: var(--r-l); background: var(--surface-1); }
.add-friend label { font-weight: 700; }
.add-friend__row { display: flex; gap: var(--sp-2); }
.add-friend__row .text-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .06em; }
.add-friend__row .text-input::placeholder { text-transform: none; letter-spacing: 0; }
.friends-sec { display: grid; gap: var(--sp-2); }
.people { display: grid; gap: var(--sp-2); }
.person { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); border-radius: var(--r-m); background: var(--surface-1); }
.person__main { flex: 1; min-width: 0; display: grid; }
.person__main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__main small.is-here { color: var(--good); font-weight: 600; }
.person__acts { display: flex; gap: 2px; flex: none; }
.person__acts .btn { min-height: 44px; padding: 0 12px; }
.person__acts .btn svg { width: 16px !important; height: 16px !important; }

/* ══ Calendar ════════════════════════════════════════════════════════ */
.cal { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
@media (min-width: 1024px) { .cal { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; } }
.cal-main, .cal-side > .card { padding: var(--sp-4); }
.cal-side { display: grid; gap: var(--sp-4); }
/* The month and its arrows fit a 320px phone: the title gives way, the arrows never leave the screen. */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.cal-head > * { min-width: 0; }
.cal-title { font-size: var(--fs-lg); font-weight: 700; text-transform: capitalize; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav .btn { min-width: 44px; padding: 0 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { padding: 4px 0; text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.cal-day { position: relative; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px;
  border: 0; border-radius: var(--r-s); background: none; color: var(--text-primary); cursor: pointer; overflow: hidden; }
.cal-day:hover { background: var(--fill-hover); }
.cal-day.is-out { color: var(--text-muted); }
.cal-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.cal-day.is-today .cal-num { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.is-sel .cal-num { background: var(--accent); color: var(--accent-contrast); box-shadow: none; }
.cal-chips { display: none; }
.cal-dots { display: flex; gap: 3px; }
.cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex: none; }
.cal-dot--quiz, .cal-dot--assignment { background: var(--danger); }
.cal-dot--plan { background: var(--accent); }
@media (min-width: 1024px) {
  /* Six weeks in the window's height (the page needs no scrolling). */
  .cal-day { height: clamp(52px, calc((100vh - 420px) / 6), 88px); align-items: stretch; padding: 4px 6px; gap: 2px; container-type: size; }
  /* A short day shows its first entry only (never one cut in half); the day's list is beside it. */
  @container (max-height: 80px) { .cal-chips > :nth-child(n+2) { display: none; } }
  .cal-num { align-self: flex-start; }
  .cal-chips { display: grid; gap: 2px; }
  .cal-dots { display: none; }
  .cal-chip { display: block; padding: 2px 6px; border-radius: 6px; font-size: 11.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: var(--accent-soft); color: var(--text-primary); text-align: left; }
  .cal-chip--quiz, .cal-chip--assignment { background: color-mix(in srgb, var(--danger) 18%, transparent); }
  .cal-chip.is-done { opacity: .55; text-decoration: line-through; }
  .cal-more { font-size: 11px; color: var(--text-muted); text-align: left; padding-left: 6px; }
}
.cal-legend { display: flex; gap: var(--sp-4); margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-side h3 { color: var(--text-primary); text-transform: capitalize; }
.cal-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line-subtle); }
.cal-item:first-child { border-top: 0; }
.cal-item[data-clickable] { cursor: pointer; }
.cal-item__bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--accent); flex: none; }
.cal-item--quiz .cal-item__bar, .cal-item--assignment .cal-item__bar { background: var(--danger); }
.cal-item__main { flex: 1; min-width: 0; display: grid; }
.cal-item__main strong { font-weight: 600; }
.cal-item__main p { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-secondary); }
.cal-status { color: var(--good); }
.cal-form { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line-subtle); }
.cal-form__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.cal-form__row .text-input { flex: 1; min-width: 0; }
/* A phone's date field will not shrink below its own width: on a narrow screen the day and the hour take a line each. */
@media (max-width: 400px) { .cal-form__row:has(input[type=date]) { flex-wrap: wrap; } .cal-form__row input[type=date], .cal-form__row input[type=time] { flex: 1 1 100%; } }
.cal-form textarea.text-input { min-height: 72px; }
.cal-check { font-size: var(--fs-xs); color: var(--text-muted); }
.cal-up { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; border-top: 1px solid var(--line-subtle); cursor: pointer; }
.cal-up:first-child { border-top: 0; }
.cal-up__t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm); font-weight: 600; }
.dash-empty { color: var(--text-muted); font-size: var(--fs-sm); padding: var(--sp-2) 0; }

/* ══ A course ════════════════════════════════════════════════════════
   Its name is in the top bar, its parts are the segmented tabs under it;
   the page says the rest: the exam day, today with Reti, the way. */
.course-head { margin: 0 0 var(--sp-4); }
.course-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.course-head__meta { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; }
.course-head__meta .is-near { font-weight: 700; }
.today { display: grid; gap: var(--sp-4); }
.today__side { display: grid; gap: var(--sp-4); }
@media (min-width: 1024px) {
  .today { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; }
  /* A wide screen in one view: the study time joins the side column
     instead of a full-width row under everything. */
  #tab-s-home { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: var(--sp-4); align-items: start; }
  #tab-s-home > #cx-today, #tab-s-home .today { display: contents; }
  #tab-s-home .course-head { grid-column: 1 / -1; margin: 0; }
  #tab-s-home .today > .focus { grid-column: 1; grid-row: 2 / span 2; }
  #tab-s-home .today__side { grid-column: 2; grid-row: 2; }
  #tab-s-home > .study-time { grid-column: 2; grid-row: 3; margin: 0; }
}
.focus__av { flex: none; width: 80px; min-height: 67px; display: flex; align-items: flex-end; }
.focus__scope { color: var(--text-secondary); }
.focus__list { display: grid; gap: 2px; margin-top: var(--sp-2); }
.focus__list li { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; font-size: var(--fs-sm); }
.focus__list li.is-done span[dir] { color: var(--text-muted); text-decoration: line-through; }
.tick-sm { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--surface-0); }
.tick-sm.is-on { background: var(--good); box-shadow: none; }
.progress__streak { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.progress__streak .ico { color: var(--accent); }
.study-time { display: grid; gap: var(--sp-3); }
.study-time__body { gap: var(--sp-4); }
.study-time__mine { display: flex; gap: var(--sp-6); }
.stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.study-time__big { font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.study-time__mid { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.study-time__rank, .study-time__last, .study-time__empty, .study-time__cheer { font-size: var(--fs-sm); color: var(--text-secondary); }
.study-time__lead { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); margin-bottom: var(--sp-2); }
.study-time__list { display: grid; gap: 2px; }
.study-time__row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-2); border-radius: var(--r-s); font-size: var(--fs-sm); }
.study-time__row.is-me { background: var(--accent-soft); font-weight: 700; }
.study-time__pos { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.study-time__secs { font-variant-numeric: tabular-nums; color: var(--text-secondary); }

/* The roadmap: one line through the course, a mark for every topic; the
   done ones filled in Reti's mint, today's ringed in the accent, Reti
   standing beside the one they are at. */
.road-progress { margin: 0 0 var(--sp-2); }
.road, .road-progress, .add-topic, #cx-road .course-head { max-width: 760px; }
.road { position: relative; display: grid; gap: var(--sp-5); }
.unit__title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); font-size: var(--fs-md); color: var(--text-secondary); }
.unit__title small { font-weight: 600; font-variant-numeric: tabular-nums; }
.topics { position: relative; display: grid; }
.topics::before { content: ''; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px; border-radius: 1px; background: var(--line); }
.topic { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; gap: var(--sp-3); padding: 8px 0; }
.tick { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: none; cursor: default; color: var(--surface-0); }
.tick::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface-0); box-shadow: inset 0 0 0 2px var(--line-strong); transition: background-color var(--t), box-shadow var(--t); }
.tick > span { position: relative; display: grid; place-items: center; }
button.tick { cursor: pointer; }
button.tick:hover::before { box-shadow: inset 0 0 0 2px var(--accent); }
.tick.is-on::before { background: var(--good); box-shadow: none; }
.topic.is-today .tick::before, .topic.is-here .tick::before { box-shadow: inset 0 0 0 3px var(--accent); }
.topic.is-learned .tick::before { background: var(--good); box-shadow: none; }
.topic__main { min-width: 0; padding-top: 10px; display: grid; gap: 2px; }
.topic__title { font-weight: 600; }
.topic.is-learned .topic__title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.topic__scope { font-size: var(--fs-sm); color: var(--text-secondary); }
.topic__when { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.topic.is-today .topic__when { color: var(--accent); }
.topic.is-here .topic__main { margin-top: 2px; padding: 12px 16px 14px; border-radius: var(--r-m); background: var(--surface-1); }
.topic__reti { display: inline-flex; align-items: flex-end; gap: 6px; margin-bottom: 4px; font: 600 var(--fs-xs)/1.2 var(--font-reti); color: var(--accent); }
.topic__reti-art { display: inline-flex; width: 30px; }
.topic__acts { display: flex; gap: 2px; padding-top: 0; }
.topic__go { color: var(--accent); }
.topic.is-preparing .topic__title, .topic.is-waiting .topic__title { color: var(--text-secondary); }
.road-end { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding-left: 10px; }
.road-end__mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); flex: none; }
.road-end strong { display: block; color: var(--accent); }
.add-topic { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); padding: var(--sp-5); border-radius: var(--r-l); border: 1px dashed var(--line-strong); }
.add-topic__head h3 { font-size: var(--fs-md); }
.add-topic__head p { font-size: var(--fs-sm); color: var(--text-muted); }
.add-topic__row { display: grid; gap: var(--sp-2); }
@media (min-width: 768px) { .add-topic__row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: center; } .add-topic__row [name="unit_name"] { grid-column: 1 / -1; grid-row: 2; } }

/* A course's settings. */
.form-panel { display: grid; gap: var(--sp-2); max-width: 560px; }
.form-panel .btn { justify-self: start; }
.danger-zone-x { display: grid; gap: var(--sp-3); justify-items: start; max-width: 560px; margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.danger-zone-x h2 { font-size: var(--fs-md); color: var(--text-secondary); }

/* ══ A session ═══════════════════════════════════════════════════════
   A focus screen, a shade deeper: the topic, a big quiet clock, the
   day's minutes filling, Reti on its stage studying along, and the two
   controls under the thumb. */
body.is-focus, body.is-focus #student-dashboard { background: var(--surface-3); }
body.is-focus #course-main { max-width: 640px; padding-top: 0; padding-bottom: 0; }
.sess { min-height: calc(100dvh - var(--safe-t) - var(--safe-b)); display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(var(--sp-2) + var(--safe-t)) 0 var(--sp-5); }
.sess__top { align-self: stretch; display: flex; align-items: center; gap: var(--sp-2); min-height: 56px; }
.sess__down { margin-left: -10px; color: var(--text-primary); background: var(--surface-1); }
.sess__course { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess__topic { margin-top: var(--sp-5); display: grid; gap: 6px; }
.sess__topic p:first-child:not(.sess__scope) { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.sess__topic h1 { font-size: var(--fs-xl); font-weight: 600; }
.sess__scope { font-size: var(--fs-sm); color: var(--text-secondary); max-width: 46ch; }
.sess__how { font-size: var(--fs-sm); color: var(--text-muted); max-width: 46ch; }
.sess__clock { margin-top: var(--sp-5); font: 300 clamp(76px, 24vw, 112px)/1 var(--font-ui); letter-spacing: -0.04em; min-height: 1em; font-variant-numeric: tabular-nums; }
.sess__room { flex: 1 0 150px; align-self: stretch; min-height: 150px; }
.sess__now { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--good); }
.sess__note { min-height: 24px; margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-secondary); }
.sess__note.is-done { color: var(--good); font-weight: 600; }
.sess__acts { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-4); width: 100%; }
.sess__pause { width: 72px; height: 72px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface-1); color: var(--text-primary); cursor: pointer; transition: background-color var(--t); }
.sess__pause:hover { background: var(--surface-2); }
.sess__end { min-height: 72px; flex: 1 1 auto; max-width: 300px; }
.sess__ask { color: var(--text-secondary); }
/* Reti's help with the topic in front of them: explain it, ask on it, or anything. */
.sess__help { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.sess__help .btn-sm { min-height: 44px; }
/* A wide screen: the same calm column, larger; Reti has the whole screen
   to wander over. */
@media (min-width: 1024px) {
  body.is-focus #course-main { max-width: 760px; }
  /* All of it in one screen, whatever its height: the clock and the gaps
     grow and shrink with the window; Reti's open space takes what is left. */
  .sess { min-height: 100dvh; padding: clamp(8px, 2vh, 20px) 0 clamp(12px, 3vh, 40px); }
  .sess__topic { margin-top: clamp(8px, 3vh, 40px); }
  .sess__topic h1 { font-size: var(--fs-2xl); }
  .sess__clock { font-size: clamp(88px, 17vh, 168px); margin-top: clamp(8px, 2.5vh, 32px); }
  .sess__room { flex: 1 1 96px; min-height: 96px; max-height: 260px; }
  .sess__acts { margin-top: clamp(8px, 1.5vh, 16px); }
  .sess__end { max-width: 340px; }
}
/* Reti, tapped where it sits on a page: a hop of its own. */
.focus__av { cursor: pointer; }
.is-hop { animation: reti-hop .42s steps(4, end); }
@keyframes reti-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px); } 70% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .is-hop { animation: none; } }

/* ══ Dialogs ═════════════════════════════════════════════════════════ */
/* Reti's window: a new goal talked through with Reti, or material added.
   Full height on a phone; Reti on top, the talk, the answer box below. */
/* One steady size while the talk goes on (it never grows and shrinks with each
   message); the talk scrolls inside it, what is under it never pushes it away. */
.goal-card { width: min(640px, 100%); height: min(88dvh, 860px); display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); overflow: hidden; }
@media (max-width: 767.98px) { #goal-modal .goal-card { height: calc(100dvh - var(--safe-t) - var(--sp-3)); max-height: none; } }
.goal-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 26px; line-height: 1; cursor: pointer; z-index: 1; }
.goal-x:hover { background: var(--fill-subtle); color: var(--text-primary); }
.goal-reti { display: flex; justify-content: center; min-height: 72px; flex: none; }
.goal-talk { flex: 1 1 0; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-1) 2px; }
.goal-msg { max-width: 88%; padding: 12px 16px; border-radius: var(--r-m); font-size: var(--fs-md); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.goal-msg--reti { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; font-family: var(--font-reti); font-weight: 600; letter-spacing: .01em; }
/* Its longer words in the reading font, as its long answers are in its bubble: a paragraph in pixels tires the eyes. */
.goal-msg--reti.is-long { font-family: var(--font-ui, system-ui); font-weight: 400; letter-spacing: 0; }
.goal-msg--learner { align-self: flex-end; background: var(--accent); color: var(--accent-contrast); border-bottom-right-radius: 6px; }
.goal-msg--wait { color: var(--text-secondary); }
.goal-msg--wait::after { content: '▍'; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.goal-msg--track, .goal-track { align-self: stretch; max-width: none; display: grid; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-m); background: var(--surface-2); font-family: var(--font-ui); }
.goal-track strong { font-weight: 700; }
.goal-opts { display: flex; flex-wrap: wrap; gap: var(--sp-2); flex: 0 1 auto; max-height: 30%; overflow-y: auto; }
.goal-opts .btn { white-space: normal; text-align: left; line-height: 1.3; }
.goal-pages { flex: none; display: grid; gap: var(--sp-2); }
.goal-say { display: flex; align-items: flex-end; gap: var(--sp-2); flex: none; }
.goal-say .text-input { flex: 1; min-width: 0; }
.goal-say textarea.text-input { min-height: 96px; max-height: 28dvh; }
.goal-pages { max-height: 30%; overflow-y: auto; }
.goal-road { align-self: stretch; display: grid; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-m); background: var(--surface-0); }
.goal-road__meta { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: var(--sp-1); }
/* Each unit one line that opens to its topics: the roadmap fits in a glance. */
.goal-road__unit { border-top: 1px solid var(--line-subtle); }
.goal-road__unit summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 44px; cursor: pointer;
  font-weight: 600; font-size: var(--fs-sm); list-style: none; }
.goal-road__unit summary::-webkit-details-marker { display: none; }
.goal-road__unit summary::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); margin-right: 4px; transition: transform var(--transition-fast); }
.goal-road__unit[open] summary::after { transform: rotate(-135deg); }
.goal-road__unit summary span { min-width: 0; overflow-wrap: anywhere; }
.goal-road__unit summary small { margin-left: auto; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.goal-road__unit ol { display: grid; gap: 0; padding: 0 0 var(--sp-2) var(--sp-4); list-style: decimal; color: var(--text-muted); font-size: var(--fs-sm); }
.goal-road__unit li { padding: 3px 0; }
.goal-road__unit li::marker { font-variant-numeric: tabular-nums; }
.goal-road__t { color: var(--text-primary); }
.goal-road__day { margin-left: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
/* Starting with no roadmap: a quiet line under the answers, then its own small form. */
.goal-alt { align-self: center; flex: none; min-height: 44px; padding: 0 var(--sp-3); border: 0; background: none; color: var(--text-secondary);
  font: 600 var(--fs-sm)/1 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.goal-alt:hover { color: var(--text-primary); }
.goal-quick { flex: none; display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-m); background: var(--surface-2); }
.goal-quick__min { border: 0; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.goal-quick__min legend { font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-2); }
.goal-quick__min .goal-opts { max-height: none; }
.goal-quick__acts { display: flex; justify-content: space-between; gap: var(--sp-2); }
.goal-opts--quiz { flex-direction: column; flex-wrap: nowrap; align-items: stretch; max-height: 48%; }
.goal-opts--quiz .btn { justify-content: flex-start; min-height: 44px; }
.pages-ask { display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.pages-ask__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2); }
.pages-ask__row label { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); }
.pages-ask__row .text-input { width: 96px; }
.pdf-analysis { display: grid; gap: var(--sp-2); }
.pdf-analysis__head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.pdf-analysis__bar { height: 6px; border-radius: 3px; background: var(--seg-off); overflow: hidden; }
.pdf-analysis__bar > * { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s ease-out; }

/* First steps after signing up. */
.welcome { display: grid; gap: var(--sp-4); }
.welcome__head { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; }
.welcome__head p { color: var(--text-secondary); }
.welcome__goals { display: flex; gap: var(--sp-2); }
.welcome__goals .btn { flex: 1; }
.welcome__acts { display: flex; gap: var(--sp-3); }
.welcome__acts .btn { flex: 1; }

/* My profile. */
.profile-card__photo { display: flex; justify-content: center; margin: var(--sp-2) 0 var(--sp-4); }
.profile-card__fields { display: grid; gap: 2px; margin-bottom: var(--sp-4); border-radius: var(--r-m); background: var(--surface-2); padding: var(--sp-2) var(--sp-4); }
.profile-card__fields > div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line-subtle); }
.profile-card__fields > div:first-child { border-top: 0; }
.profile-card__fields dt { color: var(--text-muted); font-size: var(--fs-sm); }
.profile-card__fields dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.profile-card__password { display: grid; gap: var(--sp-3); justify-items: start; }
.profile-card__password + .profile-card__password { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.profile-card__password .pw-form { justify-self: stretch; }
.profile-card__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.privacy { display: grid; gap: var(--sp-3); color: var(--text-secondary); line-height: 1.65; }

/* A material: what it is, its progress, its parts. */
#material-modal .modal-content { width: min(640px, 100%); }
.cx-card { display: grid; gap: var(--sp-2); background: var(--surface-2); }
.cx-card__head { display: grid; gap: 2px; }
.cx-card__head h3 { font-size: var(--fs-md); }
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line-subtle); }
.dash-row:first-of-type { border-top: 0; }
.dash-row__main { display: grid; min-width: 0; }
.dash-row__main small { overflow-wrap: anywhere; }
.dash-row__side { flex: none; }
.pedagogy-guide-block { margin: var(--sp-3) 0 var(--sp-2); }
.pedagogy-guide-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--accent); }
.pedagogy-single-note { color: var(--text-secondary); line-height: 1.6; }
.material-text { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); line-height: 1.65; }
.material-text__page { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.material-text__chunk { white-space: pre-wrap; overflow-wrap: anywhere; }
.material-text mark, mark.hit { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 2px; }

/* Settings (js/settings.js): sections in tabs; a list of tabs on a wide
   screen, a row of them on a phone. */
.settings-card { width: min(760px, 100%); display: flex; flex-direction: column; padding: var(--sp-5); }
.settings-card > h2 { margin-bottom: var(--sp-4); }
.settings-layout { display: grid; gap: var(--sp-4); min-height: 0; }
@media (min-width: 768px) { .settings-layout { grid-template-columns: 180px minmax(0, 1fr); align-items: start; } }
.settings-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .settings-tabs { flex-direction: column; position: sticky; top: 0; } }
.settings-tab { display: flex; align-items: center; gap: var(--sp-2); flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-sm); text-align: left; cursor: pointer; white-space: nowrap; }
.settings-tab:hover { color: var(--text-primary); background: var(--fill-hover); }
.settings-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--text-primary); }
.settings-tab__icon { display: grid; place-items: center; width: 20px; height: 20px; color: var(--text-muted); }
.settings-tab__icon svg { width: 18px; height: 18px; }
.settings-tab[aria-selected="true"] .settings-tab__icon { color: var(--accent); }
.settings-body { min-width: 0; display: grid; gap: var(--sp-4); align-content: start; }
.settings-body > .settings-sec { display: none; }
.settings-card[data-show="reti"] .settings-body > .settings-sec[data-tab="reti"],
.settings-card[data-show="avatar"] .settings-body > .settings-sec[data-tab="avatar"],
.settings-card[data-show="general"] .settings-body > .settings-sec[data-tab="general"],
.settings-card[data-show="notify"] .settings-body > .settings-sec[data-tab="notify"],
.settings-card[data-show="account"] .settings-body > .settings-sec[data-tab="account"] { display: grid; }
.settings-sec { gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-m); background: var(--surface-2); }
.settings-sec__title { font-size: var(--fs-md); }
.settings-hint { font-size: var(--fs-sm); color: var(--text-secondary); }
.settings-line { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; min-height: 48px; }
.settings-line > span { min-width: 0; overflow-wrap: anywhere; }
.settings-line .text-input { flex: 1 1 200px; }
.settings-hero { display: flex; gap: var(--sp-4); align-items: flex-start; }
.settings-buddy__art { flex: none; display: grid; place-items: center; width: 80px; height: 72px; border-radius: var(--r-m); background: var(--surface-1); }
.settings-buddy__art--big { width: 128px; height: 112px; }
.settings-hero__main { flex: 1; min-width: 0; display: grid; gap: var(--sp-3); }
.settings-switch { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; }
.settings-hero__name { font-size: var(--fs-lg); font-weight: 700; }
.settings-switch__state { margin-left: auto; font-size: var(--fs-sm); color: var(--text-muted); }
.settings-switch__btn { position: relative; width: 52px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 16px; background: var(--line-strong); cursor: pointer; transition: background-color var(--t); }
.settings-switch__btn[aria-checked="true"] { background: var(--accent); }
.settings-switch__dot { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform var(--t); }
.settings-switch__btn[aria-checked="true"] .settings-switch__dot { transform: translateX(20px); }
.settings-switch.is-disabled { opacity: .5; }
.settings-name { display: grid; gap: 6px; }
.settings-name label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.settings-name__row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.settings-name__in { flex: 1 1 160px; }
.settings-name__err:empty { display: none; }
.settings-name__err { color: var(--danger); }
.settings-q { display: grid; gap: var(--sp-2); }
.settings-q__title { font-size: var(--fs-sm); color: var(--text-secondary); }
.settings-choices { display: grid; gap: var(--sp-2); }
@media (min-width: 560px) { .settings-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } .settings-choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.settings-choice { display: grid; gap: 2px; align-content: start; min-height: 56px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface-1); text-align: left; cursor: pointer; transition: border-color var(--t), background-color var(--t); }
.settings-choice b { font-weight: 700; font-size: var(--fs-sm); }
.settings-choice span { font-size: var(--fs-xs); color: var(--text-muted); }
.settings-choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.settings-choice:disabled { opacity: .5; cursor: default; }
.settings-speed__opts { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-1); }
.settings-speed__opt { flex: 1; min-height: 40px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.settings-speed__opt.is-on { background: var(--accent); color: var(--accent-contrast); }
/* Reti's ways, one compact row each: the question, one segmented choice, the chosen way in one line under it;
   on a wide screen the question beside its choice. */
.settings-rows { display: grid; gap: var(--sp-3); }
.settings-group { display: grid; gap: var(--sp-2); }
.settings-group + .settings-group { padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.settings-group__title { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }
.settings-row { display: grid; gap: 6px; }
.settings-row__q { font-weight: 600; font-size: var(--fs-sm); color: var(--text-primary); }
.settings-row__seg { background: var(--surface-2); }
.settings-row__seg .seg__item { min-height: 44px; padding: 0 8px; font-size: var(--fs-sm); line-height: 1.2; text-align: center; white-space: normal; }
.settings-row__seg .seg__item:disabled { opacity: .5; cursor: default; }
.settings-row__hint { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }
/* A yes-or-no setting: the question, the phone's own switch at its end, the whole row its target. */
.settings-row--switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: var(--sp-3); row-gap: 2px; min-height: 44px; cursor: pointer; }
.settings-row--switch .settings-row__q { flex: 1 1 0; min-width: 0; }
.settings-row--switch .settings-row__hint { flex-basis: 100%; }
.settings-row--switch.is-disabled { opacity: .5; cursor: default; }
.settings-hero__look { flex: none; width: 88px; display: grid; justify-items: center; gap: 4px; align-content: start; }
.settings-hero__look .btn { min-height: 44px; padding: 0 4px; font-size: var(--fs-xs); white-space: normal; line-height: 1.2; text-align: center; }
@media (min-width: 720px) {
  .settings-row:not(.settings-row--switch) { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); column-gap: var(--sp-4); align-items: center; }
  .settings-row:not(.settings-row--switch) .settings-row__hint { grid-column: 2; }
}
.settings-about summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; color: var(--text-secondary); }
.settings-avatar { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.settings-ed { display: grid; gap: var(--sp-3); }
.settings-ed__row { display: grid; gap: 6px; }
.settings-ed__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.settings-ed__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-ed__opt { display: grid; place-items: center; width: 52px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-1); cursor: pointer; }
.settings-ed__opt.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.settings-ed__swatch { width: 24px; height: 24px; border-radius: 50%; }
.settings-ed__foot { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.settings-ed__spacer { flex: 1; }
.settings-hours { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-hour { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-1); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.settings-hour.is-on, .settings-hour[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.notify-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.notify-table th, .notify-table td { padding: 8px 4px; text-align: left; border-top: 1px solid var(--line-subtle); }
.notify-table th { color: var(--text-muted); font-weight: 600; }
.journal-list { display: grid; gap: 2px; }
.journal-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.journal-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 2px var(--sp-3); padding: 10px 0;
  border-top: 1px solid var(--line-subtle); font-size: var(--fs-sm); }
.journal-line > span { display: grid; gap: 2px; }   /* who and when above the words, never run into them */
.journal-line:first-child { border-top: 0; }
.journal-when { font-size: var(--fs-xs); color: var(--text-muted); }

/* An invisible field the study room focuses first on iOS, so the keyboard
   opens without panning the page (costudy.js). */
.kb-proxy { position: absolute; top: calc(var(--safe-t) + 8px); left: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0;
  font-size: 16px; pointer-events: none; caret-color: transparent; }

/* «Yanlış olabilir mi?» under a lesson section, an answered question, a card's
   back: quiet, but a full touch target. What the check found replaces it. */
.cx-doubt { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); }
.cx-doubt__said { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-secondary); }


/* ══ Pages to read (services/reti_sources.py) ════════════════════════
   Under each topic's title, the pages Reti found when it was hard for them:
   a row each, the page's name and its site, a × to take it off. */
.src-panel__sub { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }
.src-topic + .src-topic { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--line-subtle); }
.src-topic h4 { margin: 0 0 var(--sp-1, 4px); font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); }
.srcs { list-style: none; margin: 0; padding: 0; display: grid; }
.src { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.src__a { flex: 1 1 auto; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: var(--sp-2); padding: 4px 0;
  color: var(--text-primary); text-decoration: none; }
.src__a .ico { flex: none; color: var(--accent); }
.src__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line);
  text-underline-offset: 3px; }
.src__a:hover .src__t { text-decoration-color: currentColor; }
.src__h { flex: none; color: var(--text-muted); font-size: var(--fs-sm); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src__x { flex: none; }
.srcs__more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--text-secondary); font-size: var(--fs-sm); }
.topic__main .srcs { margin-top: var(--sp-1, 4px); }

/* ══ Reti's earlier answers (study.js openAnswers) ═══════════════════
   A sheet from the bottom on a phone; on a wide screen a panel along the
   right edge, the page still in sight beside it. Newest first, by day. */
.answers { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.answers > h2 { flex: none; }
.ans-search { flex: none; position: relative; display: block; margin-bottom: var(--sp-3); }
.ans-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.ans-search .text-input { width: 100%; min-height: 44px; padding-left: 42px; }
.ans-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--sp-5)); padding: 0 var(--sp-5) var(--sp-5); }
.ans-day + .ans-day { margin-top: var(--sp-5); }
.ans-day h3 { position: sticky; top: 0; z-index: 1; margin: 0; padding: var(--sp-2) 0; background: var(--surface-1); font-size: var(--fs-sm);
  font-weight: 700; color: var(--text-secondary); }
.ans-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.ans { padding: var(--sp-4); border-radius: var(--r-m); background: var(--surface-2); }
.ans__q { margin: 0 0 var(--sp-3); display: grid; gap: 2px; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.ans__who { font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); }
.ans__a { display: flex; gap: var(--sp-3); align-items: flex-start; }
.ans__av { flex: none; width: 28px; height: 28px; }
.ans__a p { margin: 0; min-width: 0; font: 600 var(--fs-md)/1.5 var(--font-reti); color: var(--text-primary); white-space: pre-line; overflow-wrap: anywhere; }
.ans__src { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line-subtle); }
.ans__src > small { color: var(--text-muted); font-weight: 600; }
.ans__src .src__x { display: none; }
.ans__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); }
.ans__foot time { color: var(--text-muted); font-size: var(--fs-sm); }
.ans-empty { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-secondary); }
.ans-none { padding: var(--sp-4) 0; }
[data-ans-more] { margin-top: var(--sp-4); }
#answers-modal .modal-content { height: min(88dvh, 860px); }
@media (min-width: 768px) {
  #answers-modal { justify-content: flex-end; align-items: stretch; padding: var(--sp-3); }
  #answers-modal .modal-content { width: min(480px, 100%); height: auto; max-height: none; }
}
@media (max-width: 767.98px) {
  #answers-modal .modal-content { height: calc(100dvh - var(--safe-t) - var(--sp-5)); padding-bottom: 0; }
  .ans-scroll { margin: 0 calc(-1 * max(var(--sp-4), var(--safe-r))); padding: 0 max(var(--sp-4), var(--safe-r)) calc(var(--sp-5) + var(--safe-b)); }
}
