.language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.language-picker > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.language-picker select {
  font: inherit;
  max-width: 150px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
}
.translation-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 18px 0 0;
  padding: 12px 16px;
  background: var(--subtle);
  border-radius: 12px;
}
.answer-controls {
  margin: 20px 0;
}
.answer-controls form {
  display: grid;
  gap: 14px;
}
.answer-controls input {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
}
.answer-controls label {
  line-height: 1.6;
}
.token-deck,
.sentence-answer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 55px;
  margin: 14px 0;
}
.sentence-answer {
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.token-deck .choice,
.sentence-answer .choice {
  min-height: 44px;
}
.practice-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.practice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  width: 100%;
  font: inherit;
  text-align: start;
  margin-bottom: 12px;
}
.practice-row > span {
  font-size: 13px;
  color: var(--muted);
}
.practice-row strong {
  font-weight: 500;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.metric {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.metric h2 {
  font-size: 16px;
}
.metric > strong {
  font-size: 35px;
  font-variant-numeric: tabular-nums;
}
.library-page .lang-switch {
  display: none;
}
#player > [lang="sv"],
.practice-row > [lang="sv"] {
  unicode-bidi: isolate;
}
#lesson-dialog .report-mistake {
  position: sticky;
  bottom: 0;
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin-left: auto;
  margin-right: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--surface);
  z-index: 1;
}
html[dir="rtl"] .lesson-heading,
.topic,
html[dir="rtl"] .course-card {
  text-align: start;
}
html[dir="rtl"] .topic-art {
  direction: ltr;
}
html[dir="rtl"] .topic-foot {
  direction: rtl;
}
[hidden] {
  display: none !important;
}
.teaching[lang="sv"],
.teaching strong {
  unicode-bidi: isolate;
}
#screen-content {
  padding-bottom: 40px;
}
.translation-note a {
  font-weight: 600;
}
.reading-passage {
  white-space: pre-line;
  padding: 20px;
  margin-block: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--subtle);
  font-size: 19px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.reading-question {
  font-weight: 600;
}
.audio-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-block: 16px;
}
.swedish-keys {
  display: flex;
  gap: 10px;
}
.speaking-turns {
  display: grid;
  gap: 12px;
  margin-block: 20px;
}
.speaking-turns section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle);
}
.speaking-turns h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.speaking-turns p {
  margin-bottom: 0;
  line-height: 1.7;
}
.swedish-keys button {
  min-width: 44px;
  min-height: 44px;
  font-size: 18px;
}
.transcript-panel {
  margin-block: 18px;
  padding: 14px;
  background: var(--subtle);
  border-radius: 12px;
}
.transcript-panel summary {
  min-height: 44px;
  display: list-item;
  cursor: pointer;
  padding-block: 10px;
}
.transcript-panel p {
  line-height: 1.8;
  margin: 12px 0 0;
}
.answer-controls textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.7;
}
.writing-checklist {
  display: grid;
  gap: 12px;
  margin-block: 20px;
}
.writing-checklist label {
  display: flex;
  align-items: start;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.writing-checklist input[type="checkbox"] {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 3px 0;
  accent-color: var(--accent);
}
.writing-notice {
  padding: 12px;
  border-radius: 12px;
  background: var(--subtle);
  line-height: 1.7;
}
.advanced-lesson .feature-body {
  grid-template-columns: 1fr;
}
#start,
#player > .primary {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  line-height: 1.5;
}
html:not([lang="en"]):not([lang="sv"]) :is(h1, h2, h3) {
  letter-spacing: normal;
  line-height: 1.35;
}
@media (max-width: 1200px) and (min-width: 768px) {
  .header-actions > a {
    display: none;
  }
  .header-actions {
    gap: 10px;
  }
  .language-picker select {
    max-width: 120px;
  }
}
@media (max-width: 767px) {
  .goal-section > span {
    display: none;
  }
  .header {
    height: auto;
    min-height: 78px;
    flex-wrap: wrap;
    padding: 15px 0;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  .language-picker select {
    max-width: 200px;
    font-size: 14px;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
  }
  .metric h2 {
    margin: 0;
    max-width: 65%;
  }
  .metric > strong {
    font-size: 28px;
  }
  .practice-row {
    align-items: start;
    gap: 12px;
    flex-direction: column;
    padding: 16px;
  }
  .library-page .sv-library-bridge > div {
    flex-wrap: wrap;
  }
  .library-page .language-picker {
    width: 100%;
    order: 2;
  }
  .translation-note {
    font-size: 12px;
  }
  .bottom-nav a {
    font-size: 12px;
    padding-inline: 8px;
    min-width: 0;
    flex: 1;
  }
  body {
    font-family: Outfit, "Segoe UI", system-ui, sans-serif;
  }
  #player-title {
    font-size: 26px;
    line-height: 1.4;
  }
  #player p {
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  .lesson-heading p {
    display: none;
  }
  .lesson-heading .primary {
    font-size: 14px;
  }
}
.backup-controls { padding:20px; margin-block:24px; background:var(--word); border-radius:20px; }
.backup-controls p { line-height:1.6; }
.backup-controls label { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:12px; margin-block:20px; }
.backup-controls input { display:block; width:100%; min-width:0; max-width:100%; font:inherit; min-height:44px; }
.backup-controls input::file-selector-button { font:inherit; padding:10px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); }
.backup-controls button { margin:4px; min-height:44px; white-space:normal; }
.backup-controls :focus-visible { outline:3px solid var(--focus); outline-offset:3px; }

/* Task 3: Today/Practice/Progress hierarchy and mobile clarity */
.screen-page .screen-hero { margin-bottom: 8px; }
.screen-hero .eyebrow { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.screen-intro { font-size: 18px; line-height: 1.7; color: var(--muted); max-width: 42rem; margin: 8px 0 0; }
.screen-content { display: grid; gap: 20px; padding-bottom: 40px; }
.screen-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.screen-card h2 { font-size: 20px; margin: 0 0 12px; }
.screen-card--summary { background: var(--subtle); }
.screen-action { width: 100%; justify-content: center; min-height: 52px; margin-top: 8px; }
.screen-status { color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.screen-empty { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.practice-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.filter-chip { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.filter-chip:focus-visible, .practice-row:focus-visible, .screen-action:focus-visible, .danger-action:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.practice-row { cursor: pointer; }
.practice-row--featured, .practice-row--empty { background: var(--subtle); }
.progress-list { display: grid; gap: 12px; }
.status-pill { font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--subtle); color: var(--muted); white-space: nowrap; }
.status-pill--done { background: color-mix(in srgb, var(--accent, #2f6b4f) 14%, var(--surface)); color: var(--ink); }
.screen-card--danger { border-color: color-mix(in srgb, var(--line) 70%, #b45309); }
.danger-action { width: 100%; min-height: 48px; }
.goal-section { gap: 10px; }
.goal-section select { min-height: 48px; }
#start.primary { min-height: 52px; font-size: 17px; }
.progress-card small { display: none; }
@media (max-width: 767px) {
  .screen-intro { font-size: 16px; }
  .screen-card { padding: 16px; border-radius: 16px; }
  .practice-filters { gap: 8px; }
  .filter-chip { flex: 1 1 calc(50% - 8px); justify-content: center; text-align: center; }
}
.rhythm-note{margin:.35rem 0 0;color:var(--ink-soft,var(--muted,#666));font-size:.95rem}
