:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #66727d;
  --line: #d8dee3;
  --soft: #f4f6f7;
  --panel: #ffffff;
  --accent: #2f5d62;
  --accent-soft: #e8f0f0;
  --danger: #a33d35;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--soft); }
body { margin: 0; color: var(--ink); background: var(--soft); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", Arial, sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; padding: 10px 14px; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.skip-link:focus { top: 12px; }
.edmund-system-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.edmund-system-header__inner { width: min(1500px, calc(100% - 32px)); min-height: 72px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.edmund-system-switcher__trigger { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--ink); }
.edmund-system-switcher__logo { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.edmund-system-switcher__copy { display: grid; text-align: left; }
.edmund-system-switcher__copy strong { font-family: Georgia, serif; font-size: 20px; }
.edmund-system-switcher__copy small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.edmund-system-switcher__chevron { color: var(--muted); }
.account-actions { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 700; }
.account-actions button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.page-shell { width: min(1500px, calc(100% - 32px)); margin: 24px auto 48px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); overflow: hidden; min-height: 560px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.login-hero { padding: clamp(36px, 6vw, 82px); display: flex; flex-direction: column; justify-content: center; background: var(--soft); }
.login-number, .document-motif { display: none; }
.login-hero h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(42px, 6vw, 78px); line-height: 1.04; }
.login-hero h1 span, .login-panel h2 span, .mode-card strong span { display: block; }
.login-hero > p:last-of-type { max-width: 560px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.login-panel { margin: auto; width: min(100%, 440px); padding: 36px; display: grid; gap: 20px; }
.login-panel h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 34px; }
.login-panel h2 span { margin-top: 5px; color: var(--muted); font: 500 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.login-panel label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.login-panel input { min-height: 48px; padding: 10px 12px; border: 1px solid #bfc8ce; border-radius: 8px; background: #fff; }
.primary-button, .field-button, .model-button, .submit-writing { min-height: 42px; padding: 10px 15px; border: 1px solid #bfc8ce; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700; }
.primary-button, .field-button--primary, .model-button, .submit-writing { border-color: var(--accent); background: var(--accent); color: #fff; }
.login-status { min-height: 22px; margin: 0; color: var(--danger); }
.mode-hub, .campaign-map, .briefing-scene, .writing-desk { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.mode-hub { min-height: 640px; padding: clamp(32px, 5vw, 72px); display: grid; align-content: center; gap: 42px; }
.field-heading { max-width: 780px; }
.field-heading h1, .map-toolbar h1, .briefing-title h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; }
.field-heading h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.08; }
.field-heading h1 span { display: block; }
.field-heading > p:last-child { color: var(--muted); font-size: 18px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mode-card { min-height: 250px; padding: 28px; display: grid; align-content: start; gap: 9px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.mode-card:hover, .mode-card:focus-visible { border-color: var(--accent); box-shadow: 0 8px 24px rgba(31,41,51,.09); }
.mode-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.mode-kicker { margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.mode-card strong { font-family: Georgia, "Noto Serif TC", serif; font-size: 30px; line-height: 1.2; }
.mode-card small { color: var(--muted); font-size: 14px; }
.mode-card i { align-self: end; margin-top: 22px; color: var(--accent); font-style: normal; font-weight: 800; }
.campaign-map { padding: clamp(22px, 3vw, 42px); }
.map-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.map-toolbar h1 { font-size: clamp(30px, 4vw, 46px); }
.map-count { display: grid; min-width: 92px; text-align: right; }
.map-count strong { font-size: 28px; }
.map-count span { color: var(--muted); font-size: 12px; }
.map-index { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.map-index button { min-height: 112px; padding: 18px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: start; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.map-index button:hover, .map-index button:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.map-index b { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--soft); color: var(--accent); }
.map-index span { font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.map-index small { color: var(--muted); }
.briefing-scene { padding: clamp(20px, 3vw, 42px); }
.briefing-sheet { max-width: 1120px; margin: auto; }
.briefing-title { padding: 8px 0 24px; border-bottom: 1px solid var(--line); }
.briefing-title h1 { font-size: clamp(34px, 5vw, 58px); }
.briefing-title h2 { margin: 7px 0 0; color: var(--muted); font-size: 22px; font-weight: 600; }
.briefing-section, .learning-profile article { margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.briefing-section h3, .learning-profile h3, .desk-panel h3 { margin: 0 0 14px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.briefing-section p, .briefing-section li, .bilingual-copy { line-height: 1.7; }
.briefing-section ul { margin: 0; padding-left: 22px; }
.learning-profile, .requirement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.route-list { margin: 0; padding-left: 28px; display: grid; gap: 14px; }
.bilingual-copy { margin: 0; }
.bilingual-copy > span { display: block; }
.bilingual-copy > span[lang="zh-Hant"], .model-chinese { margin-top: 7px; color: #596670; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif; }
.section-heading-row, .briefing-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bilingual-model { margin-top: 14px; }
.model-block { padding: 14px 0; }
.model-block + .model-block { border-top: 1px solid #edf0f2; }
.model-english { font-family: Georgia, "Noto Serif TC", serif; font-size: 18px; line-height: 1.7; white-space: normal; }
.model-block--title .model-english { font-size: 26px; font-weight: 700; }
.model-block--section .model-english { font-weight: 700; }
.coverage-list { display: grid; gap: 16px; }
.coverage-list section { padding: 16px; border: 1px solid #e7ebee; border-radius: 8px; }
.coverage-list h4 { margin: 0 0 10px; }
.coverage-point { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 8px; }
.expression-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.expression-grid article { padding: 14px; border: 1px solid #e7ebee; border-radius: 8px; }
.briefing-actions { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.writing-desk { padding: clamp(18px, 2.5vw, 34px); }
.desk-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.desk-toolbar h1 { margin: 0; font-family: Georgia, serif; font-size: 28px; }
.desk-toolbar__actions { display: flex; gap: 8px; }
.desk-grid { margin-top: 22px; display: grid; grid-template-columns: minmax(220px, .75fr) minmax(420px, 1.7fr) minmax(220px, .75fr); gap: 16px; align-items: stretch; }
.desk-panel, .desk-editor { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.desk-panel { display: flex; flex-direction: column; }
.desk-panel__head, .paper-heading { padding: 18px; border-bottom: 1px solid var(--line); }
.desk-panel__head h2, .paper-heading h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 24px; }
.desk-scroll { max-height: 640px; padding: 18px; overflow: auto; }
.desk-scroll section + section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.desk-scroll ul { padding-left: 20px; line-height: 1.55; }
.desk-editor { display: grid; grid-template-rows: auto minmax(460px, 1fr) auto; }
.paper-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.paper-heading > span { color: var(--muted); font-size: 13px; }
.desk-editor textarea { width: 100%; min-height: 460px; resize: vertical; padding: 22px; border: 0; outline: 0; background: #fff; color: var(--ink); font-family: Georgia, "Noto Serif TC", serif; font-size: 18px; line-height: 1.75; }
.desk-editor textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.editor-footer { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.editor-footer > div { display: flex; gap: 8px; }
.editor-footer button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.expression-card { width: 100%; margin-bottom: 10px; padding: 14px; display: grid; gap: 5px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.expression-card:hover, .expression-card:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.expression-card span, .expression-card small, .insert-hint { color: var(--muted); }
.model-button { margin: auto 18px 18px; }
.model-dialog { width: min(820px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.model-dialog::backdrop { background: rgba(31,41,51,.48); }
.model-dialog__bar { position: sticky; top: 0; z-index: 2; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #fff; }
.model-dialog__bar h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 25px; }
.model-dialog__bar button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 24px; }
.model-dialog__tools { padding: 14px 22px 0; text-align: right; }
.model-dialog__tools button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-weight: 700; }
.model-dialog article { padding: 10px 28px 28px; }
.save-toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; padding: 11px 15px; border-radius: 8px; background: #223039; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
@media (max-width: 1050px) {
  .map-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-grid { grid-template-columns: 1fr 2fr; }
  .desk-expressions { grid-column: 1 / -1; }
  .desk-expressions .desk-scroll { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .desk-expressions .expression-card { margin: 0; }
}
@media (max-width: 800px) {
  .edmund-system-header__inner, .page-shell { width: min(100% - 20px, 1500px); }
  .edmund-system-switcher__copy small, .account-actions span { display: none; }
  .page-shell { margin-top: 12px; }
  .login-view, .mode-grid, .map-index, .learning-profile, .requirement-grid, .expression-grid, .desk-grid { grid-template-columns: 1fr; }
  .login-view { min-height: auto; }
  .login-hero, .login-panel { padding: 28px 22px; }
  .mode-hub { min-height: auto; padding: 24px; }
  .mode-card { min-height: 210px; }
  .map-toolbar, .desk-toolbar { grid-template-columns: 1fr; align-items: start; }
  .map-count { text-align: left; }
  .desk-toolbar__actions { flex-wrap: wrap; }
  .desk-requirements, .desk-expressions { grid-column: auto; }
  .desk-scroll { max-height: none; }
  .desk-expressions .desk-scroll { display: block; }
  .desk-expressions .expression-card { margin-bottom: 10px; }
  .desk-editor { grid-template-rows: auto minmax(380px, 1fr) auto; }
  .desk-editor textarea { min-height: 380px; }
  .section-heading-row, .paper-heading, .editor-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .edmund-system-switcher__copy strong { font-size: 16px; }
  .field-heading h1, .login-hero h1 { font-size: 38px; }
  .campaign-map, .briefing-scene, .writing-desk { border-radius: 10px; padding: 16px; }
  .briefing-section, .learning-profile article { padding: 16px; }
  .map-index button { min-height: 96px; }
  .model-dialog article { padding: 8px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Original EdmundEducation art direction — generated specifically for this system. */
:root {
  --ink: #2c2924;
  --muted: #6c675e;
  --line: rgba(67, 52, 39, .22);
  --soft: #e8e3d8;
  --panel: #fffaf0;
  --paper: #f6ecd6;
  --paper-deep: #e7d5ae;
  --wood: #35251d;
  --accent: #8f302b;
  --accent-dark: #67201d;
  --accent-soft: #f1ded5;
  --sage: #66745d;
  --danger: #a33d35;
  --scene-shadow: 0 24px 70px rgba(28, 19, 14, .28);
}

html { background: #d6d6cf; }
body {
  background:
    radial-gradient(circle at 50% -20%, rgba(255,255,255,.86), transparent 54%),
    linear-gradient(135deg, #ecece7, #d2d4d0);
}
.edmund-system-header {
  border-bottom-color: rgba(54, 45, 38, .17);
  background: rgba(251, 249, 242, .92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 5px 22px rgba(38, 30, 23, .06);
}
.edmund-system-switcher__trigger,
.account-actions button { border-radius: 999px; }
.page-shell { width: min(1600px, calc(100% - 36px)); }
.eyebrow { color: var(--accent); letter-spacing: .17em; }
.field-button,
.primary-button,
.model-button,
.submit-writing {
  border-color: rgba(80, 62, 45, .28);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(48, 34, 25, .07);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.field-button:hover,
.primary-button:hover,
.model-button:hover,
.submit-writing:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(48, 34, 25, .14);
}
.primary-button,
.field-button--primary,
.model-button,
.submit-writing { border-color: var(--accent); background: linear-gradient(145deg, #a23d36, var(--accent-dark)); }

/* Sign-in and two-mode entrance. */
.login-view,
.mode-hub {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(66, 45, 31, .34);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(246,236,214,.18), rgba(246,236,214,.08)),
    url("dse-practical-writing-art/mode-folders-v2.webp") center / cover no-repeat;
  box-shadow: var(--scene-shadow);
}
.login-view::after,
.mode-hub::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  box-shadow: inset 0 0 0 12px rgba(255,255,255,.14), inset 0 0 80px rgba(70,45,28,.08);
}
.login-hero {
  margin: clamp(34px, 5vw, 76px) clamp(18px, 5vw, 72px);
  padding: clamp(30px, 5vw, 64px);
  border: 1px solid rgba(86,64,46,.17);
  border-radius: 18px;
  background: rgba(255,252,243,.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.login-hero h1,
.field-heading h1 { color: #34281f; text-wrap: balance; }
.login-panel {
  margin: 44px;
  padding: 38px;
  border: 1px solid rgba(86, 64, 46, .25);
  border-radius: 20px;
  background: rgba(255, 252, 243, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 45px rgba(55, 38, 27, .18);
}
.login-panel input {
  border-color: rgba(80, 62, 45, .3);
  background: rgba(255,255,255,.84);
}
.mode-hub { min-height: 760px; padding: clamp(170px, 19vw, 240px) clamp(34px, 6vw, 92px) clamp(44px, 7vw, 92px); }
.field-heading {
  position: absolute;
  left: clamp(30px, 5vw, 78px);
  top: clamp(24px, 4vw, 58px);
  width: min(640px, calc(100% - 60px));
  padding: 22px 26px;
  border-left: 4px solid var(--accent);
  background: rgba(255,250,239,.77);
  box-shadow: 0 12px 36px rgba(55,38,27,.1);
}
.mode-grid { width: 100%; gap: clamp(24px, 4.6vw, 76px); }
.mode-card {
  min-height: 360px;
  border-color: rgba(74, 55, 41, .25);
  border-radius: 18px;
  background: rgba(255, 251, 240, .58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 32px rgba(50,34,24,.13);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mode-card:hover,
.mode-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 22px 44px rgba(50,34,24,.2);
}
.mode-card--practice .mode-number { background: var(--accent); color: #fff; }
.mode-card--learn .mode-number { background: var(--sage); color: #fff; }
.mode-number { border-radius: 50%; }

/* Learning and practice catalogue: real HTML controls over an original map-table scene. */
.campaign-map {
  position: relative;
  isolation: isolate;
  min-height: min(860px, calc(100dvh - 122px));
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(51,34,23,.5);
  border-radius: 24px;
  background: #39261c url("dse-practical-writing-art/selection-map-v2.webp") center / cover no-repeat;
  box-shadow: var(--scene-shadow);
}
.campaign-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(23,14,9,.12), transparent 28%, rgba(23,14,9,.08));
}
.map-toolbar {
  position: relative;
  z-index: 3;
  padding: 18px 22px;
  border: 1px solid rgba(80,58,41,.25);
  border-radius: 14px;
  background: rgba(255,249,233,.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(51,34,23,.2);
}
.map-toolbar h1 { color: #382b22; }
.map-count strong { color: var(--accent); font-family: Georgia, serif; }
.map-index {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  margin: 0;
  pointer-events: none;
}
.map-index button {
  --node-x: 50%;
  --node-y: 50%;
  position: absolute;
  left: var(--node-x);
  top: var(--node-y);
  width: 62px;
  height: 62px;
  min-height: 0;
  padding: 0;
  display: block;
  border: 0;
  border-radius: 0;
  background: url("dse-practical-writing-art/location-marker-v2.webp") center / contain no-repeat;
  color: #fff;
  filter: drop-shadow(0 7px 8px rgba(46,24,16,.5));
  transform: translate(-50%, -50%);
  pointer-events: auto;
  transition: transform .2s ease, filter .2s ease;
}
.map-index button:hover,
.map-index button:focus-visible {
  z-index: 8;
  background: url("dse-practical-writing-art/location-marker-v2.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 5px rgba(255,249,232,.9)) drop-shadow(0 12px 12px rgba(46,24,16,.56));
  transform: translate(-50%, -50%) scale(1.09);
}
.map-index b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(48,29,18,.88);
  color: #fff8e5;
  font-size: 9px;
  line-height: 1;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(255,244,209,.45);
}
.map-index button > span {
  position: absolute;
  left: calc(100% + 9px);
  top: 50%;
  width: max-content;
  max-width: 190px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(75,55,40,.22);
  border-radius: 8px;
  background: rgba(255,249,233,.93);
  color: #352a22;
  text-align: left;
  box-shadow: 0 6px 14px rgba(47,30,20,.18);
  transform: translateY(-50%);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.map-index button > span strong { font-size: 13px; line-height: 1.2; }
.map-index button > span small { display: none; color: #756a60; font-size: 10px; line-height: 1.25; }
.map-index button:hover > span small,
.map-index button:focus-visible > span small { display: block; }
.map-index button:nth-child(4) > span,
.map-index button:nth-child(9) > span,
.map-index button:nth-child(13) > span { left: auto; right: calc(100% + 9px); text-align: right; }
.map-index button:nth-child(8) > span {
  left: 50%;
  top: calc(100% + 9px);
  transform: translateX(-50%);
}
.map-index button:nth-child(1) { --node-x: 24%; --node-y: 43%; }
.map-index button:nth-child(2) { --node-x: 43%; --node-y: 34%; }
.map-index button:nth-child(3) { --node-x: 57%; --node-y: 31%; }
.map-index button:nth-child(4) { --node-x: 82%; --node-y: 27%; }
.map-index button:nth-child(5) { --node-x: 20%; --node-y: 58%; }
.map-index button:nth-child(6) { --node-x: 35%; --node-y: 56%; }
.map-index button:nth-child(7) { --node-x: 50%; --node-y: 51%; }
.map-index button:nth-child(8) { --node-x: 66%; --node-y: 47%; }
.map-index button:nth-child(9) { --node-x: 84%; --node-y: 52%; }
.map-index button:nth-child(10) { --node-x: 29%; --node-y: 72%; }
.map-index button:nth-child(11) { --node-x: 45%; --node-y: 70%; }
.map-index button:nth-child(12) { --node-x: 63%; --node-y: 68%; }
.map-index button:nth-child(13) { --node-x: 81%; --node-y: 69%; }

/* Briefings and learning chapters use an original paper folio, not a game screenshot. */
.briefing-scene {
  position: relative;
  padding: clamp(44px, 7vw, 108px) clamp(28px, 8vw, 130px);
  border: 1px solid rgba(51,34,23,.48);
  border-radius: 24px;
  background: var(--wood) url("dse-practical-writing-art/briefing-dossier-v2.webp") center top / 100% auto no-repeat;
  box-shadow: var(--scene-shadow);
}
.briefing-sheet {
  max-width: 1180px;
  padding: clamp(26px, 4vw, 54px);
  border: 1px solid rgba(91,67,48,.17);
  background: rgba(255,250,237,.88);
  box-shadow: 0 18px 48px rgba(61,39,25,.16);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.briefing-title { border-bottom-color: rgba(99,72,51,.3); }
.briefing-title h1 { color: #34271e; text-wrap: balance; }
.briefing-section,
.learning-profile article {
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: rgba(255,253,247,.72);
  box-shadow: 0 5px 16px rgba(58,39,26,.05);
}
.briefing-section h3,
.learning-profile h3,
.desk-panel h3 { color: var(--accent); letter-spacing: .12em; }
.model-block + .model-block { border-top-color: rgba(92,69,52,.14); }
.coverage-list section,
.expression-grid article { border-color: rgba(91,67,48,.18); background: rgba(255,255,255,.45); }

/* Writing workspace: working HTML aligned to the original three-part file paper. */
.writing-desk {
  position: relative;
  min-height: min(900px, calc(100dvh - 118px));
  padding: clamp(30px, 4.2vw, 68px) clamp(34px, 7.2vw, 116px) clamp(34px, 6vw, 96px);
  border: 1px solid rgba(51,34,23,.55);
  border-radius: 24px;
  background: #342319 url("dse-practical-writing-art/writing-file-v2.webp") center / cover no-repeat;
  box-shadow: var(--scene-shadow);
}
.desk-toolbar {
  min-height: 92px;
  padding: 12px 14px 18px;
  border: 0;
  border-bottom: 1px solid rgba(61,52,43,.34);
  border-radius: 0;
  background: rgba(255,249,233,.18);
  box-shadow: none;
}
.desk-grid {
  margin-top: 0;
  min-height: 620px;
  grid-template-columns: minmax(190px, 22fr) minmax(420px, 55fr) minmax(190px, 23fr);
  gap: 0;
}
.desk-panel,
.desk-editor {
  border: 0;
  border-radius: 0;
  background: rgba(255,249,235,.34);
  box-shadow: none;
}
.desk-requirements { border-right: 1px solid rgba(61,52,43,.27); }
.desk-expressions { border-left: 1px solid rgba(61,52,43,.27); }
.desk-editor { background: rgba(255,252,243,.18); }
.editor-footer .submit-writing {
  border-color: var(--accent);
  background: linear-gradient(145deg, #a23d36, var(--accent-dark));
  color: #fff;
}
.desk-panel__head,
.paper-heading { border-bottom-color: rgba(94,70,50,.2); }
.desk-panel__head,
.paper-heading { background: rgba(255,249,235,.32); }
.desk-editor textarea {
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(88,70,54,.105) 32px),
    rgba(255,253,246,.14);
  background-attachment: local;
}
.expression-card {
  border-color: rgba(85,63,45,.2);
  background: rgba(255,255,255,.55);
}
.expression-card:hover,
.expression-card:focus-visible { background: rgba(238,221,194,.72); }

/* Model review remains one continuous paper; Chinese appears under its English block. */
.model-dialog {
  width: min(900px, calc(100% - 28px));
  border-color: rgba(82,61,45,.32);
  border-radius: 16px;
  background: #fff9eb;
  box-shadow: 0 28px 90px rgba(24,17,13,.35);
}
.model-dialog::backdrop { background: rgba(30,22,17,.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.model-dialog__bar { background: #f2e5c9; border-bottom-color: rgba(82,61,45,.25); }
.model-dialog__tools button,
.model-dialog__bar button { border-color: rgba(82,61,45,.25); background: rgba(255,250,238,.85); }
.model-dialog article { background: #fffaf0; }
.model-english { color: #302820; }
.model-chinese { color: #665f56; }

@media (max-width: 1100px) {
  .campaign-map { min-height: 760px; }
  .map-index button > span { max-width: 145px; }
  .desk-grid { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.7fr); }
}

@media (max-width: 800px) {
  .page-shell { width: min(100% - 18px, 1600px); }
  .login-panel { margin: 18px; }
  .mode-hub { min-height: auto; }
  .campaign-map {
    min-height: 0;
    padding: 18px;
    padding-top: 280px;
    background-position: center top;
    background-size: auto 360px;
    background-color: #4a3023;
  }
  .map-toolbar { position: absolute; left: 18px; right: 18px; top: 18px; }
  .map-index {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: 15px;
    background: rgba(255,249,234,.92);
  }
  .map-index button,
  .map-index button:nth-child(n) {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 82px;
    padding: 12px;
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(82,61,45,.22);
    border-radius: 12px;
    background: rgba(255,253,247,.86);
    color: #342a22;
    box-shadow: none;
    transform: none;
  }
  .map-index button:hover,
  .map-index button:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(49,32,21,.14); }
  .map-index b { width: 42px; height: 42px; background: var(--accent); color: #fff; }
  .map-index button > span,
  .map-index button:nth-child(4) > span,
  .map-index button:nth-child(9) > span,
  .map-index button:nth-child(13) > span {
    position: static;
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    box-shadow: none;
    transform: none;
    backdrop-filter: none;
  }
  .map-index button > span small,
  .map-index button:hover > span small,
  .map-index button:focus-visible > span small { display: block; }
  .briefing-scene { padding: 26px 16px; background-size: auto 560px; }
  .briefing-sheet { padding: 22px 16px; }
  .writing-desk { padding: 18px 12px; background-position: center top; }
  .desk-toolbar { border-radius: 12px; background: rgba(255,249,233,.9); }
  .desk-grid { min-height: 0; gap: 12px; }
  .desk-panel,
  .desk-editor { border: 1px solid rgba(82,61,45,.27); border-radius: 12px; background: rgba(255,249,235,.93); }
  .desk-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .login-view,
  .mode-hub,
  .campaign-map,
  .briefing-scene,
  .writing-desk { border-radius: 15px; }
  .login-panel { margin: 10px; padding: 26px 20px; }
  .field-heading { padding: 20px; }
  .campaign-map { padding: 250px 10px 10px; background-size: auto 320px; }
  .map-toolbar { left: 10px; right: 10px; top: 10px; padding: 14px; }
  .map-index { grid-template-columns: 1fr; padding: 10px; }
  .briefing-scene { padding: 16px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
