:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-deep: #f8fafc;
  --chrome: #ffffff;
  --line: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --danger: #e11d48;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--paper-deep); }
button, input, select { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 3px solid rgba(99,102,241,.42); outline-offset: 2px; }
button:disabled { opacity: .36; cursor: default; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.welcome { min-height: 100%; display: grid; place-items: center; padding: 32px; background-color: var(--paper); background-image: linear-gradient(rgba(148,163,184,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.10) 1px, transparent 1px); background-size: 24px 24px; }
.welcome-card { width: min(520px, 100%); padding: 54px; text-align: center; background: rgba(255,255,255,.94); border: 1px solid rgba(229,231,235,.9); border-radius: 28px; box-shadow: 0 24px 70px rgba(23,32,51,.10); backdrop-filter: blur(16px); }
.logo-mark { display: block; width: 54px; height: 54px; margin: 0 auto 18px; color: var(--accent); filter: drop-shadow(0 8px 14px rgba(79,70,229,.18)); }
.logo-mark > rect { fill: currentColor; }
.logo-paper { fill: white; stroke: white; stroke-width: 1.2; stroke-linejoin: round; }
.logo-fold { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.logo-grid { fill: none; stroke: var(--accent); stroke-width: 1.05; stroke-linecap: round; opacity: .58; }
.logo-mark.small { width: 32px; height: 32px; margin: 0; filter: drop-shadow(0 4px 8px rgba(79,70,229,.15)); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; line-height: 1.2; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.welcome h1 { margin: 0; font: 750 clamp(38px, 7vw, 60px)/1.02 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.055em; }
.welcome-copy { margin: 22px auto 28px; max-width: 410px; color: #4e5b57; font-size: 18px; line-height: 1.55; }
.privacy-note { margin: 18px auto 0; max-width: 400px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.primary.large { min-height: 52px; padding: 0 28px; border-radius: 12px; font-weight: 700; }

.app { height: 100%; display: grid; grid-template-columns: 58px minmax(0, 1fr); grid-template-rows: 54px minmax(0, 1fr); background: white; transition: grid-template-columns .18s ease; }
.app.toolbar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.topbar, .toolbar, .bottom-bar { position: relative; z-index: 5; display: flex; align-items: center; gap: 10px; border-color: var(--line); }
.topbar { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(220px, 360px) minmax(320px, 1fr); min-height: 54px; padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); background: rgba(255,255,255,.97); border-bottom: 1px solid #e8edf4; box-shadow: 0 1px 0 rgba(15,23,42,.02); backdrop-filter: blur(20px); }
.brand.compact { display: flex; align-items: center; gap: 9px; min-width: 176px; }
.brand-name { display: grid; line-height: 1; }
.brand-name strong { font-size: 15px; font-weight: 780; letter-spacing: -.025em; }
.brand-name small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
.title-wrap { width: 100%; max-width: 360px; justify-self: center; }
.title-wrap input { width: 100%; height: 38px; padding: 0 12px; background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 670; letter-spacing: -.012em; text-align: center; }
.title-wrap input:hover, .title-wrap input:focus { background: var(--paper-deep); border-color: var(--line); }
.save-status { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 9px; color: var(--muted); background: transparent; font-size: 13px; }
.status-dot { width: 7px; height: 7px; background: #4e886d; border-radius: 50%; }
.save-status.saving .status-dot { background: #b6792d; animation: pulse 1s infinite; }
.save-status.offline .status-dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.top-action, .bottom-action { min-height: 40px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: white; font-weight: 650; }
.icon-button { min-width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 12px; background: transparent; font-size: 18px; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.icon-button:hover, .bottom-action:hover, .top-action:hover { color: var(--ink); background: #f1f5f9; }
.icon-button:active { transform: scale(.96); }
.ui-icon { width: 20px; height: 20px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ui-icon circle[r="1.2"] { fill: currentColor; stroke: none; }
.top-actions { display: flex; align-items: center; gap: 3px; }
.session-controls { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.top-icon { color: #64748b; }
.top-icon.active { color: var(--accent); background: var(--accent-soft); border-color: rgba(99,102,241,.12); }
.share-quick { width: auto; min-width: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: white; background: var(--accent); border-color: var(--accent); font-size: 13px; font-weight: 700; }
.share-quick:hover { color: white; background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 5px 14px rgba(79,70,229,.20); }
.grid-glyph { width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 3px; background-image: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px); background-size: 5px 5px; background-position: -1px -1px; opacity: .9; }
.copy-glyph { position: relative; width: 17px; height: 17px; border: 1.6px solid currentColor; border-radius: 4px; transform: translate(2px, -2px); }
.copy-glyph::before { content: ''; position: absolute; width: 12px; height: 12px; right: 3px; top: 3px; border: 1.6px solid currentColor; border-radius: 3px; transform: translate(-6px, 6px); background: var(--chrome); }
.download-glyph { position: relative; width: 18px; height: 18px; border-bottom: 1.7px solid currentColor; }
.download-glyph::before { content: '↓'; position: absolute; inset: -8px 0 0; font-size: 21px; font-weight: 500; line-height: 20px; }
.people { display: flex; align-items: center; padding-left: 5px; }
.person { position: relative; width: 36px; height: 36px; margin-left: -5px; display: grid; place-items: center; border: 2px solid var(--paper); border-radius: 50%; color: white; font-size: 11px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 1px rgba(15,23,42,.10), 0 3px 9px rgba(15,23,42,.08); }
.person:hover { z-index: 2; transform: translateY(-1px); }
.person.self::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border: 2px solid var(--paper); border-radius: 50%; background: #49a56f; }
.person.away { opacity: .55; }

.toolbar { grid-column: 1; grid-row: 2; z-index: 12; width: 58px; min-height: 0; margin: 0; padding: 7px 7px 8px; display: flex; flex-direction: column; align-items: center; gap: 7px; background: rgba(250,251,253,.98); border-right: 1px solid #e8edf4; box-shadow: 3px 0 16px rgba(15,23,42,.025); overflow: visible; transition: opacity .15s ease, transform .18s ease; }
.toolbar-collapsed .toolbar { opacity: 0; transform: translateX(-100%); pointer-events: none; }
.tool-group { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 0 7px; border: 0; border-bottom: 1px solid #e8edf4; }
.tool-group:last-child { border-bottom: 0; }
.tool { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; display: grid; place-items: center; color: #64748b; background: transparent; border-radius: 12px; transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.erase-cluster { width: 44px; padding: 2px 1px; display: flex; flex-direction: column; align-items: center; gap: 0; background: #f1f5f9; border: 1px solid #e7ecf3; border-radius: 14px; }
.erase-cluster .tool { width: 40px; min-width: 40px; height: 40px; min-height: 40px; border-radius: 11px; }
.erase-cluster .tool:hover { background: white; box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.erase-cluster .tool.active { background: var(--accent); box-shadow: 0 4px 12px rgba(79,70,229,.22); }
.destructive-tool { position: relative; color: var(--danger); }
.clear-badge { position: absolute; right: 4px; bottom: 3px; width: 15px; height: 15px; display: grid; place-items: center; color: white; background: var(--danger); border: 2px solid #fafbfd; border-radius: 50%; }
.clear-badge svg { width: 8px; height: 8px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.tool:hover { color: var(--ink); background: #eef2f7; }
.tool:active { transform: scale(.96); }
.tool.active { color: white; background: var(--accent); box-shadow: 0 5px 14px rgba(79,70,229,.24); }
.destructive-tool:hover { color: var(--danger); background: #fff1f2; }
.selector-wrap { position: relative; }
.selector-trigger[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(99,102,241,.18); }
.current-colour { width: 24px; height: 24px; background: #111827; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(17,24,39,.22), 0 2px 5px rgba(17,24,39,.16); }
.tool-popover { position: absolute; left: calc(100% + 14px); top: 50%; z-index: 30; padding: 12px; transform: translateY(-50%); background: rgba(255,255,255,.985); border: 1px solid #e5eaf1; border-radius: 16px; box-shadow: 0 18px 48px rgba(15,23,42,.14), 0 2px 8px rgba(15,23,42,.06); backdrop-filter: blur(20px); }
.tool-popover::before { content: ''; position: absolute; left: -6px; top: calc(50% - 6px); width: 11px; height: 11px; transform: rotate(45deg); background: white; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.popover-label { display: block; margin: 0 3px 8px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.colours { width: 192px; display: grid; grid-template-columns: repeat(4, 44px); gap: 4px; }
.colour-button { position: relative; width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border-radius: 50%; }
.colour-button::before { content: ''; width: 26px; height: 26px; background: var(--colour); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(23,32,51,.12); transition: transform .15s ease; }
.colour-button:hover::before { transform: scale(1.12); }
.colour-button.active::before { box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 0 0 3px white, 0 0 0 5px var(--accent); }
.colour-button.active::after { content: '✓'; position: absolute; color: white; font-size: 12px; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.28); }
.colour-button.light-colour.active::after { color: #172033; text-shadow: none; }
.sizes { display: flex; align-items: center; gap: 4px; }
.size-button { width: 66px; height: 52px; padding: 7px 6px 5px; display: grid; grid-template-rows: 1fr auto; place-items: center; gap: 3px; color: #667085; background: transparent; border-radius: 10px; }
.size-button:hover, .size-button.active { color: var(--accent); background: var(--accent-soft); }
.size-button.active { box-shadow: inset 0 0 0 1px rgba(99,102,241,.18); }
.size-button small { font-size: 10px; line-height: 1; font-weight: 650; }
.width-swatch { display: block; width: 24px; border-radius: 999px; background: currentColor; }
.width-fine { height: 2px; }
.width-medium { height: 4px; }
.width-broad { height: 7px; }

.grid-switch { width: 42px; min-height: 52px; padding: 5px 0 4px; display: grid; place-items: center; gap: 3px; color: #94a3b8; background: transparent; border-radius: 12px; transition: color .15s ease, background .15s ease; }
.grid-switch:hover { color: #475569; background: #eef2f7; }
.grid-switch .ui-icon { width: 19px; height: 19px; }
.grid-switch-track { position: relative; width: 28px; height: 15px; background: #cbd5e1; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(15,23,42,.06); transition: background .16s ease; }
.grid-switch-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 11px; height: 11px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .16s ease; }
.grid-switch[aria-checked="true"] { color: var(--accent); }
.grid-switch[aria-checked="true"] .grid-switch-track { background: var(--accent); }
.grid-switch[aria-checked="true"] .grid-switch-track::after { transform: translateX(13px); }

.rail-footer { margin-top: auto; }
.rail-reveal { position: absolute; left: 10px; top: 10px; z-index: 7; color: #64748b; background: rgba(255,255,255,.97); border-color: #e2e8f0; box-shadow: 0 8px 24px rgba(15,23,42,.10); opacity: 0; transform: translateX(-12px); pointer-events: none; transition: opacity .15s ease, transform .18s ease; }
.toolbar-collapsed .rail-reveal { opacity: 1; transform: none; pointer-events: auto; }
.surface-wrap { grid-column: 2; grid-row: 2; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: white; }
#board { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#ink-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#board[data-tool="move"] { cursor: grab; }
#board[data-tool="loop"] { cursor: crosshair; }
#board[data-tool="move"].dragging, #board[data-tool="loop"].dragging { cursor: grabbing; }
.drop-hint { position: absolute; inset: 20px; display: grid; place-items: center; border: 3px dashed #6c9284; border-radius: 20px; color: var(--accent); background: rgba(219,231,223,.78); font-size: 24px; font-weight: 750; pointer-events: none; }
.toast { position: absolute; left: 50%; bottom: 24px; z-index: 8; max-width: min(440px, calc(100% - 32px)); transform: translateX(-50%); padding: 11px 15px; color: white; background: rgba(38,60,69,.94); border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; text-align: center; }
.locator { position: absolute; width: 54px; height: 54px; border: 3px solid var(--locator-colour, #265eb5); border-radius: 50%; transform: translate(-50%,-50%); animation: locate 1.2s ease-out; pointer-events: none; }
.locator::after { content: attr(data-label); position: absolute; left: 50%; top: 58px; transform: translateX(-50%); padding: 4px 8px; white-space: nowrap; color: white; background: var(--locator-colour, #265eb5); border-radius: 6px; font-size: 12px; font-weight: 700; }
@keyframes locate { from { opacity: 0; scale: .35; } 20% { opacity: 1; } to { opacity: 0; scale: 1.4; } }
.image-controls { position: absolute; right: 18px; bottom: 72px; z-index: 7; padding: 6px; display: flex; gap: 6px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.image-controls button { min-height: 40px; padding: 0 14px; border-radius: 7px; background: var(--paper-deep); font-weight: 650; }
.danger-text { color: var(--danger); }

.zoom-controls { position: absolute; right: 14px; bottom: 14px; z-index: 7; display: flex; align-items: center; gap: 1px; padding: 3px; color: #64748b; background: rgba(255,255,255,.95); border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 10px 30px rgba(15,23,42,.10); backdrop-filter: blur(16px); }
#zoom-label { min-width: 58px; height: 38px; background: transparent; font-size: 13px; font-variant-numeric: tabular-nums; }

dialog { width: min(500px, calc(100vw - 28px)); padding: 0; color: var(--ink); background: white; border: 1px solid #e2e8f0; border-radius: 22px; box-shadow: 0 24px 70px rgba(15,23,42,.18); }
dialog::backdrop { background: rgba(31,44,43,.40); backdrop-filter: blur(2px); }
.name-dialog { max-width: 410px; text-align: center; }
.name-dialog .dialog-card { padding: 30px; }
.name-dialog h2 { margin: 10px 0 6px; font-size: 25px; letter-spacing: -.035em; }
.name-dialog p { margin: 0 auto 18px; max-width: 310px; color: var(--muted); font-size: 14px; }
.name-avatar { width: 48px; height: 48px; margin: 0 auto; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #6366f1, #8b5cf6); border-radius: 16px; box-shadow: 0 9px 22px rgba(79,70,229,.25); font-size: 22px; }
.name-field { margin: 0 0 10px; }
.name-field input { height: 50px; background: white; font-size: 17px; text-align: center; }
.name-submit { width: 100%; min-height: 48px; border-radius: 11px; font-weight: 750; }
.dialog-card { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-heading h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.035em; }
.dialog-heading .icon-button { margin: -8px -8px 0 0; }
.dialog-card p { color: #56625e; line-height: 1.5; }
.field-label, fieldset legend { display: block; margin: 14px 0 7px; font-size: 13px; font-weight: 750; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input, .participant-name input { width: 100%; min-height: 44px; padding: 0 12px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.copy-row button, .dialog-actions button { min-height: 44px; padding: 0 16px; border-radius: 8px; font-weight: 700; }
.dialog-note { font-size: 12px; }
fieldset { margin: 14px 0; padding: 0; border: 0; }
.choice { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-right: 16px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-actions button:not(.primary) { background: var(--paper-deep); }
.menu-card { padding-bottom: 16px; }
.settings-field { display: grid; gap: 7px; margin: 4px 0 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.settings-field input, .settings-field select { width: 100%; height: 44px; padding: 0 12px; color: var(--ink); background: var(--paper-deep); border: 1px solid var(--line); border-radius: 10px; }
.menu-row { width: 100%; min-height: 48px; padding: 0 10px; display: flex; align-items: center; gap: 11px; background: transparent; border-radius: 8px; text-align: left; }
.menu-row:hover { background: #f5f7fb; }
.menu-card a.menu-row { color: inherit; text-decoration: none; }
.ink-diagnostic-note { margin: 0 10px 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.ink-recording-button { position: absolute; z-index: 20; left: 16px; bottom: 18px; padding: 12px 16px; border-radius: 12px; background: #be123c; color: #fff; box-shadow: 0 4px 20px #0f172a20; font-size: 13px; }
.menu-label { display: inline-flex; align-items: center; gap: 11px; }
.menu-icon { width: 20px; height: 20px; color: #64748b; flex: 0 0 auto; }
.menu-row.danger .menu-icon { color: currentColor; }
.menu-row input[type="checkbox"], .choice input, .check input { accent-color: var(--accent); }
.toggle-row { justify-content: space-between; cursor: pointer; }
.toggle-row select { min-height: 36px; padding: 0 30px 0 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
#finger-toggle { appearance: none; position: relative; width: 38px; height: 22px; flex: 0 0 auto; background: #cbd5e1; border: 0; border-radius: 999px; cursor: pointer; transition: background .16s ease; }
#finger-toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: white; border-radius: 50%; box-shadow: 0 1px 4px rgba(15,23,42,.22); transition: transform .16s ease; }
#finger-toggle:checked { background: var(--accent); }
#finger-toggle:checked::after { transform: translateX(16px); }
.danger-separator { margin: 10px 0; border: 0; border-top: 1px solid var(--line); }
.menu-row.danger { color: var(--danger); }
.compact-dialog { max-width: 400px; }
.slider-row { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 12px; }
.slider-row input { width: 100%; }
.slider-row output { display: grid; place-items: center; width: 44px; height: 40px; background: var(--paper-deep); border-radius: 8px; font-weight: 750; }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: auto minmax(140px, 1fr) auto; }
  .brand.compact { min-width: 150px; }
  .title-wrap { min-width: 120px; max-width: 260px; }
}

@media (max-width: 850px) {
  .brand.compact > span:last-child, .save-status > span:last-child { display: none; }
  .brand.compact { min-width: 36px; }
  .save-status { padding: 0 3px; }
  .session-controls { gap: 3px; }
  .share-quick { width: 40px; padding: 0; }
  .share-quick span { display: none; }
}

@media (max-width: 720px) {
  .welcome { padding: 14px; }
  .welcome-card { padding: 34px 22px; }
  .topbar { grid-template-columns: 1fr auto; gap: 5px; }
  .title-wrap { position: absolute; left: 52px; width: calc(100% - 270px); min-width: 110px; max-width: 230px; }
  .title-wrap input { padding-inline: 8px; text-align: left; }
  .save-status { display: none; }
  .people { display: flex; }
  .top-actions { gap: 1px; }
  .copy-row { grid-template-columns: 1fr; }
  .zoom-controls { right: 10px; bottom: 10px; }
}

@media (max-width: 520px) {
  .brand.compact { visibility: hidden; }
  .title-wrap { left: 10px; width: calc(100% - 230px); }
  .person { width: 34px; height: 34px; }
  .icon-button { min-width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
/* Retained lessons use the same compact control and dialog system. */
.top-actions .lesson-button { display: inline-flex; align-items: center; gap: 7px; max-width: 180px; padding-inline: 10px; }
.lesson-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.lesson-list { display: grid; gap: 6px; max-height: 38vh; overflow: auto; margin: 18px 0; }
.lesson-list button { text-align: left; padding: 11px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.lesson-list button[aria-current="true"] { border-color: #a5b4fc; background: #eef2ff; }
.lesson-list small { display: block; color: #64748b; margin-top: 3px; }
.backup-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.backup-actions button, #follow-lesson, #download-recovery { padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 9px; background: #fff; }
.lesson-progress { min-height: 1.4em; font-size: 12px; color: #64748b; }
.recovery-list { display: grid; gap: 12px; max-height: 45vh; overflow: auto; margin: 18px 0; }
.recovery-item { padding: 12px; border-radius: 10px; background: #f8fafc; font-size: 13px; }
.recovery-item button { margin: 8px 8px 0 0; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.save-status.recovery .status-dot { background: #f59e0b; }
#new-lesson { padding: 10px 14px; border-radius: 10px; }
#activate-lesson { padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 9px; background: #fff; }
@media (max-width: 800px) { .lesson-button { max-width: 44px; } .lesson-button span { display: none; } }
