:root {
  color-scheme: light;
  --page: #f4f6f1;
  --surface: #fffef9;
  --surface-muted: #e9eee8;
  --surface-soft: #f8faf4;
  --ink: #161b17;
  --muted: #687466;
  --muted-strong: #3f4b42;
  --line: #d8dfd5;
  --line-strong: #b8c4b5;
  --green: #19785b;
  --green-soft: #dff1e7;
  --blue: #2457c7;
  --blue-soft: #e3ebff;
  --red: #c3454d;
  --red-soft: #f8e0e2;
  --yellow-soft: #ffe9a8;
  --amber: #b96624;
  --amber-soft: #fff0d7;
  --sidebar: #17231d;
  --sidebar-soft: #22342b;
  --sidebar-ink: #fbfff8;
  --sidebar-muted: #aec2b1;
  --shadow: 0 18px 42px rgba(30, 43, 32, 0.1);
  --shadow-tight: 0 8px 18px rgba(30, 43, 32, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --sans: "Avenir Next", "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Iowan Old Style", "Songti SC", "STSong", Georgia, serif;
  --mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(25, 120, 91, 0.08), transparent 24%, transparent 74%, rgba(185, 102, 36, 0.06)),
    linear-gradient(rgba(22, 27, 23, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 27, 23, 0.035) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(255, 254, 249, 0.55) 0, rgba(255, 254, 249, 0.55) 1px, transparent 1px, transparent 6px),
    var(--page);
  background-size: auto, 32px 32px, 32px 32px, auto, auto;
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 196, 87, 0.48);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(36, 87, 199, 0.24);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.app-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 254, 249, 0.055), transparent 16%),
    linear-gradient(180deg, var(--sidebar), #20342a 54%, #121d18);
  color: var(--sidebar-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 28px rgba(23, 35, 29, 0.12);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #fffdf4 0 48%, #f6b85a 48% 54%, #dff1e7 54%);
  color: var(--sidebar);
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.brand strong,
.brand small,
.sidebar-block span,
.stat-tile span {
  display: block;
}

.brand strong {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.1;
}

.brand small,
.sidebar-block span {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 6px;
}

.nav-button,
.segment,
.secondary-action,
.primary-action,
.list-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.nav-button {
  width: 100%;
  padding: 0 12px 0 14px;
  text-align: left;
  background: transparent;
  color: var(--sidebar-muted);
  font-weight: 750;
  position: relative;
}

.nav-button:hover,
.nav-button.is-active {
  background: var(--sidebar-soft);
  color: var(--sidebar-ink);
}

.nav-button.is-active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #f6b85a;
}

.sidebar-block,
.practice-panel,
.info-panel,
.table-panel,
.settings-panel,
.deploy-panel,
.stat-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.sidebar-block {
  padding: 14px;
  background: rgba(255, 254, 249, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.sidebar-block .label {
  color: var(--sidebar-muted);
}

.goal-meter {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
}

.goal-ring {
  --goal: 0%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--sidebar) 57%, transparent 58%),
    conic-gradient(#72d7a8 var(--goal), rgba(255, 255, 255, 0.13) 0);
  color: var(--sidebar-ink);
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.deck-picker {
  min-width: 0;
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.deck-picker select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--sidebar-ink);
  background: var(--sidebar-soft);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
}

.deck-note {
  margin: 10px 0 0;
  color: var(--sidebar-muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.workspace-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(420px, 620px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.workspace-header h1,
.practice-panel h2,
.table-panel h2,
.settings-panel h2,
.deploy-panel h2 {
  margin: 0;
}

.workspace-header h1 {
  font-family: var(--display);
  font-size: 52px;
  line-height: 1;
  font-weight: 760;
}

.workspace-intro {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted-strong);
  line-height: 1.7;
}

.quick-stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-tile {
  min-width: 0;
  min-height: 76px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber));
}

.stat-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-tile strong {
  display: block;
  margin-top: 7px;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.practice-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.practice-panel,
.table-panel,
.settings-panel,
.deploy-panel {
  min-width: 0;
  padding: 20px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 254, 249, 0.98)),
    var(--surface);
}

.practice-panel {
  position: relative;
  overflow: hidden;
}

.practice-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--amber) 48%, var(--blue));
}

.practice-panel > * {
  position: relative;
}

.panel-toolbar,
.panel-heading,
.toolbar-row,
.word-meta,
.phonetic-row,
.library-toolbar {
  display: flex;
  align-items: center;
}

.panel-toolbar,
.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: #dfe7df;
  border: 1px solid rgba(184, 196, 181, 0.62);
}

.segment {
  background: transparent;
  color: var(--muted-strong);
  font-weight: 750;
}

.segment.is-active {
  background: var(--surface);
  color: var(--blue);
  border-color: var(--line);
  box-shadow: var(--shadow-tight);
}

.status-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill[data-status="ready"] {
  background: var(--surface-muted);
}

.status-pill[data-status="typing"] {
  color: #5d4307;
  background: var(--amber-soft);
  border-color: rgba(185, 102, 36, 0.28);
}

.status-pill[data-status="check"],
.status-pill[data-status="typo"] {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(195, 69, 77, 0.28);
}

.status-pill[data-status="done"] {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(25, 120, 91, 0.28);
}

.word-meta {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.word-panel h2 {
  font-size: 64px;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.target-word {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 74px;
  line-height: 1.05;
  overflow-wrap: anywhere;
  color: #101612;
}

.target-word.is-masked {
  color: var(--muted);
  font-size: 54px;
}

.mode-description {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--muted-strong);
  line-height: 1.5;
}

.phonetic-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: 8px 0 12px;
}

.practice-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.overview-tile {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 244, 0.94)),
    var(--surface);
}

.overview-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

.phonetic {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
}

.word-sound-actions {
  display: flex;
  gap: 8px;
}

.word-stage {
  min-height: 126px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(0deg, rgba(22, 27, 23, 0.025) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 100% 32px;
}

.word-stage span {
  min-width: 32px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
}

.word-stage .correct {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(35, 113, 90, 0.24);
}

.word-stage .active {
  color: #6d4602;
  background: var(--yellow-soft);
  border-color: rgba(185, 102, 36, 0.26);
  box-shadow: 0 0 0 3px rgba(185, 102, 36, 0.08);
}

.word-stage .pending {
  color: #a5b0bd;
}

.word-stage .wrong {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(199, 60, 74, 0.25);
}

.answer-progress {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #dfe7df;
  overflow: hidden;
}

.answer-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.answer-progress span[data-state="error"] {
  background: var(--red);
}

.answer-progress span[data-state="complete"] {
  background: linear-gradient(90deg, var(--green), #5fbf77);
}

.word-stage .stage-message {
  min-width: auto;
  width: 100%;
  height: auto;
  padding: 10px 0;
  border: 0;
  background: transparent;
  place-items: start;
  color: var(--muted);
}

.word-input,
textarea,
.library-search {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.word-input {
  height: 54px;
  margin-top: 12px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 20px;
  box-shadow: 0 3px 0 rgba(25, 120, 91, 0.07);
}

textarea {
  min-height: 190px;
  margin-top: 14px;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

.library-search {
  min-height: 42px;
  padding: 0 12px;
}

.word-input::placeholder,
textarea::placeholder,
.library-search::placeholder {
  color: #9aa6b4;
}

.word-input:focus,
textarea:focus,
.library-search:focus {
  border-color: var(--blue);
}

.word-input[readonly] {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(25, 120, 91, 0.24);
}

.word-meaning-block,
.word-detail-block {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
}

.word-meaning-block .meaning,
.word-detail-text {
  color: var(--muted-strong);
}

.word-detail-text {
  margin: 0;
  line-height: 1.65;
}

.toolbar-row {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.primary-action,
.secondary-action {
  padding: 0 14px;
  font-weight: 820;
}

.primary-action {
  background: linear-gradient(180deg, #2b63de, var(--blue));
  color: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 10px 22px rgba(36, 87, 199, 0.18);
}

.primary-action:hover {
  background: linear-gradient(180deg, #2457c7, #1d479f);
}

.secondary-action {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.secondary-action:hover,
.list-button:hover {
  background: var(--surface-muted);
}

.primary-action:hover,
.secondary-action:hover,
.list-button:hover {
  transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled,
.list-button:disabled {
  cursor: not-allowed;
  color: #8b9689;
  background: #edf1ea;
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.secondary-action.compact {
  min-height: 34px;
  padding: 0 10px;
}

.secondary-action.danger {
  color: var(--red);
  border-color: rgba(199, 60, 74, 0.35);
}

.practice-note {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.practice-note.is-success {
  color: var(--green);
  font-weight: 750;
}

.practice-note.is-error {
  color: var(--red);
  font-weight: 750;
}

.section-note {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.inspector {
  display: grid;
  gap: 10px;
}

.info-panel {
  padding: 14px;
  box-shadow: var(--shadow-tight);
}

.label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meaning,
.info-panel p {
  margin: 0;
  line-height: 1.65;
}

.meaning p + p {
  margin-top: 7px;
}

.meaning-line strong {
  color: var(--ink);
}

.example-list,
.article-list,
.word-table,
.queue-list {
  display: grid;
  gap: 8px;
}

.example-list p,
.queue-item {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  line-height: 1.55;
}

.example-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 244, 0.96)),
    var(--surface-soft);
  border: 1px solid var(--line);
}

.example-en {
  margin: 0 0 6px;
  color: var(--ink);
  line-height: 1.55;
}

.example-zh,
.empty-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.queue-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  transition:
    border-color 140ms ease,
    background-color 140ms ease;
}

.queue-item strong {
  font-family: var(--mono);
}

.queue-item:hover {
  border-color: rgba(36, 87, 199, 0.26);
  background: var(--blue-soft);
}

.article-prompt,
.article-answer {
  margin: 10px 0 0;
  line-height: 1.7;
}

.article-answer {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: #243d70;
}

.accuracy-track {
  height: 10px;
  margin-top: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  overflow: hidden;
}

.accuracy-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
  transition: width 160ms ease;
}

.list-button {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  text-align: left;
}

.list-button.is-active {
  background: var(--blue-soft);
  border-color: rgba(49, 95, 210, 0.32);
}

.library-toolbar {
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.library-mode-toggle,
.word-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.library-mode-button.is-active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(49, 95, 210, 0.32);
}

.library-toolbar .library-search {
  flex: 1 1 260px;
}

.word-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 254, 249, 0.98)),
    var(--surface);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.word-row.is-vocabulary {
  border-color: rgba(49, 95, 210, 0.28);
  background: linear-gradient(180deg, rgba(228, 236, 255, 0.42), #ffffff);
}

.word-row:hover {
  border-color: rgba(36, 87, 199, 0.26);
  box-shadow: var(--shadow-tight);
  transform: translateY(-1px);
}

.word-row strong {
  font-family: var(--mono);
}

.word-primary {
  display: grid;
  gap: 4px;
}

.word-primary small {
  color: var(--muted);
  line-height: 1.4;
}

.word-row span,
.library-note,
.deploy-panel li,
.settings-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.word-row-empty {
  grid-template-columns: 1fr;
}

.settings-grid,
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.range-control,
.toggle-row,
.select-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.range-control {
  grid-template-columns: 1fr auto;
}

.range-control input {
  grid-column: 1 / -1;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.select-row select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

input[type="checkbox"] {
  width: 42px;
  height: 24px;
  accent-color: var(--blue);
}

input[type="range"] {
  accent-color: var(--blue);
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: var(--radius);
  background: #111827;
  color: #eff6ff;
}

code {
  font-family: var(--mono);
}

.deploy-panel ol {
  margin: 0;
  padding-left: 20px;
}

.seo-strip,
.content-band,
.faq-band,
.guide-section {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 254, 249, 0.98)),
    var(--surface);
  box-shadow: var(--shadow-tight);
}

.seo-strip-header,
.content-band {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.seo-strip-header {
  margin-bottom: 14px;
}

.seo-grid,
.faq-list,
.guide-link-grid {
  display: grid;
  gap: 12px;
}

.seo-grid,
.guide-link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.seo-card-link,
.guide-link-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  text-decoration: none;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.seo-card-link:hover,
.guide-link-card:hover,
.mini-link-list a:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 87, 199, 0.28);
  box-shadow: var(--shadow-tight);
}

.seo-card-kicker,
.guide-card-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.seo-card-link strong,
.guide-link-card strong {
  font-size: 19px;
  line-height: 1.35;
}

.seo-card-link span:last-child,
.guide-link-card span:last-child,
.mini-link-list a,
.guide-summary,
.guide-section p,
.guide-section li,
.content-band-copy p,
.content-band-aside p,
.faq-item p {
  color: var(--muted-strong);
  line-height: 1.7;
}

.content-band-copy,
.content-band-aside {
  min-width: 0;
}

.plain-list,
.guide-bullet-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.plain-list li + li,
.guide-bullet-list li + li {
  margin-top: 8px;
}

.mini-link-list {
  display: grid;
  gap: 10px;
}

.mini-link-list a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  text-decoration: none;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.faq-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.faq-item h3,
.guide-section h2,
.guide-section h3,
.guide-hero h1 {
  margin: 0;
}

.faq-item h3 {
  font-size: 20px;
  line-height: 1.3;
}

.faq-item p {
  margin: 8px 0 0;
}

.guide-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 22px 46px;
}

.guide-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 18px;
}

.guide-topbar a {
  color: var(--muted-strong);
  text-decoration: none;
}

.guide-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.guide-hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 241, 231, 0.85), rgba(255, 240, 215, 0.88) 48%, rgba(227, 235, 255, 0.9)),
    var(--surface);
  box-shadow: var(--shadow);
}

.guide-hero h1 {
  font-family: var(--display);
  font-size: 50px;
  line-height: 1.05;
}

.guide-hero p {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted-strong);
  line-height: 1.8;
}

.guide-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.guide-meta-grid,
.guide-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.guide-meta-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.guide-meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.35;
}

.guide-section + .guide-section {
  margin-top: 18px;
}

.guide-section h2 {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.15;
}

.guide-section h3 {
  font-size: 22px;
  line-height: 1.3;
}

.guide-section p {
  margin: 10px 0 0;
}

.guide-section-grid {
  margin-top: 14px;
}

.guide-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #5f4214;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: 50vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr) repeat(2, minmax(180px, 0.7fr));
    align-items: stretch;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button {
    text-align: center;
  }

  .workspace-header,
  .practice-layout,
  .settings-grid,
  .deploy-grid,
  .seo-strip-header,
  .content-band,
  .guide-meta-grid,
  .guide-section-grid {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .seo-grid,
  .guide-link-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .brand,
  .nav-stack {
    grid-column: 1 / -1;
  }

  .brand {
    min-height: 42px;
  }

  .brand small,
  .deck-note {
    display: none;
  }

  .sidebar-block {
    padding: 10px;
  }

  .goal-meter {
    grid-template-columns: 48px 1fr;
    gap: 9px;
  }

  .goal-ring {
    width: 46px;
    height: 46px;
    font-size: 12px;
  }

  .nav-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button {
    padding: 0 6px;
  }

  .workspace-header h1 {
    font-size: 2.1rem;
  }

  .workspace-intro {
    font-size: 14px;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .target-word {
    font-size: 2.8rem;
  }

  .target-word.is-masked {
    font-size: 2.45rem;
  }

  .practice-overview {
    grid-template-columns: 1fr;
  }

  .word-stage {
    min-height: 104px;
    padding: 12px;
  }

  .word-stage span {
    min-width: 25px;
    height: 42px;
    padding: 0 4px;
    font-size: 21px;
  }

  .word-row {
    grid-template-columns: 1fr;
  }

  .guide-shell {
    padding: 18px 14px 28px;
  }

  .guide-hero {
    padding: 20px;
  }

  .guide-hero h1 {
    font-size: 36px;
  }

  .toolbar-row > * {
    flex: 1 1 126px;
  }
}

@media (max-width: 540px) {
  .practice-panel,
  .table-panel,
  .settings-panel,
  .deploy-panel,
  .stat-tile,
  .info-panel {
    padding: 14px;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-toolbar,
  .word-meta,
  .phonetic-row,
  .library-toolbar {
    display: grid;
  }

  .segmented-control {
    width: 100%;
  }

  .word-input {
    font-size: 18px;
  }
}

/* ── Dictation module ── */

.dictation-hint {
  margin: 4px 0 12px;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.55;
}

.dictation-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dictation-controls .select-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-strong);
}

.dictation-controls .select-row select {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}

.dictation-diff {
  min-height: 0;
  padding: 14px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  line-height: 2;
  font-size: 15px;
}

.dictation-diff:empty {
  display: none;
}

.diff-word {
  display: inline;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 14px;
}

.diff-word.correct {
  color: var(--green);
  background: var(--green-soft);
}

.diff-word.wrong {
  color: var(--red);
  background: var(--red-soft);
  text-decoration: line-through;
  position: relative;
}

.diff-fix {
  display: inline;
  margin-left: 4px;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
}

.diff-word.missing {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line-strong);
  opacity: 0.7;
}

.diff-word.extra {
  color: var(--amber);
  background: var(--amber-soft);
  text-decoration: line-through;
}

.dictation-reveal {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
