:root {
  --bg: #eef7fb;
  --paper: #fffef9;
  --paper-soft: #f7f4eb;
  --ink: #34312c;
  --muted: #77736a;
  --line: #e6dfd1;
  --line-strong: #d2c8b8;
  --accent: #638b82;
  --accent-ink: #ffffff;
  --accent-soft: #e3efeb;
  --gold: #b89c50;
  --rose: #b27076;
  --blue: #9ebbc4;
  --leaf: #a9ba8e;
  --warn: #7b5c32;
  --danger: #9a4a4a;
  --shadow: 0 18px 40px rgba(64, 57, 45, 0.06);
  --radius: 8px;
  font-family: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.7;
  letter-spacing: 0;
}

.ambient-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-decor span {
  position: absolute;
  display: block;
  opacity: 0.38;
}

.ambient-decor .paper {
  width: 30px;
  height: 38px;
  border: 1px solid rgba(112, 139, 142, 0.18);
  background: rgba(243, 248, 247, 0.8);
  box-shadow: 8px 10px 0 rgba(142, 177, 184, 0.10);
}

.ambient-decor .card {
  width: 42px;
  height: 30px;
  border: 1px solid rgba(184, 156, 80, 0.18);
  background: rgba(255, 248, 225, 0.75);
  transform: rotate(12deg);
}

.ambient-decor .leaf {
  width: 34px;
  height: 15px;
  border-radius: 80% 10% 80% 10%;
  background: rgba(151, 177, 126, 0.55);
}

.p1 { left: 7%; top: 18%; transform: rotate(-26deg); }
.p2 { right: 15%; top: 11%; transform: rotate(18deg); }
.p3 { left: 48%; top: 7%; transform: rotate(45deg); opacity: 0.22 !important; }
.c1 { left: 14%; top: 72%; }
.c2 { right: 9%; top: 48%; transform: rotate(-15deg) !important; }
.l1 { right: 19%; top: 5%; transform: rotate(-24deg); }
.l2 { left: 56%; top: 24%; transform: rotate(22deg); opacity: 0.24 !important; }

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

.site-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 76px 0 64px;
}

.brand,
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.brand-link {
  display: inline-block;
  text-decoration: none;
}

.brand-link:hover {
  color: #4f8377;
}


h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.16;
  white-space: nowrap;
}

h2 {
  margin-bottom: 6px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.45;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 700;
}

.lead {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.header-actions,
.result-actions,
.mini-actions,
.build-actions,
.section-editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.header-actions {
  display: grid;
  justify-content: flex-start;
  gap: 10px;
}

.header-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 260px));
  gap: 10px;
  align-items: center;
}

.header-action-button {
  width: 260px;
  min-width: 260px;
  text-align: center;
}

.primary-button.create-action {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(99, 139, 130, 0.16);
}

.primary-button.create-action:hover { background: #527b73; }

.primary-button.take-action {
  background: #5f7fa4;
  color: #fffef9;
  box-shadow: 0 8px 20px rgba(95, 127, 164, 0.16);
}

.primary-button.take-action:hover { background: #506f93; }

.ghost-button.create-last-action {
  border-color: rgba(99, 139, 130, 0.24);
  background: rgba(227, 239, 235, 0.88);
  color: #4f766d;
}

.ghost-button.create-last-action:hover {
  border-color: rgba(99, 139, 130, 0.40);
  background: rgba(216, 234, 228, 0.96);
}

.ghost-button.take-last-action {
  border-color: rgba(95, 127, 164, 0.24);
  background: rgba(231, 238, 247, 0.90);
  color: #4f6f92;
}

.ghost-button.take-last-action:hover {
  border-color: rgba(95, 127, 164, 0.40);
  background: rgba(219, 230, 243, 0.98);
}

.app-shell {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto 132px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  align-items: start;
}

.panel,
.results {
  position: relative;
  background: rgba(255, 254, 249, 0.88);
  border: 1px solid rgba(230, 223, 209, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
}

.panel::before,
.results::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 6px;
  border-top: 1px solid rgba(99, 139, 130, 0.22);
  border-bottom: 1px solid rgba(184, 156, 80, 0.18);
}

.panel { padding: 32px; }

.source-panel.is-dragging-file {
  border-color: rgba(95, 127, 164, 0.42);
  background: rgba(232, 243, 247, 0.72);
  box-shadow: 0 18px 40px rgba(95, 127, 164, 0.12);
}

.input-feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(166, 91, 91, 0.24);
  border-radius: 8px;
  background: rgba(255, 246, 243, 0.82);
  color: #7c4545;
  font-size: 13px;
  line-height: 1.75;
}

.input-feedback.ok {
  border-color: rgba(99, 139, 130, 0.24);
  background: rgba(240, 248, 246, 0.84);
  color: var(--accent);
}

.input-feedback.warning {
  border-color: rgba(184, 138, 64, 0.3);
  background: rgba(255, 249, 232, 0.9);
  color: #795b25;
}

.input-feedback strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.input-feedback ul {
  margin: 0;
  padding-left: 1.2em;
}

.input-feedback li + li {
  margin-top: 2px;
}

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.panel-heading p,
.result-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.step {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(99, 139, 130, 0.2);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 400;
}

.segmented,
.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 244, 235, 0.76);
}

.segment,
.tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  font-size: 13px;
}

.segment.is-active,
.tab.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(64, 57, 45, 0.07);
}

.source-note,
.notice,
.custom-source,
.section-format-intro,
.section-editor { margin-top: 22px; }

.source-note {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid rgba(99, 139, 130, 0.18);
  border-radius: var(--radius);
  background: rgba(246, 250, 246, 0.76);
}

.source-note span,
.notice p { color: var(--muted); }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 254, 249, 0.94);
  color: var(--ink);
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(99, 139, 130, 0.22);
  border-color: rgba(99, 139, 130, 0.55);
}

textarea {
  min-height: 240px;
  resize: vertical;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.62;
}

#normalizeAiOutputButton,
#copyExcelTsvButton,
#downloadExcelFileButton {
  border-color: rgba(95, 127, 164, 0.24);
  background: rgba(231, 238, 247, 0.86);
  color: #4f6f92;
}

#normalizeAiOutputButton:hover,
#copyExcelTsvButton:hover,
#downloadExcelFileButton:hover {
  border-color: rgba(95, 127, 164, 0.44);
  background: rgba(219, 230, 243, 0.96);
}

.input-help {
  max-width: 720px;
  min-height: 7.6em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.vocab-guide-entry {
  display: flex;
  max-width: 860px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  border: 1px solid rgba(95, 127, 164, 0.22);
  border-radius: 10px;
  background: rgba(231, 238, 247, 0.58);
  padding: 14px 16px;
}

.vocab-guide-entry div,
.vocab-guide-entry span {
  display: block;
}

.vocab-guide-entry strong {
  color: var(--ink);
  font-size: 13px;
}

.vocab-guide-entry span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.vocab-guide-entry a {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(79, 111, 146, 0.28);
  color: #4f6f92;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.vocab-guide-entry a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.notice {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.notice summary {
  color: var(--warn);
  font-weight: 700;
}

.notice p {
  margin: 10px 0 0;
  font-size: 13px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.preset-button {
  position: relative;
  min-height: 104px;
  border: 1px solid rgba(230, 223, 209, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.72);
  padding: 22px 16px 16px 76px;
  text-align: left;
  box-shadow: inset 0 -1px 0 rgba(210, 200, 184, 0.26);
}

.preset-button::before {
  content: attr(data-initial);
  position: absolute;
  left: 18px;
  top: 17px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
}

.preset-button:nth-child(2)::before { color: var(--gold); }
.preset-button:nth-child(3)::before { color: var(--rose); }
.preset-button:nth-child(4)::before { color: var(--blue); }
.preset-button:nth-child(5)::before { color: var(--leaf); }
.preset-button:nth-child(6)::before { color: var(--accent); }

.preset-button::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 16px;
  width: 38px;
  height: 1px;
  background: rgba(52, 49, 44, 0.18);
}

.preset-button strong,
.preset-button span { display: block; }

.preset-button strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.preset-button span {
  color: var(--muted);
  font-size: 12px;
}

.preset-button:hover {
  border-color: rgba(99, 139, 130, 0.28);
  background: rgba(255, 254, 249, 0.88);
}

.preset-button.is-selected {
  border-color: rgba(99, 139, 130, 0.34);
  background: rgba(255, 254, 249, 0.72);
}

.preset-button.is-selected::after {
  height: 3px;
  background: var(--accent);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.recipe-panel.create-mode .recipe-heading,
.recipe-panel.create-mode .preset-grid,
.recipe-panel.take-mode #recipeLead,
.recipe-panel.take-mode .settings-grid,
.recipe-panel.take-mode .section-editor,
.recipe-panel.take-mode #resetButton {
  display: none;
}

.recipe-panel.take-mode .preset-grid {
  margin-bottom: 24px;
}

.section-format-intro {
  display: grid;
  gap: 6px;
}

.section-format-intro h3 {
  margin: 0;
  color: var(--accent);
}

.section-format-intro p {
  margin: 0;
  color: #5f8c82;
  font-size: 13px;
  line-height: 1.8;
}


.full-line { grid-column: 1 / -1; }

.checkbox-line {
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
  align-items: center;
  color: var(--ink);
}

.checkbox-line input { width: auto; }

.section-editor {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.section-editor-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-action {
  min-width: 104px;
  padding: 8px 12px;
  text-align: center;
  font-size: 14px;
}


.section-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  align-self: end;
}

.section-list {
  display: grid;
  gap: 12px;
}

.section-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(130px, 0.85fr) 96px minmax(216px, auto);
  gap: 10px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(230, 223, 209, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.58);
  box-shadow: inset 0 -1px 0 rgba(210, 200, 184, 0.18);
}

.section-index-label {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.primary-button,
.ghost-button,
.icon-button {
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 10px 15px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(99, 139, 130, 0.16);
}

.primary-button:hover { background: #527b73; }

.ghost-button,
.icon-button {
  background: rgba(255, 254, 249, 0.78);
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--accent);
  background: rgba(246, 250, 246, 0.9);
}
button.remove-section {
  border-color: rgba(178, 112, 118, 0.24);
  background: rgba(252, 238, 238, 0.72);
  color: #925b61;
}

button.remove-section:hover {
  border-color: rgba(178, 112, 118, 0.44);
  background: rgba(249, 229, 229, 0.9);
  color: #854b52;
}

.primary-button.large {
  min-width: 168px;
  padding: 13px 20px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--danger);
}


.build-actions { margin-top: 22px; }

.results {
  margin-top: 30px;
  padding: 32px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.result-actions .ghost-button {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.result-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.result-start-button {
  min-width: 148px;
  padding: 10px 16px;
}

.tabs { margin-bottom: 0; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }


body.online-test-mode .site-header,
body.online-test-mode .app-shell {
  display: none;
}

.test-screen {
  width: min(920px, calc(100% - 48px));
  margin: 54px auto 86px;
}

.test-shell {
  background: rgba(255, 254, 249, 0.9);
  border: 1px solid rgba(230, 223, 209, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.test-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.test-header p { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.compact-button {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.test-footer-actions,
.test-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.test-result-actions.is-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.result-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.76);
  padding: 18px;
}

.result-card.ok { border-color: rgba(99, 139, 130, 0.28); }
.result-card.manual { border-color: rgba(123, 92, 50, 0.28); }
.result-card.ng { border-color: rgba(154, 74, 74, 0.28); }
.result-card p { margin-bottom: 6px; color: var(--muted); }

.empty-state {
  padding: 52px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 254, 249, 0.58);
}

.quiz-section,
.answer-section,
.print-section { margin-bottom: 30px; }

.quiz-section h3,
.answer-section h3,
.print-section h3 {
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.print-section h3 {
  padding-bottom: 0;
  border-bottom: 0;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.74);
  padding: 18px;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.question-number {
  color: var(--accent);
  font-weight: 700;
}

.question-prompt {
  font-size: 18px;
  font-weight: 700;
}

.question-prompt .zh {
  font-family: "Microsoft YaHei", "Noto Sans SC", "Yu Gothic", sans-serif;
  font-size: 25px;
}

.question-task {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.answer-target {
  display: inline-block;
  width: fit-content;
  margin-bottom: 14px;
  padding: 5px 10px;
  border: 1px solid rgba(99, 139, 130, 0.18);
  border-radius: 999px;
  background: rgba(227, 239, 235, 0.7);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.answer-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

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

.pinyin-preview {
  display: block;
  min-height: 1.5em;
  margin-top: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.pinyin-preview.is-empty {
  visibility: hidden;
}

.print-answer-lines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}

.print-answer-lines span {
  display: flex;
  gap: 8px;
  align-items: baseline;
  white-space: nowrap;
}

.print-answer-lines i {
  display: block;
  flex: 1 1 120px;
  min-width: 90px;
  border-bottom: 1px solid #555;
}
.option-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.option-line {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  font-weight: 500;
}

.option-line input { width: auto; }
.short-answer { margin-top: 14px; }
.match-select { max-width: 420px; margin-top: 14px; }

.feedback {
  margin-top: 10px;
  font-weight: 700;
}
.feedback.ok { color: var(--accent); }
.feedback.ng { color: var(--danger); }
.feedback.manual { color: var(--warn); }

.online-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.print-paper {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
}

.print-view-only {
  padding: 28px;
}

.print-view-only .print-paper {
  width: min(900px, 100%);
  margin: 0 auto;
}

.print-view-actions {
  display: flex;
  justify-content: center;
  margin: 0 auto 18px;
}

.print-title {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.print-title h2 { margin: 0; }

.print-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  font-size: 14px;
}

.print-question {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  margin-bottom: 13px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-paper:not(.compact) .print-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 8px;
}

.print-paper:not(.compact) .print-section h3 {
  grid-column: 1 / -1;
}

.print-paper:not(.compact) .print-question {
  grid-template-columns: 28px 1fr;
  gap: 8px;
  margin-bottom: 8px;
}


.answer-line {
  display: inline-block;
  min-width: 180px;
  border-bottom: 1px solid #555;
  margin-left: 10px;
}

.answer-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 254, 249, 0.74);
}

.answer-table th,
.answer-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.copy-box {
  width: 100%;
  min-height: 360px;
  white-space: pre;
}

.is-hidden { display: none !important; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}


body.split-preview-mode .site-header {
  display: none;
}

body.split-preview-mode .app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  width: min(1440px, calc(100% - 32px));
  margin: 18px auto 56px;
}

body.split-preview-mode .workspace {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  align-self: start;
  padding-right: 4px;
  padding-bottom: 120px;
  scroll-padding-bottom: 120px;
}

body.split-preview-mode .input-help {
  min-height: 11.6em;
}

body.split-preview-mode .panel {
  padding: 20px;
  box-shadow: none;
}

body.split-preview-mode .panel-heading {
  margin-bottom: 18px;
}

body.split-preview-mode .settings-grid,
body.split-preview-mode .section-row {
  grid-template-columns: 1fr;
}

body.split-preview-mode .section-actions {
  justify-content: flex-start;
}

body.split-preview-mode .source-panel textarea {
  min-height: 160px;
}

body.split-preview-mode .results {
  min-width: 0;
  margin-top: 0;
  padding: 26px;
}

body.split-preview-mode .result-header {
  align-items: flex-start;
}
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr; }

  .result-header,
  .result-navigation,
  .test-header { flex-direction: column; align-items: flex-start; }

  .site-header {
    width: min(100% - 32px, 1080px);
    padding: 54px 0 40px;
  }

  h1 {
    font-size: 38px;
    white-space: normal;
  }

  .header-actions { justify-content: stretch; }
  .header-action-row { grid-template-columns: 1fr; }
  .header-action-button { width: 100%; }

  .app-shell,
  .test-screen { width: min(100% - 32px, 1080px); }

  body.split-preview-mode .app-shell {
    display: block;
    width: min(100% - 32px, 1080px);
  }

  body.split-preview-mode .workspace {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
    margin-bottom: 20px;
  }

  .preset-grid,
  .settings-grid { grid-template-columns: 1fr; }
  .section-row { grid-template-columns: 1fr; }
  .section-actions { justify-content: flex-start; }
  .icon-button { width: 100%; }
  .panel,
  .results { padding: 22px; }
}


@media (max-width: 520px) {
  h1 { font-size: 32px; }
}
@media print {
  body { background: white; }

  .ambient-decor,
  .print-view-actions,
  .site-header,
  .workspace,
  .result-header,
  .tabs,
  #onlinePanel,
  #answersPanel,
  #textPanel {
    display: none !important;
  }

  .app-shell,
  .results,
  .tab-panel,
  .print-paper {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .results::before,
  .print-paper::before { display: none; }
  #printPanel { display: block !important; }
  .print-paper { font-size: 11pt; }
}



/* A001 guide page */
.app-local-nav {
  display: flex;
  margin-top: 20px;
}

.app-guide-card {
  display: grid;
  width: min(420px, 100%);
  min-height: 76px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  border: 1px solid rgba(95, 127, 164, 0.34);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(239, 246, 252, 0.96), rgba(231, 238, 247, 0.88));
  padding: 13px 15px;
  color: #3f6389;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(79, 111, 146, 0.12);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.app-guide-card:hover {
  border-color: rgba(79, 111, 146, 0.58);
  box-shadow: 0 15px 30px rgba(79, 111, 146, 0.17);
  transform: translateY(-1px);
}

.app-guide-card:focus-visible {
  outline: 3px solid rgba(95, 127, 164, 0.34);
  outline-offset: 3px;
}

.app-guide-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #5f7fa4;
  color: #ffffff;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 7px 16px rgba(79, 111, 146, 0.2);
}

.app-guide-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.app-guide-kicker {
  color: #607f9f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.app-guide-copy strong {
  color: #315a84;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
}

.app-guide-detail {
  color: #70869d;
  font-size: 12px;
  line-height: 1.4;
}

.app-guide-arrow {
  color: #4f6f92;
  font-size: 22px;
  line-height: 1;
  transition: transform 160ms ease;
}

.app-guide-card:hover .app-guide-arrow {
  transform: translateX(3px);
}

@media (max-width: 520px) {
  .app-guide-card {
    width: 100%;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 11px;
    padding: 12px 13px;
  }

  .app-guide-icon {
    width: 38px;
    height: 38px;
  }
}

.guide-page .site-header {
  padding-bottom: 36px;
}

.guide-hero {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 42px;
}

.guide-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.guide-app-link:hover {
  color: #2f665f;
}

.guide-hero .lead {
  max-width: 780px;
}

.free-guide-hero {
  padding-bottom: 32px;
}

.free-guide-hero .app-access-label {
  margin: 14px 0 12px;
}

.free-guide-shell {
  display: block;
}

.free-guide-shell .guide-section,
.free-guide-shell .notice {
  width: 100%;
}

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

.guide-hero-actions a,
.guide-final a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.guide-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto 132px;
}

.guide-index {
  grid-column: 1;
  grid-row: 1 / span 20;
  position: sticky;
  top: 20px;
  display: grid;
  align-self: start;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(230, 223, 209, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.78);
  box-shadow: var(--shadow);
}

.guide-index a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 8px;
  text-decoration: none;
}

.guide-index a:hover {
  background: rgba(227, 239, 235, 0.72);
  color: var(--accent);
}

.guide-section {
  grid-column: 2;
  position: relative;
  margin-bottom: 22px;
  padding: 30px;
  border: 1px solid rgba(230, 223, 209, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.86);
  box-shadow: var(--shadow);
}

.guide-section::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 6px;
  border-top: 1px solid rgba(99, 139, 130, 0.22);
  border-bottom: 1px solid rgba(184, 156, 80, 0.18);
}

.guide-section h2 {
  margin-bottom: 16px;
  font-weight: 500;
}

.guide-section h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 600;
}

.guide-section p,
.guide-section li,
.guide-table td {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.guide-feature-grid,
.guide-steps,
.guide-flow {
  display: grid;
  gap: 14px;
}

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

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

.guide-feature-grid article,
.guide-steps article,
.guide-flow article,
.guide-callout {
  border: 1px solid rgba(230, 223, 209, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 254, 249, 0.58);
  padding: 18px;
}

.guide-number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid rgba(99, 139, 130, 0.2);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 17px;
}

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

.guide-flow ol {
  margin: 0;
  padding-left: 1.25em;
}

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

.guide-note,
.guide-callout {
  margin-top: 16px;
}

.guide-table-wrap {
  overflow-x: auto;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 254, 249, 0.56);
}

.guide-table th,
.guide-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.guide-table th {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.guide-table code,
.guide-section code {
  border: 1px solid rgba(95, 127, 164, 0.14);
  border-radius: 5px;
  background: rgba(231, 238, 247, 0.55);
  color: #4f6f92;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
  padding: 0.08em 0.34em;
}

.guide-list {
  margin: 0;
  padding-left: 1.3em;
}

.guide-final {
  text-align: left;
}

.guide-final p {
  max-width: 700px;
}

@media (max-width: 900px) {
  .guide-hero,
  .guide-shell {
    width: min(100% - 32px, 1080px);
  }

  .guide-shell {
    display: block;
  }

  .guide-index {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
  }

  .guide-feature-grid,
  .guide-feature-grid.compact,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .guide-section {
    grid-column: auto;
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .guide-index {
    grid-template-columns: 1fr;
  }

  .vocab-guide-entry {
    align-items: flex-start;
    flex-direction: column;
  }
}
.guide-visual {
  margin: 18px 0 20px;
}

.guide-visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(174, 200, 213, 0.65);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 16px 32px rgba(64, 57, 45, 0.06);
}

.guide-visual figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.guide-inline-link {
  color: #4f6f92;
  font-weight: 600;
  text-decoration: none;
}

.guide-inline-link:hover {
  color: var(--accent);
}

/* First-time experience gateway */
.experience-start-button {
  min-height: 40px;
  border: 1px solid rgba(99, 139, 130, 0.26);
  border-radius: 999px;
  background: #638b82;
  color: #fffef9;
  font-weight: 700;
  line-height: 1;
  padding: 0 18px;
  box-shadow: 0 12px 26px rgba(99, 139, 130, 0.16);
}

.experience-start-button:hover {
  background: #557f76;
}
.experience-start-button.take {
  border-color: rgba(95, 127, 164, 0.28);
  background: #5f7fa4;
  box-shadow: 0 12px 26px rgba(95, 127, 164, 0.16);
}

.experience-start-button.take:hover {
  background: #557395;
}

.experience-start-button.make {
  border-color: rgba(99, 139, 130, 0.28);
  background: #638b82;
}

/* Access labels */
.access-label-free,
.vocab-guide-entry .access-inline-free,
.guide-section .access-label-free {
  display: inline-flex;
  width: auto;
  min-width: 36px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid #315a84;
  border-radius: 5px;
  background: #3f6f9f;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0 6px;
  box-shadow: 0 3px 8px rgba(49, 90, 132, 0.24);
}

.app-access-label {
  margin: 14px 0 8px;
}

.vocab-guide-entry .access-inline-free {
  margin: 0 0 0 7px;
  vertical-align: 0.08em;
}

.guide-section .access-label-free {
  margin: 0 0 18px;
}
/* Vocab prompt display */
.prompt-content-panel {
  border-color: rgba(184, 156, 80, 0.34);
  background: linear-gradient(180deg, rgba(255, 254, 249, 0.97), rgba(250, 247, 237, 0.86));
}

.prompt-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.prompt-heading-row p {
  margin-bottom: 0;
}

.prompt-version {
  flex: 0 0 auto;
  border: 1px solid rgba(184, 156, 80, 0.36);
  border-radius: 999px;
  background: rgba(255, 252, 238, 0.92);
  color: #7f682e;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.prompt-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.prompt-copy-button {
  border-color: rgba(95, 127, 164, 0.32);
  background: rgba(231, 238, 247, 0.78);
  color: #4f6f92;
}

.prompt-copy-status {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.prompt-details {
  margin-top: 18px;
  border-top: 1px solid rgba(184, 156, 80, 0.22);
  padding-top: 14px;
}

.prompt-details summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.prompt-textarea {
  width: 100%;
  min-height: 440px;
  margin-top: 14px;
  border: 1px solid rgba(219, 210, 190, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 253, 0.94);
  color: #3f3a31;
  font-family: "Yu Gothic UI", "Noto Sans JP", sans-serif;
  font-size: 13px;
  line-height: 1.8;
  padding: 16px;
  resize: vertical;
}

@media (max-width: 520px) {
  .prompt-heading-row {
    flex-direction: column;
  }

  .prompt-textarea {
    min-height: 360px;
  }
}
/* One-minute guided experience */
.experience-tour-layer {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
}

.experience-tour-spotlight {
  display: none;
}

.experience-tour-arrow {
  display: none;
}

.experience-tour-arrow path {
  fill: none;
  stroke: #4e79a8;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.experience-tour-arrow marker path {
  fill: #4e79a8;
  stroke: none;
}

.experience-tour-card {
  position: fixed;
  z-index: 3;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid rgba(64, 103, 145, 0.44);
  border-radius: 12px;
  background: #fffef9;
  box-shadow: 0 22px 54px rgba(31, 48, 66, 0.24);
  padding: 20px;
  pointer-events: auto;
}

.experience-tour-progress {
  margin: 0 0 8px;
  color: #4f6f92;
  font-size: 12px;
  font-weight: 800;
}

.experience-tour-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.45;
}

.experience-tour-card > p:not(.experience-tour-progress) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.experience-tour-instruction:not(:empty) {
  margin-top: 10px !important;
  color: #4f6f92 !important;
  font-weight: 700;
}

.experience-tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.experience-tour-actions button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.experience-tour-skip {
  border: 1px solid var(--line-strong);
  background: #fffef9;
  color: var(--muted);
}

.experience-tour-next {
  border: 1px solid #4f7197;
  background: #5f7fa4;
  color: #ffffff;
}

.experience-tour-surface {
  position: relative;
}

.experience-tour-target {
  position: relative;
  scroll-margin: 150px;
  outline: 4px solid #4e79a8;
  outline-offset: 7px;
  border-radius: 10px;
  box-shadow: 0 0 0 10px rgba(231, 238, 247, 0.88), 0 12px 28px rgba(49, 90, 132, 0.22);
}

.experience-tour-target-pointer {
  display: none;
  position: fixed;
  z-index: 4;
  width: 120px;
  border-radius: 999px;
  background: #4e79a8;
  color: #ffffff;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(49, 90, 132, 0.24);
  pointer-events: none;
}

.experience-tour-target-pointer.is-visible {
  display: block;
}

.experience-tour-target-pointer::after {
  content: "";
  position: absolute;
  left: 36px;
  top: 100%;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top: 15px solid #4e79a8;
}

.experience-tour-target-pointer.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom: 15px solid #4e79a8;
}

@media (max-width: 520px) {
  .experience-tour-card {
    padding: 17px;
  }

  .experience-tour-card h2 {
    font-size: 17px;
  }

  .experience-tour-arrow path {
    stroke-width: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .experience-tour-spotlight {
    transition: none;
  }
}

.launch-free-note {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}


/* Edition split additions */
.access-label-full,
.vocab-guide-entry .access-inline-full,
.access-inline-full {
  display: inline-flex;
  width: auto;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid #4f776f;
  border-radius: 5px;
  background: #638b82;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 4px 7px;
  box-shadow: 0 3px 8px rgba(79, 119, 111, 0.22);
}

.vocab-guide-entry .access-inline-full,
.access-inline-full {
  margin-left: 7px;
  vertical-align: 0.08em;
}

.edition-home-link {
  display: inline-flex;
  margin-bottom: 10px;
  color: #6d5860;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.edition-upgrade-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.edition-upgrade-card > div {
  display: grid;
  gap: 6px;
}

.edition-upgrade-card span { color: var(--muted); }
.edition-upgrade-card a {
  flex: 0 0 auto;
  color: #4f7f75;
  font-weight: 700;
  text-decoration: none;
}

.result-upgrade-card { margin-top: 26px; }

.guide-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.guide-choice-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 20px;
  border: 1px solid rgba(95, 127, 164, 0.26);
  border-radius: 14px;
  background: rgba(241, 247, 252, 0.88);
  text-decoration: none;
}

.guide-choice-card.make {
  border-color: rgba(99, 139, 130, 0.26);
  background: rgba(239, 247, 244, 0.88);
}

.guide-choice-card span { color: var(--muted); }

@media (max-width: 720px) {
  .edition-upgrade-card { align-items: stretch; flex-direction: column; gap: 14px; }
  .edition-upgrade-card a { align-self: flex-start; }
  .guide-choice-grid { grid-template-columns: 1fr; }
}