/* Hallmark · shape: app screen · genre: modern-minimal · theme: Ultraviolet, recoloured green by request (deal 2/3, seed plataforma-estudio-para-opositores-2daf·065b7a6c·2026-11-30·r0) · redesign: full
 * nav: kept (sidebar, eight destinations with the oposiciones; a glass panel that collapses under 60rem) · signature: the temario index, tema numbers in light Outfit figures on a frosted sheet · states: loading, empty, error, full · ultraviolet: corporate green and dark green by request (hue 150 to 165), rounded, one-hue gradients and frosted glass, sentence case kept for Spanish proper names (Guardia Civil, Constitución Española)
 * axes: light/geometric-sans/cool · posture: committed · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H3 E4 S4 R4 V4 · weakest: H, an app has no hero; the temario index and its figures carry the first screen */
/* Hallmark · answered F7 · one surface recipe per level is the page invariant; pills on .seg, progress tracks and the skeleton are controls and meters, not boxes */
@import url("./tokens.css");
@import url("./base.css");

/* App tokens: the project's roles on Ultraviolet, plus the user's asks (gradient, glass) */
:root {
  --side: 272px;
  --topbar: 60px;
  --sticky-offset: 0px;
  --control: 44px;
  --control-sm: 34px;
  --measure: 68ch;
  --radius-control: 12px;
  --radius-sheet: 20px;
  --radius-inner: 12px;
  --color-plate: oklch(99.3% 0.004 150);
  --color-glass: color-mix(in oklch, var(--color-plate) 74%, transparent);
  --color-glass-strong: color-mix(in oklch, var(--color-plate) 88%, transparent);
  --color-glass-edge: color-mix(in oklch, var(--color-plate) 70%, transparent);
  --color-scrim: oklch(19% 0.02 165 / 0.32);
  --color-error-soft: oklch(94% 0.03 27);
  --color-accent-wash: color-mix(in oklch, var(--color-accent-soft) 45%, transparent);
  --color-on-accent-muted: oklch(88% 0.04 150);
  --grad-accent: linear-gradient(135deg, oklch(58% 0.14 150), var(--color-accent-deep));
  --grad-accent-hover: linear-gradient(135deg, oklch(50% 0.14 152), oklch(33% 0.09 160));
  --grad-field: linear-gradient(160deg, oklch(43% 0.11 154), oklch(24% 0.06 165));
  --grad-page: radial-gradient(1200px 600px at 85% -10%, var(--color-accent-wash), transparent 70%), radial-gradient(900px 500px at -10% 110%, color-mix(in oklch, var(--color-paper-3) 70%, transparent), transparent 70%);
  --shadow-sheet: 0 1px 2px oklch(19% 0.02 165 / 0.05), 0 12px 32px -12px oklch(28% 0.06 160 / 0.18);
  --shadow-pop: 0 24px 64px -16px oklch(24% 0.06 162 / 0.32);
  --shadow-accent: 0 6px 16px -6px oklch(40% 0.11 156 / 0.5);
  --shadow-lift: 0 2px 10px -4px oklch(28% 0.06 160 / 0.26);
  --shadow-knob: 0 1px 3px oklch(19% 0.02 165 / 0.25);
  --shadow-msg: 0 1px 2px oklch(19% 0.02 165 / 0.08);
  --shadow-mark: oklch(40% 0.11 156 / 0.3);
  --blur: 18px;
  --text-reading: 1.0625rem;
}

html, body { height: 100%; }
body { background: var(--grad-page), var(--color-paper); background-attachment: fixed; }
#app { min-height: 100%; }
a { color: var(--color-accent-deep); }
h1, h2, h3, .brand { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.1; }
h1 { font-size: var(--text-3xl); max-width: 28ch; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-sm); }
.muted { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: var(--space-sm); }
.row.pills { gap: var(--space-xs); }
.stack > * + * { margin-top: var(--space-md); }
.hidden { display: none !important; }
.glass { background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); }

/* ------------------------------------------------------------ Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: var(--control); padding: 0 var(--space-md); border: 0; border-radius: var(--radius-pill);
  background: var(--color-glass-strong); color: var(--color-ink); box-shadow: inset 0 0 0 1.5px var(--color-rule-2);
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-plate); box-shadow: inset 0 0 0 1.5px var(--color-ink); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad-accent); color: var(--color-accent-ink); box-shadow: var(--shadow-accent); }
.btn.primary:hover { background: var(--grad-accent-hover); }
.btn.danger { color: var(--color-error); box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--color-error) 45%, transparent); }
.btn.danger:hover { background: var(--color-error-soft); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--color-accent-wash); box-shadow: none; }
.btn.ghost.danger:hover { background: var(--color-error-soft); }
.btn.sm { min-height: var(--control-sm); padding: 0 var(--space-sm); }
.btn.icon { width: var(--control); padding: 0; }
.btn.sm.icon { width: var(--control-sm); }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }

.field { display: block; }
.field > span { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); margin-bottom: var(--space-2xs); color: var(--color-ink-2); }
.field small { display: block; color: var(--color-muted); font-size: var(--text-xs); margin-top: var(--space-2xs); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--control); padding: 0 var(--space-md); border: 0; border-radius: var(--radius-control);
  background: var(--color-glass-strong); color: var(--color-ink); box-shadow: inset 0 0 0 1.5px var(--color-rule);
  transition: background-color var(--dur-micro) var(--ease-out);
}
textarea.input { min-height: 96px; padding: var(--space-sm) var(--space-md); resize: vertical; }
.input::placeholder { color: var(--color-muted); }
.input:hover { box-shadow: inset 0 0 0 1.5px var(--color-rule-2); }
.input:focus, .input:focus-visible { outline: none; background: var(--color-plate); box-shadow: inset 0 0 0 1.5px var(--color-accent), 0 0 0 4px var(--color-accent-wash); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }
.title-input { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; min-height: 52px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-md); }
.check input, .opo-checks input { width: 18px; height: 18px; accent-color: var(--color-accent); }

.switch { display: inline-flex; align-items: center; gap: var(--space-sm); cursor: pointer; font-size: var(--text-sm); font-weight: 500; min-height: var(--control-sm); }
.switch input { appearance: none; width: 42px; height: 24px; margin: 0; border-radius: var(--radius-pill); background: var(--color-paper-3); position: relative; cursor: pointer; flex: none; transition: background-color var(--dur-micro) var(--ease-out); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--color-plate); box-shadow: var(--shadow-knob); transition: transform var(--dur-short) var(--ease-out); }
.switch input:checked { background: var(--color-accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: var(--space-3xs); padding: var(--space-3xs); border-radius: var(--radius-pill); background: var(--color-paper-2); }
.seg label { min-height: var(--control-sm); display: inline-flex; align-items: center; padding: 0 var(--space-md); border-radius: var(--radius-pill); font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.seg label:hover { background: var(--color-glass-strong); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--color-plate); color: var(--color-accent-deep); box-shadow: var(--shadow-lift); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 1px; }

.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 var(--space-xs); border-radius: var(--radius-pill); background: var(--grad-accent); color: var(--color-accent-ink); font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-sm); border-radius: var(--radius-pill); background: var(--color-glass-strong); box-shadow: inset 0 0 0 1px var(--color-rule); font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-2); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill.draft { background: var(--color-accent-wash); box-shadow: none; color: var(--color-accent-deep); }
.pill.ok { box-shadow: inset 0 0 0 1px var(--color-rule-2); color: var(--color-ink); }
.pill.off { background: var(--color-error-soft); box-shadow: none; color: var(--color-error); }

/* ------------------------------------------------------------ Brand */
.brand { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-lg); color: var(--color-ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; display: block; filter: drop-shadow(0 6px 10px var(--shadow-mark)); }
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------ Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding: var(--space-md); gap: var(--space-md); }
.login-art { position: relative; overflow: hidden; border-radius: var(--radius-sheet); background: var(--grad-field); color: var(--color-accent-ink); padding: var(--space-xl); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-xl); isolation: isolate; }
.login-art .brand { color: var(--color-accent-ink); }
.login-art .alpha-big { position: absolute; right: -8%; bottom: -14%; width: 72%; z-index: -1; color: var(--color-accent-ink); opacity: 0.1; }
.login-art blockquote { margin: 0; font-family: var(--font-display); font-weight: 300; letter-spacing: var(--tracking-display); font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; max-width: 15ch; text-wrap: balance; }
.login-art footer { font-size: var(--text-sm); color: var(--color-on-accent-muted); }
.login-form { display: flex; align-items: center; justify-content: center; padding: var(--space-xl) var(--space-md); }
.login-form form { width: 100%; max-width: 400px; padding: var(--space-xl); border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); }
.login-form h1 { font-size: var(--text-2xl); margin-bottom: var(--space-xs); }
.login-form p { color: var(--color-muted); margin-bottom: var(--space-lg); }
.login-form .btn { width: 100%; margin-top: var(--space-lg); }
.form-error { border-radius: var(--radius-control); background: var(--color-error-soft); color: var(--color-error); padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); margin-top: var(--space-md); }

/* ------------------------------------------------------------ Shell */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; }
.side { margin: var(--space-sm) 0 var(--space-sm) var(--space-sm); padding: var(--space-md) var(--space-sm); border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); display: flex; flex-direction: column; gap: var(--space-3xs); height: calc(100vh - var(--space-lg)); overflow-y: auto; }
.side .brand { padding: var(--space-2xs) var(--space-xs) var(--space-lg); }
.nav-group { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); padding: var(--space-md) var(--space-sm) var(--space-2xs); }
.nav a { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--control); padding: 0 var(--space-sm); border-radius: var(--radius-control); color: var(--color-ink-2); text-decoration: none; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.nav a:hover { background: var(--color-accent-wash); color: var(--color-ink); }
.nav a:active { background: var(--color-paper-2); }
.nav a.active { background: var(--color-plate); color: var(--color-accent-deep); box-shadow: var(--shadow-lift); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.opo-dot { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--c, var(--color-accent)); color: var(--color-plate); font-family: var(--font-display); font-size: 9.5px; font-weight: 500; flex: none; }
.side-foot { margin-top: auto; padding-top: var(--space-sm); border-top: 1px solid var(--color-rule); }
.me { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-deep); font-family: var(--font-display); font-weight: 500; font-size: var(--text-xs); flex: none; }
.avatar.ink { background: var(--grad-accent); color: var(--color-accent-ink); }
.me .who { min-width: 0; line-height: 1.3; }
.me .who b { display: block; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: var(--text-xs); color: var(--color-muted); }

.topbar { display: none; }
.main { min-width: 0; height: 100vh; overflow-y: auto; }
.page { max-width: 1200px; margin: 0 auto; padding: var(--space-xl) var(--space-xl) var(--space-2xl); }
.page.narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-lg); flex-wrap: wrap; }
.page-head p { margin: var(--space-xs) 0 0; color: var(--color-muted); max-width: 70ch; }
.backlink { display: inline-flex; align-items: center; gap: var(--space-2xs); margin-bottom: var(--space-xs); text-decoration: none; font-family: var(--font-display); font-weight: 500; }
.backlink:hover { text-decoration: underline; }
.backlink svg { width: 14px; height: 14px; }
.panel { border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); }
.panel-pad { padding: var(--space-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); min-height: 64px; border-bottom: 1px solid var(--color-rule); }
.panel-head h2 { font-size: var(--text-lg); }
.empty { padding: var(--space-xl) var(--space-lg); color: var(--color-muted); max-width: 60ch; }
.empty h3 { color: var(--color-ink); margin-bottom: var(--space-xs); }
.empty .btn { margin-top: var(--space-md); }
.empty-thread { margin: auto; text-align: center; }
.narrow-form { max-width: 480px; }
.loading { padding: var(--space-2xl); display: grid; gap: var(--space-sm); max-width: 720px; margin: 0 auto; }
.loading::before, .loading::after { content: ""; display: block; height: 16px; border-radius: var(--radius-pill); background: var(--color-paper-2); }
.loading::after { width: 60%; }
.spinner { display: none; }

/* ------------------------------------------------------------ Student home */
.continue { display: flex; gap: var(--space-md); align-items: center; padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sheet); background: var(--grad-field); color: var(--color-accent-ink); text-decoration: none; margin-bottom: var(--space-xl); box-shadow: var(--shadow-sheet); transition: transform var(--dur-short) var(--ease-out); }
.continue:hover { transform: translateY(-2px); }
.continue:active { transform: none; }
.continue .play { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--color-plate); color: var(--color-accent-deep); flex: none; }
.continue .play svg { width: 16px; height: 16px; margin-left: var(--space-3xs); }
.continue small { display: block; color: var(--color-on-accent-muted); font-size: var(--text-sm); }
.continue b { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); }
.continue .btn { margin-left: auto; background: transparent; color: var(--color-accent-ink); box-shadow: inset 0 0 0 1.5px var(--color-on-accent-muted); }

.opo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-lg); }
.opo-card { display: block; position: relative; overflow: hidden; border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); text-decoration: none; color: var(--color-ink); transition: transform var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.opo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--color-glass-edge); }
.opo-card:active { transform: translateY(-1px); }
.opo-card .band { height: 96px; background: linear-gradient(135deg, var(--c), color-mix(in oklch, var(--c) 55%, var(--color-plate))); }
.opo-card .body { padding: 0 var(--space-lg) var(--space-lg); }
.opo-card .opo-dot { width: 48px; height: 48px; border-radius: 16px; font-size: var(--text-sm); margin-top: calc(-1 * var(--space-lg)); box-shadow: 0 0 0 4px var(--color-plate); }
.opo-card h3 { font-size: var(--text-xl); margin: var(--space-sm) 0 var(--space-2xs); }
.opo-card .meta { font-size: var(--text-sm); color: var(--color-muted); }
.progress { margin-top: var(--space-md); }
.progress .track { height: 8px; border-radius: var(--radius-pill); background: var(--color-paper-2); overflow: hidden; }
.progress .fill { height: 100%; width: 100%; border-radius: var(--radius-pill); background: var(--grad-accent); transform-origin: left; }
.progress .label { display: flex; justify-content: space-between; font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-xs); }
.progress .label b { font-family: var(--font-display); font-weight: 500; color: var(--color-accent-deep); }

.recent { margin-top: var(--space-2xl); }
.recent h2 { margin-bottom: var(--space-sm); }
.recent-list { border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); padding: var(--space-xs); }
.recent-list a { display: flex; align-items: center; gap: var(--space-md); min-height: 60px; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-inner); color: var(--color-ink); text-decoration: none; }
.recent-list a:hover { background: var(--color-accent-wash); }

/* ------------------------------------------------------------ Temario: the frosted index */
.opo-hero { position: relative; overflow: hidden; padding: var(--space-xl); margin-bottom: var(--space-lg); border-radius: var(--radius-sheet); background: linear-gradient(135deg, color-mix(in oklch, var(--opo, var(--color-paper-2)) 18%, var(--color-plate)), var(--color-glass)); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); }
.opo-hero > .row { justify-content: space-between; flex-wrap: wrap; align-items: flex-end; gap: var(--space-lg); }
.opo-hero h1 { margin-top: var(--space-sm); }
.opo-hero p { color: var(--color-ink-2); margin: var(--space-xs) 0 0; max-width: 70ch; }
.opo-hero .progress { max-width: 440px; }

.index { border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); padding: var(--space-xs) var(--space-sm); }
.idx-bloque { display: flex; gap: var(--space-sm); align-items: baseline; padding: var(--space-lg) var(--space-sm) var(--space-xs); font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); color: var(--color-accent-deep); }
.idx-bloque span { font-weight: 400; color: var(--color-muted); }
.idx-tema { border-radius: var(--radius-inner); }
.idx-tema + .idx-tema { margin-top: var(--space-3xs); }
.idx-tema > summary { list-style: none; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 20px; gap: var(--space-md); align-items: center; padding: var(--space-sm); min-height: 72px; border-radius: var(--radius-inner); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.idx-tema > summary::-webkit-details-marker { display: none; }
.idx-tema > summary:hover { background: var(--color-accent-wash); }
.idx-tema[open] { background: var(--color-plate); box-shadow: var(--shadow-lift); }
.idx-num { font-family: var(--font-display); font-weight: 300; font-size: var(--text-3xl); line-height: 1; color: var(--color-accent); font-variant-numeric: tabular-nums; text-align: center; }
.idx-title { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); }
.idx-title small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--color-muted); font-size: var(--text-sm); }
.idx-count { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); white-space: nowrap; padding: var(--space-3xs) var(--space-sm); border-radius: var(--radius-pill); background: var(--color-paper-2); }
.idx-count.done { color: var(--color-accent-ink); background: var(--grad-accent); }
.chev { width: 18px; height: 18px; color: var(--color-muted); transition: transform var(--dur-short) var(--ease-out); flex: none; }
details[open] > summary .chev { transform: rotate(90deg); }
.idx-body { padding: 0 var(--space-sm) var(--space-md) var(--space-3xl); }
.idx-sub { margin-top: var(--space-xs); }
.idx-sub-title { display: flex; gap: var(--space-sm); padding: var(--space-sm) 0 var(--space-2xs); font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.idx-sub-title .n { color: var(--color-accent); font-variant-numeric: tabular-nums; }
.idx-sub .idx-sub { margin-left: var(--space-lg); }
.lesson-row { display: flex; align-items: center; gap: var(--space-sm); min-height: 56px; padding: var(--space-xs) var(--space-sm); margin: 0 calc(-1 * var(--space-sm)); border-radius: var(--radius-inner); color: var(--color-ink); text-decoration: none; transition: background-color var(--dur-micro) var(--ease-out); }
.lesson-row:hover { background: var(--color-accent-wash); }
.lesson-row:active { background: var(--color-paper-2); }
.lesson-row .k { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--color-paper-2); color: var(--color-accent-deep); flex: none; }
.lesson-row .k svg { width: 17px; height: 17px; }
.lesson-row .t { flex: 1; min-width: 0; }
.lesson-row .t b { font-weight: 500; }
.lesson-row .t small { display: block; color: var(--color-muted); font-size: var(--text-sm); }
.tick { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--color-rule-2); color: transparent; flex: none; }
.tick svg { width: 12px; height: 12px; }
.lesson-row.done .tick { background: var(--grad-accent); box-shadow: none; color: var(--color-accent-ink); }
.lesson-row.done .t b { color: var(--color-ink-2); }

/* ------------------------------------------------------------ Lesson view */
.study { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100vh; }
.study-index { margin: var(--space-sm) 0 var(--space-sm) var(--space-sm); padding: var(--space-md) var(--space-sm) var(--space-xl); border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); height: calc(100vh - var(--space-lg)); overflow-y: auto; }
.study-index .back { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-sm); padding: 0 var(--space-sm); border-radius: var(--radius-pill); font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink); text-decoration: none; }
.study-index .back:hover { background: var(--color-accent-wash); }
.study-index .back svg { width: 16px; height: 16px; }
.study-index h2 { display: flex; gap: var(--space-sm); align-items: center; font-size: var(--text-lg); padding: var(--space-sm) var(--space-xs) var(--space-md); margin-bottom: var(--space-xs); border-bottom: 1px solid var(--color-rule); max-width: none; }
.mini-tema > summary { list-style: none; display: flex; gap: var(--space-sm); align-items: baseline; padding: var(--space-xs); border-radius: var(--radius-inner); cursor: pointer; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; }
.mini-tema > summary::-webkit-details-marker { display: none; }
.mini-tema > summary:hover { background: var(--color-accent-wash); }
.mini-tema > summary .n { color: var(--color-accent); width: 24px; text-align: right; flex: none; }
.mini-bloque { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; color: var(--color-accent-deep); padding: var(--space-md) var(--space-xs) var(--space-2xs); }
.mini-sub { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); padding: var(--space-xs) var(--space-xs) var(--space-3xs) var(--space-xl); }
.mini-lesson { display: flex; gap: var(--space-xs); align-items: center; padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-xl); border-radius: var(--radius-inner); font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; line-height: 1.35; }
.mini-lesson:hover { background: var(--color-accent-wash); color: var(--color-ink); }
.mini-lesson.current { background: var(--color-plate); color: var(--color-accent-deep); font-weight: 500; box-shadow: var(--shadow-lift); }
.mini-lesson .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--color-rule-2); flex: none; }
.mini-lesson.done .dot { background: var(--color-accent); box-shadow: none; }

.study-main { min-width: 0; height: 100vh; overflow-y: auto; }
.study-content { max-width: 880px; margin: 0 auto; padding: var(--space-xl) var(--space-xl) var(--space-2xl); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-sm); }
.crumbs span + span::before { content: "/"; margin-right: var(--space-xs); color: var(--color-rule-2); }
.lesson-title { font-size: var(--text-3xl); margin: var(--space-sm) 0; max-width: 24ch; }
.lesson-intro { color: var(--color-ink-2); font-size: var(--text-lg); max-width: 60ch; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-lg) 0 var(--space-xl); }
.btn.done-toggle[aria-pressed="true"] { color: var(--color-accent-deep); box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.player { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sheet); background: var(--color-ink); box-shadow: var(--shadow-pop); margin-bottom: var(--space-xl); }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.section-title { font-size: var(--text-xl); margin: var(--space-2xl) 0 var(--space-md); max-width: none; }

.reading { font-size: var(--text-reading); line-height: 1.7; color: var(--color-ink-2); max-width: var(--measure); }
.reading h2 { font-size: var(--text-xl); color: var(--color-ink); margin: var(--space-xl) 0 var(--space-sm); }
.reading h3 { font-size: var(--text-lg); color: var(--color-ink); margin: var(--space-lg) 0 var(--space-xs); }
.reading h4 { font-family: var(--font-display); font-size: var(--text-md); font-weight: 500; color: var(--color-ink); margin: var(--space-md) 0 var(--space-2xs); }
.reading p { margin: 0 0 var(--space-md); }
.reading strong, .reading b { color: var(--color-ink); font-weight: 500; }
.reading ul, .reading ol { padding-left: var(--space-lg); margin: 0 0 var(--space-md); }
.reading li { margin-bottom: var(--space-2xs); }
.reading li::marker { color: var(--color-accent); }
.reading mark { background: var(--color-accent-wash); color: var(--color-accent-deep); padding: 0 var(--space-2xs); border-radius: 6px; }
.reading blockquote { margin: var(--space-lg) 0; padding: var(--space-md) var(--space-lg); border-radius: var(--radius-inner); background: var(--color-glass-strong); box-shadow: inset 3px 0 0 var(--color-accent); color: var(--color-ink); }
.reading table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--text-sm); margin: var(--space-md) 0; border-radius: var(--radius-inner); overflow: hidden; box-shadow: inset 0 0 0 1px var(--color-rule); }
.reading th, .reading td { border-bottom: 1px solid var(--color-rule); padding: var(--space-xs) var(--space-sm); text-align: left; vertical-align: top; }
.reading tr:last-child td { border-bottom: 0; }
.reading th { font-family: var(--font-display); font-weight: 500; color: var(--color-ink); background: var(--color-paper-2); }
.reading img { border-radius: var(--radius-inner); margin: var(--space-sm) 0; }
.reading hr { border: 0; border-top: 1px solid var(--color-rule); margin: var(--space-xl) 0; }
.reading a { text-decoration: underline; text-decoration-color: var(--color-accent); }

.files { display: grid; gap: var(--space-xs); }
.file { display: flex; align-items: center; gap: var(--space-sm); min-height: 60px; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-inner); background: var(--color-glass-strong); box-shadow: inset 0 0 0 1px var(--color-rule); color: var(--color-ink); text-decoration: none; }
.file:hover { box-shadow: inset 0 0 0 1px var(--color-rule-2); }
.file .ext { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--color-accent-wash); font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; color: var(--color-accent-deep); flex: none; }
.file .ext svg { width: 18px; height: 18px; }
.file .name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .size { color: var(--color-muted); font-size: var(--text-sm); }

.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-md); margin-top: var(--space-2xl); }
.pager a { display: block; padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sheet); background: var(--color-glass); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); color: var(--color-ink); text-decoration: none; font-family: var(--font-display); font-weight: 500; transition: transform var(--dur-short) var(--ease-out); }
.pager a:hover { transform: translateY(-2px); }
.pager small { display: block; color: var(--color-muted); font-size: var(--text-sm); font-weight: 400; }
.pager .next { text-align: right; grid-column: 2; }

/* ------------------------------------------------------------ Comments */
.comments { display: grid; gap: var(--space-xs); }
.comment { display: flex; gap: var(--space-sm); padding: var(--space-md); border-radius: var(--radius-inner); background: var(--color-glass-strong); box-shadow: inset 0 0 0 1px var(--color-rule); }
.comment .c-head { display: flex; gap: var(--space-xs); align-items: baseline; flex-wrap: wrap; }
.comment .c-head b { font-family: var(--font-display); font-weight: 500; }
.comment .c-head time { font-size: var(--text-sm); color: var(--color-muted); }
.comment .c-body { white-space: pre-wrap; overflow-wrap: break-word; margin-top: var(--space-2xs); max-width: 70ch; }
.comment .c-acts { display: flex; gap: var(--space-2xs); margin-top: var(--space-xs); margin-left: calc(-1 * var(--space-sm)); }
.comment .replies { margin-top: var(--space-sm); padding-left: var(--space-md); box-shadow: inset 2px 0 0 var(--color-accent-soft); }
.comment .replies .comment { background: transparent; box-shadow: none; padding: var(--space-xs) 0; }
.comment.teacher > .avatar { background: var(--grad-accent); color: var(--color-accent-ink); }
.compose { display: flex; gap: var(--space-sm); align-items: flex-start; margin-top: var(--space-md); }
.compose textarea { min-height: var(--control); height: var(--control); padding-top: var(--space-sm); border-radius: 22px; }
.compose textarea:focus { min-height: 96px; border-radius: var(--radius-control); }
.reply-box { margin-top: var(--space-sm); }

/* ------------------------------------------------------------ Chat */
.chat-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 200px); min-height: 480px; overflow: hidden; }
.chat-wrap.single { grid-template-columns: minmax(0, 1fr); }
.chat-list { border-right: 1px solid var(--color-rule); display: flex; flex-direction: column; min-height: 0; }
.chat-list .search { padding: var(--space-sm); }
#convs { overflow-y: auto; flex: 1; padding: 0 var(--space-xs) var(--space-xs); }
.conv { display: flex; gap: var(--space-sm); padding: var(--space-sm); border-radius: var(--radius-inner); color: var(--color-ink); text-decoration: none; }
.conv:hover { background: var(--color-accent-wash); }
.conv.active { background: var(--color-plate); box-shadow: var(--shadow-lift); }
.conv .who { flex: 1; min-width: 0; }
.conv .who b { display: flex; justify-content: space-between; gap: var(--space-xs); font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); }
.conv .who b time { font-family: var(--font-body); font-weight: 400; font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.conv .who p { margin: var(--space-3xs) 0 0; font-size: var(--text-sm); color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .who p { color: var(--color-ink); font-weight: 500; }
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-lg); min-height: 68px; border-bottom: 1px solid var(--color-rule); }
.thread-head b { font-family: var(--font-display); font-weight: 500; }
.thread-msgs { flex: 1; overflow-y: auto; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-xs); }
.msg { max-width: 72%; padding: var(--space-sm) var(--space-md); border-radius: 18px 18px 18px 6px; background: var(--color-plate); box-shadow: var(--shadow-msg); align-self: flex-start; white-space: pre-wrap; overflow-wrap: break-word; }
.msg.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--grad-accent); color: var(--color-accent-ink); }
.msg time { display: block; font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-2xs); }
.msg.mine time { color: var(--color-on-accent-muted); }
.msg .ctx { display: block; font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; color: var(--color-accent-deep); margin-bottom: var(--space-2xs); }
.msg.mine .ctx { color: var(--color-on-accent-muted); }
.day-sep { align-self: center; font-size: var(--text-xs); color: var(--color-muted); padding: var(--space-2xs) var(--space-sm); margin: var(--space-xs) 0; border-radius: var(--radius-pill); background: var(--color-glass-strong); }
.thread-form { display: flex; gap: var(--space-sm); padding: var(--space-sm); border-top: 1px solid var(--color-rule); align-items: flex-end; }
.thread-form textarea { min-height: var(--control); height: var(--control); max-height: 160px; padding-top: var(--space-sm); border-radius: 22px; }
.ctxbar { padding: var(--space-xs) var(--space-sm) 0; }

/* ------------------------------------------------------------ Teacher panel */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.stat { display: block; padding: var(--space-lg); border-radius: var(--radius-sheet); background: var(--color-glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: var(--shadow-sheet), inset 0 0 0 1px var(--color-glass-edge); color: var(--color-ink); text-decoration: none; transition: transform var(--dur-short) var(--ease-out); }
.stat:hover { transform: translateY(-2px); }
.stat b { display: block; font-family: var(--font-display); font-weight: 300; font-size: 2.75rem; line-height: 1; letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; }
.stat.attn { background: var(--grad-field); color: var(--color-accent-ink); }
.stat.attn span { color: var(--color-on-accent-muted); }
.stat span { display: block; margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.feed-item { display: flex; gap: var(--space-sm); margin: var(--space-3xs) var(--space-xs); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-inner); text-decoration: none; color: var(--color-ink); }
a.feed-item:hover { background: var(--color-accent-wash); }
.feed-item p { margin: var(--space-2xs) 0 0; color: var(--color-ink-2); font-size: var(--text-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-item b { font-family: var(--font-display); font-weight: 500; }
.feed-item .chip { align-self: flex-start; }
.opo-line { display: flex; align-items: center; gap: var(--space-sm); min-height: 64px; margin: var(--space-3xs) var(--space-xs); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-inner); color: var(--color-ink); text-decoration: none; }
a.opo-line:hover { background: var(--color-accent-wash); }
.opo-line b { font-family: var(--font-display); font-weight: 500; }
.panel > .feed-item:first-of-type, .panel > .opo-line:first-of-type { margin-top: var(--space-xs); }
.panel > .feed-item:last-child, .panel > .opo-line:last-child { margin-bottom: var(--space-xs); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-rule); white-space: nowrap; }
.table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-rule); vertical-align: middle; }
.table tbody tr { transition: background-color var(--dur-micro) var(--ease-out); }
.table tbody tr:hover { background: var(--color-accent-wash); }
.table tr:last-child td { border-bottom: 0; }
.table .acts { text-align: right; white-space: nowrap; }
.table td b { font-family: var(--font-display); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.chip { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-sm) var(--space-3xs) var(--space-3xs); border-radius: var(--radius-pill); background: var(--color-glass-strong); box-shadow: inset 0 0 0 1px var(--color-rule); font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; }
.chip i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.toolbar { display: flex; gap: var(--space-sm); flex-wrap: wrap; padding: var(--space-md); border-bottom: 1px solid var(--color-rule); }
.toolbar .input { width: auto; }
.toolbar .search-in { flex: 1; min-width: 200px; }

/* Temario editor */
.opo-tabs { display: inline-flex; flex-wrap: wrap; gap: var(--space-3xs); padding: var(--space-2xs); margin-bottom: var(--space-lg); border-radius: var(--radius-pill); background: var(--color-glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: inset 0 0 0 1px var(--color-glass-edge); }
.opo-tabs a { display: flex; align-items: center; gap: var(--space-xs); min-height: 40px; padding: 0 var(--space-md) 0 var(--space-2xs); border-radius: var(--radius-pill); text-decoration: none; color: var(--color-ink-2); font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); transition: background-color var(--dur-micro) var(--ease-out); }
.opo-tabs a .opo-dot { border-radius: 50%; width: 32px; height: 32px; }
.opo-tabs a:hover { background: var(--color-glass-strong); color: var(--color-ink); }
.opo-tabs a.active { background: var(--color-plate); color: var(--color-ink); box-shadow: var(--shadow-lift); }
.tree { padding: var(--space-xs); }
.tree-node + .tree-node { margin-top: var(--space-3xs); }
.tree-row { display: flex; align-items: center; gap: var(--space-sm); min-height: 56px; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-inner); transition: background-color var(--dur-micro) var(--ease-out); }
.tree-row:hover { background: var(--color-accent-wash); }
.tree-row .acts { display: flex; gap: var(--space-3xs); opacity: 0.6; transition: opacity var(--dur-micro) var(--ease-out); }
.tree-row:hover .acts, .tree-row:focus-within .acts { opacity: 1; }
.tree-children { margin-left: var(--space-lg); padding-left: var(--space-sm); box-shadow: inset 2px 0 0 var(--color-paper-2); }
.kind-tag { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; padding: var(--space-2xs) var(--space-sm); min-width: 64px; text-align: center; border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink-2); flex: none; }
.kind-tag.bloque { background: var(--grad-accent); color: var(--color-accent-ink); }
.kind-tag.tema { background: var(--color-accent-wash); color: var(--color-accent-deep); }
.tree-lesson .tree-row { min-height: 48px; }
.tree-lesson .k { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--color-paper-2); color: var(--color-accent-deep); flex: none; }
.tree-lesson .k svg { width: 15px; height: 15px; }
.tree-title { font-family: var(--font-display); font-weight: 500; }
.tree-lesson .tree-title { font-family: var(--font-body); font-weight: 400; }
.tree-title a { color: var(--color-ink); text-decoration: none; }
.tree-title a:hover { color: var(--color-accent-deep); }

/* Lesson editor */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-lg); align-items: start; }
.editor-side { position: sticky; top: var(--space-lg); }
.rte { overflow: hidden; border-radius: 0 0 var(--radius-sheet) var(--radius-sheet); }
.rte-bar { display: flex; flex-wrap: wrap; gap: var(--space-3xs); padding: var(--space-xs); border-bottom: 1px solid var(--color-rule); position: sticky; top: var(--sticky-offset); background: var(--color-glass-strong); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); z-index: var(--z-raised); }
.rte-bar button { min-height: var(--control-sm); min-width: var(--control-sm); padding: 0 var(--space-sm); border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); color: var(--color-ink-2); display: inline-flex; align-items: center; gap: var(--space-2xs); transition: background-color var(--dur-micro) var(--ease-out); }
.rte-bar button:hover { background: var(--color-accent-wash); color: var(--color-ink); }
.rte-bar button:active { background: var(--color-paper-2); }
.rte-bar button svg { width: 16px; height: 16px; }
.rte-bar .sep { width: 1px; background: var(--color-rule); margin: var(--space-2xs); }
.rte-bar .mk { background: var(--color-accent-wash); color: var(--color-accent-deep); }
.rte-area { min-height: 400px; padding: var(--space-lg); outline: none; max-width: none; }
.rte-area:focus-visible { box-shadow: inset 0 0 0 2px var(--color-focus); }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--color-muted); }
.upload-zone { border: 1.5px dashed var(--color-rule-2); border-radius: var(--radius-inner); padding: var(--space-lg); text-align: center; color: var(--color-ink-2); cursor: pointer; background: var(--color-glass-strong); font-size: var(--text-sm); transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
.upload-zone:hover, .upload-zone.drag { background: var(--color-accent-wash); border-color: var(--color-accent); }
.upload-zone input { display: none; }
.upload-zone b { font-family: var(--font-display); font-weight: 500; color: var(--color-ink); }
.bar { height: 8px; border-radius: var(--radius-pill); background: var(--color-paper-2); overflow: hidden; margin-top: var(--space-xs); }
.bar i { display: block; height: 100%; width: 100%; background: var(--grad-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-short) var(--ease-out); }
.progress-text { margin-top: var(--space-xs); }
.video-preview { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-inner); background: var(--color-ink); position: relative; margin-top: var(--space-sm); }
.video-preview video, .video-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.swatches { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.swatches label { width: 34px; height: 34px; border-radius: 50%; background: var(--c); cursor: pointer; position: relative; transition: transform var(--dur-micro) var(--ease-out); }
.swatches label:hover { transform: scale(1.08); }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--color-plate), 0 0 0 5px var(--c); }
.swatches label:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 5px; }
.opo-checks { display: grid; gap: var(--space-2xs); }
.opo-checks label { display: flex; gap: var(--space-sm); align-items: center; min-height: 52px; padding: 0 var(--space-sm); border-radius: var(--radius-inner); background: var(--color-glass-strong); box-shadow: inset 0 0 0 1px var(--color-rule); cursor: pointer; font-size: var(--text-sm); font-weight: 500; transition: background-color var(--dur-micro) var(--ease-out); }
.opo-checks label:hover { box-shadow: inset 0 0 0 1px var(--color-rule-2); }
.opo-checks label:has(input:checked) { background: var(--color-accent-wash); box-shadow: inset 0 0 0 1.5px var(--color-accent); }

/* ------------------------------------------------------------ Dialogs, toasts */
.modal-bg { position: fixed; inset: 0; background: var(--color-scrim); display: grid; place-items: center; padding: var(--space-lg); z-index: var(--z-modal); }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 48px); overflow: auto; border-radius: 24px; background: var(--color-glass-strong); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--color-glass-edge); }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); padding: var(--space-lg) var(--space-lg) 0; }
.modal-head h2 { font-size: var(--text-xl); }
.modal-head p { margin: var(--space-2xs) 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.modal-body { padding: var(--space-md) var(--space-lg); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--space-xs); padding: var(--space-md) var(--space-lg) var(--space-lg); }
#toasts { position: fixed; bottom: var(--space-lg); left: 50%; transform: translateX(-50%); display: grid; gap: var(--space-xs); z-index: var(--z-toast); }
.toast { padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-pill); background: color-mix(in oklch, var(--color-ink) 88%, transparent); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); color: var(--color-plate); font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500; box-shadow: var(--shadow-pop); max-width: min(560px, calc(100vw - 32px)); }
.toast.err { background: var(--color-error); }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 75rem) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 60rem) {
  :root { --sticky-offset: var(--topbar); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; z-index: var(--z-sticky-nav); width: 288px; background: var(--color-glass-strong); }
  .js .side { transform: translateX(-110%); visibility: hidden; transition: transform var(--dur-short) var(--ease-out), visibility var(--dur-short); }
  .js .shell.nav-open .side, .js .study.idx-open .study-index { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .shell.nav-open::after, .study.idx-open::after { content: ""; position: fixed; inset: 0; background: var(--color-scrim); z-index: var(--z-sticky); }
  .topbar { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--space-xs); min-height: var(--topbar); padding: 0 var(--space-sm); background: var(--color-glass); backdrop-filter: blur(var(--blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); border-bottom: 1px solid var(--color-glass-edge); }
  .topbar .brand { font-size: var(--text-md); }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .page { padding: var(--space-lg) var(--space-md) var(--space-xl); }
  .study { grid-template-columns: minmax(0, 1fr); }
  .study-index { position: fixed; left: 0; top: 0; z-index: var(--z-sticky-nav); width: 320px; max-width: 88vw; background: var(--color-glass-strong); }
  .js .study-index { transform: translateX(-110%); visibility: hidden; transition: transform var(--dur-short) var(--ease-out), visibility var(--dur-short); }
  .study-content { padding: var(--space-lg) var(--space-md) var(--space-xl); }
  .login { grid-template-columns: minmax(0, 1fr); padding: var(--space-sm); }
  .login-art { padding: var(--space-lg); min-height: 240px; }
  .login-form { padding: var(--space-md) 0; }
  .login-form form { padding: var(--space-lg); }
  .chat-wrap { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 240px); }
  .chat-wrap.has-thread .chat-list { display: none; }
  .chat-wrap:not(.has-thread):not(.single) .thread { display: none; }
  .chat-list { border-right: 0; }
  .idx-tema > summary { grid-template-columns: 44px minmax(0, 1fr) auto 18px; gap: var(--space-sm); }
  .idx-num { font-size: var(--text-2xl); }
  .idx-body { padding-left: var(--space-sm); }
  .table .hide-m { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 88%; }
  .lesson-title, h1 { font-size: var(--text-2xl); }
  .opo-hero { padding: var(--space-lg); }
  .opo-hero > .row { flex-direction: column; align-items: stretch; }
  .opo-hero .progress { max-width: none; }
  .tree-children { margin-left: var(--space-xs); }
  .tree-row { flex-wrap: wrap; }
  .stat b { font-size: var(--text-3xl); }
  .nav a, .btn, .input { min-height: 44px; }
  .input { font-size: var(--text-md); }
}
@media (min-width: 60.0625rem) { .only-m { display: none !important; } }
@media (prefers-reduced-transparency: reduce) {
  :root { --color-glass: var(--color-plate); --color-glass-strong: var(--color-plate); }
}
/* The Alpha mark: its gradient lives in the tokens like every other colour */
:root { --logo-a: oklch(58% 0.14 150); --logo-b: oklch(34% 0.09 162); --logo-glyph: var(--color-plate); }
