/* Application-wide design: landing practice tokens are the source of truth.
   Legacy Tailwind colors inherit this palette, including Stimulus-built controls.
   Keep student-only presentation in student_learning.css; never change geometry
   of calendar grids, drag targets, hidden panels, media frames or editor tabs. */
.app-theme {
  --color-slate-50: #f7f8f4;
  --color-slate-100: #f0f2ed;
  --color-slate-200: var(--practice-line);
  --color-slate-300: #c6d0c9;
  --color-slate-400: #88978f;
  --color-slate-500: var(--practice-muted);
  --color-slate-600: #586b63;
  --color-slate-700: #40594e;
  --color-slate-800: #304a3f;
  --color-slate-900: #253e33;
  --color-slate-950: var(--practice-ink);
  --color-blue-50: var(--practice-blue);
  --color-blue-100: #dce9ef;
  --color-blue-200: #c4d9e3;
  --color-blue-300: #abcbd9;
  --color-blue-400: #729aae;
  --color-blue-500: #d9743e;
  --color-blue-600: var(--practice-accent-strong);
  --color-blue-700: #a84019;
  --color-blue-800: #903a1b;
  --color-blue-900: #74391f;
  --color-blue-950: #503323;
  --color-violet-50: #fff6ef;
  --color-violet-100: var(--practice-peach);
  --color-violet-200: #edcdb6;
  --color-violet-300: #dfb191;
  --color-violet-400: #cd9268;
  --color-violet-500: #b36b40;
  --color-violet-600: #a35b30;
  --color-violet-700: #8e4b28;
  --color-violet-800: #773e23;
  --color-violet-900: #603422;
  --color-violet-950: #42291d;
  --color-indigo-50: var(--practice-blue);
  --color-indigo-100: #dce9ef;
  --color-indigo-200: #c4d9e3;
  --color-indigo-600: #a35b30;
  --color-indigo-700: #8e4b28;
  --color-indigo-800: #773e23;
  color: var(--practice-ink);
}
body.app-theme { background: var(--practice-paper); }
/* Non-modal coachmarks: no inert page, click-catching backdrop or raised form
   sections. Measure against the real anchor and visual viewport. */
.app-theme .editor-tour-spotlight { position: fixed; z-index: 50; pointer-events: none; border: 2px solid var(--practice-accent-strong); border-radius: 14px; box-shadow: 0 0 0 100vmax rgb(32 55 49 / 22%); }
.app-theme .editor-tour-tip { position: fixed; z-index: 51; width: min(20rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); overflow: auto; color: var(--practice-ink); border-radius: 18px; box-shadow: 0 8px 32px rgb(32 55 49 / 16%); }
.app-theme [data-controller~="editor-tour"]:not([data-editor-tour-active="true"]) :is(.editor-tour-spotlight, .editor-tour-tip),
.app-theme :is(.editor-tour-spotlight, .editor-tour-tip)[hidden] { display: none; }
.app-theme .editor-tour-safety { color: var(--practice-muted); }
.app-theme .editor-tour-tip:not([hidden]) { animation: editor-tour-enter 140ms ease-out; }
@keyframes editor-tour-enter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .app-theme .editor-tour-tip:not([hidden]) { animation: none; } }
.app-theme h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.14;
  overflow-wrap: anywhere;
}
.app-theme .font-black { font-weight: 650; }
.app-theme h1.font-black { font-weight: 400; }
.app-theme :is(button.inline-flex, a.inline-flex, input[type="submit"]) { border-radius: 999px; }
.app-theme :is(input, textarea, select) { accent-color: var(--practice-accent-strong); }
.app-theme :is(input, textarea)::placeholder { color: #718078; }
.app-theme :focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: 4px; }
/* Reading destinations still receive programmatic focus/announcements, but
   aren't controls. Keep their focus from looking like a lingering tour box. */
.app-theme :is(h2, h3, p, section).app-focus-anchor[tabindex="-1"]:focus { outline: none; }
.app-theme :is(a, button, input, textarea, select) { scroll-margin-block: 24px; }
.app-theme :is(button, a)[aria-disabled="true"] { cursor: default; }
.app-theme .shadow-sm { box-shadow: 0 3px 14px #20373205; }

.app-theme > .app-safe-header { background: var(--practice-paper); border-color: var(--practice-line); }
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--practice-ink); flex-shrink: 0; min-height: 44px; }
.app-brand svg { color: var(--practice-accent-strong); }
.app-brand > span { font-size: 1.125rem; font-weight: 650; letter-spacing: -.025em; }
.app-brand em { font-family: Georgia, serif; font-weight: 400; }

/* Shared components are themed by default, without changing form behavior. */
.app-theme .app-surface { border: 1px solid var(--practice-line); border-radius: var(--practice-radius); background: #fff; box-shadow: 0 10px 26px #20373207; }
.app-theme :is(article, section, fieldset, details).border { border-radius: var(--practice-radius); }
.app-theme .app-input,
.app-theme :is([data-select-target="trigger"], [data-inline-select-target="trigger"], [data-creatable-combobox-target="trigger"]) {
  border-radius: 12px; border-color: #cfdad9;
}
.app-theme .app-input { min-height: 48px; }
.app-theme .app-input:hover { border-color: #a9bbb3; }
.app-theme .app-input:focus { border-color: var(--practice-accent-strong); }
.app-theme .app-input[aria-invalid="true"] { border-color: #b44522; }
.app-theme :is(button, input, select, textarea):disabled { cursor: not-allowed; }
.app-theme .app-panel { background: var(--practice-blue); border-color: #d9e4e9; color: var(--practice-ink); }
.app-theme .app-filter-active { background: var(--practice-peach); border-color: #e3ba9e; color: #8e431e; box-shadow: none; }
.app-theme .app-filter-active:hover { background: #ffe2cd; }
.app-theme .app-filter-tabs [aria-current="page"] { background: var(--practice-peach); border-color: #e3ba9e; color: #8e431e; box-shadow: none; }
.app-theme .app-status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; background: #f0f2ed; color: var(--practice-muted); font-size: .75rem; font-weight: 650; line-height: 1.5; }
.app-theme .app-status-badge[data-state="scheduled"] { background: var(--practice-blue); color: #426478; }
.app-theme .app-status-badge[data-state="available"] { background: var(--practice-sage); color: #286443; }
.app-theme .app-status-badge:is([data-state="partial"], [data-state="mixed"]) { background: var(--practice-peach); color: #8e431e; }
.app-theme .app-status-badge[data-state="unreleased"] { background: #fff4d9; color: #805510; }

/* Teacher navigation and admin information density retain their existing layout. */
.app-theme [data-testid="teacher-workspace-navigation"] { background: #f5f6f0; border-color: var(--practice-line); }
.app-theme [data-testid="teacher-workspace-navigation"] nav a { border-radius: 12px; }
.app-theme [data-testid="teacher-workspace-navigation"] [aria-current="page"],
.app-theme .admin-workspace-navigation [aria-current="page"] {
  background: var(--practice-peach); color: #8e431e; border-color: #e3ba9e; box-shadow: none;
}
.app-theme [data-testid="teacher-workspace-section-switcher"] [aria-current="page"] :is(.text-white, .text-slate-300) { color: #8e431e; }
.app-theme .admin-workspace-navigation { border-radius: var(--practice-radius); box-shadow: none; }
.app-theme .admin-workspace-navigation a { border-radius: 12px; }
.app-theme [data-weekly-topic-editor-target="tab"][aria-selected="true"] { background: var(--practice-peach); color: #8e431e; }
.app-theme [data-weekly-topic-editor-target="tab"][aria-selected="true"] [data-tab-icon] { background: #fff; color: var(--practice-accent-strong); }
.app-theme table thead { background: #f5f7f2; }
.app-theme table th { font-weight: 650; }
.app-theme :is(dialog, [role="listbox"]) { border-color: var(--practice-line); }
/* One preparation workspace for choices, real progress, results and retries. */
.app-theme .weekly-preparation-modal .preparation-progress-heading { flex-direction: column; text-align: center; }
.app-theme .weekly-preparation-modal .preparation-working-icon { width: 100%; }
.app-theme .weekly-preparation-modal .preparation-working-icon[hidden] { display: none; }
.app-theme .preparation-sync[data-state="reconnecting"] { color: var(--practice-accent-strong); }
.app-theme .preparation-sailing { stroke-linecap: round; stroke-linejoin: round; }
.app-theme .preparation-sailing .sailing-sky { fill: var(--practice-blue); }
.app-theme .preparation-sailing .sailing-sun,
.app-theme .preparation-sailing .sailing-jib { fill: var(--practice-peach); }
.app-theme .preparation-sailing .sailing-cloud,
.app-theme .preparation-sailing .sailing-main { fill: var(--practice-paper); }
.app-theme .preparation-sailing .sailing-main { stroke: var(--practice-line); stroke-width: 1.5; }
.app-theme .preparation-sailing .sailing-seam { fill: none; stroke: var(--practice-line); stroke-width: 1; }
.app-theme .preparation-sailing .sailing-pennant,
.app-theme .preparation-sailing .sailing-shirt { fill: var(--practice-accent-strong); }
.app-theme .preparation-sailing .sailing-sail-stripe { fill: var(--practice-accent); }
.app-theme .preparation-sailing .sailing-rigging { fill: none; stroke: var(--practice-muted); stroke-width: 1.5; }
.app-theme .preparation-sailing .sailing-boom { stroke: var(--practice-ink); stroke-width: 3; }
.app-theme .preparation-sailing .sailing-cabin { fill: var(--practice-paper); stroke: var(--practice-line); stroke-width: 1.5; }
.app-theme .preparation-sailing .sailing-window { fill: var(--practice-muted); }
.app-theme .preparation-sailing .sailing-hair,
.app-theme .preparation-sailing .sailing-hull { fill: var(--practice-ink); }
.app-theme .preparation-sailing .sailing-skin { fill: var(--practice-peach); }
.app-theme .preparation-sailing .sailing-face { fill: none; stroke: var(--practice-ink); stroke-width: 1.3; }
.app-theme .preparation-sailing .sailing-collar { fill: none; stroke: var(--practice-paper); stroke-width: 2; }
.app-theme .preparation-sailing .sailing-sleeve { fill: none; stroke: var(--practice-accent-strong); stroke-width: 7; }
.app-theme .preparation-sailing .sailing-hand { fill: none; stroke: var(--practice-peach); stroke-width: 4; }
.app-theme .preparation-sailing .sailing-helm { fill: none; stroke: var(--practice-muted); stroke-width: 2; }
.app-theme .preparation-sailing .sailing-trim { fill: var(--practice-accent); }
.app-theme .preparation-sailing .sailing-portholes { fill: var(--practice-blue); }
.app-theme .preparation-sailing .sailing-waves { fill: none; stroke: var(--practice-muted); stroke-width: 2; }
.app-theme .preparation-sailing .sailing-waves-back { opacity: .3; animation: preparation-waves 6s ease-in-out infinite reverse; }
.app-theme .preparation-sailing .sailing-waves-front { opacity: .55; animation: preparation-waves 4.5s ease-in-out infinite; }
.app-theme .preparation-sailing .sailing-birds { fill: none; stroke: var(--practice-muted); stroke-width: 1.5; }
.app-theme .preparation-sailing .sailing-boat { transform-origin: 210px 150px; animation: preparation-sailing 5s ease-in-out infinite; }
.app-theme .preparation-sailing .sailing-sails { transform-origin: 207px 120px; animation: preparation-sail-breeze 5s ease-in-out infinite; }
.app-theme .preparation-sailing .sailing-pennant { transform-origin: 208px 35px; animation: preparation-pennant 3s ease-in-out infinite; }
.app-theme .preparation-sailing .sailing-hair-breeze { transform-origin: 270px 90px; animation: preparation-pennant 3s ease-in-out infinite reverse; }
.app-theme .preparation-sailing .sailing-clouds { animation: preparation-clouds 12s ease-in-out infinite; }
.app-theme .preparation-working-icon[data-connection="reconnecting"] *,
.app-theme .weekly-preparation-modal dialog:not([open]) .preparation-sailing * { animation-play-state: paused; }
@keyframes preparation-sailing {
  0%, 100% { transform: translate(-3px, 1px) rotate(-1.5deg); }
  50% { transform: translate(3px, -3px) rotate(1.5deg); }
}
@keyframes preparation-waves {
  0%, 100% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
}
@keyframes preparation-sail-breeze {
  0%, 100% { transform: skewX(-1deg); }
  50% { transform: skewX(1deg); }
}
@keyframes preparation-pennant {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes preparation-clouds {
  0%, 100% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .app-theme .preparation-sailing * { animation: none; }
}
.app-theme .app-preview-heading { background: var(--practice-blue); color: var(--practice-ink); }
.app-theme .student-activity-heading { background: #fffaf5; color: var(--practice-ink); border-bottom: 1px solid #e7ddd1; }
.app-theme .student-activity-heading .text-blue-200 { color: var(--practice-accent-strong); }
.app-theme .student-activity-heading .text-slate-300 { color: var(--practice-muted); }
.app-theme .student-activity-heading .text-violet-100 { color: #8e431e; background: var(--practice-peach); }
.app-theme .student-activity-heading .text-emerald-100 { color: #286443; background: var(--practice-sage); }

/* Keep the brand compact without changing control tap targets. */
@media (max-width: 639px) {
  .app-brand > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-theme *, .app-theme *::before, .app-theme *::after { scroll-behavior: auto; transition-duration: 0s; animation-duration: 0s; }
}

/* Shared lesson whiteboards use the same practice surface as every role. */
.app-theme .lesson-whiteboard .ql-container { position: relative; z-index: 1; font: inherit; border: 0; background: transparent; }
.app-theme .lesson-whiteboard .ql-editor { min-height: 100rem; padding: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.app-theme .lesson-whiteboard .ql-editor:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--practice-line); }
.app-theme .lesson-whiteboard .ql-editor h1 { font-size: 2rem; }
.app-theme .lesson-whiteboard .ql-editor h2 { font-size: 1.5rem; }
.app-theme .whiteboard-toolbar button { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .625rem; border: 1px solid var(--practice-line); border-radius: .5rem; color: var(--practice-ink); background: var(--practice-paper); }
.app-theme .whiteboard-toolbar button svg { width: 1.25rem; height: 1.25rem; }
.app-theme .whiteboard-toolbar .ql-stroke { stroke: currentColor; }
.app-theme .whiteboard-toolbar .ql-fill { fill: currentColor; }
.app-theme .whiteboard-toolbar button.ql-active { background: var(--practice-peach); border-color: var(--practice-accent-strong); }

.app-theme .whiteboard-toolbar { align-items: center; }
.app-theme .whiteboard-toolbar .whiteboard-format-trigger { width: auto; min-width: 8rem; max-width: 100%; justify-content: space-between; }
.app-theme .whiteboard-format-options { position: fixed; inset: auto; margin: 0; z-index: 80; padding: .375rem; min-width: 12rem; max-width: calc(100vw - 1rem); overflow-y: auto; border: 1px solid var(--practice-line); border-radius: .75rem; box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / .12); }
.app-theme .whiteboard-format-options button { width: 100%; justify-content: space-between; gap: .75rem; border: 0; text-align: left; font-size: .875rem; font-weight: 600; background: transparent; }
.app-theme .whiteboard-format-options button[aria-selected="true"], .app-theme .whiteboard-format-options button:hover { background: var(--practice-peach); }
.app-theme .whiteboard-format-options button:focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: -2px; }
.app-theme .whiteboard-color-swatch { display: inline-block; flex-shrink: 0; width: .875rem; height: .875rem; border: 1px solid var(--practice-line); border-radius: 50%; background: var(--whiteboard-color); }
.app-theme .whiteboard-viewport { overflow-x: auto; overscroll-behavior-x: contain; overscroll-behavior-y: auto; border: 1px solid var(--practice-line); border-radius: var(--practice-radius); background: var(--practice-paper); }
.app-theme .whiteboard-viewport:focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: 2px; }
.app-theme .whiteboard-canvas { position: relative; isolation: isolate; width: 100%; min-width: 1680px; min-height: 1600px; }
.app-theme .whiteboard-images { position: absolute; inset: 0; pointer-events: none; }
.app-theme .whiteboard-image { position: absolute; pointer-events: auto; touch-action: none; cursor: move; border: 2px solid var(--practice-line); border-radius: .5rem; padding: 0; background: transparent; }
.app-theme .whiteboard-image.is-selected { border-color: var(--practice-accent-strong); }
.app-theme .whiteboard-image img { width: 100%; height: 100%; object-fit: contain; user-select: none; pointer-events: none; }
.app-theme .whiteboard-upload-button { border-color: var(--practice-line); background: var(--practice-paper); }
.app-theme .whiteboard-upload-button:focus-within { outline: 2px solid var(--practice-accent-strong); outline-offset: 2px; }
.app-theme .whiteboard-upload-button:has(input:disabled) { cursor: not-allowed; opacity: .6; }

.app-theme .whiteboard-image-resize:focus-visible { outline: 2px solid var(--practice-ink); outline-offset: 2px; }

.app-theme .whiteboard-image-options { position: absolute; top: .25rem; right: .25rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; padding: 0; min-width: 0; min-height: 0; border: 1px solid var(--practice-line); border-radius: .5rem; background: var(--practice-paper); color: var(--practice-ink); font-size: 1.125rem; line-height: 1; cursor: pointer; }
@media (pointer: coarse) { .app-theme .whiteboard-image-options { width: 2.75rem; height: 2.75rem; } }
.app-theme .whiteboard-image-options:focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: 2px; }
.app-theme .whiteboard-image-menu { position: fixed; inset: auto; z-index: 80; margin: 0; padding: .375rem; width: 15rem; max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); overflow-y: auto; border: 1px solid var(--practice-line); border-radius: .75rem; box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / .12); }
.app-theme .whiteboard-image-menu button { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: .625rem .75rem; border: 0; border-radius: .5rem; background: transparent; color: var(--practice-ink); text-align: left; font-size: .875rem; font-weight: 600; }
.app-theme .whiteboard-image-menu button:hover, .app-theme .whiteboard-image-menu button:focus-visible { background: var(--practice-peach); outline: 2px solid var(--practice-accent-strong); outline-offset: -2px; }
.app-theme .whiteboard-image-menu button[data-image-action="remove"] { color: #b91c1c; }
.app-theme .whiteboard-image-menu button:disabled { opacity: .6; cursor: not-allowed; }

.app-theme .whiteboard-text-boxes { position: absolute; inset: 0; pointer-events: none; }
.app-theme .whiteboard-text-box { position: absolute; z-index: 3; pointer-events: auto; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; grid-template-rows: minmax(0, 1fr); align-items: start; min-height: 3.25rem; border: 1px solid var(--practice-line); border-radius: .5rem; }
.app-theme .lesson-whiteboard .whiteboard-text-editor { min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.app-theme .lesson-whiteboard .whiteboard-text-box .ql-editor { min-height: 0; height: 100%; overflow-y: auto; padding: .5rem; overflow-wrap: anywhere; }
.app-theme .lesson-whiteboard .whiteboard-text-box .ql-editor.ql-blank::before { left: .5rem; right: .5rem; }
.app-theme .lesson-whiteboard .whiteboard-text-box .ql-editor:focus-visible { box-shadow: none; }
.app-theme .whiteboard-text-drag, .app-theme .whiteboard-text-remove { width: 100%; min-width: 0; height: 2.75rem; margin-top: .25rem; display: flex; align-items: center; justify-content: center; border: 0; border-radius: .5rem; background: transparent; color: var(--practice-muted); font-size: 1.5rem; }
.app-theme .whiteboard-text-drag { cursor: move; touch-action: none; }
.app-theme .whiteboard-text-remove { height: 1.5rem; }

.app-theme .section-generation-feedback { background: var(--practice-peach); border-color: var(--practice-accent-strong); color: var(--practice-ink); }
.app-theme .section-generation-feedback[data-state="ready"] { background: var(--practice-paper); border-color: var(--practice-line); }

.app-theme .section-ai-badge { background: var(--practice-peach); color: var(--practice-muted); }
.app-theme .section-ai-badge[data-state="ready"] { background: #dcfce7; color: #166534; }
.app-theme .section-generation-button:disabled[aria-busy="true"] { opacity: 1; cursor: progress; }
.app-theme .section-generation-button progress { appearance: none; border: 0; background: rgb(255 255 255 / .2); }
.app-theme .section-generation-button progress::-webkit-progress-bar { background: rgb(255 255 255 / .2); }
.app-theme .section-generation-button progress::-webkit-progress-value { background: currentColor; transition: width .2s ease; }
.app-theme .section-generation-button progress::-moz-progress-bar { background: currentColor; }
@media (prefers-reduced-motion: reduce) { .app-theme .section-generation-button progress::-webkit-progress-value { transition: none; } }

/* Keep the hit area inside the object; the three-line grip stays clear of its text. */
.app-theme .whiteboard-text-resize, .app-theme .whiteboard-image-resize { position: absolute; bottom: 0; right: 0; display: block; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: .25rem; background: var(--practice-paper); color: var(--practice-muted); cursor: nwse-resize; touch-action: none; }
.app-theme .whiteboard-text-resize::after, .app-theme .whiteboard-image-resize::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; pointer-events: none; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 17 17 3M9 17 17 9M15 17 17 15' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.app-theme .whiteboard-text-resize:hover, .app-theme .whiteboard-image-resize:hover { color: var(--practice-ink); }
.app-theme .whiteboard-text-resize:focus-visible, .app-theme .whiteboard-text-drag:focus-visible, .app-theme .whiteboard-text-remove:focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: -2px; }
.app-theme .whiteboard-text-box .whiteboard-text-editor { align-self: stretch; }
.app-theme .whiteboard-presence { position: absolute; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
.app-theme .whiteboard-peer-selection { position: absolute; background: var(--practice-accent-strong); opacity: .2; border-radius: 2px; }
.app-theme .whiteboard-peer-selection.is-student { background: var(--practice-ink); }
.app-theme .whiteboard-peer-cursor { position: absolute; border-left: 2px solid var(--practice-accent-strong); }
.app-theme .whiteboard-peer-cursor span { position: absolute; top: -1.25rem; left: -2px; max-width: 12rem; overflow: hidden; white-space: nowrap; padding: 0 .3rem; border-radius: .25rem; font-size: .75rem; color: var(--practice-paper); background: var(--practice-accent-strong); }
.app-theme .whiteboard-peer-cursor.is-student { border-color: var(--practice-ink); }
.app-theme .whiteboard-peer-cursor.is-student span { background: var(--practice-ink); }

.app-theme ::highlight(whiteboard-search) { background: var(--practice-peach); color: var(--practice-ink); text-decoration: underline; }

/* The next lesson is the shared entry point for teachers and students. */
.app-theme .lesson-overview-action { color: var(--practice-ink); background: var(--practice-paper); border-color: var(--practice-line); }
.app-theme .lesson-overview-action:hover:not(:disabled) { background: var(--practice-peach); }
.app-theme .lesson-overview-join { color: white; background: var(--practice-accent-strong); }
.app-theme .lesson-overview-join:hover { filter: brightness(.95); }
.app-theme :is(.lesson-overview-action, .lesson-overview-join):focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: 3px; }

/* Mobile learning navigation stays beside the top bar without an empty notice gap. */
@media (max-width: 1023px) {
  .student-app > .app-notices { padding-top: 0; }
  .student-app > .app-notices:has(> :not(.hidden)) { padding-top: 1rem; padding-bottom: 1rem; }
  .student-app > .app-safe-main { padding-top: 0; }
  .app-theme .learning-mobile-menu > summary { background: var(--practice-paper); border: 1px solid var(--practice-line); color: var(--practice-ink); }
  .app-theme .learning-mobile-link { border: 1px solid var(--practice-line); }
  .app-theme .learning-mobile-menu :is(a, summary):focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: 2px; }
}

/* A day strip and real lesson cards replace empty hourly rows on phones. */
.app-theme [data-mobile-day-lessons] :is(a, button) { min-height: 2.75rem; }
.app-theme .mobile-calendar-day { color: var(--practice-ink); }
.app-theme .mobile-calendar-day:hover { background: var(--practice-blue); }
.app-theme .mobile-calendar-day[aria-current="date"] { background: var(--practice-peach); box-shadow: inset 0 0 0 1px var(--practice-accent-strong); }
.app-theme .mobile-calendar-day:focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: -2px; }
@media (max-width: 639px) {
  .app-theme .student-calendar-navigation { gap: .5rem; padding: .75rem; }
  .student-calendar-navigation h2 { display: none; }
  .student-calendar-navigation > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
  .student-calendar-navigation [data-week-navigation-controls] { width: auto; grid-template-columns: 44px minmax(60px, auto) 44px; }
  .student-calendar-navigation [data-week-direction] > span { display: none; }
  .student-calendar-navigation [data-controller="date-picker"] > span[id] { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .student-calendar-navigation [data-date-picker-target="trigger"] { gap: .25rem; padding-left: .5rem; padding-right: .5rem; font-size: .875rem; }
}

@media (max-width: 359px) {
  .student-calendar-navigation > div:last-child { grid-template-columns: minmax(0, 1fr); }
  .student-calendar-navigation [data-week-navigation-controls] { grid-template-columns: 44px minmax(60px, 1fr) 44px; }
}

/* History uses the same date tiles and actions as upcoming lessons. */
.app-theme .lesson-history [data-testid="lesson-whiteboard-link"] { max-width: 100%; justify-content: flex-start; text-align: left; overflow-wrap: anywhere; }
.app-theme .lesson-history [data-testid="lesson-whiteboard-link"] > span { min-width: 0; }
.app-theme .lesson-history [data-testid="lesson-whiteboard-link"] > svg { flex-shrink: 0; }
/* Segmented week controls retain square inner edges in pages and dialogs. */
.app-theme [data-week-navigation-controls] > a { border-radius: 0; white-space: nowrap; }
.app-theme [data-week-navigation-controls] > a:focus-visible { outline: 2px solid var(--practice-accent-strong); outline-offset: -3px; }
.app-theme [data-week-navigation-controls] [data-week-direction="today"] { background: var(--practice-peach); color: var(--practice-accent-strong); }

/* Header icon controls share the circular state used by the compact links. */
.app-theme > .app-safe-header :is([data-popover-target="trigger"], [data-chat-target="navTrigger"]) { border-radius: 50%; }
