:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --text: #17191c;
  --muted: #6b7078;
  --muted-2: #9197a0;
  --border: #e2e5e9;
  --border-strong: #cfd4da;
  --accent: #176b55;
  --accent-soft: #e9f4f0;
  --accent-hover: #115845;
  --danger: #b33a3a;
  --danger-soft: #fff0ef;
  --warning: #8a5a13;
  --warning-soft: #fff4dc;
  --success: #216e4e;
  --success-soft: #e8f5ee;
  --shadow: 0 1px 2px rgba(18, 24, 32, .04), 0 8px 24px rgba(18, 24, 32, .04);
  --radius: 12px;
  --radius-small: 8px;
  --max-width: 1240px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 85, .18);
  outline-offset: 1px;
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app { min-height: 100dvh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.brand-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--text);
  color: #fff;
  font-weight: 750;
}
.brand-copy { display: grid; text-align: left; line-height: 1.15; }
.brand-copy strong { font-size: 14px; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.primary-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.nav-link:hover { background: var(--surface-subtle); color: var(--text); }
.nav-link.is-active { background: #eff1f3; color: var(--text); font-weight: 650; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.save-indicator { color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.save-indicator.is-saving { color: var(--warning); }

.button, .icon-button, .back-link, .add-block-button {
  border: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.button:active, .icon-button:active, .add-block-button:active { transform: translateY(1px); }
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.button-secondary:hover { background: var(--surface-subtle); }
.button-danger { background: var(--danger); color: #fff; }
.button-small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.icon-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.icon-button:hover { background: #eef0f2; color: var(--text); }
.icon-button.danger:hover { background: var(--danger-soft); color: var(--danger); }

.main { width: 100%; }
.route { display: none; }
.route.is-visible { display: block; }
.route:not(.editor-route) {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0 72px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}
.caption {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.page-heading h1, .editor-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.page-heading p:not(.caption) { max-width: 620px; margin: 9px 0 0; color: var(--muted); line-height: 1.6; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.summary-strip > div { padding: 20px 22px; border-right: 1px solid var(--border); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .metric-card span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.summary-strip strong { font-size: 25px; letter-spacing: -.03em; }
.records-panel, .analysis-panel, .metric-card, .form-card, .prompt-card, .reading-block, .question-card, .custom-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.records-panel { overflow: hidden; }
.toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-field { flex: 1; }
.search-field input, .compact-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.search-field input { padding: 0 12px; }
.search-field input::placeholder { color: #a2a7ae; }
.compact-field { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.compact-field select { min-width: 92px; padding: 0 28px 0 10px; }
.record-table-wrap { min-height: 240px; overflow-x: auto; }
.record-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.record-table th {
  padding: 12px 18px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}
.record-table td { padding: 15px 18px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.record-table tbody tr:last-child td { border-bottom: 0; }
.record-table tbody tr:hover { background: #fbfcfc; }
.record-name-button {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.record-name-button strong { font-size: 14px; }
.record-name-button small { color: var(--muted); font-size: 11px; }
.record-score { font-weight: 700; }
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.status-chip.is-complete { background: var(--success-soft); color: var(--success); }
.status-chip.is-progress { background: var(--warning-soft); color: var(--warning); }
.status-chip.is-empty { background: #eef0f2; color: var(--muted); }
.row-action { text-align: right; }
.row-open-button { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 650; cursor: pointer; }
.empty-state { padding: 64px 24px; text-align: center; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.empty-state h2 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }

.analytics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.metric-card { min-height: 132px; padding: 20px; }
.metric-card strong { display: block; margin-bottom: 7px; font-size: 29px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted-2); font-size: 11px; }
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 14px; margin-bottom: 14px; }
.analysis-panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading span { color: var(--muted); font-size: 11px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 18px; }
.score-trend { min-height: 270px; }
.chart-empty { min-height: 240px; display: grid; place-content: center; gap: 6px; color: var(--muted); text-align: center; }
.chart-empty strong { color: var(--text); font-size: 14px; }
.chart-wrap { position: relative; height: 270px; }
.chart-wrap svg { width: 100%; height: 230px; overflow: visible; }
.chart-grid { stroke: #eceef1; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.chart-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.error-breakdown { display: grid; gap: 14px; }
.error-item { display: grid; grid-template-columns: 86px minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: 12px; }
.error-track { height: 8px; border-radius: 999px; background: #eef0f2; overflow: hidden; }
.error-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.error-item strong { text-align: right; }
.section-performance { display: grid; gap: 12px; }
.performance-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 16px; }
.performance-row > span { font-size: 13px; font-weight: 650; }
.performance-bars { display: grid; gap: 5px; }
.performance-track { height: 7px; border-radius: 999px; background: #eef0f2; overflow: hidden; }
.performance-track i { display: block; height: 100%; border-radius: inherit; }
.performance-track.actual i { background: var(--accent); }
.performance-track.target i { background: #aeb5bd; }
.performance-numbers { display: grid; min-width: 74px; text-align: right; font-size: 11px; color: var(--muted); }

.editor-route { min-height: calc(100dvh - 68px); background: var(--surface); }
.editor-header {
  position: sticky;
  top: 68px;
  z-index: 30;
  padding: 18px 32px 0;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.back-link { padding: 0; background: transparent; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--text); }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 13px; padding-bottom: 16px; }
.editor-heading h1 { font-size: clamp(23px, 3vw, 31px); }
.editor-header-actions { display: flex; align-items: center; gap: 4px; }
.editor-progress { height: 3px; margin: 0 -32px; background: #edf0f2; }
.editor-progress i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
.editor-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; min-height: calc(100dvh - 169px); }
.task-sidebar {
  position: sticky;
  top: 169px;
  height: calc(100dvh - 169px);
  padding: 28px 20px;
  background: var(--surface-subtle);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.task-summary { display: flex; align-items: baseline; justify-content: space-between; padding: 0 8px 16px; }
.task-summary span { color: var(--muted); font-size: 11px; }
.task-summary strong { font-size: 18px; }
.task-list { display: grid; gap: 5px; }
.task-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.task-button:hover { background: #eceff1; }
.task-button.is-active { background: var(--surface); box-shadow: 0 1px 2px rgba(18,24,32,.07); }
.task-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e7eaed; color: var(--muted); font-size: 11px; font-weight: 700; }
.task-button.is-active .task-number { background: var(--accent); color: #fff; }
.task-copy { display: grid; gap: 3px; min-width: 0; }
.task-copy strong { font-size: 12px; }
.task-copy small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #cfd4d9; }
.task-status-dot.is-progress { background: #d9992f; }
.task-status-dot.is-complete { background: var(--accent); }
.editor-main { width: min(930px, calc(100% - 48px)); margin: 0 auto; padding: 46px 0 110px; }
.task-panel { display: none; }
.task-panel.is-visible { display: block; }
.task-panel-heading { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; margin-bottom: 24px; }
.task-panel-heading > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; }
.task-panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.task-panel-heading p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }
.form-card { padding: 22px; margin-bottom: 16px; }
.field-grid { display: grid; gap: 16px; }
.field-grid.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; }
.field > span, .prompt-card > span { font-size: 12px; font-weight: 650; }
.field > small, .prompt-card > small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.field input, .field select, .field textarea, .question-card input, .question-card textarea, .question-card select, .score-part input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.field input, .field select, .question-card input, .question-card select, .score-part input { min-height: 40px; padding: 0 11px; }
.field textarea, .question-card textarea { min-height: 100px; padding: 10px 11px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder, .question-card textarea::placeholder { color: #a3a9b0; }
.form-card > .field + .field { margin-top: 16px; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 30px 0 12px; }
.section-heading-row h3 { margin: 0; font-size: 16px; }
.section-heading-row p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.score-parts { display: grid; gap: 8px; }
.score-part {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) repeat(3, minmax(100px, .75fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.score-part label { display: grid; gap: 5px; }
.score-part label span { color: var(--muted); font-size: 10px; }
.score-part input.fixed-target-input { border-color: #c9ddd4; background: #eef7f3; color: var(--accent); font-weight: 750; cursor: default; }
.remove-button { min-height: 38px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); font-size: 12px; cursor: pointer; }
.remove-button:hover { background: var(--danger-soft); color: var(--danger); }
.score-total { display: flex; justify-content: flex-end; gap: 28px; padding: 16px 4px 0; color: var(--muted); font-size: 12px; }
.score-total strong { margin-left: 5px; color: var(--text); font-size: 15px; }
.prompt-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.prompt-list.single-column { grid-template-columns: 1fr; }
.prompt-card { display: grid; gap: 6px; padding: 20px; }
.prompt-card textarea { width: 100%; min-height: 150px; margin-top: 7px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; resize: vertical; line-height: 1.55; }
.reading-blocks { display: grid; gap: 12px; }
.reading-block { overflow: hidden; }
.reading-block-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 15px 16px; }
.collapse-button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f0f2f4; cursor: pointer; }
.reading-title-input { min-width: 0; height: 36px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-weight: 700; }
.reading-title-input:hover, .reading-title-input:focus { border-color: var(--border-strong); background: var(--surface); }
.reading-count { color: var(--muted); font-size: 11px; }
.reading-block-body { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.reading-block.is-collapsed .reading-block-body { display: none; }
.reading-overall { margin: 16px 0; }
.question-stack { display: grid; gap: 10px; }
.question-card { padding: 15px; box-shadow: none; }
.reading-question-card { padding: 0; overflow: hidden; }
.question-head { display: grid; grid-template-columns: 86px auto 1fr auto; align-items: center; gap: 10px; }
.word-template-question-head { grid-template-columns: 92px auto 1fr auto; padding: 16px; border-bottom: 1px solid var(--border); background: #fbfcfc; }
.status-with-label { display: grid; gap: 5px; }
.status-with-label > span { color: var(--muted); font-size: 10px; }
.word-template-badge { justify-self: start; padding: 6px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }
.round-review { padding: 18px; }
.round-review + .round-review { border-top: 1px solid var(--border); }
.first-round-review { background: #fff; }
.second-round-review { background: #f8faf9; }
.round-review > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.round-review > header span { font-size: 15px; font-weight: 800; }
.round-review > header small { color: var(--muted); font-size: 11px; }
.round-review-grid { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 12px; }
.round-review-grid .field.is-wide { grid-column: 1 / -1; }
.round-review-grid textarea { min-height: 82px; }
.question-number { display: grid; gap: 4px; }
.question-number span { color: var(--muted); font-size: 10px; }
.question-status { display: inline-flex; padding: 3px; border-radius: 8px; background: #f0f2f4; }
.status-button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.status-button.is-active[data-value="对"] { background: var(--success-soft); color: var(--success); font-weight: 700; }
.status-button.is-active[data-value="错"] { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.status-button.is-active[data-value=""] { background: var(--surface); color: var(--text); }
.error-type-field { max-width: 170px; }
.question-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.question-details[hidden] { display: none !important; }
.question-details textarea { min-height: 92px; }
.question-card.translation-card .question-details { grid-template-columns: 1fr; }
.add-block-button { width: 100%; min-height: 48px; margin-top: 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 650; }
.add-block-button:hover { background: var(--accent-soft); border-color: var(--accent); }
.stack-card { display: grid; gap: 18px; }
.custom-heading { margin-top: 36px; }
.custom-sections { display: grid; gap: 10px; }
.custom-card { padding: 16px; box-shadow: none; }
.custom-card-header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; }
.custom-title { height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; font-weight: 650; }
.custom-card textarea { width: 100%; min-height: 130px; padding: 11px; border: 1px solid var(--border-strong); border-radius: 8px; resize: vertical; line-height: 1.55; }
.task-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 270px;
  z-index: 25;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px max(24px, calc((100vw - 270px - 930px) / 2));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.task-footer > div { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 11px; }
.task-footer > div small { color: var(--muted-2); font-size: 10px; }

.dialog {
  width: min(620px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(16, 21, 28, .22);
}
.dialog::backdrop { background: rgba(22, 27, 34, .42); backdrop-filter: blur(2px); }
.dialog form { padding: 26px; }
.dialog header span { color: var(--accent); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.dialog header h2 { margin: 6px 0; font-size: 23px; }
.dialog header p { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.confirm-dialog { width: min(460px, calc(100% - 32px)); }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 360px;
  padding: 12px 15px;
  border-radius: 9px;
  background: #24282d;
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #7e2929; }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 20px; }
  .primary-nav { justify-self: center; }
  .save-indicator#globalSaveStatus { display: none; }
  .summary-strip, .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-strip > div:nth-child(2) { border-right: 0; }
  .summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .analysis-layout { grid-template-columns: 1fr; }
  .field-grid.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-part { grid-template-columns: minmax(130px, 1.4fr) repeat(3, minmax(90px, .8fr)) auto; }
}

@media (max-width: 780px) {
  .topbar { height: auto; min-height: 62px; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 14px; }
  .brand-copy small, .topbar-actions .button-secondary { display: none; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: stretch; }
  .nav-link { flex: 1; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .route:not(.editor-route) { width: min(100% - 28px, var(--max-width)); padding: 30px 0 54px; }
  .page-heading { align-items: start; }
  .desktop-only { display: none; }
  .summary-strip, .analytics-grid { grid-template-columns: 1fr 1fr; }
  .summary-strip > div { padding: 16px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .compact-field { flex: 1; }
  .compact-field select { min-width: 0; }
  .editor-header { top: 106px; padding: 14px 16px 0; }
  .editor-progress { margin: 0 -16px; }
  .editor-heading { align-items: flex-start; }
  .editor-header-actions .save-indicator { display: none; }
  .editor-shell { display: block; }
  .task-sidebar {
    position: sticky;
    top: 207px;
    z-index: 22;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .task-summary { display: none; }
  .task-list { display: flex; min-width: max-content; }
  .task-button { width: auto; grid-template-columns: 24px 1fr; min-height: 46px; padding: 7px 10px; }
  .task-number { width: 24px; height: 24px; }
  .task-copy small, .task-status-dot { display: none; }
  .editor-main { width: min(100% - 28px, 760px); padding: 30px 0 100px; }
  .field-grid.four-columns, .field-grid.two-columns, .prompt-list { grid-template-columns: 1fr; }
  .score-part { grid-template-columns: 1fr 1fr; }
  .score-part > label:first-child { grid-column: 1 / -1; }
  .score-part .remove-button { align-self: end; }
  .question-head { grid-template-columns: 72px 1fr auto; }
  .word-template-question-head { grid-template-columns: 72px 1fr auto; }
  .word-template-badge { grid-column: 1 / -1; }
  .round-review-grid { grid-template-columns: 1fr; }
  .round-review-grid .field.is-wide { grid-column: auto; }
  .error-type-field { grid-column: 1 / -1; max-width: none; }
  .question-details { grid-template-columns: 1fr; }
  .reading-block-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .reading-count { display: none; }
  .task-footer { left: 0; min-height: 66px; padding: 10px 14px; }
}

@media (max-width: 520px) {
  .brand-mark { width: 32px; height: 32px; }
  .topbar-actions .button-primary { min-height: 34px; padding: 0 10px; }
  .summary-strip, .analytics-grid { grid-template-columns: 1fr; }
  .summary-strip > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .summary-strip > div:last-child { border-bottom: 0; }
  .page-heading h1 { font-size: 28px; }
  .page-heading p:not(.caption) { font-size: 13px; }
  .record-table-wrap { overflow: visible; }
  .record-table { min-width: 0; }
  .record-table thead { display: none; }
  .record-table, .record-table tbody, .record-table tr, .record-table td { display: block; width: 100%; }
  .record-table tr { position: relative; padding: 16px; border-bottom: 1px solid var(--border); }
  .record-table td { padding: 3px 0; border: 0; }
  .record-table td:nth-child(2), .record-table td:nth-child(4), .record-table td:nth-child(6) { display: inline; margin-right: 14px; color: var(--muted); font-size: 11px; }
  .record-table td:nth-child(3) { position: absolute; top: 16px; right: 16px; font-size: 17px; }
  .record-table td:nth-child(5) { margin-top: 10px; }
  .record-table td:last-child { position: absolute; right: 16px; bottom: 16px; }
  .analysis-panel, .metric-card { padding: 17px; }
  .performance-row { grid-template-columns: 90px 1fr; }
  .performance-numbers { grid-column: 2; grid-row: 2; text-align: left; grid-auto-flow: column; justify-content: start; gap: 10px; }
  .editor-header { top: 106px; }
  .editor-heading { display: block; }
  .editor-header-actions { margin-top: 10px; }
  .task-sidebar { top: 228px; }
  .task-panel-heading { grid-template-columns: 36px 1fr; }
  .task-panel-heading > span { width: 36px; height: 36px; }
  .form-card, .prompt-card { padding: 16px; }
  .score-part { grid-template-columns: 1fr 1fr; }
  .score-part label:nth-of-type(4) { grid-column: 1 / 2; }
  .score-total { justify-content: space-between; gap: 10px; }
  .reading-block-header { padding: 12px; }
  .reading-block-body { padding: 0 12px 12px; }
  .question-card { padding: 12px; }
  .question-head { grid-template-columns: 66px 1fr auto; }
  .task-footer > div { display: none; }
  .task-footer { grid-template-columns: 1fr 1fr; }
  .task-footer .button { width: 100%; }
  .dialog form { padding: 20px; }
}

@media print {
  body { background: #fff; }
  .topbar, .task-sidebar, .task-footer, .editor-header-actions, .back-link, .add-block-button, .section-heading-row .button, .remove-button, .collapse-button { display: none !important; }
  .editor-route, .route { display: block !important; }
  #recordsRoute, #analyticsRoute { display: none !important; }
  .editor-header { position: static; padding: 0 0 16px; border-bottom: 1px solid #bbb; }
  .editor-progress { display: none; }
  .editor-shell { display: block; }
  .editor-main { width: 100%; padding: 22px 0; }
  .task-panel { display: block !important; break-before: page; }
  .task-panel:first-child { break-before: auto; }
  .form-card, .prompt-card, .reading-block, .question-card, .custom-card { box-shadow: none; break-inside: avoid; }
  .reading-block.is-collapsed .reading-block-body { display: block; }
  input, textarea, select { border-color: #bbb !important; }
}
