/* Orkhan's English — global styles (linked from index.html) */

:root {
  --bg: #0b1220;
  --bg2: #0f172a;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.12);
  --text: #0b1220;
  --muted: #475569;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #166534;
  --warn: #a16207;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 10px 28px rgba(2, 6, 23, 0.08);
  --shadow-md: 0 16px 44px rgba(2, 6, 23, 0.12);
  --dash-bg: #f8fafc;
  --dash-sidebar: #0f172a;
  --dash-text: #1e293b;
  --dash-muted: #64748b;
  --dash-blue: #2563eb;
  --dash-card-radius: 14px;
}
* {
  box-sizing: border-box;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  font-size: 17.5px;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% 0%, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0) 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0) 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
::selection {
  background: rgba(37, 99, 235, 0.25);
}
button {
  font-family: inherit;
  cursor: pointer;
}
.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 56px;
}
.app.reading-mode {
  padding-bottom: 0;
}

/* Hide the pinned sidebar during full-screen test overlays
   (Listening/Reading runner use app.reading-mode). */
.app.reading-mode .sidebar {
  display: none;
}
.app.reading-mode .layout-shell {
  padding-left: 0;
}

/* Hide the pinned sidebar when the user enters browser fullscreen
   (Writing uses requestFullscreen on the workspace card). */
.app.in-fullscreen .sidebar {
  display: none;
}
.app.in-fullscreen .layout-shell {
  padding-left: 0;
}

/* Hard override for the actual sidebar element to survive any logged-in state CSS. */
#appSidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0;
  z-index: 60;
}
.top-bar {
  background: rgba(255, 255, 255, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  padding: 16px 20px 12px;
  text-align: center;
  position: relative;
}
.icon-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 40px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover {
  background: #f8f9fb;
}
.top-bar h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.next-test {
  font-size: 0.875rem;
  color: var(--muted);
}
.next-test strong {
  color: var(--accent);
  font-weight: 600;
}
.main {
  flex: 1;
  padding: 22px 18px 28px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}
.main.main--listening {
  max-width: 100%;
  padding-left: 4px;
  padding-right: 4px;
  padding-top: 10px;
}
@media (min-width: 1200px) {
  .main {
    max-width: 1480px;
    padding-left: 26px;
    padding-right: 26px;
  }
  .main.main--listening {
    max-width: 100%;
    padding-left: 6px;
    padding-right: 6px;
  }
}
@media (min-width: 1600px) {
  .main {
    max-width: 1680px;
  }
  .main.main--listening {
    max-width: 100%;
  }
}
.hidden {
  display: none !important;
}
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.card-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 28px 24px;
  min-height: 120px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.86));
  border-color: rgba(37, 99, 235, 0.35);
}
.card-btn:active {
  transform: translateY(-1px);
}
.card-btn small {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  line-height: 1.4;
}
.sub-screen {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  max-width: 640px;
  margin: 0 auto;
}

/* Listening: one scroll area — questions first; controls are below in the same scroll (not pinned). */
#screen-listening .sub-screen {
  max-width: none;
  width: 100%;
  margin: 0;
  border-radius: var(--radius);
  padding: 6px 10px 16px;
  display: block;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  font-size: 1.08rem;
  line-height: 1.5;
}
#screen-listening .listen-page-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 6px 0;
  padding: 4px 0 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 88%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(6px);
}
#screen-listening .listen-page-head .btn-primary {
  margin-left: auto;
  white-space: nowrap;
}
#screen-listening .listen-page-head .link-back {
  margin-bottom: 0;
}
#screen-listening .listen-page-kicker {
  font-weight: 950;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
}
#screen-listening .listen-section-main {
  margin: 0;
  padding: 0 0 4px 0;
}
#screen-listening .listen-topbar--end {
  justify-content: flex-end;
  margin: 0 0 6px 0;
}
#screen-listening .listen-catalog-dock .listen-topbar {
  margin: 0 0 6px 0;
}
#screen-listening .listen-catalog-dock {
  margin-top: 12px;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}
#screen-listening .listen-catalog-dock #listeningReviewBanner {
  margin: 0 0 8px 0;
}
#screen-listening #listeningSections .ai-row {
  justify-content: flex-start;
  gap: 8px;
}
#screen-listening #listeningSectionView .writing-chart {
  border-radius: 14px;
  padding: 14px 14px 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}
#screen-listening #listeningSectionView .q-block {
  border-radius: 14px;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}
#screen-listening #listeningSectionView .q-block .q-head {
  margin-bottom: 10px;
}
#screen-listening .listen-topbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 12px;
}
#screen-listening .listen-font {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#screen-listening .listen-font button {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 900;
}
#screen-listening .listen-font button:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}
#screen-listening .listen-font .lbl {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 800;
  padding: 0 2px;
}
#screen-listening .listen-banner {
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0 0;
  font-weight: 800;
  font-size: 0.95rem;
}
#screen-listening .listen-transcript {
  margin-top: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 12px 10px;
}
#screen-listening .listen-transcript .tt {
  font-weight: 950;
  font-size: 0.95rem;
  margin: 0 0 8px;
}
#screen-listening .listen-transcript .tx {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text);
  font-size: 1rem;
}
#screen-listening .listen-review-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}
@media (min-width: 980px) {
  #screen-listening .listen-review-split {
    grid-template-columns: 1.05fr 1fr;
  }
}
#screen-listening .listen-review-pane {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 12px 10px;
  max-height: 72vh;
  overflow: auto;
}

/* —— Dashboard catalog —— */
.dash-hero {
  margin: 0 0 16px;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
}
.dash-hero h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.dash-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.dash-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px) {
  .dash-layout {
    grid-template-columns: 320px 1fr;
    align-items: start;
  }
}
.filter-card {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-md);
  padding: 16px;
}
.filter-title {
  font-size: 0.95rem;
  font-weight: 900;
  margin: 0 0 10px;
}
.filter-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 6px;
}
.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  outline: none;
}
.input:focus {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.pill {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.pill.active {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.35);
}
.catalog {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
  padding: 16px;
}
.catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.catalog-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}
.catalog-meta {
  color: var(--muted);
  font-size: 0.82rem;
}
.test-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 700px) {
  .test-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.test-card {
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.86));
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.test-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.test-kicker {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
}
.test-title {
  margin: 8px 0 0;
  font-weight: 950;
  font-size: 0.98rem;
  line-height: 1.3;
  color: #991b1b;
}
.test-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}
.badge {
  font-size: 0.75rem;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
  color: var(--text);
  white-space: nowrap;
}
.test-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.btn-primary {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 900;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-ghost {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.06);
}
.sub-screen h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
}
.sub-screen p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
#writingPrompt {
  white-space: pre-wrap;
}
.writing-chart {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 8px;
  background: rgba(255, 255, 255, 0.86);
}
.writing-chart .title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.writing-chart .subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.writing-chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.writing-chart .legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}
.writing-chart .key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.writing-chart .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.15);
}
.ai-panel {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
}
.ai-panel h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

/* Writing screen — study materials & Task 1 file links */
.writing-materials {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.75);
}
.writing-materials-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.writing-materials > details {
  margin-top: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 12px 10px;
}
.writing-materials > details:first-of-type {
  margin-top: 0;
}
.writing-materials summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 0 8px;
  list-style: none;
}
.writing-materials summary::-webkit-details-marker {
  display: none;
}
.writing-materials-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.writing-materials-body h4 {
  margin: 14px 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.writing-materials-body h4:first-child {
  margin-top: 6px;
}
.writing-materials-body ul {
  margin: 6px 0 0;
  padding-left: 1.15rem;
}
.writing-materials-body li {
  margin-bottom: 4px;
}
.writing-materials-body .wm-example {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.06);
  font-size: 0.82rem;
  color: #0f172a;
}
.writing-task1-resources,
.writing-task2-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(15, 118, 110, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(15, 118, 110, 0.05);
}
.writing-task1-resources.hidden,
.writing-task2-resources.hidden {
  display: none;
}
.writing-task1-resources .wm-label,
.writing-task2-resources .wm-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}

/* Writing — Study library hero */
.writing-mat-screen .writing-mat-hero {
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.writing-mat-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}
.writing-mat-hero-text {
  flex: 1 1 280px;
  min-width: 0;
}
.writing-mat-h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.4vw + 0.85rem, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.writing-mat-lead {
  margin: 0;
  font-size: clamp(0.98rem, 0.5vw + 0.88rem, 1.08rem);
  line-height: 1.45;
  color: var(--muted);
  max-width: 52ch;
}
.writing-mat-hero-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
}
.writing-mat-hero-actions .btn-w-primary {
  white-space: normal;
  text-align: center;
  max-width: 280px;
}
@media (max-width: 640px) {
  .writing-mat-hero-actions {
    width: 100%;
  }
  .writing-mat-hero-actions .btn-w-primary {
    width: 100%;
    max-width: none;
  }
}

.writing-mat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.writing-mat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
}
.writing-mat-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
  margin: 0;
}
.writing-mat-disclaimer {
  margin: 0 0 12px;
}
.writing-mat-scroll {
  max-height: min(72vh, 680px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: #fff;
  line-height: 1.55;
  font-size: 0.9rem;
}
.writing-mat-scroll p {
  margin: 0 0 10px;
}

/* Tabbed writing notes — one section at a time, shallow scroll */
.writing-mat-tabbed {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  max-height: min(78vh, 720px);
  overflow: hidden;
}
.writing-mat-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
  margin: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}
.writing-mat-tab {
  margin: 0;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
}
.writing-mat-tab:hover {
  border-color: rgba(15, 118, 110, 0.35);
  color: #0f766e;
}
.writing-mat-tab.active {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}
.writing-mat-panel-root {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 14px;
}
.writing-mat-panel {
  display: none;
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 6px;
  line-height: 1.55;
  font-size: 0.88rem;
}
.writing-mat-panel.active {
  display: block;
}
.writing-mat-panel .wm-section-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f766e;
}
.writing-mat-panel p {
  margin: 0 0 10px;
}
.writing-mat-panel p:last-child {
  margin-bottom: 0;
}
.writing-protected-doc,
.writing-protected-doc * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}
.writing-protected-doc ::selection {
  background: transparent;
  color: inherit;
}
@media print {
  .writing-protected-doc.writing-mat-scroll {
    display: none !important;
  }
  .writing-protected-doc.writing-mat-tabbed .writing-mat-panel-root {
    display: none !important;
  }
}
.ai-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ai-metric {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: rgba(248, 250, 252, 0.8);
}
.ai-metric .k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.ai-metric .v {
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}
.ai-section-title {
  margin: 12px 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.ai-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.5;
  font-size: 0.9rem;
}
.ai-quote {
  border-left: 3px solid var(--border);
  padding-left: 10px;
  color: var(--text);
  background: rgba(248, 250, 252, 0.82);
  border-radius: var(--radius-sm);
  padding-top: 8px;
  padding-bottom: 8px;
  margin: 8px 0 0;
  white-space: pre-wrap;
}

/* Speaking: enhanced feedback renderer */
.spfb-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 12px;
}
.spfb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.spfb-metric {
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.85);
  border-radius: 12px;
  padding: 10px;
}
.spfb-metric .k {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.spfb-metric .v {
  font-size: 1.2rem;
  font-weight: 900;
  margin-top: 6px;
  color: var(--text);
}
.spfb-section {
  margin-top: 12px;
}
.spfb-section-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.spfb-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.55;
  font-size: 0.9rem;
}
.spfb-sample {
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text);
}

/* Writing: custom task box */
.writing-custom-box {
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 10px 12px;
}
.writing-custom-box--full {
  margin-top: 12px;
}
.writing-custom-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.writing-custom-title {
  font-weight: 900;
  color: var(--text);
}
.writing-custom-sub {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.writing-custom-body {
  margin-top: 10px;
}
.writing-custom-row {
  margin-top: 10px;
}
.writing-custom-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 980px) {
  .writing-custom-grid {
    grid-template-columns: 1fr;
  }
}
.writing-custom-col {
  min-width: 0;
}
.writing-custom-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.writing-custom-area {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.82);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}
.writing-custom-file {
  width: 100%;
  padding: 10px 0;
  color: var(--text);
}
.writing-custom-preview {
  margin-top: 8px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 12px;
  padding: 8px;
}
.writing-custom-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.writing-custom-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.writing-custom-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.writing-custom-note {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Generic modal (used for Writing submissions) */
.modal.hidden {
  display: none !important;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(84vh, 760px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.45);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}
.modal-title {
  font-weight: 900;
  color: var(--text);
}
.modal-body {
  padding: 14px;
}

/* Writing v2 (dashboard-style, screenshot-like) */
.writing2-shell {
  max-width: 1200px;
}
.writing2-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.writing2-title {
  font-weight: 950;
  font-size: 1.68rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.writing2-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 1.02rem;
  line-height: 1.45;
}
.writing2-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.85);
  margin: 8px 0 14px;
  max-width: 100%;
}
.writing2-tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
}
.writing2-tab.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
}
.writing2-tab--samples {
  align-items: flex-start !important;
  text-align: left;
  padding: 7px 14px !important;
}
.writing2-tab-line1 {
  display: block;
  font-size: 0.84rem;
  font-weight: 950;
  line-height: 1.2;
}
.writing2-tab-line2 {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  color: var(--muted);
  margin-top: 2px;
}
.writing2-tab--samples.active .writing2-tab-line2 {
  color: var(--text);
  opacity: 0.85;
}
.writing-tab-panel.hidden {
  display: none !important;
}
.writing-samples-ob-title {
  font-size: 1.12rem !important;
  line-height: 1.35 !important;
}
.writing-samples-viewer-head {
  font-weight: 950;
  margin-bottom: 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.writing-sample-heading {
  font-size: 1.05rem;
  font-weight: 950;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
}
.writing-sample-prompt {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.writing-sample-prompt-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #4338ca;
  margin-bottom: 8px;
}
.writing-sample-prompt-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}
.writing-sample-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 4px 0 8px;
}
.writing-sample-text {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.92rem;
}
.writing-sample-fig {
  margin: 0;
}
.writing-sample-fig img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.writing-sample-diagram {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow-x: auto;
}
.writing-sample-diagram svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.writing-sample-table-wrap {
  overflow-x: auto;
}
.writing-sample-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 220px;
}
.writing-sample-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.writing-sample-table th,
.writing-sample-table td {
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 8px 12px;
  text-align: center;
}
.writing-sample-table th {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 800;
}
.writing2-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px) {
  .writing2-grid {
    grid-template-columns: 1fr;
  }
}
.writing2-side,
.writing2-main {
  display: grid;
  gap: 14px;
}
.writing2-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.06);
}
.writing2-cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.writing-samples-ob-head {
  flex-wrap: wrap;
}
.writing-samples-ob-card .writing2-cardtitle {
  font-size: 1.02rem;
  line-height: 1.32;
}
.writing-samples-list-wrap {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 6px;
}
.writing-samples-task-label {
  margin-bottom: 8px;
  font-size: 0.84rem !important;
  font-weight: 950 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text) !important;
}
.writing-samples-pick--locked {
  border-style: dashed !important;
  border-color: rgba(100, 116, 139, 0.5) !important;
}
.writing-samples-lock-lbl {
  font-weight: 800;
  font-size: 0.78rem;
  color: #b45309;
}
@media (max-width: 768px) {
  #writingSamplesInner {
    grid-template-columns: 1fr !important;
  }
  .writing-samples-ob-meta {
    text-align: left !important;
    width: 100%;
  }
  .writing-samples-list-wrap {
    max-height: 260px;
  }
}
.writing2-cardtitle {
  font-weight: 950;
  color: var(--text);
}
.writing2-link {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}
.writing2-taskline {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.writing2-timerrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}
.writing2-timerlbl {
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.writing2-timer {
  font-weight: 950;
  font-size: 1.25rem;
  color: var(--text);
}
.writing2-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.writing2-switch-btn {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 950;
  color: var(--muted);
  cursor: pointer;
}
.writing2-switch-btn.active {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text);
}
.writing2-notes {
  margin-top: 12px;
}
.writing2-label {
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.writing2-notes-area {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.85);
  color: var(--text);
  line-height: 1.55;
  resize: vertical;
  min-height: 92px;
}
.writing2-notes-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.writing2-muted {
  color: var(--muted);
  font-size: 0.85rem;
}
.writing2-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.writing2-recent-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.9);
}
.writing2-recent-ic {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.writing2-recent-title {
  font-weight: 950;
  color: var(--text);
  font-size: 0.95rem;
}
.writing2-recent-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}
.writing2-badge {
  font-size: 0.78rem;
  font-weight: 950;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
}
.writing2-badge--submitted {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.10);
}
.writing2-badge--draft {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.12);
}
.writing2-editorhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  margin-bottom: 10px;
}
.writing2-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}
.writing2-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}
.writing2-words {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}
.writing2-prompt {
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  white-space: pre-wrap;
  font-size: 1.08rem;
  line-height: 1.65;
  margin-bottom: 12px;
}
.writing2-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.92);
}
.writing2-tool {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 950;
  color: var(--text);
}
.writing2-tool:hover {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.25);
}
.writing2-sep {
  width: 1px;
  height: 24px;
  background: rgba(15, 23, 42, 0.10);
  margin: 0 2px;
}
.writing2-area {
  width: 100%;
  min-height: 340px;
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  padding: 14px 14px;
  background: rgba(248, 250, 252, 0.82);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.05rem;
  resize: vertical;
}
.writing2-topicbar {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.writing2-topicbar .writing2-label {
  font-size: 0.86rem;
  margin-bottom: 0;
}
.writing2-topichead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.writing2-topicarea {
  width: 100%;
  min-height: 7.5em;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  padding: 14px 16px;
  background: rgba(248, 250, 252, 0.82);
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.65;
  resize: vertical;
}
.writing2-prompt--hidden {
  display: none !important;
}

.writing2-imgslot {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(248, 250, 252, 0.75);
  border-radius: 14px;
  padding: 10px 12px;
}
.writing2-imghead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.writing2-imgrow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.writing2-imgfile {
  width: 100%;
  max-width: 420px;
}
.writing2-imgpreview {
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
}
.writing2-imgpreview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Writing feedback tables */
.wfb-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
}
.wfb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.wfb-table th,
.wfb-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: top;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.wfb-table th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 950;
}
.wfb-table tr:last-child td {
  border-bottom: none;
}

/* Writing feedback collapsibles + markers */
.wfb-fold {
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.75);
  overflow: hidden;
}
.wfb-fold-sum {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-weight: 950;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wfb-fold-sum::-webkit-details-marker {
  display: none;
}
.wfb-fold-sum::after {
  content: "▾";
  color: var(--muted);
  font-weight: 950;
}
.wfb-fold[open] .wfb-fold-sum::after {
  content: "▴";
}
.wfb-fold-body {
  padding: 0 12px 12px;
}
.wfb-muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.wfb-mark {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(15, 23, 42, 0.12);
  margin: 0 2px;
}
.wfb-mark--err {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}
.wfb-mark--ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}
.wfb-mark--warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
}

/* Small pills (Writing status / metadata) */
.wfb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 0.78rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}
.wfb-pill--warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
}
.writing2-topicactions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.writing2-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.link-back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.875rem;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  display: flex;
  background: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  z-index: 50;
  box-shadow: 0 -14px 40px rgba(2, 6, 23, 0.14);
}
.bottom-nav button {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-top: 3px solid transparent;
  padding-top: 2px;
}
.bottom-nav button.active {
  color: var(--accent);
  border-top-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}
/* —— Reading test —— */
.reading-shell {
  --reading-scale: 1;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0) 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 55%),
    #eef2f7;
  color: var(--text);
}
.reading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}
.reading-overlay.open {
  display: flex;
}
/* Docked mode: results panel pinned to top of listening shell, no backdrop, test interactive below */
.reading-overlay.docked {
  background: transparent;
  backdrop-filter: none;
  align-items: flex-start;
  justify-content: stretch;
  padding: 0;
  pointer-events: none;
  height: 50vh;
  bottom: auto;
}
.reading-overlay.docked .reading-modal {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  border-radius: 0 0 14px 14px;
  pointer-events: auto;
  border-bottom: 2px solid rgba(15, 23, 42, 0.18);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
}
.listen-shell.has-docked-results {
  padding-top: 50vh;
}
.reading-shell.has-docked-results {
  padding-top: 50vh;
}
.show-results-btn {
  background: #0f766e;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
}
.show-results-btn:hover {
  background: #115e56;
}
.show-results-btn.hidden {
  display: none;
}
.reading-modal {
  width: min(1100px, 100%);
  max-height: min(94vh, 1000px);
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.35);
  display: flex;
  flex-direction: column;
}
#readingResultsOverlay .reading-modal-meta,
#listeningResultsOverlay .reading-modal-meta {
  display: none;
}
.reading-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.reading-modal-title {
  font-weight: 950;
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.reading-modal-paper {
  font-size: 0.88rem;
  font-weight: 800;
  color: #334155;
  margin: 0 0 8px;
  line-height: 1.35;
}
.reading-modal-paper.hidden {
  display: none;
}
.reading-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.85rem;
}
.reading-modal-meta strong {
  color: var(--text);
}
.reading-band {
  color: #dc2626;
  font-weight: 950;
}
.reading-modal-close {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  width: 40px;
  height: 36px;
  font-size: 1.1rem;
  line-height: 1;
}
.reading-modal-body {
  padding: 12px 16px 16px;
  overflow: auto;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.results-table th,
.results-table td {
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 8px 10px;
  vertical-align: top;
}
.results-table th {
  text-align: left;
  background: rgba(248, 250, 252, 0.9);
  font-weight: 900;
}
.results-row.bad td {
  background: rgba(254, 226, 226, 0.55);
}
.results-row.ok td {
  background: rgba(220, 252, 231, 0.55);
}
/* --- Mode picker (Practice / Simulation) --- */
.mode-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
}
.mode-picker-overlay.open {
  display: flex;
}
/* Catalog test cards: statistics modal */
.catalog-stats-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(4px);
}
.catalog-stats-overlay.open {
  display: flex;
}
.catalog-stats-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 0 0 16px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.catalog-stats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.catalog-stats-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f766e;
  line-height: 1.3;
  padding-right: 8px;
}
.catalog-stats-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.catalog-stats-body {
  padding: 12px 18px 8px;
  background: transparent;
  border: none;
}
.catalog-stats-body details {
  margin-top: 8px;
}
.rts-ans-btn {
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid #0f766e;
  background: #fff;
  color: #0f766e;
  cursor: pointer;
}
.rts-ans-btn:hover {
  background: rgba(15, 118, 110, 0.1);
}
.stats-answers-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(3px);
}
.stats-answers-overlay.open {
  display: flex;
}
.stats-answers-dialog {
  width: min(900px, 100%);
  max-height: min(90vh, 800px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(15, 23, 42, 0.1);
}
.stats-answers-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.stats-answers-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.35;
}
.stats-answers-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.stats-answers-body {
  padding: 12px 16px 16px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.rts-ans-detail tr.rts-ans-ok td:last-child {
  color: #15803d;
  font-weight: 800;
}
.rts-ans-detail tr.rts-ans-bad td:last-child {
  color: #b91c1c;
  font-weight: 800;
}
.mode-picker {
  position: relative;
  width: min(960px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 28px 22px 24px;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.4);
}
.mp-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.mp-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 950;
  color: #0f766e;
}
.mp-prev-attempt {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 12px;
  padding: 12px 16px;
  margin: -6px 0 16px;
}
.mp-prev-attempt.hidden { display: none; }
.mp-prev-info { flex: 1; min-width: 0; }
.mp-prev-line { font-size: 0.95rem; color: #0e7490; }
.mp-prev-hint { font-size: 0.82rem; color: #155e75; margin-top: 2px; line-height: 1.35; }
.mp-prev-continue {
  flex-shrink: 0;
  background: #0f766e;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.mp-prev-continue:hover { background: #115e56; }
.mp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 760px) {
  .mp-grid { grid-template-columns: 1fr; }
}
.mp-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.06);
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}
.mp-card-icon {
  align-self: center;
  color: #0f766e;
  margin-bottom: 6px;
}
.mp-card-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 950;
  color: #0f766e;
}
.mp-card-desc {
  margin: 0 0 16px;
  text-align: center;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.45;
}
.mp-section-title {
  font-weight: 900;
  color: #0f172a;
  margin: 8px 0 8px;
}
.mp-parts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}
.mp-parts label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #1f2937;
}
.mp-parts input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0f766e;
}
.mp-time-wrap {
  margin-bottom: 14px;
}
.mp-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #fff;
  font-size: 0.95rem;
  color: #1f2937;
}
.mp-card-info {
  margin: 0 0 14px;
  color: #1f2937;
  font-size: 0.95rem;
}
.mp-spacer {
  flex: 1;
}
.mp-start {
  align-self: center;
  margin-top: 8px;
  background: #0f766e;
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.28);
}
.mp-start:hover {
  background: #115e56;
}
.mp-start:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

/* --- Score donuts + band-scale strip in results modal --- */
.results-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 6px 0 18px;
}
.res-donut {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 6px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
}
.res-donut.center {
  width: 160px;
  height: 160px;
  border-color: #0f766e;
  background: #ecfdf5;
}
.res-donut .res-label {
  font-size: 0.78rem;
  color: #475569;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.res-donut .res-value {
  font-size: 1.2rem;
  font-weight: 950;
  color: #0f172a;
  margin-top: 4px;
}
.res-donut.center .res-value {
  font-size: 2rem;
  color: #0f766e;
}
.res-donut .res-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
}
.band-scale {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 4px 0 18px;
}
.band-scale .band-cell {
  min-width: 38px;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.band-scale .band-cell.active {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.32);
}

/* --- Numbered answer-key pills grouped by Part --- */
.ak-section-title {
  margin: 10px 0 8px;
  font-weight: 900;
  font-size: 1rem;
  color: #0f172a;
}
.ak-part-title {
  margin: 14px 0 8px;
  font-weight: 900;
  font-size: 0.95rem;
  color: #0f766e;
}
.ak-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
@media (min-width: 760px) {
  .ak-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ak-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #1f2937;
  padding: 4px 2px;
}
.ak-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-weight: 900;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.22);
}
.ak-row.bad .ak-num {
  background: #b91c1c;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}
.ak-text {
  flex: 1 1 auto;
  min-width: 0;
  color: #0f172a;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ak-mark {
  font-size: 1rem;
  font-weight: 900;
  flex: 0 0 auto;
}
.ak-mark.ok { color: #16a34a; }
.ak-mark.bad { color: #dc2626; }
.ak-mismatch {
  color: #94a3b8;
  font-weight: 600;
  margin-left: 4px;
  font-size: 0.85rem;
}

/* --- Review & Explanations split panel --- */
.review-panel {
  margin-top: 22px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.review-panel-header {
  padding: 10px 14px;
  background: #0f172a;
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
}
.review-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0;
}
@media (max-width: 860px) {
  .review-panel-body { grid-template-columns: 1fr; }
}
.review-q-col {
  padding: 14px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  max-height: 70vh;
  overflow: auto;
}
@media (max-width: 860px) {
  .review-q-col { border-right: none; border-bottom: 1px solid rgba(15, 23, 42, 0.08); max-height: none; }
}
.review-side-col {
  padding: 14px;
  background: #f8fafc;
  max-height: 70vh;
  overflow: auto;
}
.review-side-title {
  font-size: 1.05rem;
  font-weight: 950;
  color: #0f172a;
  margin: 0 0 8px;
}
.review-q-item {
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}
.review-q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 900;
  color: #0f172a;
}
.review-q-stem {
  font-size: 0.92rem;
  color: #1f2937;
  line-height: 1.5;
}
.review-q-meta {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #475569;
}
.review-q-meta strong { color: #0f172a; }
.review-q-explain {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #1e293b;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.5;
}

.results-extras {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.results-section {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.results-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 900;
  font-size: 0.95rem;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  color: #1d4ed8;
}
.results-section > summary::-webkit-details-marker {
  display: none;
}
.results-section > summary::after {
  content: "▾";
  float: right;
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.15s;
}
.results-section:not([open]) > summary::after {
  transform: rotate(-90deg);
}
.results-section-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.results-block {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fafafa;
  padding: 10px 12px;
}
.results-block-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 900;
  color: #111827;
}
.results-transcript {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #1f2937;
}
.results-transcript .listen-dialogue {
  max-height: none;
}
.results-transcript-pre {
  white-space: pre-wrap;
  font-family: inherit;
  margin: 0;
}
.results-explain-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fafafa;
}
@media (max-width: 600px) {
  .results-explain-row {
    grid-template-columns: 1fr;
  }
}
.results-explain-q {
  font-weight: 900;
  color: #111827;
  font-size: 0.92rem;
}
.results-explain-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1f2937;
}
.results-explain-key {
  margin-bottom: 4px;
}
.results-explain-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.results-explain-badge.ok {
  background: rgba(220, 252, 231, 0.9);
  color: #065f46;
  border: 1px solid rgba(5, 150, 105, 0.35);
}
.results-explain-badge.bad {
  background: rgba(254, 226, 226, 0.9);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.r-passage .passage-hl {
  background: rgba(34, 197, 94, 0.48);
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-bottom: 2px solid rgba(21, 128, 61, 0.75);
  box-shadow: 0 1px 0 rgba(21, 128, 61, 0.18);
}
.r-passage .passage-q-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.15rem;
  margin-left: 3px;
  padding: 0 3px;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: #16a34a;
  border: 1px solid rgba(20, 83, 45, 0.35);
  border-radius: 3px;
  vertical-align: super;
  position: relative;
  top: -0.15em;
  /* Let selection run through surrounding text; avoid capturing the badge. */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.r-passage .passage-anchor {
  display: inline-block;
  width: 0;
  height: 0;
  overflow: hidden;
}
.r-passage .passage-hl.passage-hl-flash {
  animation: passageHlFlash 1.25s ease-out 1;
}
@keyframes passageHlFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.85);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
.reading-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.review-banner {
  margin: 10px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}
.q-review {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.q-review-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}
.q-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
}
.q-badge.ok {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(220, 252, 231, 0.55);
  color: #166534;
}
.q-badge.bad {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.55);
  color: #991b1b;
}
.q-badge.warn {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(255, 251, 235, 0.65);
  color: #b45309;
}
.q-answer-key {
  font-style: italic;
  font-weight: 800;
  color: var(--text);
}
.q-explain {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.75);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
}
.q-explain.hidden {
  display: none;
}
.opt-list input:disabled {
  opacity: 1;
}
.opt-list li.q-opt-correct label {
  font-weight: 800;
}
.opt-list li.q-opt-wrong label {
  color: #991b1b;
}
.mh-bundle {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 12px 12px 4px;
  margin-bottom: 12px;
  background: rgba(248, 250, 252, 0.55);
}
.heading-list-panel {
  margin-bottom: 12px;
}
.heading-list-title {
  font-weight: 900;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}
.reading-heading-ol {
  margin: 0;
  padding-left: 1.6rem;
  list-style-type: lower-roman;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}
.reading-heading-ol li {
  margin-bottom: 6px;
}
.mh-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mh-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.mh-row.mh-row-bad {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(254, 226, 226, 0.35);
}
.mh-row.mh-row-ok {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(220, 252, 231, 0.35);
}
.mh-row .match-radio-list {
  flex: 1 1 100%;
  margin: 2px 0 0;
  width: 100%;
}
.mh-row .match-radio-list label {
  user-select: text;
  cursor: pointer;
}
.mh-para {
  font-weight: 800;
  min-width: 120px;
  font-size: 0.88rem;
}
.mh-qnum {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
}
.mh-select {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
  padding: 8px 10px;
  font-size: 0.88rem;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 8px;
  background: #fff;
}
.reading-sel-toolbar {
  position: fixed;
  z-index: 92;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.18);
}
.reading-sel-toolbar.hidden {
  display: none !important;
}
.rst-btn {
  border: none;
  background: rgba(248, 250, 252, 0.95);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.rst-btn:hover {
  background: #e2e8f0;
}
.rst-btn.rst-primary {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.rst-btn.rst-warn {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}
.rst-btn.rst-danger {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}
.user-hl {
  background: rgba(251, 191, 36, 0.35);
  border-bottom: 2px solid rgba(245, 158, 11, 0.55);
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.reading-vocab-sheet {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(3px);
}
.reading-vocab-sheet:not(.hidden) {
  display: flex;
}
.reading-vocab-inner {
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  position: relative;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
  padding: 18px 18px 16px;
}
.reading-vocab-word {
  font-size: 1.35rem;
  font-weight: 950;
  margin: 0 36px 12px 0;
  letter-spacing: 0.02em;
}
.reading-vocab-section {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.reading-vocab-section strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.reading-vocab-body {
  color: var(--text);
  white-space: pre-wrap;
}
.flashcards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flashcard-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: start;
}
.flashcard-item .fw {
  font-weight: 900;
  font-size: 1rem;
}
.flashcard-item .fd {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.flashcard-item .fx {
  font-size: 0.85rem;
  color: var(--text);
}
.flashcard-item .fc-stat {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}
.flashcard-item .fc-stat strong {
  color: var(--text);
  font-weight: 700;
}

.sub-screen--flashcards.fc-page {
  max-width: 1120px;
}
.fc-page-head {
  margin-bottom: 18px;
}
.fc-page-head h2 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}
.fc-page-sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}
.fc-stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 960px) {
  .fc-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .fc-stats-row {
    grid-template-columns: 1fr;
  }
}
.fc-stat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.fc-stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.fc-stat-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
}
.fc-stat-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.fc-stat-bar-wrap {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}
.fc-stat-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.35s ease;
}
.fc-stat-link {
  margin-top: 8px;
  border: none;
  background: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6366f1;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fc-stat-link:hover {
  color: #4f46e5;
}
.fc-stat-card--streak .fc-stat-value {
  font-size: 1.15rem;
}
.fc-streak-cal {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.fc-streak-d {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}
.fc-streak-d.is-on {
  background: rgba(34, 197, 94, 0.25);
  color: #15803d;
}
.fc-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .fc-body-grid {
    grid-template-columns: 1fr;
  }
  .fc-aside {
    order: 3;
  }
}
.fc-body-main {
  min-width: 0;
}
.fc-panel-lead {
  margin-bottom: 14px;
}
.fc-empty-state {
  text-align: center;
  padding: 32px 20px 28px;
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(255, 255, 255, 0.5));
  margin-bottom: 16px;
}
.fc-empty-illu {
  margin-bottom: 12px;
}
.fc-empty-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 900;
}
.fc-empty-text {
  margin: 0 auto 8px;
  max-width: 420px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.fc-empty-text--soft {
  color: var(--muted);
  font-size: 0.86rem;
}
.fc-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fc-aside-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
}
.fc-aside-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 900;
}
.fc-aside-sub {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
}
.fc-donut-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 8px auto 14px;
}
.fc-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#e2e8f0 0deg 360deg);
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.98);
}
.fc-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.fc-donut-center strong {
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
}
.fc-donut-center span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.fc-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}
.fc-donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
}
.fc-donut-legend li:last-child {
  margin-bottom: 0;
}
.fc-donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.fc-mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100px;
  padding-top: 8px;
}
.fc-mini-bar {
  flex: 1;
  min-width: 0;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.55), rgba(99, 102, 241, 0.2));
  position: relative;
  transition: height 0.3s ease;
}
.fc-mini-bar span {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
/* Full-width deck promos (Vocabulary Studio + mirrored From Reading) */
.fc-deck-promo {
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.99) 100%);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.fc-deck-promo--studio {
  border-color: rgba(99, 102, 241, 0.28);
  background: linear-gradient(125deg, rgba(99, 102, 241, 0.09), rgba(255, 255, 255, 0.97) 45%, rgba(255, 255, 255, 0.99));
}
.fc-deck-promo--reading {
  border-color: rgba(99, 102, 241, 0.22);
}
.fc-deck-promo.hidden {
  display: none;
}
.fc-deck-promo-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.fc-deck-promo-body {
  flex: 1;
  min-width: min(100%, 280px);
}
.fc-deck-promo-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 8px;
}
.fc-deck-promo-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5b21b6;
  background: rgba(91, 33, 182, 0.14);
  padding: 5px 11px;
  border-radius: 999px;
}
.fc-deck-promo-badge--muted {
  color: #475569;
  background: rgba(71, 85, 105, 0.12);
}
.fc-deck-promo-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--text);
}
.fc-deck-promo-desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}
.fc-deck-promo-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: flex-end;
}
.fc-deck-promo-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fc-deck-promo-stat--wide {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.fc-deck-promo-stat-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.fc-deck-promo-stat-val {
  font-size: 1.35rem;
  font-weight: 950;
  color: var(--text);
  line-height: 1.1;
}
.fc-deck-promo-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 2px;
}
.fc-deck-promo-bar {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
  min-width: 80px;
}
.fc-deck-promo-bar--teal {
  background: rgba(45, 212, 191, 0.2);
}
.fc-deck-promo-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.45s ease;
}
.fc-deck-promo-bar--teal span {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}
.fc-deck-promo-pct {
  font-size: 0.88rem;
  font-weight: 950;
  color: #5b21b6;
  min-width: 3.2rem;
  text-align: right;
}
.fc-deck-promo-pct--teal {
  color: #0f766e;
}
.fc-deck-promo-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.fc-deck-promo-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-weight: 800;
  border-radius: 12px;
}
.btn-w-primary.fc-deck-promo-cta--outline {
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(99, 102, 241, 0.5);
  color: #4f46e5;
  box-shadow: none;
}
.btn-w-primary.fc-deck-promo-cta--outline:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
}
.fc-deck-promo-arrow {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.9;
}
@media (max-width: 720px) {
  .fc-deck-promo {
    flex-direction: column;
    align-items: stretch;
  }
  .fc-deck-promo-icon {
    margin: 0 auto;
  }
  .fc-deck-promo-cta {
    width: 100%;
    justify-content: center;
  }
}
.fc-deck-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.fc-deck-tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.fc-deck-tab:hover {
  border-color: rgba(99, 102, 241, 0.45);
}
.fc-deck-tab.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.fc-deck-panel {
  margin-top: 4px;
}
.fc-reading-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.fc-reading-count {
  margin-left: auto;
}
.fc-reading-study-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 10px;
}
.fc-lang-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fc-lang-picker-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.fc-lang-select {
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.95);
}
.fc-practice-lead {
  margin: 0 0 14px;
  line-height: 1.5;
}
.fc-practice-panel {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.07), rgba(255, 255, 255, 0.96));
}
.fc-practice-inner {
  max-width: 520px;
  margin: 0 auto;
}
.fc-practice-cardwrap {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  min-height: 200px;
  padding: 20px 18px;
  cursor: pointer;
  margin-bottom: 14px;
  outline: none;
  transition: box-shadow 0.15s;
}
.fc-practice-cardwrap:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}
.fc-practice-cardwrap:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}
.fc-practice-side {
  text-align: center;
}
.fc-practice-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.fc-practice-word {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--text);
}
.fc-practice-taphint {
  display: block;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}
.fc-practice-meaning,
.fc-practice-tr {
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}
.fc-practice-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.fc-practice-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fc-practice-meta {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
}
.flashcard-item .fc-meaning-lbl {
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.fc-tr-missing {
  color: var(--muted);
}
.fc-tr-missing-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
}
.fc-tr-alt {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}
.fc-tr-alt-item {
  display: inline;
}
.fc-tr-alt-item:not(:last-child)::after {
  content: " · ";
}
.fc-studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.ramazz-studio-top {
  position: sticky;
  top: 8px;
  z-index: 8;
  padding: 10px 0 12px;
  margin: 0 0 12px;
  background: rgba(252, 252, 253, 0.97);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0 0 12px 12px;
}
.ramazz-studio-top .fc-studio-toolbar {
  margin-bottom: 10px;
}
.ramazz-quiz-lang {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.22);
}
.ramazz-quiz-lang-select {
  min-width: 200px;
  max-width: 100%;
}
.fc-studio-toolbar--wrap {
  align-items: flex-end;
}
.fc-studio-toolbar--wrap .ramazz-lang-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}
.fc-studio-toolbar--wrap .ramazz-lang-select {
  min-width: 180px;
}
.fc-studio-toolbar--wrap .ramazz-search {
  flex: 1 1 220px;
}
.ramazz-tr-details {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  font-size: 0.82rem;
}
.ramazz-tr-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.ramazz-tr-body {
  margin-top: 8px;
  line-height: 1.5;
  color: var(--muted);
}
.ramazz-tr-text {
  color: var(--text);
  font-size: 0.86rem;
}
.ramazz-quiz-tr-slot {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 0.86rem;
  line-height: 1.5;
}
.ramazz-quiz-tr-k {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5b21b6;
  margin-bottom: 4px;
}
.ramazz-quiz-tr-v {
  color: var(--text);
  font-weight: 600;
}
.ramazz-search {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.95);
}
.ramazz-load-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.25);
  color: #7f1d1d;
  font-size: 0.88rem;
  margin-bottom: 12px;
}
.ramazz-vocab-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding-right: 4px;
}
.ramazz-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
}
.ramazz-card-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.ramazz-lemma {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
}
.ramazz-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5b21b6;
  background: rgba(91, 33, 182, 0.1);
  padding: 3px 8px;
  border-radius: 999px;
}
.ramazz-def {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}
.ramazz-sample {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.25);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
}
.ramazz-sample strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.ramazz-practice {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.ramazz-practice summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.ramazz-quiz {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), rgba(255, 255, 255, 0.95));
}
.ramazz-quiz h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.ramazz-quiz-prompt {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--text);
}
.ramazz-quiz-def {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  max-height: 120px;
  overflow-y: auto;
}
.ramazz-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ramazz-quiz-opt {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.ramazz-quiz-opt:hover:not(:disabled) {
  border-color: rgba(99, 102, 241, 0.45);
}
.ramazz-quiz-opt:disabled {
  cursor: default;
  opacity: 0.85;
}
.ramazz-quiz-opt.is-correct {
  border-color: #059669;
  background: rgba(5, 150, 105, 0.1);
}
.ramazz-quiz-opt.is-wrong {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
.ramazz-quiz-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.progress-vocab-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.progress-vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 10px;
}
.progress-vocab-table th,
.progress-vocab-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.progress-vocab-table th {
  font-weight: 800;
  color: var(--text);
  background: rgba(248, 250, 252, 0.9);
}

.tools-home {
  margin: 12px 0 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
}
.tools-home h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 950;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 720px) {
  .tools-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.tool-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 12px 10px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tool-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.35);
}
.tool-card .tt {
  font-weight: 950;
  font-size: 1.02rem;
  margin: 0 0 4px;
}
.tool-card .td {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

/* Engnovate-style test catalog cards (Listening / Reading list screens) */
.eg-screen {
  max-width: 1100px;
}
.eg-hero {
  margin: 8px 0 16px;
}
.eg-hero h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: -0.01em;
}
.eg-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.eg-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.eg-group {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 18px;
}
.eg-group-title {
  margin: 2px 0 10px;
  font-weight: 900;
  font-size: 1.1rem;
  color: #0f172a;
}
.eg-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 720px) {
  .eg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) {
  .eg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.eg-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 14px 14px 14px;
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 158px;
}
.eg-pill {
  align-self: flex-start;
  background: #fde68a;
  color: #92400e;
  border: 1px solid #f59e0b33;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 6px;
  text-transform: uppercase;
}
.eg-card .eg-title {
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #b91c1c;
  margin: 2px 0 0;
}
.eg-status {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: auto;
}
.eg-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.eg-stats-btn {
  background: #fff;
  color: #0f766e;
  border: 2px solid #0f766e;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.eg-stats-btn:hover {
  background: rgba(15, 118, 110, 0.08);
}
.eg-take-btn {
  align-self: flex-start;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.28);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.eg-take-btn:hover {
  background: #b91c1c;
}
.eg-take-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.22);
}
.reading-shell .r-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.reading-test-stats {
  padding: 8px 16px 10px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.45;
}
.reading-test-stats .rts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
.reading-test-stats .rts-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  color: var(--muted);
}
.reading-test-stats .rts-muted {
  color: var(--muted);
}
.reading-test-stats .rts-paper-line {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.reading-test-stats .rts-paper-value {
  font-weight: 800;
  color: var(--text);
}
.reading-test-stats details {
  margin-top: 6px;
}
.reading-test-stats summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}
.reading-test-stats .rts-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.75rem;
}
.reading-test-stats .rts-table th,
.reading-test-stats .rts-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
.reading-test-stats .rts-table th {
  background: rgba(37, 99, 235, 0.08);
  font-weight: 700;
}
.r-top .r-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}
.r-top .r-qid {
  font-weight: 600;
}
.r-top .r-paper {
  font-weight: 800;
  font-size: 0.82rem;
  color: #334155;
  max-width: min(420px, 100%);
  line-height: 1.3;
}
.r-flag {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 2px;
}
.r-flag.flagged {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}
.r-flag:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Flashcards practice MCQ feedback */
.r-flag.fc-opt {
  transition: transform 0.08s, background 0.15s, border-color 0.15s, color 0.15s;
}
.r-flag.fc-opt:disabled {
  cursor: default;
  opacity: 1;
}
.r-flag.fc-opt-wrong {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.55);
  color: #991b1b;
}
.r-flag.fc-opt.flagged {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.6);
  color: #14532d;
}
.r-font {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
}
.r-font button {
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  line-height: 1;
}
.r-font button:hover {
  background: #f8fafc;
}
.r-font .r-font-label {
  min-width: 44px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.r-mid {
  flex: 1;
  display: flex;
  min-height: 0;
  flex-direction: row;
}
.r-passage,
.r-questions {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--panel);
  padding: 16px 18px 24px;
  font-size: calc(0.9rem * var(--reading-scale));
  line-height: 1.55;
  -webkit-user-select: text;
  user-select: text;
}
.r-passage {
  border-right: 1px solid var(--border);
}
.r-passage h3 {
  font-size: 1rem;
  margin: 0 0 12px;
  font-weight: 600;
}
.r-passage .p-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.r-passage p {
  margin: 0 0 12px;
}
.r-passage p.passage-p-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.r-passage .passage-p-letter {
  flex: 0 0 auto;
  min-width: 1.25em;
  font-weight: 700;
  color: var(--muted);
  line-height: inherit;
}
.r-passage .passage-p-body {
  flex: 1;
  min-width: 0;
}
.passage-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.passage-tabs button {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.passage-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.r-questions h4 {
  font-size: 0.95rem;
  margin: 0 0 10px;
  font-weight: 600;
}
.q-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.opt-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.opt-list li {
  margin-bottom: 8px;
}
.opt-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: text;
}
.opt-list input {
  margin-top: 3px;
}
.listen-map-match-select,
.reading-match-select {
  display: block;
  min-width: 160px;
  max-width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
}
.q-block {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 12px 10px;
  margin: 0 0 12px;
  background: #fff;
}
.q-block.current {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.q-block.flagged {
  border-color: #fcd34d;
  background: #fffbeb;
}
.q-block .q-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.q-block .q-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.q-block .q-pass {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.q-section-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}
.q-group-title {
  margin: 14px 0 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}
.q-group-instructions {
  margin: -6px 0 10px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.listen-notes-title {
  margin: 4px 0 14px;
  padding: 10px 12px;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text);
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.q-group-section {
  margin: 18px 0 4px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #1a73e8;
}
.q-group-image {
  margin: 6px 0 14px;
  padding: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.q-group-image img {
  max-width: 100%;
  height: auto;
  max-height: 520px;
  border-radius: 6px;
  display: inline-block;
}
.sentence-input {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-top: 8px;
}
.sb-text .sb-answer-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  margin: 0 4px 8px 0;
}
.sb-qnum {
  flex: 0 0 auto;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 4px;
  background: #f8fafc;
  color: var(--text);
}
.sb-text .sb-answer-slot .sentence-input {
  width: auto;
  min-width: 116px;
  max-width: min(240px, 92vw);
  margin-top: 0;
}
.sb-text .sentence-input.sb-ok {
  border-color: #86efac;
  background: rgba(220, 252, 231, 0.45);
}
.sb-text .sentence-input.sb-bad {
  border-color: #fca5a5;
  background: rgba(254, 226, 226, 0.35);
}
.nc-notes {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
}
.nc-notes .nc-title {
  font-weight: 800;
  font-size: 1.02rem;
  margin: 10px 0 12px;
}
.nc-notes .nc-row {
  position: relative;
  margin: 0 0 6px;
  padding-left: 1.15em;
}
.nc-notes .nc-row::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: 700;
}
.nc-notes .nc-level-1 {
  margin-left: 1.1em;
}
.nc-notes .nc-static {
  padding-top: 2px;
  padding-bottom: 2px;
}
.nc-notes .q-block.nc-answer-line {
  margin: 0 0 8px;
  padding: 10px 12px 10px 1.35em;
  border-radius: 2px;
}
.nc-notes .q-block.nc-answer-line .nc-row {
  margin-bottom: 0;
}
.nc-notes .sb-qnum {
  border: 1px solid #0f172a;
  border-radius: 2px;
  background: #fff;
  min-width: 28px;
  height: 28px;
  font-size: 0.75rem;
}
.nc-notes .sb-answer-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  flex-wrap: wrap;
  margin: 0 2px 0 0;
}
.nc-notes .sb-answer-slot .sentence-input {
  width: auto;
  min-width: 120px;
  max-width: min(260px, 88vw);
  margin-top: 0;
}
.nc-notes .sentence-input.sb-ok {
  border-color: #86efac;
  background: rgba(220, 252, 231, 0.45);
}
.nc-notes .sentence-input.sb-bad {
  border-color: #fca5a5;
  background: rgba(254, 226, 226, 0.35);
}
.nc-notes .reading-completion-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: inherit;
}
.nc-notes .reading-completion-table th,
.nc-notes .reading-completion-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}
.nc-notes .reading-completion-table th {
  background: var(--panel);
  font-weight: 800;
}
.nc-notes .reading-completion-table .q-block.nc-table-cell {
  margin: 0;
  padding: 0;
  border: none;
}
.r-bottom {
  flex-shrink: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 8px 12px 10px;
  z-index: 41;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.06);
}

/* --- Full-screen Listening runner (Engnovate-like layout) --- */
.listen-shell {
  --listen-scale: 1;
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #f5f6f8;
  color: #111827;
}
.listen-shell #listenQuestionsPane {
  font-size: calc(0.95rem * var(--listen-scale));
}
.listen-shell #listenQuestionsPane * {
  font-size: inherit;
}
.listen-shell #listenQuestionsPane h1,
.listen-shell #listenQuestionsPane h2,
.listen-shell #listenQuestionsPane h3 {
  font-size: calc(1.05rem * var(--listen-scale));
}
.listen-shell #listenTranscriptText {
  font-size: calc(0.95rem * var(--listen-scale));
  line-height: 1.55;
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
.listen-shell #listenQuestionsPane,
.listen-shell .listen-transcript-text {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
.listen-shell #listenTranscriptWrap,
.listen-shell .listen-pane.listen-left,
.listen-shell .listen-pane.listen-right {
  -webkit-user-select: text !important;
  user-select: text !important;
}
.listen-shell #listenQuestionsPane input,
.listen-shell #listenQuestionsPane select,
.listen-shell #listenQuestionsPane textarea {
  font-size: calc(0.92rem * var(--listen-scale));
}
.listen-shell.hidden {
  display: none !important;
}
.listen-top,
.listen-audio {
  flex-shrink: 0;
}
.listen-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
}
.listen-title {
  font-weight: 900;
  font-size: 0.98rem;
}
.listen-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  color: #111827;
}
.listen-audio {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
}
.listen-audio-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.listen-mp3-exam-flex:not(.hidden) {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.listen-mid {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Take test: one column when transcript is off (before submit). */
.listen-mid .listen-pane.listen-left {
  display: none;
}
.listen-mid .listen-pane.listen-right {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 20px;
  background: #ffffff;
}
/* Take test: split when transcript is shown (after submit) — wide screens: side by side. */
.listen-mid.listen-mid--split .listen-pane.listen-left {
  display: block;
  min-height: 0;
  padding: 12px 12px 14px;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.listen-mid.listen-mid--split .listen-pane.listen-left .listen-transcript-box {
  margin: 0;
}
.listen-mid.listen-mid--split .listen-pane.listen-right {
  flex: 1 1 0;
  min-width: 0;
}
@media (min-width: 900px) {
  .listen-mid.listen-mid--split {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    flex-direction: row;
  }
  .listen-mid.listen-mid--split .listen-pane.listen-left {
    border-bottom: none;
    border-right: 1px solid rgba(15, 23, 42, 0.1);
  }
  .listen-mid.listen-mid--split .listen-pane.listen-left,
  .listen-mid.listen-mid--split .listen-pane.listen-right {
    overflow: auto;
  }
}
@media (max-width: 899px) {
  .listen-mid.listen-mid--split {
    flex: 1 1 0;
  }
  .listen-mid.listen-mid--split .listen-pane.listen-left {
    max-height: 38vh;
    flex: 0 0 auto;
    overflow: auto;
  }
  .listen-mid.listen-mid--split .listen-pane.listen-right {
    flex: 1 1 0;
    min-height: 0;
  }
}
.listen-transcript-box {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}
.listen-transcript-box h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 950;
}
.listen-transcript-text {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.95rem;
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
#listeningSectionView,
#listeningTranscriptPane,
#listeningTranscriptPane .tx {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
.listen-dialogue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.listen-dialogue .dlg-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.listen-dialogue .dlg-spk {
  font-weight: 950;
  color: #0f172a;
  white-space: nowrap;
  min-width: 110px;
}
.listen-dialogue .dlg-utt {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.listen-dialogue .dlg-gap {
  height: 6px;
}
.listen-bottom {
  flex: 0 0 auto;
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
}
.listen-parts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.listen-part-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.95);
}
.listen-part-btn.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}
.listen-completion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 10px 0 14px;
  table-layout: fixed;
}
.listen-completion-table th,
.listen-completion-table td {
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 10px 8px;
  vertical-align: top;
  line-height: 1.45;
  word-wrap: break-word;
}
.listen-completion-table th {
  background: rgba(241, 245, 249, 0.95);
  font-weight: 800;
  font-size: 0.86rem;
}
.listen-completion-table .listen-rowhead {
  font-weight: 800;
  background: rgba(248, 250, 252, 0.75);
  width: 6.5rem;
}
.listen-qnum-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border: 1px solid rgba(15, 23, 42, 0.28);
  border-radius: 3px;
  font-weight: 950;
  font-size: 0.78rem;
  margin-right: 6px;
  flex: 0 0 auto;
}
.listen-ans-field {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  max-width: 100%;
}
.listen-ans-field .sentence-input {
  min-width: 4.5rem;
  max-width: min(100%, 12rem);
  flex: 1 1 auto;
}
.listen-inc-bullets {
  margin: 0;
  padding-left: 1.15rem;
}
.listen-inc-bullets li {
  margin: 0.2em 0;
}
.listen-completion-table .q-review {
  margin-top: 6px;
}
.listen-table-title {
  font-weight: 900;
  font-size: 0.95rem;
  margin: 14px 0 6px;
  color: var(--text);
}
#screen-listening .listen-completion-table,
.listen-shell .listen-completion-table {
  color: #111827;
}
.listen-submit-row {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.listen-submit-row .spacer { flex: 1; }
.listen-submit-row button.primary {
  background: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 950;
}
.q-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
  max-height: 52px;
  overflow-y: auto;
}
.q-grid button {
  width: 32px;
  height: 28px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 2px;
  padding: 0;
}
.q-grid button.done {
  background: #dcfce7;
  border-color: #86efac;
  color: var(--success);
}
.q-grid button.flagged {
  background: #fef3c7;
  border-color: #fcd34d;
}
.q-grid button.current {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.r-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.r-actions button {
  min-width: 100px;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.r-actions .primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.r-actions .primary:hover {
  background: var(--accent-hover);
}
@media (max-width: 768px) {
  .r-mid {
    flex-direction: column;
  }
  .r-passage {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex: 1 1 45%;
    min-height: 0;
  }
  .r-questions {
    flex: 1 1 55%;
    min-height: 0;
  }
}

/* —— App shell: sidebar + main (SaaS layout) —— */
.layout-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  /* Reserve space for the fixed sidebar */
  padding-left: 260px;
}
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  align-self: stretch;
  min-height: 0;
  height: 100vh;
  max-height: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0;
  z-index: 60;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 55%, #060a12 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.12);
}
.sidebar-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 0 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.25);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.sidebar-brand h1 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
  line-height: 1.25;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 12px 11px 14px;
  border-radius: 0 12px 12px 0;
  border: none;
  border-left: 4px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}
.sidebar-nav button.active {
  background: rgba(255, 255, 255, 0.09);
  border-left-color: var(--dash-blue);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.sidebar-nav .sn-ico {
  width: 1.25rem;
  text-align: center;
  opacity: 0.88;
}
.sidebar-user {
  flex-shrink: 0;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}
.sidebar-user .su-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .su-av {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.4);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.layout-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--dash-bg);
}
.layout-main .main {
  flex: 1;
  background: var(--dash-bg);
  padding: 22px 22px 88px;
}
/* Sidebar hidden on small screens — mirror Premium CTA under header everywhere */
.premium-mobile-strip {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(79, 70, 229, 0.1));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.premium-mobile-strip .pms-copy strong {
  display: block;
  font-size: 0.92rem;
  color: #0f172a;
}
.premium-mobile-strip .pms-copy span {
  font-size: 0.78rem;
  color: #475569;
}
.premium-mobile-strip button[disabled] {
  opacity: 0.92;
}
.top-bar-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.account-badge.hidden {
  display: none !important;
}
.account-badge-user {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--dash-text, #0f172a);
  max-width: min(200px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-badge-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.account-badge-tag--premium {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.38);
}
.account-badge-tag--teacher {
  background: linear-gradient(135deg, #ecfdf5, #a7f3d0);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.38);
}
.top-bar.minimal {
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.top-bar.minimal h1 {
  font-size: 1.05rem;
}
@media (max-width: 900px) {
  /* Mobile: sidebar becomes an off-canvas drawer */
  .sidebar {
    display: flex;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  body.sidebar-open .sidebar,
  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.no-scroll,
  .app.no-scroll {
    overflow: hidden;
    touch-action: none;
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.48);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.sidebar-open .sidebar-overlay,
  .app.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
  }
  .sidebar-close-btn {
    display: inline-grid;
  }
  .layout-shell {
    padding-left: 0;
  }
  .premium-mobile-strip {
    display: flex;
  }
  #mainHeader.hidden ~ .premium-mobile-strip {
    display: none !important;
  }
  .bottom-nav {
    display: flex;
  }
}

/* Desktop-only defaults (do not override mobile drawer) */
@media (min-width: 901px) {
  .sidebar-overlay {
    display: none;
  }
  .mobile-menu-btn {
    display: none;
  }
  .sidebar-close-btn {
    display: none;
  }
}

/* Shared button styling (shown on mobile via media query above) */
.sidebar-close-btn {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-weight: 900;
  cursor: pointer;
}
.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.layout-main > .top-bar.minimal .mobile-menu-btn {
  margin-right: 10px;
}
@media (min-width: 901px) {
  .bottom-nav {
    display: none;
  }
}

/* Practice dashboard (stats cards) */
.practice-dash {
  max-width: 1180px;
  margin: 0 auto 24px;
}
.practice-dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.practice-dash-head h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}
.practice-dash-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.95rem;
}
.practice-dash-device {
  font-size: 0.82rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}
.stat-card .sc-ico {
  font-size: 1.35rem;
  margin-bottom: 8px;
}
.stat-card .sc-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}
.stat-card .sc-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 4px;
}
.stat-card.sc-blue .sc-val {
  color: #2563eb;
}
.stat-card.sc-purple .sc-val {
  color: #7c3aed;
}
.dash-time-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: #eef2f6;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9);
}
.dash-time-tabs button {
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
  font-size: 0.86rem;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.dash-time-tabs button:hover {
  color: var(--dash-text);
}
.dash-time-tabs button.active {
  color: var(--dash-blue);
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.dash-reco-panel {
  margin-bottom: 18px;
}
.dash-reco-panel h3 {
  color: #0f172a;
}
.dash-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
@media (max-width: 800px) {
  .dash-detail-grid {
    grid-template-columns: 1fr;
  }
}
.dash-vocab-card,
.dash-rl-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}
.dash-vocab-card h3,
.dash-rl-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-vocab-rows .dvr {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.92rem;
}
.dash-vocab-rows .dvr:last-child {
  border-bottom: none;
}
.dash-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  margin-top: 12px;
  overflow: hidden;
}
.dash-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #22c55e);
  border-radius: 999px;
}
.dash-rl-detail {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.55;
}
.dash-rl-detail > p.next-test {
  margin: 0;
}
.dash-rl-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.dash-rl-metrics .dash-lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 4px;
}
.dash-lbl--recent {
  display: block;
  margin: 10px 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  text-transform: none;
}

.dash-attempt-scroll {
  max-height: none;
  overflow-y: visible;
  overflow-x: hidden;
  padding: 0 2px 2px 0;
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.72);
  scrollbar-gutter: stable;
}

.dash-attempt-scroll::-webkit-scrollbar {
  width: 8px;
}

.dash-attempt-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}

.dash-attempt-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.dash-attempt-scroll .dash-attempt-list {
  border-top: none;
}

.dash-attempt-scroll .dash-attempt-list li:first-child {
  padding-top: 8px;
}

.dash-attempt-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}
.dash-attempt-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.82rem;
}
.dash-attempt-list li:last-child {
  border-bottom: none;
}
.dash-attempt-title {
  color: #0f172a;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.dash-attempt-meta {
  color: #64748b;
  font-size: 0.78rem;
  text-align: right;
  flex-shrink: 0;
  max-width: 46%;
  line-height: 1.35;
}
.dash-footnote {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.88rem;
  color: #334155;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tools-home.compact h3 {
  margin-top: 8px;
}
.tools-home.open-modules-first {
  margin-bottom: 22px;
}

/* Reading library page (collections + table) */
.library-page {
  max-width: 1200px;
  margin: 0 auto;
}
.library-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.library-hero h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
}
.library-hero p {
  margin: 8px 0 0;
  color: #64748b;
  max-width: 560px;
  line-height: 1.55;
}
.library-hero-art {
  width: 140px;
  height: 110px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(16, 185, 129, 0.12));
  border: 1px dashed rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}
.library-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .library-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.lib-stat-pill {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: var(--shadow-sm);
}
.lib-stat-pill .ls-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lib-stat-pill .ls-big {
  font-size: 1.35rem;
  font-weight: 900;
  margin-top: 6px;
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 768px) {
  .collection-grid {
    grid-template-columns: 1fr;
  }
}
.collection-card {
  border-radius: 16px;
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.collection-card.teal {
  background: linear-gradient(145deg, #0d9488 0%, #0f766e 100%);
}
.collection-card.purple {
  background: linear-gradient(145deg, #7c3aed 0%, #5b21b6 100%);
}
.collection-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}
.collection-card p {
  margin: 0;
  opacity: 0.92;
  font-size: 0.92rem;
  line-height: 1.5;
}
.collection-card .cc-meta {
  margin-top: 14px;
  font-size: 0.88rem;
  opacity: 0.9;
}
.collection-card .cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.collection-card .cc-actions button {
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
}
.collection-card .cc-actions .btn-solid {
  background: #fff;
  color: #0f172a;
}
.collection-card .cc-actions .btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.65);
}
.recent-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .recent-split {
    grid-template-columns: 1fr;
  }
}
.recent-panel,
.reco-panel {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
}
.recent-panel h4,
.reco-panel h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
}
.reco-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.reco-block {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.reco-block--continue {
  border-left: 3px solid #2563eb;
}

.reco-block--new {
  border-left: 3px solid #7c3aed;
}

.reco-block--tip {
  border-left: 3px solid #0d9488;
}
.reco-block h5 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.reco-line {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 4px;
}
.reco-tip-body strong {
  color: #1d4ed8;
  font-weight: 800;
}
.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.88rem;
}
.recent-row:last-child {
  border-bottom: none;
}
.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.library-filters .lf-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: #475569;
}
.library-filters .lf-pill.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}
.library-filters .lf-search {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.library-filters input[type="search"] {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  min-width: 180px;
}
.btn-tiny-primary {
  padding: 7px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Dashboard UI — mock-inspired (light shell, navy sidebar, cards, spark row)
   -------------------------------------------------------------------------- */

.layout-main > .top-bar.minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  text-align: left;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

@media (min-width: 901px) {
  .layout-main > .top-bar.minimal {
    position: sticky;
    top: 0;
    z-index: 40;
  }
}

.layout-main > .top-bar.minimal h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dash-text);
  letter-spacing: 0.01em;
}

.layout-main .top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.layout-main .top-bar-auth-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow:
    0 2px 4px rgba(37, 99, 235, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.layout-main .top-bar-auth-btn:hover {
  filter: brightness(1.06);
  box-shadow:
    0 4px 14px rgba(37, 99, 235, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.08);
}

.layout-main .top-bar-auth-btn:active {
  transform: scale(0.98);
}

.layout-main .top-bar-auth-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.45),
    0 4px 14px rgba(37, 99, 235, 0.35);
}

.layout-main .top-bar-auth-btn.top-bar-auth-btn--out {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 2px 4px rgba(220, 38, 38, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.06);
}

.layout-main .top-bar-auth-btn.top-bar-auth-btn--out:hover {
  filter: brightness(1.06);
  box-shadow:
    0 4px 14px rgba(220, 38, 38, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.08);
}

.layout-main .top-bar-auth-btn.top-bar-auth-btn--out:focus-visible {
  box-shadow:
    0 0 0 3px rgba(220, 38, 38, 0.45),
    0 4px 14px rgba(220, 38, 38, 0.35);
}

.layout-main .top-bar .icon-btn {
  position: relative;
  right: auto;
  top: auto;
}

.layout-main .top-bar-cal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--dash-muted);
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.layout-main .top-bar-cal strong {
  color: var(--dash-blue);
  font-weight: 700;
}

.layout-main > .top-bar.minimal .icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  font-size: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  box-shadow: none;
}

.layout-main > .top-bar.minimal .icon-btn:hover {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.12);
}

.sidebar-premium {
  flex-shrink: 0;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.55), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.35);
  position: relative;
  overflow: hidden;
}

.dash-reading-module,
.dash-listening-module {
  margin-bottom: 12px;
}

.dash-writing-module {
  margin-bottom: 0;
}

.sidebar-premium::before {
  content: "👑";
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 1.25rem;
  opacity: 0.95;
}

#screen-dashboard.dash-screen .dash-tools-quick {
  display: none;
}

.practice-dash {
  max-width: 1180px;
  padding: 0 4px;
}

.dash-welcome {
  align-items: flex-start;
  margin-bottom: 22px;
}

.practice-dash-head.dash-welcome h2.dash-welcome-title {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  color: var(--dash-text);
  letter-spacing: -0.02em;
}

.practice-dash-head.dash-welcome .dash-welcome-sub {
  margin: 8px 0 0;
  font-size: 0.98rem;
  color: var(--dash-muted);
  max-width: 52ch;
}

.dash-device-pill {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  color: var(--dash-muted);
}

.stat-cards--six {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-cards--six .stat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--dash-card-radius);
  padding: 14px 14px 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.stat-cards--six .stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-cards--six .stat-card.sc-blue::before {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.stat-cards--six .stat-card.sc-purple::before {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.stat-cards--six .stat-card.sc-warm::before {
  background: linear-gradient(90deg, #ea580c, #fb923c);
}

.stat-cards--six .stat-card.sc-mint::before {
  background: linear-gradient(90deg, #0d9488, #2dd4bf);
}

.stat-cards--six .sc-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dash-muted);
  margin-bottom: 4px;
}

.stat-cards--six .sc-val {
  font-size: 1.45rem;
}

.sc-ico-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.sc-iw-blue {
  background: rgba(37, 99, 235, 0.14);
}
.sc-iw-sky {
  background: rgba(14, 165, 233, 0.16);
}
.sc-iw-violet {
  background: rgba(139, 92, 246, 0.14);
}
.sc-iw-indigo {
  background: rgba(99, 102, 241, 0.15);
}
.sc-iw-orange {
  background: rgba(249, 115, 22, 0.15);
}
.sc-iw-teal {
  background: rgba(20, 184, 166, 0.16);
}

.stat-card.sc-warm .sc-val {
  color: #ea580c;
}
.stat-card.sc-mint .sc-val {
  color: #0d9488;
}

@media (max-width: 1100px) {
  .stat-cards--six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stat-cards--six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-reco-panel .reco-panel {
  border-radius: var(--dash-card-radius);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
}

.dash-flash-card .dash-flash-head {
  padding-bottom: 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dash-reco-panel h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.dash-flash-card .dash-flash-head h3 {
  margin: 0 0 12px;
}

.dash-vocab-inner-title {
  margin: 18px 0 12px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--dash-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-donut-visual {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.dash-donut-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0deg 120deg, #a855f7 120deg 230deg, #cbd5e1 230deg 360deg);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 14px #fff, 0 10px 28px rgba(15, 23, 42, 0.08);
}

.dash-donut-ring::after {
  content: "";
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.dash-chart-strip {
  margin: 22px 0 16px;
}

.dash-chart-panel {
  background: #fff;
  border-radius: var(--dash-card-radius);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  padding: 18px 20px 16px;
}

.dash-progress-overview.dash-chart-panel {
  padding-bottom: 18px;
}

.dash-chart-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-chart-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--dash-text);
}

.dash-chart-tabs-mock {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-chart-tabs-mock span {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--dash-muted);
  cursor: default;
}

.dash-chart-tabs-mock span.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--dash-blue);
}

.dash-progress-overview .dash-chart-panel-head {
  align-items: center;
}

.dash-progress-period-label {
  margin: 0;
}

.dash-progress-period {
  appearance: none;
  cursor: pointer;
  padding: 8px 36px 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  font: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--dash-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dash-progress-period:hover {
  border-color: rgba(15, 23, 42, 0.18);
}

.dash-progress-period:focus {
  outline: none;
  border-color: var(--dash-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dash-skill-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

@media (max-width: 1024px) {
  .dash-skill-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .dash-skill-cards {
    grid-template-columns: 1fr;
  }
}

.dash-skill-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: #fafbfc;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dash-skill-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dash-text);
  margin-bottom: 2px;
}

.dash-skill-sublabel {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dash-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.dash-skill-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.dash-skill-card--reading .dash-skill-value:not(.dash-skill-value--empty) {
  color: #2563eb;
}

.dash-skill-card--listening .dash-skill-value:not(.dash-skill-value--empty) {
  color: #059669;
}

.dash-skill-card--writing .dash-skill-value:not(.dash-skill-value--empty) {
  color: #7c3aed;
}

.dash-skill-card--speaking .dash-skill-value:not(.dash-skill-value--empty) {
  color: #ea580c;
}

.dash-skill-value--empty {
  color: #94a3b8;
  font-weight: 900;
}

.dash-skill-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dash-muted);
  margin-bottom: auto;
  padding-bottom: 10px;
}

/* Progress overview: forced line-chart plot (Cartesian-style grid + axes + inset graph) */
.dash-progress-overview.dash-progress-linegraph {
  --lg-axis: rgba(15, 23, 42, 0.13);
  --lg-grid-h: rgba(148, 163, 184, 0.28);
  --lg-grid-v: rgba(148, 163, 184, 0.11);
}

.dash-progress-overview.dash-progress-linegraph .dash-skill-spark {
  position: relative;
  margin-top: auto;
  width: 100%;
  min-height: 82px;
  padding: 11px 14px 11px 20px;
  border-radius: 10px;
  isolation: isolate;
  border: 1px solid rgba(15, 23, 42, 0.11);
  box-shadow: inset 1px 0 0 var(--lg-axis), inset 0 -1px 0 var(--lg-axis),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  background-color: #ffffff;
  background-image: repeating-linear-gradient(
      180deg,
      transparent,
      transparent calc(100% / 5 - 1px),
      var(--lg-grid-h) calc(100% / 5 - 1px),
      var(--lg-grid-h) calc(100% / 5)
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc(100% / 7 - 1px),
      var(--lg-grid-v) calc(100% / 7 - 1px),
      var(--lg-grid-v) calc(100% / 7)
    ),
    linear-gradient(180deg, rgba(248, 250, 252, 0.65) 0%, rgba(255, 255, 255, 0.98) 55%);
}

.dash-progress-overview.dash-progress-linegraph .dash-skill-card--reading .dash-skill-spark {
  background-color: rgba(239, 246, 255, 0.55);
}

.dash-progress-overview.dash-progress-linegraph .dash-skill-card--listening .dash-skill-spark {
  background-color: rgba(236, 253, 245, 0.55);
}

.dash-progress-overview.dash-progress-linegraph .dash-skill-card--writing .dash-skill-spark {
  background-color: rgba(245, 243, 255, 0.55);
}

.dash-progress-overview.dash-progress-linegraph .dash-skill-card--speaking .dash-skill-spark {
  background-color: rgba(255, 247, 237, 0.55);
}

.dash-progress-overview.dash-progress-linegraph .dash-skill-spark .dash-spark-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 72px !important;
  max-height: none !important;
  filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.07));
}

.dash-chart-hint {
  margin: 12px 0 0;
  font-size: 0.78rem;
}

.dash-footnote.dash-tip-of-day {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.98));
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--dash-text);
  margin-bottom: 12px;
  margin-top: 0;
}

.dash-tip-ico {
  font-size: 1.25rem;
  line-height: 1;
}

.dash-tip-text {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.45;
}

.dash-tip-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--dash-muted);
  padding: 0 4px;
  border-radius: 6px;
}

.dash-tip-dismiss:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--dash-text);
}

.dash-footnote.dash-footnote-meta {
  font-size: 0.78rem;
  color: var(--dash-muted);
  background: transparent !important;
  border: none !important;
  padding: 8px 0 0;
  margin-top: 4px;
}

/* Sidebar section labels + profile (mock alignment) */
.sidebar-section-label {
  margin: 14px 8px 6px;
  padding-left: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
}

.sidebar-section-label:first-of-type {
  margin-top: 4px;
}

.sidebar-user .su-body {
  flex: 1;
  min-width: 0;
}

.sidebar-user .su-name {
  font-weight: 800;
  color: #fff;
  font-size: 0.92rem;
}

.sidebar-user .su-band-line {
  margin-top: 4px;
  opacity: 0.88;
  font-size: 0.84rem;
  color: #e2e8f0;
}

.sidebar-user .su-level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.85);
}

.sidebar-user .su-level-val {
  font-weight: 700;
  color: #fef08a;
}

.sidebar-user .su-level-track {
  margin-top: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.sidebar-user .su-level-fill {
  display: block;
  height: 100%;
  width: 72%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.sidebar-user .su-meta {
  margin-top: 8px;
  font-size: 0.72rem;
  opacity: 0.72;
  color: #cbd5e1;
}

.sidebar-premium .sp-title {
  font-weight: 800;
  font-size: 0.9rem;
  padding-right: 36px;
}

.sidebar-premium .sp-copy {
  opacity: 0.88;
  font-size: 0.78rem;
  margin-top: 6px;
  line-height: 1.35;
}

.sidebar-premium .sp-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: not-allowed;
}

/* Recommended strip header */
.dash-reco-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dash-reco-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dash-text);
}

.dash-reco-viewall {
  border: none;
  background: none;
  padding: 6px 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dash-blue);
  cursor: pointer;
  border-radius: 8px;
}

.dash-reco-viewall:hover {
  background: rgba(37, 99, 235, 0.08);
}

.dash-reco-inner.reco-panel {
  margin: 0;
  padding: 16px;
}

.dash-reco-loading {
  margin: 0;
}

/* Flashcards streak row */
.dash-streak {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.12), rgba(249, 115, 22, 0.06));
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.dash-streak-ico {
  font-size: 1.35rem;
  line-height: 1;
}

.dash-streak-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-streak-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dash-muted);
}

.dash-streak-days {
  font-size: 0.82rem;
  font-weight: 600;
  color: #c2410c;
}

@media (max-width: 900px) {
  .layout-main .top-bar-cal span:last-child {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Writing dashboard + shell (mock-inspired: indigo accent, navy sidebar)
   -------------------------------------------------------------------------- */
:root {
  --w-primary: #6366f1;
  --w-primary-dark: #4f46e5;
  --w-sidebar-bg: #0a1128;
  --w-page-bg: #f8f9fb;
  --w-card-shadow: 0 4px 24px rgba(10, 17, 40, 0.06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.layout-main {
  background: var(--w-page-bg);
}
.layout-main .main {
  background: var(--w-page-bg);
}
.sidebar {
  background: linear-gradient(180deg, #0d1630 0%, var(--w-sidebar-bg) 40%, #060a14 100%);
}
.sidebar-brand-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(37, 99, 235, 0.35));
  border-radius: 12px;
}
.sidebar-nav button.active {
  border-left-color: var(--w-primary);
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
}
.sn-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.95);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.sn-count--soft {
  font-weight: 600;
  opacity: 0.9;
}
.sidebar-nav-muted {
  opacity: 0.45;
  cursor: not-allowed;
}
.sidebar-band-widget {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sbw-ring {
  --band-pct: 0.65;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(var(--w-primary) calc(var(--band-pct) * 360deg), rgba(255, 255, 255, 0.12) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sbw-ring-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.sbw-ring-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.sbw-ring-lbl {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.sbw-text {
  min-width: 0;
}
.sbw-title {
  display: block;
  font-size: 0.88rem;
  color: #e2e8f0;
  margin-bottom: 4px;
}
.sbw-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
}

.top-bar-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.top-bar-sub {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dash-muted);
  line-height: 1.35;
  max-width: 520px;
}
.top-bar-sub.hidden {
  display: none !important;
}
.icon-btn {
  position: relative;
}
.icon-btn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

#screen-writing .sub-screen.writing-page-shell {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 0 48px;
}
.writing-page-back {
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--dash-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
}
.writing-page-back:hover {
  color: var(--w-primary);
}

.writing-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1000px) {
  .writing-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .writing-stat-grid {
    grid-template-columns: 1fr;
  }
}
.writing-stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--w-card-shadow);
}
.writing-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dash-muted);
  margin-bottom: 8px;
}
.writing-stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.writing-stat-of {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
}
.writing-stat-bar {
  margin-top: 12px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.writing-stat-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--w-primary), #a855f7);
  transition: width 0.35s ease;
}
.writing-stat-trend {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}
.writing-stat-trend--up {
  color: #16a34a;
}

.writing-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .writing-mid-grid {
    grid-template-columns: 1fr;
  }
}
.w-panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--w-card-shadow);
}
.w-panel-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.w-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.w-panel-head .w-panel-title {
  margin: 0;
}

.writing-seg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.writing-seg--sm .writing-seg-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
}
.writing-seg--lg .writing-seg-btn {
  padding: 10px 20px;
  font-size: 0.88rem;
}
.writing-seg-btn {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.writing-seg-btn:hover {
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--w-primary-dark);
}
.writing-seg-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--w-primary);
  color: var(--w-primary-dark);
}

.writing-guide-body {
  margin-top: 4px;
}
.writing-guide-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  text-align: left;
  padding: 14px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.writing-guide-row:hover:not(:disabled) {
  border-color: rgba(99, 102, 241, 0.35);
  background: #fff;
}
.writing-guide-row--muted {
  opacity: 0.55;
  cursor: not-allowed;
}
.wgr-main {
  grid-column: 1;
  font-size: 0.88rem;
  color: #0f172a;
}
.wgr-sub {
  grid-column: 1;
  font-size: 0.78rem;
  color: #64748b;
}
.wgr-chev {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.25rem;
  color: #cbd5e1;
}
.writing-guide-hint {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 12px;
}
.writing-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-w-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: var(--w-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-w-primary:hover {
  background: var(--w-primary-dark);
}
.btn-w-secondary {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
  color: var(--w-primary-dark);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn-w-outline {
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  color: #334155;
  cursor: pointer;
}
.btn-w-outline:hover {
  border-color: var(--w-primary);
  color: var(--w-primary-dark);
}
.btn-w-ghost {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  background: transparent;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--w-primary-dark);
  cursor: pointer;
}
.btn-w-ghost--sm {
  padding: 5px 10px;
  font-size: 0.72rem;
}
.btn-w-link {
  border: none;
  background: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--w-primary);
  cursor: pointer;
}
.btn-w-link:hover {
  text-decoration: underline;
}

.writing-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
.writing-recent-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 0.82rem;
  color: #94a3b8;
}
.writing-recent-item {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.writing-recent-item:last-child {
  border-bottom: none;
}
.wri-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.wri-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}
.wri-band {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--w-primary);
}
.wri-snippet {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wri-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #94a3b8;
}
.wri-status--done {
  color: #16a34a;
  font-weight: 700;
}
.wri-status--prog {
  color: #d97706;
  font-weight: 700;
}

.w-panel--workspace {
  padding: 22px;
  margin-bottom: 20px;
}
.writing-ws-top {
  margin-bottom: 16px;
}
.writing-ws-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.writing-ws-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  flex: 1;
  min-width: 140px;
}
.writing-ws-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 0.88rem;
  color: #475569;
}
.writing-ws-timer strong {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  font-size: 1.05rem;
}
.writing-ws-timer-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.writing-t2-subrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.writing-t2-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.writing-t2-chip:hover {
  border-color: rgba(99, 102, 241, 0.35);
}
.writing-t2-chip.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--w-primary);
  color: var(--w-primary-dark);
}
.writing-t2-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.writing-inline-resources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.25);
}

.writing-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .writing-split {
    grid-template-columns: 1fr;
  }
}
.writing-chart-slot {
  margin-bottom: 14px;
}
.writing-meta-blocks {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.writing-meta-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.writing-meta-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
}
.writing-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: #475569;
}
.writing-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.writing-meta-words {
  margin: 0;
  font-size: 0.88rem;
  color: #334155;
}
.writing-prompt-box {
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #0f172a;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  max-height: 360px;
  overflow-y: auto;
}

.writing-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: #f8fafc;
}
.writing-tb-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: #475569;
}
.writing-tb-btn:hover {
  background: #e2e8f0;
}
.writing-tb-sep {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  align-self: center;
  margin: 0 4px;
}
.writing-editor-area {
  width: 100%;
  min-height: 320px;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  font-family: var(--font);
  resize: vertical;
  background: #fff;
}
.writing-editor-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.writing-wc {
  font-size: 0.82rem;
  color: #64748b;
}
.writing-wc strong {
  color: #0f172a;
}
.writing-editor-footer .btn-w-outline {
  margin-left: auto;
}
.writing-ai-row {
  margin-top: 16px;
}
.writing-ai-panel {
  margin-top: 14px;
}

.w-panel--flash-teaser {
  padding: 20px 22px;
}
.writing-flash-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.writing-flash-copy {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: #64748b;
  max-width: 420px;
}
.writing-flash-stats {
  margin-left: auto;
  text-align: right;
}
.writing-flash-stats span:first-child {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--w-primary);
}
.writing-flash-lbl {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Speaking Part 2: Cue Card Library */
.sp2-lib {
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.65);
  border-radius: 12px;
  padding: 12px;
}
.sp2-lib-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sp2-help {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.sp2-search {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff;
}
.sp2-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Speaking Part 2: user-friendly topic cards grid */
.sp2-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.sp2-topic-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px;
}
.sp2-topic-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.sp2-topic-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.86rem;
  flex: 0 0 34px;
}
.sp2-topic-title {
  font-weight: 900;
  line-height: 1.25;
}
.sp2-topic-preview {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.sp2-topic-actions {
  display: flex;
}
.sp2-topic-select-btn {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 10px 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 900;
  cursor: pointer;
}
.sp2-topic-select-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}
.sp2-cue-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
}
.sp2-cue-card summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--text);
}
.sp2-cue-card summary::-webkit-details-marker {
  display: none;
}
.sp2-summary-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.sp2-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.86rem;
  margin-top: 2px;
  flex: 0 0 34px;
}
.sp2-cue-title {
  font-weight: 900;
}
.sp2-cue-body {
  margin-top: 10px;
}
.sp2-cue-instr {
  margin-bottom: 10px;
}
.sp2-cue-instr-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.sp2-cue-instr ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.sp2-sample {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 10px;
}
.sp2-sample p {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.65;
  font-size: 0.92rem;
}
.sp2-sample p:last-child {
  margin-bottom: 0;
}
.sp2-use-btn {
  margin-top: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 900;
  cursor: pointer;
}
.sp2-use-btn:hover {
  background: rgba(37, 99, 235, 0.14);
}
.sp2-selected {
  margin-top: 2px;
}

/* Speaking Part 1: Topics + sample answers */
.sp1-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  padding: 14px 14px 12px;
  color: var(--text);
}
.sp1-toprow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sp1-badge {
  font-weight: 900;
  color: #3b82f6;
  font-size: 0.95rem;
}
.sp1-meta-title {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 4px;
}
.sp1-select {
  width: min(820px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 0.95rem;
}
.sp1-qwrap {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.85);
  border-radius: 12px;
  padding: 12px;
}
.sp1-qnum {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
}
.sp1-question {
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.3;
}
.sp1-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sp1-btn {
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 10px 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  flex: 1 1 180px;
}
.sp1-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}
.sp1-btn-ghost {
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
}
.sp1-sample {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 12px;
}
.sp1-sample-head {
  font-weight: 900;
  margin-bottom: 8px;
}
.sp1-sample-body {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* Speaking: dashboard (matches reference screenshot) */
.spdash {
  margin: 10px 0 14px;
}
.spdash-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 14px;
  align-items: start;
}
.spdash-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.spdash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.spdash-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.04);
}
.spdash-card--list {
  padding: 12px;
}
.spdash-title {
  font-weight: 900;
  color: var(--text);
}
.spdash-ver {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: 6px;
}
.spdash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.spdash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.spdash-stat {
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(248, 250, 252, 0.85);
  border-radius: 12px;
  padding: 10px;
  min-height: 72px;
}
.spdash-stat-k {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 800;
}
.spdash-stat-v {
  font-size: 1.35rem;
  font-weight: 900;
  margin-top: 6px;
  color: var(--text);
}
.spdash-stat-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 700;
}
.spdash-list-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.spdash-list-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.spdash-link {
  border: none;
  background: none;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}
.spdash-save-btn {
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 900;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.85rem;
}
.spdash-save-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}
.spdash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.spdash-item {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px;
}
.spdash-item-title {
  font-weight: 900;
  color: var(--text);
  font-size: 0.92rem;
}
.spdash-item-sub {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
  font-weight: 700;
}
.spdash-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
.spdash-item-right {
  flex: 0 0 auto;
}
.spdash-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  font-weight: 900;
  font-size: 0.78rem;
  white-space: nowrap;
}
.spdash-kebab {
  border: none;
  background: rgba(248, 250, 252, 0.9);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 900;
  color: var(--muted);
}
.spdash-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 10px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
}
.spdash-notes-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.spdash-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 800;
}
.spdash-notes {
  width: 100%;
  min-height: 118px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  font-size: 0.92rem;
  line-height: 1.55;
  background: #fff;
  color: var(--text);
}
.spdash-keywords-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.spdash-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.spdash-chip {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  color: #475569;
  font-weight: 800;
  cursor: pointer;
}
.spdash-chip:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}
.spdash-tips {
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(167, 243, 208, 0.45), rgba(191, 219, 254, 0.2));
}
.spdash-tips-body {
  margin-top: 10px;
  color: #334155;
  font-weight: 700;
  line-height: 1.5;
}
.spdash-tips-link {
  margin-top: 10px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #2563eb;
  font-weight: 900;
}

@media (max-width: 980px) {
  .spdash-grid {
    grid-template-columns: 1fr;
  }
  .spdash-row {
    grid-template-columns: 1fr;
  }
  .spdash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Speaking Part 2: Cue Card (matches screenshot layout) */
.sp2-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  padding: 14px 14px 12px;
  color: var(--text);
  font-size: 0.95rem;
}
.sp2-card-toprow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.sp2-card-badge {
  font-weight: 900;
  color: #3b82f6;
  font-size: 0.95rem;
}
.sp2-card-main {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.sp2-card-left {
  flex: 1 1 0%;
  min-width: 0;
}
.sp2-cue-title {
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 10px;
}
.sp2-ideas-title {
  font-weight: 900;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.sp2-ideas-panel {
  margin-bottom: 10px;
}
.sp2-ideas-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.sp2-ideas-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.sp2-check {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-weight: 900;
  flex: 0 0 18px;
  font-size: 0.85rem;
  margin-top: 1px;
}
.sp2-prep-hint {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
}
.sp2-prep-line {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 3px;
}
.sp2-prep-line--small {
  margin-bottom: 0;
}
.sp2-clock {
  margin-right: 6px;
}
.sp2-card-right {
  width: 270px;
  flex: 0 0 270px;
  display: flex;
  align-items: stretch;
  height: 260px;
}

/* Ensure the cue card container can grow and fill space in Part 2 mode. */
#screen-speaking.speaking-part2-mode .sp2-card {
  max-width: 100%;
}
.sp2-cue-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.sp2-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Speaking Part 2: student answer + feedback UI */
.sp2-user-area {
  margin-top: 12px;
}
.sp2-user-head {
  font-weight: 900;
  margin-bottom: 6px;
}
.sp2-user-textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  resize: vertical;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}
.sp2-user-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.sp2-submit-btn,
.sp2-improve-btn {
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.1);
}
.sp2-submit-btn {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}
.sp2-improve-btn {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #15803d;
}
.sp2-improve-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.sp2-action-btn {
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 10px 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 900;
  font-size: 0.9rem;
  flex: 1 1 200px;
}
.sp2-action-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}
.sp2-action-ghost {
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
}
.sp2-sample-panel {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 12px;
}
.sp2-sample-panel-head {
  font-weight: 900;
  margin-bottom: 8px;
}
.sp2-sample-panel-body p {
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.65;
  font-size: 0.95rem;
}
.sp2-sample-panel-body p:last-child {
  margin-bottom: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .sp2-card-main {
    flex-direction: column;
  }
  .sp2-card-right {
    width: 100%;
    flex: 0 0 auto;
    height: 190px;
  }
}

/* Speaking: widen the whole speaking panel (Part 1/2/3). */
#screen-speaking .sub-screen {
  max-width: 1320px !important; /* align with .main max-width */
  width: 100% !important;
  margin: 0 auto !important;
  padding: 28px 22px;
}

/* Teacher view mode: "My students" hides own practice strip until a student is selected (dashboard moves to teacher slot). */
body.ielts-teacher-students:not(.ielts-teacher-student-slot-active) #screen-dashboard > section.tools-home,
body.ielts-teacher-students:not(.ielts-teacher-student-slot-active) #studentDashboardHomeSlot {
  display: none !important;
}

/* Teacher "My practice": hide student selector, roster, promos, essays queue — toggle stays visible */
body.ielts-teacher-practice #teacherStudentsPanel {
  display: none !important;
}

