:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #254535;
  background: #f8f9f3;
  font-synthesis: none;
  --muted: #72806c;
  --line: #dce3d3;
  --soft: #eef2e8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { max-width: 1120px; margin: 0 auto; padding: 20px 28px 48px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; text-decoration: none; }
.brand > img { display: block; border-radius: 12px; }
.account-control { position: relative; flex: 0 0 auto; }
.account-avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid #d3ddca; border-radius: 50%; overflow: hidden; background: #e4ecd9; color: #385340; font-size: 14px; font-weight: 600; text-decoration: none; }
.account-avatar:hover { box-shadow: 0 0 0 4px #e8ecdf; }
.account-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.google-login { background: #fff; }
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 20; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 8px 28px #2545351f; }
.account-menu button { display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 6px; color: inherit; background: transparent; text-align: left; font-size: 13px; }
.account-menu button:hover, .account-menu button:focus-visible { background: var(--soft); }
.profile-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100% - 40px); margin: auto; padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: #fcfcf8; color: inherit; box-shadow: 0 18px 70px #122a2533; }
.profile-dialog::backdrop { background: #182e2a55; }
.settings-dialog { width: min(380px, calc(100% - 32px)); }
#settings-loading { margin: 0 0 16px; }
.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.profile-heading h2 { font-size: 18px; }
.close-button { flex: 0 0 32px; height: 32px; border: 0; padding: 0; background: transparent; color: #718169; font-size: 26px; line-height: 1; }
.close-button:hover { background: var(--soft); }
.profile-google-name { margin: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
#profile-email { margin: 3px 0 20px; overflow-wrap: anywhere; }
.profile-photo-refresh { display: inline-block; margin: -8px 0 8px; }
.profile-dialog .form-columns label { min-height: 30px; }
.profile-dialog .form-columns { gap: 12px; }
.profile-languages { margin-top: 16px; }
.profile-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 23px; }
a { color: inherit; }
.intro { margin: 64px 0 34px; }
.eyebrow { color: #6f8169; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
h1 { font-family: Georgia, serif; font-size: clamp(32px, 6vw, 48px); line-height: 1.15; font-weight: 400; margin: 16px 0; }
h2 { font-size: 19px; font-weight: 600; margin: 0; }
p { line-height: 1.6; }
.sr-only, body.has-account .intro { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body.has-account .intro .eyebrow { display: none; }
.button, button, input, textarea, select { font: inherit; }
.button, button { cursor: pointer; border-radius: 9px; }
.button { display: inline-block; border: 1px solid transparent; padding: 11px 17px; background: #31513d; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.button:hover { background: #254535; }
.quiet { border: 1px solid #d8e0cf; padding: 8px 12px; background: transparent; color: #385340; font-size: 13px; }
.quiet:hover { background: #edf1e6; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: #617b53; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: #254535; }
button:disabled { opacity: .5; cursor: default; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8ba77a; outline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
summary { cursor: pointer; }
.practice-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 30px; align-items: start; margin-top: 24px; }
.controls-sidebar { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.library { margin-top: 15px; }
.history-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.generation-folder { margin: 9px 0 0; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.folder-form { padding: 9px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; }
.folder-parent { margin: 0 0 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.folder-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.folder-children { list-style: none; padding: 0 0 0 14px; margin: 0 0 4px 9px; border-left: 1px solid var(--line); }
.folder-row { display: flex; align-items: center; min-width: 0; gap: 2px; }
.folder-select { display: block; flex: 1; min-width: 0; padding: 8px; border: 1px solid transparent; background: transparent; color: inherit; text-align: left; font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.folder-select:hover, .folder-toggle:hover { background: var(--soft); }
.folder-select[aria-current="true"] { background: #eaf0e2; border-color: #d6dfca; }
.folder-toggle { flex: 0 0 28px; height: 32px; padding: 0; border: 0; background: transparent; color: #617b53; }
.folder-root { margin-bottom: 4px; width: 100%; color: var(--muted); font-size: 12px; }
.refresh-history { display: grid; place-items: center; width: 28px; height: 28px; padding: 5px; border: 0; background: transparent; color: #718069; }
.refresh-history:hover { background: var(--soft); }
.refresh-history svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.exercise-list { list-style: none; margin: 0; padding: 0; }
.exercise-list li { margin: 0; padding: 0; }
.history-item { display: block; width: 100%; padding: 10px; margin: 0 0 4px; text-align: left; border: 1px solid transparent; background: transparent; color: inherit; }
.history-item:hover { background: var(--soft); }
.history-item[aria-current="true"] { background: #eaf0e2; border-color: #d6dfca; }
.history-title { display: block; font-weight: 500; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.history-meta { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; margin-top: 5px; }
.history-stage { color: #839b6e; }
.workspace { min-width: 0; }
.composer { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fcfcf8; }
.composer .section-heading { margin-bottom: 15px; }
.composer h2 { font-size: 18px; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
label { display: block; font-size: 12px; font-weight: 600; margin: 16px 0 7px; }
fieldset > label:first-child { margin-top: 0; }
input[type="text"], textarea, select { display: block; width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #d6decd; border-radius: 7px; background: #fff; color: #304b36; font-size: 13px; line-height: 1.45; }
select { min-height: 41px; }
textarea { resize: vertical; min-height: 72px; }
textarea::placeholder, input::placeholder { color: #9aa38f; opacity: 1; }
.optional { font-size: 10px; color: #89947f; font-weight: 400; margin-left: 4px; }
.field-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 8px 0 0; }
.word-list { color: #667c58; font-size: 12px; line-height: 1.7; margin: 7px 0 0; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compact-field { display: flex; align-items: center; gap: 10px; }
.compact-field label { flex: 0 0 auto; margin: 0; font-size: 12px; }
.compact-field select { flex: 1 1 auto; width: 0; min-height: 36px; padding: 7px 9px; font-size: 12px; }
.topic-field { align-items: center; }
.size-field { margin-top: 13px; }
.size-field select { flex-grow: 0; width: auto; min-width: 135px; }
.prompt-settings { margin-top: 13px; font-size: 12px; }
.prompt-settings summary { color: #496146; }
.prompt-settings textarea { margin-top: 9px; min-height: 66px; font-size: 12px; padding: 8px 9px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; margin: 15px 0 0; font-size: 12px; font-weight: 500; cursor: pointer; }
.checkbox-label input { width: 15px; height: 15px; margin: 0; accent-color: #426443; }
.checkbox-note { margin: 4px 0 0 24px; }
.speaker-settings { margin-top: 15px; font-size: 12px; }
.speaker-settings summary { width: fit-content; }
.speaker-settings summary .muted { margin-left: 8px; font-size: 11px; }
.speaker-columns { display: grid; grid-template-columns: 1fr; gap: 17px; margin-top: 14px; }
.speaker-fields legend { padding: 0; color: #819172; font-size: 11px; }
.speaker-fields label { font-size: 11px; margin-top: 12px; }
.speaker-fields input, .speaker-fields select { font-size: 12px; padding: 8px; }
.speaker-fields .form-columns { gap: 10px; }
.speaker-fields .form-columns label { margin-top: 10px; }
.speaker-fields select { min-height: 34px; padding: 7px 8px; }
.speaker-fields input { padding: 7px 8px; }
.create-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.create-actions .button { min-height: 37px; padding: 9px 11px; font-size: 12px; }
.create-actions .quiet { min-height: 37px; padding: 9px 8px; font-size: 11px; }
.exercise-detail { display: flex; flex-direction: column; max-height: max(360px, calc(100dvh - 132px)); margin: 0; padding: 0; }
.exercise-detail > * { flex-shrink: 0; }
.exercise-heading { align-items: start; margin-bottom: 14px; min-height: 27px; }
.exercise-heading h2 { line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exercise-title-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exercise-title-group h2 { min-width: 0; }
.exercise-title-group button { flex-shrink: 0; padding: 4px 8px; }
.title-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.title-form input { flex: 1 1 180px; min-width: 0; }
.exercise-prompt { margin-bottom: 14px; font-size: 13px; }
.exercise-prompt summary { color: #42604a; text-decoration: underline; text-underline-offset: 3px; }
#exercise-prompt-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; padding: 10px 0; }
.exercise-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.delete-button { border: 0; background: transparent; padding: 5px 0; color: #a13c2f; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.delete-button:hover { color: #772a20; }
.status-tag { border-radius: 20px; color: #78876d; background: var(--soft); font-size: 10px; padding: 5px 9px; white-space: nowrap; margin-top: 2px; }
.status-tag[data-status="ready"] { color: #43683d; background: #e6efdc; }
.status-tag[data-status="failed"] { color: #9b3d31; background: #f6e9e0; }
.exercise-progress { position: sticky; top: 12px; z-index: 5; display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; padding: 13px; border: 2px solid #d6a207; border-radius: 11px; background: #fff0a8; color: #513b00; box-shadow: 0 4px 15px #5b470021; }
.progress-indicator { flex: 0 0 19px; width: 19px; height: 19px; margin-top: 2px; border: 3px solid #d5b54a; border-top-color: #624800; border-radius: 50%; animation: progress-spin 1s linear infinite; }
.progress-content { flex: 1; min-width: 0; }
.exercise-progress p { margin: 0; color: inherit; }
#progress-label { font-size: 13px; font-weight: 700; line-height: 1.45; }
#progress-description { margin: 5px 0 9px; font-size: 11px; line-height: 1.5; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 8px; overflow: hidden; accent-color: #846200; }
progress::-webkit-progress-bar { background: #e4cc71; }
progress::-webkit-progress-value { background: #846200; }
progress::-moz-progress-bar { background: #846200; }
@keyframes progress-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .progress-indicator { animation: none; } }
.playback { margin: 0 0 18px; }
.speech-controls { margin-top: 17px; }
.speech-controls label { margin: 0; }
.audio-player { display: grid; grid-template-columns: 42px minmax(0, 1fr) 36px 172px; align-items: center; gap: 14px; padding: 9px 12px; border: 1px solid #cdd8c3; border-radius: 12px; background: #edf2e7; }
.player-toggle, .player-mute, .player-loop { display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; }
.player-toggle { width: 42px; height: 42px; background: #315b43; color: #fff; }
.player-toggle:hover { background: #244631; }
.player-mute { width: 36px; height: 42px; background: transparent; color: #315b43; }
.player-mute:hover { background: #dce6d3; }
.player-loop { width: 36px; height: 36px; background: transparent; color: #315b43; }
.player-loop:hover { background: #dce6d3; }
.player-loop[aria-pressed="true"], .player-loop[aria-pressed="true"]:hover { background: #315b43; color: #fff; }
.audio-player svg { display: block; width: 23px; height: 23px; fill: currentColor; }
.audio-player .sound-lines, .audio-player .repeat-lines { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.player-timeline { min-width: 0; }
.player-times { display: flex; justify-content: space-between; color: #42604a; font-size: 11px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.player-seek { --played: 0%; display: block; width: 100%; height: 28px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; border-radius: 4px; }
.player-seek::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(to right, #315b43 0 var(--played), #c1d0b5 var(--played) 100%); box-shadow: 0 0 0 1px #7a8c6d; }
.player-seek::-moz-range-track { height: 8px; border-radius: 8px; background: linear-gradient(to right, #315b43 0 var(--played), #c1d0b5 var(--played) 100%); box-shadow: 0 0 0 1px #7a8c6d; }
.player-seek::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -5px; border: 2px solid #fff; border-radius: 50%; appearance: none; -webkit-appearance: none; background: #315b43; box-shadow: 0 0 0 1px #315b43; }
.player-seek::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #315b43; box-shadow: 0 0 0 1px #315b43; }
.player-seek:disabled { cursor: default; opacity: .55; }
.player-volume-controls { display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px; align-items: center; gap: 6px; }
.player-volume { height: 36px; }
.player-volume-value { color: #42604a; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.playback p { margin: 8px 0; }
.exercise-failure { margin: 16px 0 22px; }
.exercise-failure p { margin: 0 0 10px; }
.dialogue { flex-shrink: 1; min-height: 192px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; border: 1px solid var(--line); border-radius: 12px; background: #fcfcf8; }
.dialogue:focus-visible { outline: 2px solid #718f5f; outline-offset: 2px; }
#dialogue-rows { padding: 0 4px 4px; }
.dialogue-heading, .turn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
.dialogue-heading { position: sticky; top: 0; z-index: 1; padding: 11px 14px 9px; background: #fcfcf8; color: #839078; font-size: 11px; }
.turn-row { padding: 10px; margin: 2px 0; border-radius: 6px; align-items: start; }
.turn-playable { cursor: pointer; }
.turn-playable:hover { background: #eef2e8; }
.turn-playable:focus-visible { outline: 2px solid #718f5f; outline-offset: 2px; }
.turn-current, .turn-current:hover { background: #dce8cf; box-shadow: inset 3px 0 #648353; }
.turn-cell { min-width: 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.turn-speaker { font-size: 11px; color: #81916f; font-weight: 600; margin-right: 6px; }
.turn-translation { color: #78816d; }
.connections { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin-top: 17px; padding: 0 10px; color: var(--muted); }
.connections p { margin: 0; font-size: 11px; }
.connections .text-button { font-size: 11px; }
.error { color: #9b3d31; }
#error { margin-top: 22px; font-size: 13px; }
@media (max-width: 1000px) {
  .shell { padding-right: 20px; padding-left: 20px; }
  .practice-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 24px; }
  .composer { padding: 14px; }
  .create-actions .button { padding-right: 8px; padding-left: 8px; }
  .create-actions .quiet { font-size: 10px; padding-right: 6px; padding-left: 6px; }
  .dialogue-heading, .turn-row { gap: 18px; }
}
@media (max-width: 780px) {
  .practice-layout { display: flex; flex-direction: column; gap: 22px; margin-top: 20px; }
  .controls-sidebar { display: contents; }
  .composer, .workspace, .library, .connections, .exercise-progress { width: 100%; }
  .composer { order: 1; }
  .exercise-progress { order: 2; margin: 0; }
  .workspace { order: 3; }
  .library { order: 4; margin: 0; }
  .connections { order: 5; margin: 0; }
  .exercise-list { display: block; }
  .topic-field select { max-width: 380px; }
  .speech-controls select { flex-grow: 0; width: auto; }
  .create-actions .button { padding: 9px 11px; }
  .create-actions .quiet { padding: 9px 11px; font-size: 11px; }
}
@media (max-width: 640px) {
  .shell { padding: 18px 16px 36px; }
  .intro { margin-top: 42px; }
  .composer { padding: 14px; }
  .form-columns { gap: 11px; }
  .dialogue-heading, .turn-row { gap: 15px; }
  .dialogue-heading { padding-right: 11px; padding-left: 11px; }
  .turn-row { padding-right: 7px; padding-left: 7px; }
  .turn-cell { font-size: 13px; }
  .exercise-heading { gap: 8px; }
  .exercise-heading h2 { font-size: 18px; }
  .exercise-actions { gap: 5px 9px; }
  .audio-player { grid-template-columns: 42px minmax(0, 1fr) 36px; gap: 4px 10px; padding: 8px 10px; }
  .player-volume-controls { grid-column: 2 / -1; justify-self: end; width: 172px; max-width: 100%; }
  .exercise-progress { top: 8px; }
  .status-tag { font-size: 9px; padding: 5px 7px; }
}
