/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles — Gold Experience B2 Interactive
   ========================================================================== */

/* --- Variables & Reset --- */
:root {
  --green-dark: #1a6b34;
  --green-mid: #2e7d32;
  --green-light: #4caf50;
  --green-bg: #e8f5e9;
  --green-border: #a5d6a7;
  --orange: #ff7043;
  --blue: #1565c0;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-400: #bdbdbd;
  --gray-600: #757575;
  --gray-800: #424242;
  --correct: #2e7d32;
  --correct-bg: #e8f5e9;
  --wrong: #c62828;
  --wrong-bg: #ffebee;
  --nav-h: 56px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-800);
  background: #f9f9f9;
  margin: 0;
  padding: 0;
}

/* --- Top header with unit navigation --- */
#top-header {
  background: var(--green-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.top-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  gap: 20px;
}


.level-badge {
  background: var(--green-light);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

#unit-nav {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
#unit-nav::-webkit-scrollbar { display: none; }

#unit-tabs {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}

#unit-tabs li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  transition: background .15s, color .15s;
  white-space: nowrap;
}

#unit-tabs li a:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

#unit-tabs li a.active {
  background: #fff;
  color: var(--green-dark);
}

#unit-tabs li a.locked {
  color: rgba(255,255,255,.3);
  cursor: default;
  pointer-events: none;
}

/* --- Book selector --- */
.book-select {
  flex-shrink: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.book-select:hover { background: rgba(255,255,255,.22); }
.book-select option { background: #1a6b34; color: #fff; }

/* --- Reading audio bar --- */
.reading-audio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e8f5e9;
}
.rap-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--green-dark);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rap-btn:hover { background: var(--green-medium); }
.rap-current, .rap-duration {
  flex-shrink: 0;
  font-size: 12px;
  color: #757575;
  min-width: 34px;
  text-align: center;
}
.rap-seek {
  flex: 1;
  height: 4px;
  cursor: pointer;
  accent-color: var(--green-dark);
}

/* --- Vocab word tooltip --- */
.vocab-word {
  cursor: pointer;
  border-radius: 2px;
  transition: background .1s;
}
.vocab-word:hover { background: rgba(46,125,50,.1); }
.vocab-word.is-vocab {
  border-bottom: 1px dotted var(--green-dark);
  color: var(--green-dark);
}

.vocab-tooltip {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px;
}
.vt-ipa {
  font-family: monospace;
  font-size: 13px;
  color: #283593;
  letter-spacing: .5px;
}
.vt-listen, .vt-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
}
.vt-listen { font-size: 14px; }
.vt-listen:hover { background: #f5f5f5; }
.vt-close { font-size: 18px; color: #9e9e9e; margin-left: 2px; }
.vt-close:hover { color: #333; }

/* --- Current unit title bar --- */
#unit-title-bar {
  background: var(--green-bg);
  border-bottom: 2px solid var(--green-border);
  position: sticky;
  top: 48px;
  z-index: 99;
}

.unit-title-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-unit-badge {
  background: var(--green-mid);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.current-unit-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
}

/* --- Main layout --- */
#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* --- Section block --- */
.section-block {
  margin-bottom: 48px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: var(--green-mid);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.section-label.grammar  { background: #1565c0; }
.section-label.vocabulary { background: #6a1b9a; }
.section-label.listening { background: #e65100; }
.section-label.use-of-english { background: #00695c; }
.section-label.speaking { background: #ad1457; }
.section-label.writing { background: #37474f; }
.section-label.unit-check { background: #4e342e; }

.section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0 0 20px;
  line-height: 1.2;
}

.section-title.grammar  { color: #1565c0; }
.section-title.vocabulary { color: #6a1b9a; }
.section-title.listening { color: #e65100; }
.section-title.use-of-english { color: #00695c; }
.section-title.speaking { color: #ad1457; }
.section-title.writing { color: #37474f; }
.section-title.unit-check { color: #4e342e; }

/* --- Sub-section headings --- */
.sub-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-600);
  margin: 28px 0 8px;
}

/* --- Article / reading text --- */
.reading-text {
  background: #fff;
  border-left: 4px solid var(--green-mid);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
}

.reading-text-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.reading-text-header h3 { margin: 0; font-size: 20px; color: var(--green-dark); }
.btn-tts {
  background: none;
  border: 1px solid var(--green-mid);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 10px;
  color: var(--green-mid);
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-tts:hover { background: var(--green-bg); }
.btn-tts.speaking { background: var(--green-bg); color: var(--green-dark); font-weight: 600; }

.reading-text .intro-quote {
  font-size: 18px;
  font-style: italic;
  color: var(--green-mid);
  border: none;
  padding: 0;
  margin-bottom: 12px;
}

/* --- Info / explore boxes --- */
.info-box {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}

.info-box.grammar-box { background: #e3f2fd; border-color: #90caf9; }
.info-box.vocab-box   { background: #f3e5f5; border-color: #ce93d8; }
.info-box.exam-tip    { background: #fff8e1; border-color: #ffe082; }
.info-box.useful-lang { background: #e0f2f1; border-color: #80cbc4; }

.info-box h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green-dark);
}
.info-box.grammar-box h4 { color: #1565c0; }
.info-box.vocab-box h4   { color: #6a1b9a; }
.info-box.exam-tip h4    { color: #e65100; }
.info-box.useful-lang h4 { color: #00695c; }

.info-box h5 {
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}

.info-box ul, .info-box ol {
  margin: 4px 0 8px 18px;
  padding: 0;
}

.info-box li { margin-bottom: 3px; }

.info-box .rule-item {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.info-box .rule-letter {
  font-weight: 700;
  color: var(--green-mid);
  min-width: 18px;
}
.info-box.grammar-box .rule-letter { color: #1565c0; }

/* --- Exercise card --- */
.exercise-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.exercise-card .ex-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--green-mid);
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.exercise-card .ex-instruction {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* --- Word bank --- */
.word-bank {
  background: var(--gray-100);
  border: 1px dashed var(--gray-400);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}

.word-bank-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: .5px;
  width: 100%;
  margin-bottom: 2px;
}

.word-chip {
  background: #fff;
  border: 1px solid var(--gray-400);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 13px;
  color: var(--gray-800);
  font-style: italic;
}

/* --- Gap fill items --- */
.gapfill-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gapfill-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 14px;
  flex-wrap: wrap;
}

.gapfill-list .item-num {
  min-width: 20px;
  font-weight: 700;
  color: var(--gray-600);
  font-size: 13px;
}

.gapfill-text {
  font-size: 14px;
  line-height: 2;
  margin-bottom: 10px;
}

/* --- Inputs --- */
.gap-input {
  border: none;
  border-bottom: 2px solid var(--green-mid);
  background: transparent;
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-800);
  padding: 0 4px;
  min-width: 100px;
  outline: none;
  transition: border-color .15s;
}

.gap-input:focus { border-bottom-color: var(--green-light); }
.gap-input.correct { border-bottom-color: var(--correct); background: var(--correct-bg); color: var(--correct); border-radius: 3px 3px 0 0; }
.gap-input.wrong   { border-bottom-color: var(--wrong); background: var(--wrong-bg); color: var(--wrong); border-radius: 3px 3px 0 0; }

.answer-reveal {
  font-size: 12px;
  color: var(--correct);
  font-weight: 600;
  margin-left: 4px;
  display: none;
}
.answer-reveal.visible { display: inline; }

/* --- Transformation items --- */
.transform-item {
  background: var(--gray-100);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.transform-item .original-sentence {
  font-size: 14px;
  margin-bottom: 6px;
}

.transform-item .keyword-badge {
  display: inline-block;
  background: var(--green-mid);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 1px 7px;
  border-radius: 3px;
  margin-right: 8px;
}

.transform-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-top: 6px;
}

.transform-prefix, .transform-suffix {
  font-size: 14px;
  color: var(--gray-800);
}

.transform-input {
  border: none;
  border-bottom: 2px solid var(--green-mid);
  background: transparent;
  font-size: 14px;
  font-family: var(--font);
  padding: 0 4px;
  min-width: 180px;
  outline: none;
}
.transform-input:focus { border-bottom-color: var(--green-light); }
.transform-input.correct { border-bottom-color: var(--correct); background: var(--correct-bg); color: var(--correct); border-radius: 3px 3px 0 0; }
.transform-input.wrong   { border-bottom-color: var(--wrong); background: var(--wrong-bg); color: var(--wrong); border-radius: 3px 3px 0 0; }

/* --- Matching exercise --- */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.match-col { list-style: none; margin: 0; padding: 0; }

.match-col li {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}

.match-col li:hover { border-color: var(--green-mid); background: var(--green-bg); }
.match-col li.selected { border-color: var(--green-mid); background: var(--green-bg); font-weight: 600; }
.match-col li.matched  { border-color: var(--correct); background: var(--correct-bg); cursor: default; }
.match-col li.wrong-match { border-color: var(--wrong); background: var(--wrong-bg); }

.match-num { font-weight: 700; color: var(--green-mid); margin-right: 6px; }

/* --- Multiple choice --- */
.mc-item {
  margin-bottom: 16px;
}

.mc-item .mc-question {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.mc-options { display: flex; flex-direction: column; gap: 6px; }

.mc-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background .12s, border-color .12s;
}
.mc-option:hover { background: var(--green-bg); border-color: var(--green-mid); }
.mc-option input[type=radio] { accent-color: var(--green-mid); }
.mc-option.correct { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); }
.mc-option.wrong   { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); }

/* --- Check / score controls --- */
.exercise-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-check {
  background: var(--green-mid);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .3px;
}
.btn-check:hover { background: var(--green-dark); }

.btn-reset {
  background: none;
  color: var(--gray-600);
  border: 1px solid var(--gray-400);
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.btn-reset:hover { background: var(--gray-100); }

.score-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--gray-200);
  color: var(--gray-600);
}
.score-badge.good { background: var(--correct-bg); color: var(--correct); }
.score-badge.bad  { background: var(--wrong-bg); color: var(--wrong); }

/* --- Discussion item (no check) --- */
.discussion-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.discussion-list li {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  align-items: flex-start;
}

.discussion-list .q-num {
  min-width: 22px;
  height: 22px;
  background: var(--green-mid);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- Audio player --- */
.audio-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-100);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.audio-track-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
}

.audio-player-row audio {
  flex: 1;
  min-width: 0;
  height: 34px;
}

/* --- Vocabulary cards --- */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.vocab-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 10px 14px;
}

.vocab-card .word {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
}

.vocab-card .pos {
  font-size: 11px;
  color: var(--gray-600);
  font-style: italic;
  margin-left: 4px;
}

.vocab-card .definition {
  font-size: 13px;
  color: var(--gray-800);
  margin-top: 4px;
}

/* --- Wordlist table --- */
.wordlist-section {
  margin-bottom: 20px;
}

.wordlist-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0 0 8px;
  border-bottom: 1px solid var(--green-border);
  padding-bottom: 4px;
}

.wordlist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wordlist-chip {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 13px;
  color: var(--gray-800);
}

.wordlist-chip .chip-pos {
  font-size: 11px;
  color: var(--gray-600);
  font-style: italic;
  margin-left: 2px;
}

/* --- Cloze passage (article with gaps) --- */
.cloze-passage {
  font-size: 14px;
  line-height: 2;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.cloze-passage h3 {
  font-size: 18px;
  color: var(--green-dark);
  margin: 0 0 10px;
}

/* --- Sentence list --- */
.sentence-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sentence-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  align-items: start;
}

.sentence-list .s-num {
  font-weight: 700;
  color: var(--green-mid);
}

/* --- Vocabulary table --- */
.vocab-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.vocab-table thead tr {
  background: var(--green-mid);
  color: #fff;
}

.vocab-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}

.vocab-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
  line-height: 1.5;
}

.vocab-table tbody tr:last-child td { border-bottom: none; }

.vocab-table tbody tr:nth-child(even) { background: var(--gray-100); }
.vocab-table tbody tr:hover { background: var(--green-bg); }

.vocab-table .cell-word { font-weight: 700; }
.vocab-table .cell-word a { color: var(--green-dark); text-decoration: none; }
.vocab-table .cell-word a:hover { text-decoration: underline; }
.vocab-table .cell-pos  { font-size: 11px; color: var(--gray-600); font-style: italic; }
.vocab-table .cell-ipa  { font-family: serif; color: #37474f; white-space: nowrap; }
.vocab-table .cell-link { text-align: center; }
.btn-listen {
  background: none;
  border: 1px solid var(--green-mid);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  color: var(--green-mid);
  transition: background 0.15s;
}
.btn-listen:hover { background: var(--green-bg); }
.vocab-table .cell-example { font-style: italic; color: var(--gray-600); font-size: 12px; }
.vocab-table .cell-meaning { color: var(--gray-800); }

.vocab-group-header td {
  background: var(--green-bg) !important;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-bottom: 1px solid var(--green-border) !important;
}

/* --- Word structure --- */
.translation-block {
  margin-bottom: 20px;
}
.translation-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--green-light);
}
.translation-body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-800);
  margin: 0 0 10px;
}

.word-structure-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.word-structure-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--green-mid);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.ws-word {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 2px;
}

.ws-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  background: var(--green-mid);
  padding: 1px 7px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.ws-analysis {
  font-size: 13px;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.ws-analysis strong { color: var(--green-dark); }

.ws-meaning {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.ws-family {
  font-size: 12px;
  background: var(--gray-100);
  border-radius: 3px;
  padding: 3px 8px;
  color: var(--gray-800);
  display: inline-block;
  margin-top: 2px;
}

.ws-family-label {
  font-weight: 700;
  color: var(--green-dark);
}

/* --- Sentence structure --- */
.sentence-structure-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ss-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.ss-pattern {
  font-size: 15px;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: 3px;
  font-family: 'Courier New', monospace;
  background: #e3f2fd;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

.ss-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  background: #1565c0;
  padding: 1px 7px;
  border-radius: 3px;
  margin: 6px 0;
  display: inline-block;
}

.ss-example {
  font-size: 14px;
  font-style: italic;
  color: var(--gray-800);
  border-left: 3px solid #90caf9;
  padding: 6px 12px;
  margin: 8px 0;
  background: #f8fbff;
  border-radius: 0 4px 4px 0;
}

.ss-analysis {
  font-size: 13px;
  color: var(--gray-800);
  line-height: 1.6;
  margin-bottom: 4px;
}

.ss-more {
  font-size: 12px;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: 3px;
  margin-top: 6px;
}

.ss-more-label { font-weight: 700; color: var(--green-dark); }

/* --- Audio Playlist --- */
.audio-playlist {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.playlist-section-inline {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-mid);
  white-space: nowrap;
  min-width: 80px;
}
.playlist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: default;
  transition: background 0.12s;
}
.playlist-row:hover { background: var(--green-bg); }
.playlist-row.playing { background: #e8f5e9; }
.playlist-track {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--green-mid);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}
.playlist-row.playing .playlist-track { background: var(--green-dark); }
.playlist-title {
  flex: 1;
  font-size: 14px;
  color: var(--gray-800);
}
.playlist-btn {
  background: none;
  border: 1px solid var(--green-mid);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 12px;
  color: var(--green-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
}
.playlist-btn:hover { background: var(--green-bg); }
.playlist-row.playing .playlist-btn { background: var(--green-bg); color: var(--green-dark); border-color: var(--green-dark); }

/* --- Responsive --- */
@media (max-width: 640px) {
  .match-grid { grid-template-columns: 1fr; }
  .vocab-grid { grid-template-columns: 1fr 1fr; }
  #unit-header .unit-title { font-size: 13px; }
  .section-title { font-size: 22px; }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

