:root {
  color-scheme: light;
  --text-zoom: 1;
  --auto-fit-scale: 1;
  --ink: #f4f7ff;
  --muted: #a3c2b0;
  --line: #254536;
  --surface: rgba(26, 66, 48, .82);
  --blue: #4fd696;
  --blue-dark: #1f8f55;
  --green: #1f8f55;
  --warn: #ffb454;
  --gutter: clamp(16px, 4vw, 48px);
  --container-max: 87.5rem;
  --bottombar-h: 81px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { overscroll-behavior: contain; }
body { margin: 0; min-width: 20rem; overflow: hidden; overscroll-behavior: contain; color: var(--ink); background: #0f1f18; background-image: radial-gradient(circle at 20% 0%, rgba(34,130,85,.30), transparent 42%), linear-gradient(145deg, #0c1912, #17281f 58%, #10201a); }
button, input { font: inherit; }
button, a { min-height: 2.75rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.app-shell { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 72px; scroll-padding-bottom: 96px; }
.login { display: grid; place-items: center; width: min(calc(100% - 2 * var(--gutter)), var(--container-max)); min-height: 100%; margin-inline: auto; padding: var(--gutter); }
.login-card { width: min(100%, clamp(18rem, 80vw, 26.25rem)); padding: 42px; border: 1px solid rgba(0,0,0,.06); border-radius: 28px; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.08); }
.mark { display: inline-flex; align-items: center; gap: 9px; color: var(--blue); font-weight: 700; letter-spacing: -.02em; }
.mark-dot { width: .75rem; height: .75rem; border-radius: 50%; background: var(--blue); }
h1, h2, p { margin-top: 0; }
h1 { margin: clamp(8px, 1.5vh, 24px) 0 10px; font-size: clamp(28px, 4vw, 48px); line-height: 1.02; letter-spacing: -.055em; }
h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.08; letter-spacing: -.045em; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.intro { color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin: 28px 0 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.field input { width: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: #0c1912; color: var(--ink); }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,143,85,.18); }
.primary, .nav-button { border: 0; border-radius: 16px; color: #fff; background: var(--blue); font-weight: 700; transition: transform .18s, background .18s; }
.primary { width: 100%; padding: 16px; margin-top: 8px; }
.primary:hover, .nav-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary:active, .nav-button:active, .back:active, .menu-trigger:active { transform: translateY(1px); }
.error { min-height: 22px; color: #bd1c1c; font-size: 14px; }
.lesson { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100dvh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px clamp(20px, 5vw, 72px); border-bottom: 1px solid rgba(140,205,175,.12); background: rgba(12,25,18,.78); backdrop-filter: blur(20px); }
.shared-header { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); min-height: 56px; padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px; border-bottom: 1px solid rgba(140,205,175,.12); background: rgba(12,25,18,.9); backdrop-filter: blur(20px); }
.header-crumb { color: var(--ink); font-size: 14px; font-weight: 700; }
.header-crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-short { display: none; }
.menu-trigger { margin-left: auto; min-width: 4.5rem; min-height: 2.75rem; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 17px; font-weight: 650; }
.menu-trigger:hover, .menu-trigger:focus-visible { background: rgba(79,214,150,.14); outline: 0; }
.fullscreen-trigger { min-width: 2.75rem; min-height: 2.75rem; padding: 0; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 27px; line-height: 1; }
.fullscreen-trigger:hover, .fullscreen-trigger:focus-visible { color: var(--ink); background: rgba(79,214,150,.14); outline: 0; }
.overflow-menu { position: absolute; z-index: 10; top: 3.875rem; right: 0; display: grid; min-width: 10.625rem; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #16281f; box-shadow: 0 18px 42px rgba(0,0,0,.28); }
.overflow-menu[hidden] { display: none; }
.overflow-menu button { padding: 12px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; }
.overflow-menu button:hover, .overflow-menu button:focus-visible { background: rgba(79,214,150,.14); outline: 0; }
.tile-bar { position: relative; position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 72px; padding: env(safe-area-inset-top) var(--gutter) 8px; border-bottom: 1px solid rgba(140,205,175,.12); background: rgba(12,25,18,.94); backdrop-filter: blur(20px); }
.tile-lesson-clock { position: absolute; z-index: 22; top: 100%; right: calc(var(--gutter) + 10.1rem); transform: translateY(-50%) scale(1.4); transform-origin: center center; }
.tile-lesson-clock .flip-digit { width: 2.6rem; height: 4rem; font-size: 52px; line-height: 4rem; }
.tile-lesson-clock .flip-colon { font-size: 34px; }
.exercise-picker-reset { position: absolute; z-index: 22; right: calc(var(--gutter) + 1.875rem); bottom: -2.8rem; min-height: 3.5rem; padding-inline: 18px; }
.exercise-picker-reset:hover, .exercise-picker-reset:focus-visible { background: var(--surface); outline: 0; }
.tile-nav { display: flex; flex: 1 1 auto; gap: 8px; min-width: 0; overflow: visible; white-space: nowrap; }
.nav-tile { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 120px; height: 56px; padding: 0 20px; overflow: hidden; border: 0; border-bottom: 3px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; font-size: 17px; font-weight: 650; white-space: nowrap; }
.nav-tile:hover, .nav-tile:focus-visible { color: var(--ink); background: rgba(255,255,255,.1); outline: 0; }
.nav-tile:active, .menu-trigger:active { transform: translateY(1px); background: var(--surface); }
.nav-tile.is-active { border-bottom-color: var(--blue); color: var(--ink); background: var(--surface); }
.nav-tile:first-child { color: var(--blue); }
.nav-tile-logo { z-index: 2; overflow: visible; }
.nav-tile-logo .nav-tile-icon { display: grid; place-items: center; width: 7rem; height: 7rem; }
.nav-logo { display: block; width: 7rem; height: 7rem; object-fit: contain; }
.nav-tile-icon { font-size: 22px; line-height: 1; }
.nav-tile-subline { display: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-tile-label-short, .nav-tile-context-short { display: none; }
.menu-icon { display: none; font-size: 22px; }
.topbar-meta { display: flex; align-items: center; gap: 22px; }
.back { min-height: 2.75rem; border: 0; padding: 12px 12px 12px 0; color: var(--blue); background: transparent; font-weight: 600; }
.timer { min-width: clamp(4.5rem, 8vw, 5rem); color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.content { width: min(calc(100% - 2 * var(--gutter)), var(--container-max)); margin-inline: auto; padding: clamp(24px, 4vh, 96px) 0 calc(var(--bottombar-h) + env(safe-area-inset-bottom)); }
.progress-line { height: 4px; margin: 18px 0 42px; overflow: hidden; border-radius: 9px; background: #dedee3; }
.progress-value { height: 100%; border-radius: inherit; background: var(--blue); transition: width .3s ease; }
.progress-segments { display: flex; gap: 4px; height: 6px; margin: 24px 0 52px; }
.progress-segment { min-width: .25rem; border-radius: 4px; background: var(--blue); }
.progress-segment.is-future { opacity: .2; }
.progress-segment.is-current { background: var(--warn); }
.progress-segment.is-done { background: var(--green); }
.progress-segment.optional { border: 1px dashed var(--blue); background: transparent; }
.progress-minutes-2 { flex: 2; }
.progress-minutes-3 { flex: 3; }
.progress-minutes-4 { flex: 4; }
.progress-minutes-5 { flex: 5; }
.progress-minutes-6 { flex: 6; }
.progress-minutes-7 { flex: 7; }
.step-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 8vw, 7.5rem); align-items: start; }
.step-title { max-width: 690px; margin-bottom: 24px; color: var(--ink); font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; letter-spacing: -.02em; }
.step-copy { max-width: 690px; color: var(--ink); font-size: clamp(18px, 2.2vw, 30px); line-height: 1.4; letter-spacing: -.02em; }
.action { display: inline-flex; margin-top: 28px; padding: 12px 16px; border-radius: 12px; color: var(--green); background: #e7f5ec; font-size: 15px; font-weight: 700; }
.aside { display: grid; gap: 14px; }
.panel { padding: 20px; border: 1px solid rgba(0,0,0,.07); border-radius: 20px; background: var(--surface); }
.panel h3 { margin: 0 0 14px; color: var(--ink); font-size: 16px; }
.timer-panel { text-align: center; }
.step-timer { margin: 4px 0 2px; color: var(--ink); font-size: clamp(48px, 7vw, 96px); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.06em; line-height: 1; }
.panel p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.asset { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.asset:first-of-type { border-top: 0; }
.asset-thumb { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 2.75rem; border-radius: 12px; color: var(--blue); background: #e8f2ff; font-size: 12px; font-weight: 800; }
.asset strong, .asset span { display: block; }
.asset-preview { width: 4rem; height: 2.75rem; flex: 0 0 4rem; object-fit: cover; border-radius: 9px; }
.asset-thumb-label { display: grid !important; place-items: center; width: 4rem; height: 2.75rem; flex: 0 0 4rem; border-radius: 9px; background: #1a3327; color: #cdf3dc !important; font-size: 9px !important; font-weight: 800; letter-spacing: .05em; }
.asset strong { color: var(--ink); font-size: 14px; }
.asset span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.asset-document { cursor: pointer; border-radius: 12px; margin-inline: -8px; padding-inline: 8px; transition: background .18s, box-shadow .18s; }
.asset-document:hover, .asset-document:focus-visible { background: rgba(79,214,150,.12); box-shadow: 0 0 0 2px rgba(79,214,150,.25); outline: 0; }
.asset-document-label { color: var(--blue) !important; }
.timer-controls { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.timer-action, .audio-play { min-width: 2.75rem; min-height: 2.75rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #1a3327; font-weight: 700; }
.timer-action:hover, .timer-action:focus-visible, .audio-play:hover, .audio-play:focus-visible { border-color: var(--blue); outline: 0; }
.flip-timer { display: flex; align-items: center; justify-content: center; gap: 5px; perspective: 600px; font-variant-numeric: tabular-nums; }
.flip-digit { position: relative; display: block; width: clamp(2.75rem, 7vw, 6rem); height: clamp(3.5rem, 8vw, 6.5rem); overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: #3aa66d; box-shadow: inset 0 -15px 20px rgba(0,0,0,.14); color: var(--ink); font-size: clamp(48px, 7vw, 96px); font-weight: 750; line-height: clamp(3.5rem, 8vw, 6.5rem); text-align: center; }
.flip-digit::after { position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: rgba(5,12,26,.5); content: ''; }
.flip-top, .flip-bottom { position: absolute; right: 0; left: 0; height: 50%; overflow: hidden; }
.flip-top { top: 0; }
.flip-bottom { bottom: 0; line-height: 0; }
.flip-colon { color: var(--muted); font-size: 36px; font-weight: 700; }
.flip-sign { color: var(--warn); font-size: 32px; font-weight: 700; }
.flip-overtime .flip-digit, .flip-overtime .flip-colon { color: var(--warn); }
.flip-warning .flip-digit, .flip-warning .flip-colon { color: var(--warn); }
.flip-warning .flip-digit, .flip-warning .flip-colon { color: var(--warn); }
.audio-row { align-items: flex-start; }
.audio-row > div { min-width: 0; flex: 1; }
.audio-play { float: right; width: 2.75rem; padding: 0; }
.audio-range { width: calc(100% - 3.5rem); margin-top: 13px; accent-color: var(--blue); }
.audio-time { color: var(--muted); font-size: 12px; }
.audio-player { display: none; }
.screen-offset { margin-top: clamp(8px, 1.5vh, 24px); }
[data-theme="light"] { --ink: #163024; --muted: #4f7a63; --line: #d3ece0; --surface: rgba(255,255,255,.9); --blue: #1f8f55; --blue-dark: #146b3f; --warn: #ad6500; }
[data-theme="light"] body { background: #f5f7fb; background-image: radial-gradient(circle at 20% 0%, rgba(31,143,85,.20), transparent 42%), linear-gradient(145deg, #f5f7fb, #eaf0fa 58%, #f5f7fb); }
.audio-control { margin-top: 7px; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }
.audio-control:hover, .audio-control:focus-visible { text-decoration: underline; outline: 0; }
.audio-player { display: none; }
.nav { position: sticky; z-index: 4; bottom: 0; display: flex; justify-content: flex-end; gap: 12px; margin-top: auto; padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(140,205,175,.14); background: rgba(12,25,18,.9); backdrop-filter: blur(20px); }
.nav-button { min-width: clamp(8rem, 20vw, 10rem); min-height: 3rem; padding: 16px 22px; }
.nav-button.secondary { color: var(--ink); background: #e5e5ea; }
.nav-button.secondary:hover { background: #d6d6db; }
.nav-button:disabled { cursor: default; opacity: .42; transform: none; }
.chooser { width: min(calc(100% - 2 * var(--gutter)), var(--container-max)); margin-inline: auto; padding: clamp(24px, 4vh, 96px) 0 80px; }
.chooser-hero { max-width: 700px; margin-top: clamp(8px, 1.5vh, 24px); }
.chooser-head { display: flex; align-items: center; justify-content: space-between; }
.chooser-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.resume-card { display: flex; align-items: center; justify-content: space-between; width: calc((100% - 36px) / 3); margin: 28px auto 0; padding: 20px 24px; border: 1px solid rgba(79,214,150,.35); border-radius: 18px; color: var(--ink); background: var(--surface); text-align: left; }
.resume-card strong, .resume-card small { display: block; }
.resume-card strong { font-size: 20px; }
.resume-card small { margin-top: 6px; color: var(--muted); }
.level { min-height: 160px; padding: clamp(16px, 2.4vw, 32px); border: 1px solid rgba(140,205,175,.16); border-radius: 26px; background: linear-gradient(155deg, #182f24, #12211a); color: var(--ink); text-align: left; transition: transform .2s, box-shadow .2s, border-color .2s; }
.level:hover, .level:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.08); outline: 0; }
.level strong { display: block; margin: clamp(24px, 3vw, 44px) 0 10px; font-size: 19px; letter-spacing: -.02em; }
.level span { color: var(--muted); font-size: 14px; }
.level .level-code { display: block; color: #cdf3dc; font-size: 27px; font-weight: 750; letter-spacing: -.05em; }
.level span b { color: #55d18b; font-size: 10px; }
.level-active { border-color: rgba(79,214,150,.9); box-shadow: 0 16px 38px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.09); background: linear-gradient(155deg, #1f4a34, #16281f); }
.level-active:hover, .level-active:focus-visible { border-color: #8fe6b8; }
.lesson-card { display: grid; grid-template-columns: 4rem minmax(0, 1fr) 2rem; gap: 18px; align-items: center; width: 100%; margin-top: 38px; padding: 24px; border: 1px solid rgba(140,205,175,.16); border-radius: 22px; background: #16281f; color: var(--ink); text-align: left; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.lesson-list { display: grid; gap: 14px; margin-top: 24px; }
.lesson-list .lesson-card { margin-top: 0; grid-template-columns: 4rem minmax(0, 1fr) auto 2rem; }
.lesson-card:hover, .lesson-card:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.08); outline: 0; }
.lesson-card-number { color: var(--blue); font-size: 30px; font-weight: 700; }
.lesson-card strong, .lesson-card small { display: block; }
.lesson-card strong { font-size: 20px; }
.exercise-list { display: grid; gap: 12px; }
.exercise-picker h1 { color: var(--blue); }
.exercise-picker-nav { justify-content: flex-start; min-height: 5.5rem; margin: 24px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); }
.exercise-picker-nav .nav-button { min-width: clamp(13.75rem, 28vw, 22rem); min-height: 4rem; color: var(--warn); background: #1a3327; font-size: 22px; text-align: left; }
.exercise-picker-nav .nav-button:hover, .exercise-picker-nav .nav-button:focus-visible { color: var(--warn); background: #234a35; }
.exercise-card { grid-template-columns: 4rem minmax(0, 1fr) auto 2rem; margin-top: 0; text-align: left; }
.exercise-copy { min-width: 0; }
.exercise-copy strong { display: inline; margin-right: 8px; }
.lesson-card.exercise-card .exercise-copy small { display: inline; margin-top: 0; color: var(--muted); line-height: 1.4; }
.exercise-duration { color: var(--blue); font-size: 30px; font-weight: 700; line-height: 1; white-space: nowrap; }
.exercise-time-stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.exercise-audio-chip { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); background: var(--surface); font-size: 16px; }
.exercise-audio-chip:hover, .exercise-audio-chip:focus-visible { border-color: var(--blue); outline: 0; }
.exercise-audio-chip.is-playing { color: #fff; background: var(--blue); }
@media (min-width: 40rem) { .exercise-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lesson-card small { margin-top: 8px; color: var(--muted); }
.chevron { color: var(--blue); font-size: 32px; }
.start-card { max-width: 650px; margin-top: 38px; padding: 26px; border-radius: 22px; background: #16281f; }
.start-card p { color: var(--muted); font-size: 18px; line-height: 1.5; }
.start-card .primary { width: auto; padding-inline: 24px; }
.step-meta { margin-top: 8px; color: var(--muted); font-size: 15px; }
.lesson-heading .progress-line { margin: 24px 0 52px; }
.asset-link { display: flex; justify-content: space-between; width: 100%; min-height: 2.75rem; padding: 12px 0 0; border: 0; background: transparent; color: var(--blue); font-size: 14px; text-align: left; }
.asset-link:hover, .asset-link:focus-visible { text-decoration: underline; outline: 0; }
/* Breakpoints: <640 phone · 640–1023 tablet · 1024–1439 tablet landscape/small laptop · ≥1440 desktop. */
@media (min-width: 64rem) { .step-layout { grid-template-columns: minmax(0, 1fr) 20rem; } }
@media (max-width: 63.9375rem) { .crumb-full { display: none; } .crumb-short { display: inline; } }
@media (min-width: 40rem) and (max-width: 63.9375rem) { .chooser-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 39.9375rem) { .chooser-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 39.9375rem) { .resume-card { width: 100%; } }
@media (max-width: 39.9375rem) { .login-card { padding: 30px 24px; } .aside { grid-template-columns: repeat(2, minmax(0,1fr)); } .panel { padding: 16px; } .nav-button { min-width: 0; flex: 1; } .chooser-grid { gap: 12px; } .level { min-height: 180px; padding: 20px; } .chooser-hero { margin-top: 58px; } .topbar { padding: 16px 20px; } .topbar-meta { gap: 10px; } .nav-button { padding: 14px 12px; font-size: 14px; } }
@media (min-width: 90rem) { .nav-tile-context { min-width: 220px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; } .nav-tile-context .nav-tile-subline { display: block; } }
@media (min-width: 40rem) and (max-width: 89.9375rem) { .nav-tile-label-full, .nav-tile-context-full { display: none; } .nav-tile-label-short, .nav-tile-context-short { display: inline; } .nav-tile-context .nav-tile-subline { display: block; } .nav-tile-context { flex-direction: column; gap: 0; } .tile-nav { flex: 1 1 auto; } .nav-tile { min-width: 0; flex: 1 1 0; padding-inline: 10px; } .nav-tile-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; } .nav-tile-context .nav-tile-subline { max-width: 100%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; } .fullscreen-trigger { margin-left: auto; } }
@media (max-width: 39.9375rem) { .tile-bar { min-height: 64px; padding-inline: 8px; } .tile-nav { justify-content: space-evenly; gap: 2px; } .nav-tile { min-width: 0; flex: 1 1 0; height: 56px; padding: 4px 2px 3px; flex-direction: column; gap: 2px; font-size: 12px; } .nav-tile-icon { font-size: 20px; } .nav-tile-label { overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .menu-trigger { min-width: 42px; width: 42px; height: 56px; padding: 3px 1px; font-size: 12px; } .menu-icon { display: block; } .nav-tile-context .nav-tile-subline { display: none; } }
@media (max-width: 63.9375rem) { .step-layout { grid-template-columns: minmax(0, 1fr); } .aside { display: grid; grid-template-columns: 1fr; gap: 12px; } .aside .panel:nth-child(2) { display: flex; flex-wrap: wrap; gap: 12px; } .aside .panel:nth-child(2) > h3 { flex: 1 0 100%; } .aside .panel:nth-child(2) > .asset { flex: 1 1 13.75rem; min-width: 0; } .aside .panel:nth-child(2) > .asset-link { flex: 1 1 13.75rem; width: auto; } }
@media (max-width: 63.9375rem) { .start-card .primary { width: 100%; } }
@media (max-width: 39.9375rem) { .nav { gap: 12px; } .nav-button { min-width: 0; } .nav-button.secondary { flex: 1; } .nav-button:not(.secondary) { flex: 2; } }
/* Teacher cue card: one reading column at every viewport. */
.cue-content { width: min(calc(100% - 24px), 60rem); margin-inline: auto; padding: clamp(20px, 4vh, 48px) 0 40px; }
.cue-card { --bottombar-h: 5.5rem; }
.cue-card .lesson-head { position: sticky; z-index: 5; top: 0; }
.cue-card .shared-header { position: relative; }
.cue-content { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); }
.cue-status { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; margin-bottom: calc(18px * var(--auto-fit-scale, 1)); color: var(--warn); font-size: clamp(18px, 2vw, 20px); line-height: 1.2; white-space: nowrap; }
.prepare-label { position: absolute; left: 50%; margin: 0; color: var(--blue); font-size: clamp(22px, 2.8vw, 32px); line-height: 1; white-space: nowrap; transform: translateX(-50%); }
.cue-status.is-warning { color: var(--warn); }
.inline-lesson-clock { display: flex; justify-content: center; align-items: center; color: var(--ink); }
.inline-lesson-clock .flip-digit { width: 2.2rem; height: 2.7rem; font-size: 34px; line-height: 2.7rem; }
.inline-lesson-clock .flip-colon { font-size: 26px; }
.cue-timer { display: flex; justify-content: center; margin: 0 auto 14px; }
.cue-timer .flip-digit { width: clamp(3.75rem, 10vw, 6rem); height: clamp(4.75rem, 12vw, 7rem); font-size: clamp(64px, 9vw, 96px); line-height: clamp(4.75rem, 12vw, 7rem); }
.cue-timer .flip-colon { font-size: clamp(48px, 7vw, 72px); }
.cue-card .timer-controls { margin: 0 0 20px; }
.cue-card .timer-action { min-height: 3.5rem; padding: 0 24px; font-size: 18px; }
.cue-card .timer-main { min-width: 8rem; }
.cue-progress { height: 6px; margin: 0 0 calc(20px * var(--auto-fit-scale, 1)); }
.text-zoom { display: flex; align-items: center; gap: 10px; margin: 0 0 calc(clamp(28px, 4vh, 48px) * var(--auto-fit-scale, 1)); }
.text-zoom-icon { font-size: 20px; line-height: 1; opacity: .85; }
.text-zoom-button { width: 2.5rem; height: 2.5rem; border: 1px solid rgba(140,205,175,.24); border-radius: 10px; background: #16281f; color: var(--blue); font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; }
.text-zoom-button:hover, .text-zoom-button:focus-visible { background: #1b3327; outline: 0; }
.text-zoom-button:active { transform: translateY(1px); }
.cue-body-exercise { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(18rem, .8fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.cue-body-exercise .prepare { margin-top: 0; }
.cue-body-exercise .prepare-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cue-body-exercise .prepare-documents .materials-strip { grid-template-rows: none; }
.cue-body-exercise .prepare-documents .document-chip { aspect-ratio: 4 / 3; }
.cue-instruction { max-width: 65ch; }
.cue-instruction .step-title { margin: 0 0 14px; font-size: calc(clamp(32px, 3.2vw, 36px) * var(--text-zoom, 1) * var(--auto-fit-scale, 1)); line-height: 1.12; }
.cue-instruction .step-copy { max-width: 65ch; font-size: calc(clamp(26px, 2.5vw, 30px) * var(--text-zoom, 1) * var(--auto-fit-scale, 1)); line-height: calc(1.4 - (1 - min(1, var(--auto-fit-scale, 1))) * 0.35); }
.exercise-back { margin-top: 22px; }
.prepare { margin-top: clamp(28px, 4vh, 48px); }
.prepare { position: relative; }
.prepare h2 { margin: 0 0 14px; color: var(--ink); font-size: clamp(32px, 3.2vw, 36px); line-height: 1.12; text-align: center; }
.prepare-columns { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); align-items: stretch; gap: 24px; }
.prepare-column h3 { margin: 0 0 10px; color: var(--muted); font-size: 17px; }
.material-group + .material-group { margin-top: 12px; }
.material-group-divider { height: 3px; margin: 14px 0; border-radius: 3px; background: #1c3d2c; }
.audio-under-supplies { margin-top: 20px; }
.audio-under-supplies h4 { margin: 0 0 10px; color: var(--muted); font-size: 17px; }
.audio-under-supplies .audio-chip { width: 100%; flex-basis: 100%; }
.audio-under-supplies .audio-chip { grid-column: 1 / -1; }
.prepare-columns > .audio-under-supplies { grid-column: 2; }
.prepare-supplies .materials-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cue-body-exercise .prepare-supplies .materials-strip { grid-template-columns: 1fr; }
.prepare-supplies .material-chip { min-height: 3.5rem; padding: 8px 10px; gap: 8px; }
.prepare-supplies .material-name { overflow: visible; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.15; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.prepare-supplies .material-quantity { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.materials-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.material-chip { display: flex; align-items: center; gap: 12px; min-height: 4rem; flex: 1 1 13.75rem; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); text-align: left; text-decoration: none; }
.material-info { min-width: 0; display: grid; gap: 3px; }
.material-quantity { overflow: hidden; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
button.material-chip { cursor: pointer; font-size: inherit; }
.material-chip:hover, .material-chip:focus-visible, .material-chip:active { border-color: var(--blue); background: rgba(79,214,150,.14); outline: 0; }
.prepare-documents { align-self: stretch; min-height: 0; }
.prepare-documents .materials-strip { display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 12px; width: 100%; height: 100%; min-height: 0; }
.prepare-documents.document-count-1 .materials-strip { grid-template-rows: 1fr; }
.prepare-documents .document-chip { position: relative; display: grid; grid-template-rows: 1fr auto; align-self: stretch; width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; padding: 4px; overflow: hidden; }
.document-open { display: grid; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100%; min-height: 0; color: inherit; text-decoration: none; }
.prepare-documents .document-chip:hover, .prepare-documents .document-chip:focus-visible { background: var(--surface); }
.document-preview-image { display: block; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 10px; background: #fff; object-fit: contain; pointer-events: none; }
.prepare-documents .document-chip .material-info { padding: 0 4px 4px; text-align: center; }
.prepare-documents .document-chip .material-name { font-size: clamp(20px, 2vw, 22px); }
.print-document { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 1.25rem; cursor: pointer; }
.print-document:hover, .print-document:focus-visible, .print-document:active { border-color: var(--blue); background: rgba(79,214,150,.18); outline: 0; }
.print-document-frame { position: fixed; top: 0; left: -100vw; width: 100vw; height: 100vh; border: 0; opacity: 0; pointer-events: none; }
.material-icon { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 2rem; font-size: 1.75rem; }
.material-preview { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; flex: 0 0 3.5rem; overflow: hidden; border: 1px solid rgba(140,205,175,.22); border-radius: 8px; background: #e8f6ee; color: #17301f; font-size: 1.75rem; }
.material-preview.pdf-preview { display: block; object-fit: cover; background: #fff; }
.material-name { min-width: 0; overflow: hidden; color: var(--ink); font-size: clamp(20px, 2.1vw, 22px); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.zeszyt-chip .material-name { overflow: visible; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.2; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.material-action, .audio-chip-time { margin-left: auto; color: var(--blue); font-size: 16px; font-weight: 700; white-space: nowrap; }
.audio-chip { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) 6px; column-gap: 8px; row-gap: 8px; }
.audio-toggle { display: flex; align-items: center; min-width: 0; gap: 12px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.audio-toggle .material-info { min-width: 0; }
.audio-toggle:focus-visible, .audio-restart:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.audio-restart { align-self: start; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); background: var(--surface); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.audio-restart:hover, .audio-restart:active { border-color: var(--blue); background: rgba(79,214,150,.18); }
.audio-progress { grid-column: 1 / -1; align-self: end; display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: rgba(140,205,175,.22); opacity: 0; transition: opacity .16s ease; }
.audio-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .08s linear; }
.audio-chip.has-progress .audio-progress { opacity: 1; }
.audio-under-supplies .audio-chip { min-height: 4rem; }
.audio-chip.is-playing .material-icon { color: var(--blue); }
.audio-chip audio { display: none; }
.shortcut-hint { margin-top: 24px; color: var(--muted); font-size: 16px; }
.cue-card .nav { min-height: 5.5rem; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); }
.cue-card .nav-button { min-width: clamp(13.75rem, 28vw, 22rem); min-height: 4rem; font-size: 22px; }
.cue-card .nav-button, .cue-card .nav-button.secondary { color: var(--warn); background: #1a3327; }
.cue-card .nav-button:hover, .cue-card .nav-button:focus-visible, .cue-card .nav-button.secondary:hover { color: var(--warn); background: #234a35; }
.cue-card .nav-button.secondary { margin-right: auto; text-align: left; }
.cue-card .nav-button:not(.secondary) { margin-left: auto; text-align: right; }
@media (min-width: 40rem) and (max-width: 63.9375rem) { .cue-content { width: calc(100% - 24px); } .cue-card .nav-button { min-width: 13.75rem; } }
@media (pointer: coarse) and (min-width: 40rem) { .cue-card .nav { position: fixed; right: 0; bottom: 0; left: 0; height: calc(4.5rem + env(safe-area-inset-bottom)); min-height: calc(4.5rem + env(safe-area-inset-bottom)); margin: 0; padding: 8px 24px calc(8px + env(safe-area-inset-bottom)); } .cue-content { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); } .cue-card .nav-button { position: relative; top: 16px; min-height: 3.5rem; } }
@media (pointer: coarse) and (min-width: 40rem) { :fullscreen .cue-card .nav { bottom: calc(-1 * env(safe-area-inset-bottom)); height: calc(4rem + env(safe-area-inset-bottom)); min-height: calc(4rem + env(safe-area-inset-bottom)); padding: 6px 24px calc(6px + env(safe-area-inset-bottom)); } :fullscreen .cue-card .nav-button { top: 0; min-height: 3rem; } :fullscreen .cue-card .cue-content { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); } }
@media (max-width: 39.9375rem) { .cue-status { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; white-space: normal; } .prepare-label { position: static; grid-column: 1 / -1; grid-row: 2; justify-self: center; transform: none; } .inline-lesson-clock { grid-column: 2; grid-row: 1; } .cue-status #timer-reset { grid-column: 2; grid-row: 3; } .cue-card .nav { gap: 12px; } .cue-card .nav-button { min-height: 4rem; padding-inline: 12px; } .cue-card .nav-button.secondary, .cue-card .nav-button:not(.secondary) { flex: 1 1 0; } .material-name { font-size: 18px; } }
@media (max-width: 39.9375rem) { .prepare-documents .materials-strip { grid-template-columns: 1fr; gap: 8px; } }
@media (max-width: 63.9375rem) { .prepare-columns > .audio-under-supplies { grid-column: 1; } }
@media (max-width: 63.9375rem) { .prepare-columns { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 63.9375rem) { .cue-body-exercise { grid-template-columns: 1fr; gap: 24px; } }
@media (max-width: 63.9375rem) { .start-card .primary { width: 100%; } }
.times-table-dialog { position: fixed; inset: 0; width: 100vw; width: 100dvw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 16px calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); border: 0; border-radius: 0; color: var(--ink); background: #10241a; display: flex; flex-direction: column; gap: 12px; }
.times-table-dialog::backdrop { background: rgba(0,0,0,.55); }
.times-table-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: clamp(20px, 3vw, 32px); text-align: center; }
.times-table-head strong { flex: 1 1 auto; }
.times-table-head .timer-action { flex: 0 0 auto; font-size: clamp(13px, 1.6vw, 18px); }
.times-table-head .timer-action[disabled] { opacity: .4; cursor: default; }
.times-table-grid { position: relative; flex: 1 1 auto; display: grid; gap: 2px; min-height: 0; background: var(--line); border: 1px solid var(--line); }
.times-table-cell { display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--ink); background: #10241a; font-size: clamp(12px, 2.8vh, 26px); font-variant-numeric: tabular-nums; transition: background .12s, color .12s; }
.times-table-header { color: var(--blue); background: rgba(79,214,150,.14); font-weight: 700; cursor: pointer; }
.times-table-header.is-selected { color: #10241a; background: var(--blue); }
.times-table-corner { background: rgba(79,214,150,.14); }
.times-table-cell.is-highlighted { background: rgba(79,214,150,.22); }
.times-table-cell.is-picked { color: #10241a; background: var(--blue); font-weight: 800; }
/* własne display: flex bije domyślne [hidden] { display: none } przeglądarki,
   więc ukrycie wyniku trzeba wymusić wprost */
.times-table-result[hidden] { display: none !important; }
.times-table-result.is-divide { flex-direction: column; gap: 2px; font-size: clamp(22px, 6vh, 72px); }
.times-table-equation { font-size: .42em; font-weight: 700; opacity: .85; }
.times-table-value { line-height: 1; }
.times-table-result { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 4px; border: 3px solid var(--blue); border-radius: 12px; color: #10241a; background: var(--blue); font-weight: 800; font-size: clamp(28px, 8vh, 96px); line-height: 1; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4); cursor: pointer; }

/* Small-screen layout guardrails: all width-sensitive components stay inside the app scroller. */
html, body, #app { max-width: 100%; min-width: 0; }
.app-shell { width: 100%; max-width: 100%; overflow-x: clip; }
.chooser, .cue-content, .content { min-width: 0; max-width: calc(100% - 24px); }
.lesson-card, .level, .material-chip, .prepare-column, .material-group, .exercise-copy { min-width: 0; max-width: 100%; }
.lesson-card strong, .lesson-card small, .material-name, .material-quantity, .step-copy { overflow-wrap: anywhere; }

@media (max-width: 39.9375rem) {
  :root { --gutter: 12px; --bottombar-h: 76px; }
  .tile-bar { display: flex; align-items: stretch; gap: 4px; width: 100%; min-height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 4px 4px; overflow: visible; }
  .tile-nav { flex: 1 1 auto; min-width: 0; max-width: calc(100% - 98px); gap: 2px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tile-nav::-webkit-scrollbar { display: none; }
  .nav-tile { flex: 0 0 66px; width: 66px; min-width: 66px; height: 56px; padding: 3px 2px 2px; scroll-snap-align: start; }
  .nav-tile-label { display: block; max-width: 100%; overflow: hidden; font-size: 11px; line-height: 1.05; text-align: center; text-overflow: ellipsis; white-space: normal; overflow-wrap: anywhere; }
  .nav-tile-label-full { display: none; }
  .nav-tile-label-short { display: inline; }
  .nav-tile-icon { flex: 0 0 auto; font-size: 19px; }
  .nav-tile-logo .nav-tile-icon { width: auto; height: auto; }
  .nav-logo { width: 42px; height: 42px; }
  .fullscreen-trigger, .menu-trigger { flex: 0 0 44px; width: 44px; min-width: 44px; height: 56px; min-height: 44px; padding: 2px; }
  .fullscreen-trigger { font-size: 22px; }
  .menu-trigger { font-size: 11px; line-height: 1.05; }
  .menu-icon { display: block; font-size: 20px; }
  .overflow-menu { position: fixed; top: calc(64px + env(safe-area-inset-top)); right: 8px; max-width: calc(100vw - 16px); }

  .chooser { width: calc(100% - 24px); margin-inline: auto; padding: 16px 0 calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 16px); }
  .chooser-hero { margin-top: 16px; }
  .chooser h1 { font-size: clamp(30px, 9vw, 42px); }
  .chooser-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
  .level { min-height: 148px; padding: 14px; border-radius: 18px; }
  .level strong { margin: 24px 0 8px; font-size: 17px; }
  .level .level-code { font-size: 25px; }
  .level span { font-size: 13px; }
  .resume-card { width: 100%; margin-top: 16px; padding: 16px; }

  .lesson-list, .exercise-list { gap: 10px; margin-top: 16px; }
  .lesson-card, .lesson-list .lesson-card, .exercise-card { grid-template-columns: 2.75rem minmax(0, 1fr) auto 1.25rem; gap: 7px; margin-top: 0; padding: 14px 10px; border-radius: 16px; }
  .lesson-card-number { font-size: 25px; }
  .lesson-card strong { font-size: 17px; line-height: 1.12; }
  .lesson-card small { margin-top: 5px; font-size: 14px; line-height: 1.25; }
  .exercise-duration { font-size: 17px; }
  .chevron { font-size: 27px; }
  .exercise-copy strong, .lesson-card.exercise-card .exercise-copy small { display: block; margin-right: 0; }
  .exercise-copy strong { line-height: 1.12; }
  .exercise-time-stack { gap: 4px; }
  .exercise-audio-chip { width: 2.5rem; height: 2.5rem; }

  .lesson-card + .nav, .chooser > .nav { width: calc(100% + 24px); margin-inline: -12px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .chooser > .nav { position: sticky; bottom: 0; z-index: 4; min-height: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); background: rgba(12,25,18,.96); }
  .chooser > .nav .nav-button, .exercise-picker-nav .nav-button { min-width: 0; min-height: 52px; padding: 10px 12px; font-size: 18px; }

  .tile-lesson-clock { top: calc(100% + 10px); right: 94px; transform: none; transform-origin: center; }
  .tile-lesson-clock .flip-digit { width: 2.35rem; height: 3.25rem; font-size: 43px; line-height: 3.25rem; }
  .tile-lesson-clock .flip-colon { font-size: 29px; }
  .exercise-picker-reset { top: calc(100% + 10px); right: 4px; bottom: auto; min-height: 3.25rem; padding: 8px 10px; font-size: 15px; }
  .exercise-picker .screen-offset { margin-top: 78px; }

  .cue-content { width: calc(100% - 24px); padding: 16px 0 calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 16px); }
  .cue-status { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-bottom: 12px; font-size: 16px; line-height: 1.15; }
  .prepare-label { max-width: 100%; font-size: clamp(21px, 6vw, 28px); text-align: center; }
  .inline-lesson-clock .flip-digit { width: 1.85rem; height: 2.3rem; font-size: 29px; line-height: 2.3rem; }
  .inline-lesson-clock .flip-colon { font-size: 22px; }
  .cue-progress { margin-bottom: 14px; }
  .text-zoom { gap: 8px; margin-bottom: 22px; }
  .text-zoom-button { width: 2.75rem; height: 2.75rem; }
  .cue-timer .flip-digit { width: clamp(2.35rem, 13vw, 3.25rem); height: clamp(3.25rem, 18vw, 4.5rem); font-size: clamp(42px, 13vw, 64px); line-height: clamp(3.25rem, 18vw, 4.5rem); }
  .cue-timer .flip-colon { font-size: clamp(32px, 9vw, 48px); }
  .cue-instruction .step-title { font-size: calc(clamp(28px, 8vw, 34px) * var(--text-zoom, 1) * var(--auto-fit-scale, 1)); }
  .cue-instruction .step-copy { max-width: none; font-size: calc(clamp(20px, 5.5vw, 26px) * var(--text-zoom, 1) * var(--auto-fit-scale, 1)); overflow-wrap: anywhere; }
  .prepare { margin-top: 24px; }
  .prepare-columns, .cue-body-exercise .prepare-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .prepare-supplies .materials-strip, .cue-body-exercise .prepare-supplies .materials-strip { grid-template-columns: minmax(0, 1fr); }
  .materials-strip { gap: 8px; }
  .material-chip { width: 100%; flex: 1 1 auto; padding: 10px; }
  .prepare-supplies .material-chip { min-height: 4rem; }
  .prepare-supplies .material-name, .material-name { font-size: 17px; line-height: 1.18; white-space: normal; }
  .material-quantity { font-size: 13px; white-space: normal; }
  .prepare-documents .materials-strip { grid-template-rows: none; height: auto; }
  .prepare-documents .document-chip { min-height: 13rem; aspect-ratio: 4 / 3; }
  .document-preview-image { max-width: 100%; }
  .audio-under-supplies .audio-chip { width: 100%; }
  .cue-card .nav { position: sticky; bottom: 0; z-index: 6; min-height: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); margin: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(12,25,18,.96); }
  .cue-card .nav-button { min-width: 0; min-height: 52px; padding: 10px 12px; font-size: 18px; }
}

@media (max-width: 22.5rem) {
  .chooser-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-tile { flex-basis: 62px; width: 62px; min-width: 62px; }
  .tile-nav { max-width: calc(100% - 98px); }
  .lesson-card, .lesson-list .lesson-card, .exercise-card { grid-template-columns: 2.4rem minmax(0, 1fr) auto 1rem; gap: 5px; padding-inline: 8px; }
  .exercise-duration { font-size: 15px; }
}

/* iPhone preparation guard: material cards always use the full parent width. */
@media (max-width: 39.9375rem) {
  .cue-card .cue-content,
  .cue-card .cue-body,
  .cue-card .prepare,
  .cue-card .prepare-columns,
  .cue-card .prepare-column,
  .cue-card .prepare-supplies,
  .cue-card .material-group,
  .cue-card .materials-strip { width: 100%; min-width: 0; max-width: 100%; }
  .cue-card .prepare-columns { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cue-card .prepare-supplies .materials-strip,
  .cue-card .cue-body-exercise .prepare-supplies .materials-strip { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cue-card .prepare-supplies .material-chip,
  .cue-card .prepare-documents .material-chip { width: 100%; min-width: 0; max-width: 100%; }
  .cue-card .material-info,
  .cue-card .material-name,
  .cue-card .material-quantity { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .cue-card .prepare-supplies .material-name,
  .cue-card .prepare-supplies .material-quantity { white-space: normal; overflow: visible; }
  .cue-card .nav { width: 100%; max-width: 100%; }
}

/* Portrait iPhone: keep the six navigation destinations readable in two rows. */
@media (max-width: 39.9375rem) and (orientation: portrait) {
  .tile-bar { min-height: calc(120px + env(safe-area-inset-top)); align-items: center; }
  .tile-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 56px; flex: 1 1 auto; width: 100%; max-width: calc(100% - 98px); gap: 2px; overflow: visible; }
  .nav-tile { width: auto; min-width: 0; height: 56px; flex: none; }
  .fullscreen-trigger, .menu-trigger { align-self: center; }
  .overflow-menu { top: calc(120px + env(safe-area-inset-top)); }
}

.basic-vocabulary { margin: 0; color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); line-height: 1.5; }
.basic-lesson-tag { color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.basic-vocabulary-group { padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.prepare-supplies .material-group + .material-group { margin-top: .75rem; }
.prepare-supplies .audio-chip .material-name { white-space: normal; overflow-wrap: normal; }
.basic-prepare .prepare-documents .document-chip { max-height: 26rem; }
.basic-prepare .material-chip { padding: .5rem .75rem; }
.basic-prepare .material-name { font-size: clamp(14px, 1.35vw, 17px); }
.basic-prepare .prepare-columns { align-items: start; }
.basic-prepare .prepare-supplies .materials-strip { gap: .5rem; }
/* Bez karty do druku ekran „Przygotuj” nie ma lewej kolumny — materiały biorą
   wtedy całą szerokość, tak jak pasek postępu nad nimi. */
/* Karcie do druku wystarczy węższa kolumna — reszta szerokości idzie na
   materiały, których w Basic bywa kilkanaście. */
.basic-prepare .prepare-columns { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); }
.basic-prepare .prepare-columns.prepare-single { grid-template-columns: minmax(0, 1fr); }
.basic-prepare .prepare-supplies .materials-strip { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.basic-prepare .audio-chip { min-width: 0; }

/* Druk tabliczki: na papier idzie kopia siatki wyjęta z okna (.table-print-sheet),
   bo treści z <dialog> przeglądarki przy drukowaniu pomijają. Jedna kartka A4
   poziomo, wypełniona do marginesów. */
@page { size: A4 landscape; margin: 6mm; }

.table-print-sheet { position: absolute; left: -10000px; top: 0; width: 0; height: 0; overflow: hidden; }

@media print {
  html, body { height: auto; background: #fff; }
  body > *:not(.table-print-sheet) { display: none !important; }
  .table-print-sheet { position: static; left: auto; display: flex; flex-direction: column; width: 100%; height: auto; overflow: visible; color: #000; }
  .table-print-sheet strong { margin: 0 0 4mm; font-size: 20pt; text-align: center; }
  /* Reguły ekranu są bardziej szczegółowe od drukowych, a przeglądarka
     dodatkowo „poprawia" ciemne tła na wydruku — dlatego kolory arkusza
     wymuszamy wprost, razem z color-adjust, żeby nikt ich nie tłumaczył. */
  .table-print-sheet, .table-print-sheet * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .table-print-sheet .times-table-grid { flex: 1 1 auto !important; height: 180mm !important; gap: 0 !important; background: #fff !important; border: .6pt solid #000 !important; }
  .table-print-sheet .times-table-cell { color: #000 !important; background: #fff !important; border: .4pt solid #000 !important; font-size: 13pt !important; font-weight: 400 !important; }
  .table-print-sheet .times-table-header, .table-print-sheet .times-table-corner { color: #000 !important; background: #e8e8e8 !important; font-weight: 700 !important; }
  .table-print-sheet .times-table-result { display: none !important; }
}
