:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --text: #122033;
  --muted: #64748b;
  --line: #dbe3ec;
  --primary: #0869c7;
  --primary-dark: #064f98;
  --primary-soft: #e6f2fd;
  --teal: #0f9b8e;
  --orange: #e27816;
  --purple: #7555c7;
  --red: #c53c4a;
  --shadow: 0 12px 34px rgba(29, 47, 70, .08);
  --radius: 18px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0d1a2b;
  --surface-2: #14243a;
  --text: #edf5ff;
  --muted: #9baec4;
  --line: #223650;
  --primary: #45a1f5;
  --primary-dark: #70b7f8;
  --primary-soft: #102d4c;
  --shadow: 0 14px 40px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button, select, input[type="range"] { touch-action: manipulation; }
button { color: inherit; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 275px; }
.brand-mark, .login-logo {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0573d8, #064782);
  color: white;
  font-weight: 900;
  letter-spacing: -.05em;
  border-radius: 11px;
}
.brand-mark { width: 40px; height: 40px; font-size: 16px; }
.brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(4, 72, 139, .2);
}
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.desktop-nav { display: flex; align-items: center; gap: 8px; margin: auto; }
.desktop-nav a {
  color: var(--muted);
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: 650;
  font-size: 14px;
}
.desktop-nav a:hover { background: var(--surface-2); color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 8px; min-width: 275px; justify-content: end; }
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.mobile-nav { display: none; }

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(21, 50, 82, .1); }
.button-primary { color: white; border-color: var(--primary); background: var(--primary); }
.button-primary:hover { background: var(--primary-dark); }
.button-ghost { background: transparent; }
.button-danger { color: white; background: var(--red); border-color: var(--red); }
.button-large { min-height: 52px; padding: 13px 22px; border-radius: 13px; font-size: 15px; }
.button-small { min-height: 36px; padding: 7px 12px; }
.play-symbol { display: grid; place-items: center; width: 25px; height: 25px; background: #fff; color: var(--primary); border-radius: 50%; font-size: 10px; }

.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 38px 40px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgba(39, 175, 238, .45), transparent 24%),
    linear-gradient(120deg, #052d58, #075da4 65%, #0b7fc9);
  box-shadow: 0 18px 42px rgba(5, 79, 145, .22);
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -170px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { max-width: 690px; margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.hero p:last-child { margin: 14px 0 0; opacity: .78; }
.hero .eyebrow { color: #a9dcff; }
.hero .button { background: white; color: #07599e; border: 0; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin: 22px 0 44px; }
.metric-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card > span, .metric-head span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card > strong { margin-top: 5px; font-size: 34px; line-height: 1.1; letter-spacing: -.04em; }
.metric-card small, .metric-card p { color: var(--muted); margin: 6px 0 0; }
.metric-head { display: flex; justify-content: space-between; margin-bottom: 13px; }
.metric-head b { font-size: 22px; color: var(--primary); }
.progress-track { overflow: hidden; width: 100%; height: 9px; background: var(--surface-2); border-radius: 99px; }
.progress-track span, .progress-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #32a7e3); border-radius: inherit; }
.progress-track.small { height: 6px; }

.section-heading, .page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 38px 0 18px;
}
.section-heading h2, .page-heading h1 { margin: 0; letter-spacing: -.035em; }
.section-heading a { color: var(--primary); font-weight: 750; font-size: 14px; }
.page-heading { margin-top: 4px; }
.page-heading h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.1; }
.page-heading p:last-child { margin: 7px 0 0; color: var(--muted); }
.result-count { color: var(--muted); font-weight: 700; }

.discipline-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.discipline-card {
  --accent: var(--primary);
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.discipline-card:hover { transform: translateY(-3px); }
.discipline-card::after {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  right: -35px;
  bottom: -45px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 50%;
}
.discipline-card.accent-2 { --accent: var(--teal); }
.discipline-card.accent-3 { --accent: var(--orange); }
.discipline-card.accent-4 { --accent: var(--purple); }
.discipline-card.accent-5 { --accent: #d65c78; }
.discipline-top { display: flex; justify-content: space-between; color: var(--accent); font-weight: 850; font-size: 13px; }
.discipline-number { font-size: 11px; letter-spacing: .12em; }
.discipline-card h3 { min-height: 53px; margin: 26px 0 7px; line-height: 1.25; }
.discipline-card p { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.discipline-card .progress-track span { background: var(--accent); }

.module-list { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.module-row {
  display: grid;
  grid-template-columns: 90px minmax(250px, 1fr) 210px 15px;
  gap: 16px;
  align-items: center;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.module-row:last-child { border-bottom: 0; }
.module-row:hover { background: var(--surface-2); }
.module-code, .code-pill { color: var(--primary); font-weight: 850; letter-spacing: .03em; }
.module-name { display: flex; flex-direction: column; }
.module-name small { color: var(--muted); margin-top: 2px; }
.module-progress { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 12px; }

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(125px, 1fr)) auto auto;
  gap: 10px;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-panel select, .filter-panel input, .stack input, .stack textarea, .note-card textarea {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}
.filter-panel select:focus, .filter-panel input:focus, .stack input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-field { position: relative; }
.search-field span { position: absolute; left: 13px; top: 8px; color: var(--muted); font-size: 21px; }
.search-field input { width: 100%; padding-left: 39px; }
.lesson-list { display: grid; gap: 10px; }
.lesson-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: transform .15s ease, border-color .15s ease;
}
.lesson-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.lesson-card.is-complete { border-left: 4px solid var(--teal); }
.lesson-card.is-started { border-left: 4px solid var(--primary); }
.lesson-main { display: grid; grid-template-columns: 58px 1fr 20px; gap: 16px; align-items: center; padding: 18px 20px; }
.lesson-order { color: var(--muted); font-size: 12px; font-weight: 850; }
.lesson-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.code-pill, .priority, .audio-ready { display: inline-flex; padding: 4px 8px; border-radius: 7px; background: var(--primary-soft); }
.priority { color: var(--muted); background: var(--surface-2); }
.priority-a { color: #b74816; background: #fff0e7; }
[data-theme="dark"] .priority-a { color: #ffad80; background: #3c2118; }
.audio-ready { color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.lesson-info h3 { margin: 7px 0 3px; font-size: 17px; line-height: 1.3; }
.lesson-info > p { margin: 0; color: var(--muted); font-size: 13px; }
.lesson-bottom { display: flex; gap: 18px; margin-top: 10px; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.lesson-arrow { color: var(--muted); font-size: 27px; }
.empty-state { padding: 60px 25px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h2 { color: var(--text); }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--primary); }
.lesson-header { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 22px; }
.lesson-header h1 { max-width: 850px; margin: 10px 0 5px; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.lesson-header p { margin: 0; color: var(--muted); }
.mark-actions { display: flex; gap: 8px; }
.chip-button {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.chip-button.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

.audio-player {
  position: relative;
  padding: 25px 28px 20px;
  color: white;
  border-radius: 22px;
  background:
    radial-gradient(circle at 94% 10%, rgba(55, 184, 243, .3), transparent 30%),
    linear-gradient(120deg, #061f3d, #073d70);
  box-shadow: 0 18px 40px rgba(4, 44, 80, .24);
}
.now-playing { display: grid; grid-template-columns: 74px 1fr auto; gap: 18px; align-items: center; }
.cover-art {
  position: relative;
  overflow: hidden;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0a79d4, #23a4c0);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 900;
}
.cover-art i { position: absolute; width: 60px; height: 60px; right: -25px; bottom: -28px; border: 8px solid rgba(255,255,255,.13); border-radius: 50%; }
.now-playing .eyebrow { color: #86cff7; }
.now-playing h2 { margin: 0; max-width: 700px; font-size: 20px; line-height: 1.25; }
.now-playing > div:nth-child(2) > span { color: #a9bed2; font-size: 12px; }
.download-button { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; font-size: 13px; font-weight: 750; }
.timeline { display: grid; grid-template-columns: 43px 1fr 43px; align-items: center; gap: 10px; margin-top: 20px; color: #afc1d2; font-size: 11px; }
.timeline input { width: 100%; accent-color: #46b7f2; }
.player-controls { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 9px; }
.player-controls button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #d7e6f2;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 23px;
}
.player-controls button small { position: absolute; font-size: 8px; margin-top: 4px; }
.player-controls .play-button { width: 58px; height: 58px; color: #07365f; background: white; font-size: 18px; }
.player-controls select { position: absolute; right: 0; padding: 7px; color: white; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2); border-radius: 9px; }
.drive-link { position: absolute; right: 27px; bottom: 22px; color: #bcd0e2; font-size: 12px; }
.audio-empty { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.audio-empty > div { display: flex; align-items: center; gap: 15px; }
.audio-empty h2, .audio-empty p { margin: 0; }
.audio-empty p { color: var(--muted); font-size: 13px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; color: var(--primary); background: var(--primary-soft); border-radius: 13px; font-size: 24px; }
.audio-empty-actions { flex-wrap: wrap; justify-content: end; }
.upload-form { display: flex; gap: 8px; }
.upload-form input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; margin-top: 28px; }
.lesson-content, .note-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lesson-content { padding: clamp(24px, 4vw, 50px); }
.objective-box { padding: 20px; background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: 11px; }
.objective-box p:last-child { margin: 0; font-size: 17px; }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; padding: 0; list-style: none; }
.check-list li::before { content: "✓"; margin-right: 8px; color: var(--teal); font-weight: 900; }
.markdown-body { margin-top: 40px; color: color-mix(in srgb, var(--text) 92%, var(--muted)); font-family: ui-serif, Georgia, Cambria, serif; font-size: 18px; line-height: 1.86; }
.markdown-body h1 { display: none; }
.markdown-body h2, .markdown-body h3 { margin: 1.7em 0 .55em; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.25; }
.markdown-body h2 { font-size: 25px; }
.markdown-body h3 { font-size: 20px; }
.markdown-body a { color: var(--primary); text-decoration: underline; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.markdown-body th, .markdown-body td { padding: 10px; border: 1px solid var(--line); }
.note-card { position: sticky; top: 92px; padding: 20px; }
.note-card h2 { margin: 0; }
.note-card > p { margin: 4px 0 14px; color: var(--muted); font-size: 12px; }
.note-card form { display: grid; gap: 10px; }
.note-card textarea { width: 100%; resize: vertical; }
.lesson-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.lesson-navigation a { display: flex; flex-direction: column; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.lesson-navigation a.next { text-align: right; }
.lesson-navigation small, .lesson-navigation span { color: var(--muted); }

.review-filters { grid-template-columns: repeat(3, 1fr) auto; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-card h2 { margin-top: 0; }
.settings-card > p { color: var(--muted); }
.stack { display: grid; gap: 13px; }
.stack label { display: grid; gap: 6px; font-size: 13px; font-weight: 750; }
.switch-row { grid-template-columns: 1fr auto !important; align-items: center; padding: 13px; background: var(--surface-2); border-radius: 10px; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-weight: 400; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--primary); }
.voice-preview { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.voice-preview > div { display: flex; flex-direction: column; }
.voice-preview small { color: var(--muted); font-size: 12px; }
.voice-samples { display: grid; gap: 9px; margin-top: 12px; }
.voice-sample { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; padding: 10px; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; }
.voice-sample.selected { border-color: var(--primary); }
.voice-sample audio { width: 100%; height: 34px; }
.settings-card details { margin-top: 18px; }
.settings-card summary { color: var(--primary); cursor: pointer; font-weight: 750; }
.settings-card details form { margin-top: 15px; }
.audit-number { display: flex; align-items: baseline; gap: 8px; }
.audit-number strong { font-size: 44px; color: var(--primary); }
.audit-number span { color: var(--muted); }
.audit-list, .queue-card ul { padding: 0; list-style: none; }
.audit-list li, .queue-card li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.queue-card li > span:first-child { display: flex; flex-direction: column; }
.queue-card small { color: var(--muted); }
.status { align-self: center; padding: 4px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; background: var(--surface-2); }
.status-completed { color: var(--teal); }
.status-failed { color: var(--red); }
.status-processing { color: var(--primary); }

.flash { margin-bottom: 15px; padding: 12px 15px; border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--primary); }
.flash-error { color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); border-color: var(--red); }
.flash-success { color: var(--teal); border-color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, var(--surface)); }
.login-page { min-height: 100vh; background: radial-gradient(circle at 70% 15%, #126d9e, transparent 26%), linear-gradient(145deg, #03182d, #073e69); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); padding: 42px; background: var(--surface); border-radius: 24px; box-shadow: 0 25px 70px rgba(0,0,0,.3); }
.login-logo { width: 58px; height: 58px; font-size: 22px; }
.official-logo {
  background-image: url("../img/program-logo.png");
  background-repeat: no-repeat;
  background-position: center 49%;
  background-size: 170% auto;
}
.official-logo-login {
  width: 100%;
  height: 128px;
  margin: -9px 0 20px;
  background-color: #061522;
  border-radius: 16px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .25);
}
.login-card .eyebrow { margin-top: 28px; }
.login-card h1 { margin: 0; font-size: 35px; line-height: 1.08; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-card form { margin-top: 25px; }

.drive-mode { background: #020811; }
.drive-mode .topbar, .drive-mode .mobile-nav, .drive-mode .breadcrumb, .drive-mode .lesson-header, .drive-mode .lesson-layout, .drive-mode .lesson-navigation { display: none; }
.drive-mode .page { width: 100%; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.drive-mode .audio-player { width: min(720px, 100%); padding: 35px; }
.drive-mode .cover-art { width: 105px; height: 105px; }
.drive-mode .player-controls { gap: 30px; margin-top: 25px; }
.drive-mode .player-controls button { width: 80px; height: 80px; font-size: 38px; border: 1px solid rgba(255,255,255,.18); }
.drive-mode .player-controls .play-button { width: 110px; height: 110px; font-size: 30px; }
.drive-mode .timeline { margin-top: 30px; }
.drive-mode .drive-link { font-size: 0; }
.drive-mode .drive-link::after { content: "Sair do modo direção"; font-size: 14px; }

@media (max-width: 1050px) {
  .discipline-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-panel { grid-template-columns: 2fr 1fr 1fr; }
  .filter-panel .button { width: 100%; }
  .desktop-nav { display: none; }
  .brand, .top-actions { min-width: 0; }
  .topbar { justify-content: space-between; }
}

@media (max-width: 760px) {
  .page { width: min(100% - 24px, 620px); padding: 22px 0 96px; }
  .topbar { min-height: 62px; padding: 0 14px; }
  .brand small { display: none; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 10px; font-weight: 750; }
  .mobile-nav span { font-size: 20px; line-height: 1.2; }
  .hero { align-items: stretch; flex-direction: column; padding: 27px 24px; }
  .hero h1 { font-size: 32px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .primary-metric { grid-column: 1 / -1; }
  .metric-card { min-height: 125px; padding: 18px; }
  .discipline-grid { grid-template-columns: 1fr 1fr; }
  .discipline-card { min-height: 165px; }
  .module-row { grid-template-columns: 68px 1fr 12px; padding: 14px; }
  .module-progress { grid-column: 2; }
  .filter-panel, .review-filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .lesson-main { grid-template-columns: 42px 1fr 10px; gap: 8px; padding: 15px 12px; }
  .lesson-bottom { gap: 10px; }
  .lesson-header { align-items: start; flex-direction: column; }
  .mark-actions { width: 100%; }
  .chip-button { flex: 1; }
  .chip-button span { display: none; }
  .now-playing { grid-template-columns: 58px 1fr auto; gap: 11px; }
  .cover-art { width: 58px; height: 58px; }
  .now-playing h2 { font-size: 15px; }
  .download-button span { display: none; }
  .audio-player { padding: 18px 15px; border-radius: 16px; }
  .player-controls select { position: static; }
  .drive-link { position: static; display: block; margin-top: 10px; text-align: center; }
  .audio-empty { align-items: stretch; flex-direction: column; }
  .audio-empty-actions { align-items: stretch !important; }
  .upload-form { flex-wrap: wrap; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-content { padding: 22px 18px; }
  .check-list { grid-template-columns: 1fr; }
  .markdown-body { font-size: 17px; line-height: 1.75; }
  .note-card { position: static; }
  .lesson-navigation { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 25px; }
  .login-card h1 { font-size: 30px; }
  .voice-preview { align-items: stretch; flex-direction: column; }
  .voice-preview .button { width: 100%; }
  .voice-sample { grid-template-columns: 1fr; }
  .drive-mode .page { width: 100%; padding: 12px; }
  .drive-mode .now-playing { grid-template-columns: 75px 1fr; }
  .drive-mode .cover-art { width: 75px; height: 75px; }
  .drive-mode .download-button { display: none; }
  .drive-mode .player-controls { gap: 12px; }
  .drive-mode .player-controls button { width: 65px; height: 65px; font-size: 28px; }
  .drive-mode .player-controls .play-button { width: 86px; height: 86px; }
}

@media (max-width: 470px) {
  .discipline-grid { grid-template-columns: 1fr; }
  .discipline-card { min-height: 145px; }
  .filter-panel, .review-filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .metric-card > strong { font-size: 29px; }
  .lesson-order { display: none; }
  .lesson-main { grid-template-columns: 1fr 10px; }
  .lesson-bottom span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
