:root {
  --bg: #f5e8bd;
  --paper: #fbf5e6;
  --paper-deep: #f0e0ba;
  --ink: #213733;
  --muted: #5f675e;
  --accent: #8f6131;
  --accent-soft: #d6b27a;
  --green-deep: #25433d;
  --green: #486b61;
  --line: #ccb890;
  --shadow: 0 20px 40px rgba(77, 63, 34, 0.12);
  --shadow-soft: 0 12px 24px rgba(53, 44, 24, 0.1);
  --header-h: 82px;
  --header-h-compact: 66px;
  --map-stage-h: clamp(600px, 45vw, 640px);
  --map-frame-pad: 14px;
  --map-frame-h: calc(var(--map-stage-h) + (var(--map-frame-pad) * 2));
  --shell-w: min(1380px, calc(100vw - 48px));
  --serif: "STSong", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.34), transparent 18%),
    radial-gradient(circle at 82% 8%, rgba(255,255,255,0.2), transparent 18%),
    linear-gradient(180deg, #f2e2ab 0%, #f5e9c8 22%, #f2e7cf 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

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

.paper-noise,
.page-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.paper-noise {
  opacity: 0.14;
  background-image:
    linear-gradient(45deg, rgba(140,111,59,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(140,111,59,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(140,111,59,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(140,111,59,0.06) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.page-ambient {
  z-index: 0;
}

.page-ambient-a::before,
.page-ambient-b::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.7;
  animation: drift 16s ease-in-out infinite alternate;
}

.page-ambient-a::before {
  width: 360px;
  height: 360px;
  top: 72px;
  right: -80px;
  background: radial-gradient(circle, rgba(227, 197, 136, 0.55), transparent 72%);
}

.page-ambient-b::before {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: 10vh;
  background: radial-gradient(circle, rgba(56, 98, 86, 0.18), transparent 74%);
  animation-duration: 20s;
}

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--shell-w);
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-radius: 24px;
  background: rgba(29, 52, 48, 0.8);
  border: 1px solid rgba(255, 240, 208, 0.1);
  box-shadow: 0 14px 28px rgba(32, 37, 29, 0.16);
  backdrop-filter: blur(14px);
  z-index: 20;
  transition:
    min-height .22s ease,
    padding .22s ease,
    border-radius .22s ease,
    background-color .22s ease,
    box-shadow .22s ease,
    top .22s ease;
}

body[data-nav-mode="compact"] .site-header {
  min-height: var(--header-h-compact);
  padding: 9px 14px;
  border-radius: 20px;
  background: rgba(29, 52, 48, 0.72);
  box-shadow: 0 10px 20px rgba(32, 37, 29, 0.14);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  color: #f6efdf;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.24), transparent 42%),
    linear-gradient(145deg, rgba(229, 197, 129, 0.95), rgba(152, 104, 49, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title,
.brand-subtitle {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  transition: font-size .22s ease;
}

.brand-subtitle {
  color: rgba(246, 239, 223, 0.72);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity .22s ease, transform .22s ease;
}

body[data-nav-mode="compact"] .brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 12px;
}

body[data-nav-mode="compact"] .brand-title {
  font-size: 17px;
}

body[data-nav-mode="compact"] .brand-subtitle {
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  overflow: hidden;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 28px;
}

.crumb-link,
.crumb-current {
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.crumb-link {
  border: 1px solid rgba(255, 240, 208, 0.14);
  background: rgba(255, 244, 225, 0.08);
  color: rgba(246, 239, 223, 0.88);
  padding: 6px 11px;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.crumb-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 244, 225, 0.14);
  border-color: rgba(255, 240, 208, 0.22);
}

.crumb-current {
  padding: 6px 0;
  color: #f6efdf;
  font-weight: 700;
}

body[data-nav-mode="compact"] .breadcrumb {
  gap: 6px;
  min-height: 24px;
}

body[data-nav-mode="compact"] .crumb-link,
body[data-nav-mode="compact"] .crumb-current {
  font-size: 11px;
}

body[data-nav-mode="compact"] .crumb-link {
  padding: 5px 9px;
}

.crumb-separator {
  color: rgba(246, 239, 223, 0.44);
  font-size: 12px;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-button,
.primary-link,
.empty-button,
.filter-chip,
.province-pill,
.project-card,
.detail-media-link {
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    background-color .22s ease,
    border-color .22s ease,
    color .22s ease,
    opacity .22s ease;
}

.header-button,
.primary-link,
.empty-button {
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
}

.header-button {
  border: 1px solid rgba(255, 240, 208, 0.16);
  background: rgba(255, 244, 225, 0.08);
  color: #f6efdf;
}

.header-button-accent {
  border-color: transparent;
  background: #f6ead1;
  color: #22403a;
}

body[data-nav-mode="compact"] .header-button {
  padding: 8px 13px;
  font-size: 12px;
}

.header-button:hover,
.primary-link:hover,
.filter-chip:hover,
.province-pill:hover,
.project-card:hover,
.empty-button:hover,
.detail-media-link:hover {
  transform: translateY(-2px);
}

.header-button.is-hidden {
  display: none;
}

.site-main {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-h) + 38px) 0 40px;
}

body[data-nav-mode="compact"] .site-main {
  padding-top: calc(var(--header-h-compact) + 30px);
}

.hero,
.stage-shell {
  width: var(--shell-w);
  margin: 0 auto 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 24px;
  align-items: stretch;
  min-height: calc(100vh - var(--header-h) - 76px);
  padding: 40px;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(29,52,48,0.96), rgba(34,64,58,0.9));
  color: #f5f1e4;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 360px;
  height: 360px;
  right: -80px;
  top: -110px;
  background: radial-gradient(circle, rgba(223,192,126,0.48), transparent 72%);
}

.hero::after {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: -150px;
  background: radial-gradient(circle, rgba(255,238,189,0.16), transparent 74%);
}

.hero-copy,
.hero-aside {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.hero-copy > * {
  animation: riseIn .68s ease both;
}

.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
.hero-copy > :nth-child(5) { animation-delay: .24s; }

.eyebrow,
.section-index {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: #ddc28a;
}

.hero h1,
.page-head h2,
.map-context-panel h3,
.detail-section h3,
.hero-panel h2,
.detail-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
}

.hero h1 {
  font-size: clamp(46px, 6vw, 78px);
  max-width: 720px;
}

.hero-subtitle,
.hero-lead,
.section-note,
.map-source-note,
.official-note-block p,
.hero-panel-body {
  line-height: 1.8;
  font-size: 16px;
}

.hero-subtitle {
  margin: 18px 0 0;
  color: rgba(245,241,228,0.9);
  font-size: 19px;
}

.hero-lead {
  margin: 14px 0 0;
  max-width: 640px;
  color: rgba(245,241,228,0.74);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-link {
  color: #22403a;
  background: #f6ead1;
  border: 1px solid #f6ead1;
  box-shadow: 0 14px 30px rgba(17, 28, 24, 0.16);
}

.primary-link:hover {
  box-shadow: 0 20px 36px rgba(17, 28, 24, 0.2);
}

.hero-aside {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
}

.hero-panel,
.hero-stats-panel {
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(245,235,208,0.16), rgba(245,235,208,0.05));
  border: 1px solid rgba(255,240,208,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.hero-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.hero-panel h2 {
  font-size: clamp(28px, 3vw, 38px);
  color: #f7ecd4;
}

.hero-panel-body,
.official-note-block p {
  margin: 0;
  color: rgba(245,241,228,0.84);
}

.official-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.official-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(246,228,178,0.12);
  border: 1px solid rgba(246,228,178,0.16);
  font-size: 13px;
  color: #f6ebcf;
}

.hero-stats-panel {
  display: grid;
  gap: 14px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  padding: 16px 16px 18px;
  border-radius: 20px;
  background: rgba(255,247,229,0.08);
  border: 1px solid rgba(255,240,208,0.1);
}

.stat-value {
  font-family: var(--serif);
  font-size: 30px;
  color: #f7e8c0;
}

.stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(247,241,229,0.72);
}

.stage-shell {
  background: rgba(251,245,230,0.88);
  border: 1px solid rgba(204,184,144,0.7);
  border-radius: 30px;
  padding: 28px;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--header-h-compact) + 28px);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h2 {
  font-size: clamp(30px, 4vw, 46px);
}

.page-head .section-note {
  max-width: 760px;
  color: var(--muted);
  margin-top: 12px;
}

.province-shell,
.detail-shell {
  padding-top: 24px;
}

.province-shell .section-index,
.detail-shell .section-index {
  margin-bottom: 8px;
}

.province-shell .page-head,
.detail-shell .page-head {
  margin-bottom: 12px;
}

.province-shell .page-head .section-note,
.detail-shell .page-head .section-note {
  margin-top: 8px;
  max-width: 700px;
}

.search-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.map-browse-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.map-browse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.9);
  border: 1px solid rgba(204,184,144,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.56);
}

.map-mode-button,
.map-side-button,
.map-inset-button {
  border-radius: 999px;
  border: 1px solid rgba(122,106,82,0.16);
  background: rgba(255, 251, 243, 0.96);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  padding: 10px 16px;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    background-color .22s ease,
    border-color .22s ease,
    color .22s ease;
}

.map-mode-button.is-active,
.map-side-button,
.map-inset-button {
  background: #22403a;
  color: #fff7e7;
  border-color: transparent;
  box-shadow: 0 12px 22px rgba(35, 65, 59, 0.16);
}

.map-mode-button:hover,
.map-side-button:hover,
.map-inset-button:hover {
  transform: translateY(-2px);
}

.search-box {
  width: min(420px, 100%);
}

.search-box input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,252,243,0.9);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.52);
}

.search-box input:focus {
  border-color: rgba(143, 97, 49, 0.45);
  box-shadow: 0 0 0 3px rgba(143, 97, 49, 0.08);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip,
.province-pill {
  border: 1px solid rgba(122,106,82,0.18);
  background: #fffaf0;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
}

.filter-chip.is-active,
.province-pill.is-active {
  color: #fff9eb;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(44,60,46,0.18);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(316px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.map-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.map-frame,
.detail-panel,
.map-context-panel {
  background: linear-gradient(180deg, rgba(255,252,244,0.92), rgba(244,234,209,0.92));
  border: 1px solid rgba(204,184,144,0.82);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), var(--shadow-soft);
}

.map-frame {
  padding: var(--map-frame-pad);
  height: var(--map-frame-h);
}

.official-map-stage {
  position: relative;
  min-height: var(--map-stage-h);
  height: var(--map-stage-h);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(251,249,243,0.98), rgba(246,241,226,0.98));
  cursor: grab;
  touch-action: none;
}

.map-reference-overlay {
  position: absolute;
  inset: 22px;
  width: calc(100% - 44px);
  height: calc(100% - 44px);
  object-fit: contain;
  opacity: 0.22;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

.map-surface {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  z-index: 2;
}

.official-map-stage.is-dragging {
  cursor: grabbing;
}

.map-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,252,244,0.92);
  border: 1px solid rgba(184,162,118,0.48);
  box-shadow: 0 10px 24px rgba(72, 60, 34, 0.12);
  z-index: 3;
}

.map-tool-button {
  border: 1px solid rgba(122,106,82,0.16);
  background: #fffaf0;
  color: #2b3a34;
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 12px;
}

.map-tool-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-tool-reset {
  background: #23413b;
  color: #fff7e7;
  border-color: transparent;
}

.zoom-value {
  min-width: 54px;
  text-align: center;
  font-size: 12px;
  color: #5a4e3f;
  font-weight: 700;
}

.map-hint {
  position: absolute;
  left: 16px;
  top: 16px;
  max-width: 332px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(255,252,244,0.86);
  border: 1px solid rgba(184,162,118,0.36);
  color: #5f675e;
  line-height: 1.55;
  font-size: 12px;
  z-index: 3;
}

.map-inset-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
}

.map-inset-button-glyph {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.7), transparent 40%), #ddc28a;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.south-sea-float-panel {
  position: absolute;
  right: 16px;
  bottom: 58px;
  width: min(270px, calc(100% - 32px));
  max-height: 350px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,252,244,0.96), rgba(244,234,209,0.96));
  border: 1px solid rgba(204,184,144,0.76);
  box-shadow: 0 18px 36px rgba(72, 60, 34, 0.18);
  z-index: 4;
  overflow: hidden;
}

.south-sea-float-scroll {
  display: grid;
  gap: 10px;
  max-height: 100%;
  overflow: auto;
  padding: 14px;
}

.south-sea-float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.south-sea-float-head h3 {
  font-size: 22px;
  line-height: 1.12;
}

.south-sea-float-copy {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.decor-ribbon,
.decor-river,
.decor-lake {
  display: none;
}

.province-shape {
  vector-effect: non-scaling-stroke;
  fill: var(--province-fill, #f5e9cc);
  stroke: rgba(255, 250, 240, 0.9);
  stroke-width: 1.4;
  stroke-linejoin: round;
  transition: fill .22s ease, stroke .22s ease, filter .22s ease, opacity .22s ease;
}

.province-shape.reference-mode {
  stroke: #31403a;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#inkWobble);
  pointer-events: none;
}

body[data-map-province-entry="enabled"] .province-shape.reference-mode.is-interactive {
  pointer-events: auto;
  cursor: pointer;
}

body[data-map-province-hover="enabled"] .province-shape.reference-mode.is-interactive:hover {
  fill: var(--province-fill, #f5e9cc);
}

.province-shape.has-data {
  stroke: rgba(255, 250, 240, 0.92);
}

.province-shape.is-active {
  fill: var(--province-fill-active, #ead6a6);
  stroke: #5a4327;
  stroke-width: 1.4;
  filter: url(#softShadow);
}

.province-shape.reference-mode.is-active {
  fill: var(--province-fill, #f5e9cc);
  stroke: #31403a;
  stroke-width: 1.2;
  filter: url(#inkWobble);
}

.province-boundary-line {
  vector-effect: non-scaling-stroke;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.96;
  pointer-events: none;
}

.national-boundary-line {
  stroke: #312b24;
  stroke-width: 2.2;
}

.internal-boundary-line {
  stroke: rgba(82, 76, 66, 0.82);
  stroke-width: 1.15;
}

body[data-map-mode="reference-calibrated-handdrawn"] .south-sea-islands {
  stroke: #31403a;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#inkWobble);
}

.province-label {
  font-size: 16px;
  font-family: var(--sans);
  font-weight: 700;
  fill: #2d302a;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.96);
  stroke-width: 4;
  stroke-linejoin: round;
}

.province-count {
  font-size: 13px;
  font-family: var(--sans);
  fill: #655846;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.96);
  stroke-width: 3;
}

.special-region-badge {
  cursor: pointer;
}

.special-region-pill {
  fill: rgba(255,252,244,0.94);
  stroke: rgba(120,102,74,0.22);
  stroke-width: 1.1;
}

.special-region-name {
  font-size: 14px;
  font-weight: 700;
  fill: #33403b;
}

.special-region-count {
  font-size: 12px;
  fill: #7a6850;
}

.special-region-badge.is-active .special-region-pill {
  fill: rgba(233, 212, 148, 0.96);
  stroke: #8f6131;
}

#southSeaInsetLayer {
  pointer-events: none;
}

#provinceButtonLayer {
  pointer-events: none;
}

.south-sea-frame {
  fill: rgba(255, 252, 244, 0.94);
  stroke: rgba(143, 97, 49, 0.42);
  stroke-width: 1.2;
}

.south-sea-inner {
  fill: rgba(248, 241, 224, 0.72);
  stroke: rgba(184, 162, 118, 0.32);
  stroke-width: 1;
}

.south-sea-title {
  font-size: 13px;
  font-weight: 700;
  fill: #31403a;
}

.south-sea-divider {
  stroke: rgba(154, 133, 96, 0.55);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.south-sea-islands {
  fill: rgba(240, 225, 190, 0.9);
  stroke: #41382f;
  stroke-width: 0.9;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.reference-special-region {
  pointer-events: none;
}

.reference-special-region-shape {
  fill: var(--reference-region-fill, #f5e9cc);
  stroke: #31403a;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: url(#inkWobble);
}

body[data-map-province-entry="enabled"] .reference-special-region.is-interactive {
  pointer-events: auto;
  cursor: pointer;
}

body[data-map-province-hover="enabled"] .reference-special-region.is-interactive:hover .reference-special-region-shape,
.reference-special-region.is-active .reference-special-region-shape {
  fill: var(--reference-region-fill-active, var(--reference-region-fill, #f5e9cc));
}

.province-browse-button {
  pointer-events: auto;
  cursor: pointer;
}

.province-browse-hit-area {
  fill: transparent;
  pointer-events: all;
}

.province-browse-pill-shape {
  fill: rgba(255, 251, 243, 0.95);
  stroke: rgba(79, 86, 78, 0.26);
  stroke-width: 1.05;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 6px 14px rgba(61, 59, 39, 0.12));
}

.province-browse-button.has-items .province-browse-pill-shape {
  fill: rgba(226, 236, 216, 0.98);
  stroke: rgba(49, 64, 58, 0.42);
}

.province-browse-button.is-empty .province-browse-pill-shape {
  fill: rgba(255, 251, 243, 0.94);
  opacity: 0.92;
}

.province-browse-button.is-active .province-browse-pill-shape,
.province-browse-button:hover .province-browse-pill-shape {
  fill: #22403a;
  stroke: transparent;
  filter: drop-shadow(0 10px 20px rgba(42, 58, 54, 0.18));
}

.province-browse-pill-name,
.province-browse-pill-count {
  fill: #24403b;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.province-browse-pill-count {
  fill: #6c5e47;
  font-size: 10px;
}

.province-browse-button.is-active .province-browse-pill-name,
.province-browse-button.is-active .province-browse-pill-count,
.province-browse-button:hover .province-browse-pill-name,
.province-browse-button:hover .province-browse-pill-count {
  fill: #fff7e7;
}

.project-marker {
  cursor: pointer;
}

.project-hit-area {
  fill: transparent;
  pointer-events: all;
}

.project-marker:hover .project-tag,
.project-marker.is-active .project-tag {
  opacity: 1;
}

.project-marker:hover .project-bubble-core,
.project-marker.is-active .project-bubble-core {
  filter: brightness(1.05);
}

.project-bubble {
  transition: opacity .18s ease;
  pointer-events: none;
}

.project-tag {
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}

.project-bubble-core {
  stroke: rgba(255,250,240,0.96);
  stroke-width: 3;
}

.project-icon-glyph {
  pointer-events: none;
}

.project-tag-box {
  fill: rgba(255,251,243,0.96);
  stroke: rgba(122,106,82,0.12);
  stroke-width: 1;
}

.project-tag-text {
  font-size: 12px;
  fill: #2c2d28;
  font-family: var(--sans);
  font-weight: 700;
}

@media (min-width: 1181px) {
  .map-shell {
    padding-top: 22px;
  }

  .map-shell .section-index {
    margin-bottom: 8px;
  }

  .map-shell .page-head {
    margin-bottom: 12px;
  }

  .map-shell .page-head .section-note {
    margin-top: 8px;
  }

  .map-shell .map-browse-row {
    margin-bottom: 12px;
  }

  .map-shell .search-row {
    margin-bottom: 12px;
  }

  .map-shell .map-layout {
    margin-top: -2px;
  }
}

#provinceLabelLayer {
  pointer-events: none;
}

.taiwan-outline {
  fill: rgba(217, 228, 245, 0.88);
  stroke: #3f3a31;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.map-legend {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.legend-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a6646;
  font-weight: 700;
}

.legend-helper {
  margin: 0;
  color: #6b614d;
  font-size: 13px;
  line-height: 1.6;
}

.legend-helper-empty {
  color: #8d7d61;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,250,238,0.86);
  border: 1px solid rgba(122,106,82,0.12);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.legend-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(71, 61, 36, 0.08);
}

.legend-item.is-active {
  background: linear-gradient(180deg, rgba(34,64,58,0.98), rgba(41,75,67,0.96));
  border-color: transparent;
  box-shadow: 0 16px 28px rgba(42, 58, 54, 0.18);
}

.legend-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.legend-text {
  font-weight: 700;
}

.legend-count {
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(36, 64, 59, 0.08);
  color: #5d533f;
  font-size: 12px;
  font-weight: 700;
}

.legend-emblem {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
}

.legend-emblem svg {
  width: 14px;
  height: 14px;
}

.legend-item.is-active .legend-text {
  color: #fff7e7;
}

.legend-item.is-active .legend-count {
  background: rgba(255, 247, 231, 0.14);
  color: #fff2d3;
}

.legend-reset {
  border: 1px solid rgba(122,106,82,0.14);
  background: rgba(255,250,238,0.86);
  color: #23413b;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.legend-reset:hover {
  transform: translateY(-1px);
}

.map-source-note {
  margin: 14px 4px 0;
  color: #6c624f;
}

.map-footnote-stack {
  display: grid;
  gap: 0;
}

.map-compliance-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 251, 243, 0.92);
  border: 1px solid rgba(204,184,144,0.62);
  display: grid;
  gap: 16px;
}

.map-compliance-copy {
  display: grid;
  gap: 8px;
}

.map-compliance-copy h3,
.map-compliance-copy p {
  margin: 0;
}

.map-compliance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.map-compliance-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(251, 244, 227, 0.72);
  border: 1px solid rgba(204,184,144,0.42);
  display: grid;
  gap: 8px;
}

.map-compliance-item span {
  color: #7a6646;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-compliance-item strong {
  line-height: 1.6;
}

.map-compliance-item-wide {
  grid-column: 1 / -1;
}

.map-context-panel {
  padding: 0;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h-compact) + 26px);
  height: var(--map-frame-h);
  min-height: var(--map-frame-h);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h-compact) + 34px);
}

.map-context-scroll {
  display: grid;
  gap: 14px;
  align-content: start;
  height: 100%;
  overflow: auto;
  padding: 18px;
}

.map-context-panel .detail-section {
  background: rgba(255,252,244,0.88);
  padding: 16px;
}

.map-context-panel .detail-section h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.map-context-panel .detail-section p {
  font-size: 15px;
  line-height: 1.72;
}

.map-context-panel .detail-meta,
.map-context-panel .detail-tags {
  gap: 6px;
}

.map-context-panel .meta-pill,
.map-context-panel .tag-pill {
  padding: 6px 10px;
  font-size: 12px;
}

.map-panel-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,252,244,0.9);
  border: 1px solid rgba(204,184,144,0.6);
  display: grid;
  gap: 10px;
}

.map-panel-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.map-panel-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-panel-card h3,
.map-preview-summary-block h3,
.map-preview-title {
  margin: 0;
}

.map-panel-card h3 {
  font-size: 22px;
  line-height: 1.14;
}

.map-panel-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.72;
}

.map-preview-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.province-directory-card,
.province-spotlight-card,
.south-sea-card {
  align-content: start;
}

.province-mode-scroll {
  grid-template-rows: minmax(0, 1fr) auto;
}

.project-mode-scroll {
  grid-auto-rows: max-content;
}

.province-directory-card {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.province-directory-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.province-directory-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(204,184,144,0.56);
  background: rgba(255, 251, 243, 0.94);
  padding: 11px 13px;
  cursor: pointer;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background-color .22s ease;
}

.province-directory-item:hover {
  transform: translateY(-1px);
}

.province-directory-item.is-active {
  border-color: transparent;
  background: linear-gradient(180deg, rgba(227, 238, 216, 0.98), rgba(214, 230, 201, 0.96));
  box-shadow: 0 16px 28px rgba(46,57,47,0.14);
}

.province-directory-item.is-empty {
  opacity: 0.82;
}

.province-directory-name {
  font-weight: 700;
  color: #243a35;
  font-size: 15px;
}

.province-directory-count {
  color: #6d5f49;
  font-size: 12px;
}

.south-sea-panel-surface {
  border-radius: 18px;
  overflow: hidden;
  background: rgba(248, 241, 224, 0.72);
  border: 1px solid rgba(204,184,144,0.56);
}

.south-sea-panel-surface svg {
  width: 100%;
  height: auto;
  display: block;
}

.map-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-preview-heading {
  display: grid;
  gap: 6px;
}

.map-preview-title {
  font-size: 27px;
  line-height: 1.14;
  font-family: var(--serif);
}

.map-preview-subtitle {
  margin: 0;
  color: #5a5f58;
  font-size: 15px;
  line-height: 1.6;
}

.map-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}

.map-preview-icon svg {
  width: 20px;
  height: 20px;
}

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

.preview-fact {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,252,244,0.9);
  border: 1px solid rgba(204,184,144,0.56);
  display: grid;
  gap: 5px;
}

.preview-fact-wide {
  grid-column: 1 / -1;
}

.preview-label {
  color: #7a6646;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-fact strong {
  line-height: 1.5;
}

.map-preview-summary-block {
  margin: 0;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-action {
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  cursor: pointer;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    background-color .22s ease,
    border-color .22s ease,
    color .22s ease;
}

.panel-action:hover {
  transform: translateY(-2px);
}

.panel-action-primary {
  border: 1px solid transparent;
  background: #22403a;
  color: #fff7e7;
  box-shadow: 0 12px 22px rgba(35, 65, 59, 0.16);
}

.panel-action-secondary {
  border: 1px solid rgba(122,106,82,0.18);
  background: rgba(255,251,243,0.94);
  color: var(--ink);
}

.province-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.secondary-filter-shell {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,252,244,0.76);
  border: 1px solid rgba(204,184,144,0.56);
  margin-bottom: 14px;
}

.secondary-filter-shell .section-index {
  margin-bottom: 8px;
}

.detail-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-top {
  display: grid;
  gap: 12px;
}

.detail-title {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.14;
}

.detail-subtitle {
  font-size: 17px;
  color: #5d5d55;
  line-height: 1.55;
}

.detail-meta,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-quick-nav {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,251,243,0.72);
  border: 1px solid rgba(204,184,144,0.5);
}

.detail-quick-nav-label {
  color: #7a6646;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-quick-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-anchor-button {
  border: 1px solid rgba(122,106,82,0.16);
  background: rgba(255,252,246,0.96);
  color: #264640;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background-color .18s ease,
    box-shadow .18s ease;
}

.detail-anchor-button:hover {
  transform: translateY(-1px);
  border-color: rgba(36,68,61,0.24);
  background: rgba(235,245,238,0.96);
  box-shadow: 0 10px 18px rgba(45,58,47,0.08);
}

.detail-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-fact {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,252,244,0.92);
  border: 1px solid rgba(204,184,144,0.62);
  display: grid;
  gap: 8px;
}

.detail-fact-wide {
  grid-column: 1 / -1;
}

.detail-fact-label {
  color: #7a6646;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-fact strong {
  line-height: 1.6;
}

.meta-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,251,243,0.94);
  border: 1px solid rgba(122,106,82,0.12);
  font-size: 13px;
}

.detail-lead-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,252,245,0.97), rgba(248,241,225,0.98));
  border: 1px solid rgba(204,184,144,0.62);
}

.detail-lead-label {
  color: #7a6646;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-lead-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  color: #445047;
}

.detail-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-media-card {
  min-height: 0;
  border-radius: 22px;
  padding: 18px 20px;
  display: grid;
  gap: 14px;
  background: rgba(255,252,244,0.94);
  border: 1px solid rgba(204,184,144,0.62);
}

.detail-media-card.has-image {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: stretch;
}

.detail-media-preview {
  min-height: 230px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(246,234,209,0.86), rgba(240,226,193,0.9)),
    radial-gradient(circle at top left, rgba(255,255,255,0.75), transparent 55%);
  border: 1px solid rgba(204,184,144,0.52);
}

.detail-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-media-copy {
  display: grid;
  gap: 8px;
}

.detail-media-copy p {
  margin: 0;
  line-height: 1.7;
}

.detail-media-heading {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.2;
}

.detail-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.detail-media-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 14px;
  color: #20413b;
  background: #f6ead1;
  text-decoration: none;
  width: fit-content;
}

.detail-media-link {
  border: 1px solid rgba(122,106,82,0.18);
  background: rgba(255,252,246,0.96);
}

.detail-sections {
  display: grid;
  gap: 14px;
}

.detail-section {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,252,244,0.92);
  border: 1px solid rgba(204,184,144,0.62);
}

.detail-accordion {
  overflow: hidden;
}

.detail-accordion-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.detail-accordion-summary::-webkit-details-marker {
  display: none;
}

.detail-accordion-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  color: #243c37;
}

.detail-accordion-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(34,64,58,0.08);
  border: 1px solid rgba(34,64,58,0.12);
  flex: 0 0 auto;
}

.detail-accordion-icon::before,
.detail-accordion-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  background: #24443e;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease, transform .18s ease;
}

.detail-accordion-icon::after {
  width: 2px;
  height: 12px;
}

.detail-accordion[open] .detail-accordion-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0.2);
}

.detail-accordion-body {
  margin-top: 14px;
}

.detail-section h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.detail-section p {
  margin: 0;
  line-height: 1.8;
  color: #4f564e;
}

.detail-section p + p {
  margin-top: 12px;
}

.detail-section-sources,
.detail-reference-block,
.detail-inheritors {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.detail-section-source-label,
.detail-subsection-title {
  color: #7a6646;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-source-pills,
.detail-inheritor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-source-pill,
.detail-inheritor-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,249,238,0.96);
  border: 1px solid rgba(204,184,144,0.62);
  color: #4d473d;
  text-decoration: none;
}

.detail-inheritor-item {
  flex-direction: column;
  align-items: flex-start;
  border-radius: 16px;
}

.detail-inheritor-item small,
.detail-reference-item small {
  color: #7a6646;
  font-size: 12px;
}

.detail-reference-list {
  display: grid;
  gap: 10px;
}

.detail-reference-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,249,238,0.96);
  border: 1px solid rgba(204,184,144,0.62);
  text-decoration: none;
  color: #3f463f;
}

.detail-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-section-source_audit {
  background: rgba(251,248,240,0.96);
}

.detail-empty {
  margin: auto;
  text-align: center;
  max-width: 320px;
}

.empty-button {
  border: 1px solid rgba(122,106,82,0.18);
  background: #fffaf0;
  color: var(--ink);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.project-card {
  text-align: left;
  width: 100%;
  border: 1px solid rgba(204,184,144,0.62);
  background: rgba(255,252,244,0.94);
  border-radius: 22px;
  padding: 18px 18px 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 332px;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background-color .22s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(122,106,82,0.38);
  box-shadow: 0 16px 30px rgba(46,57,47,0.12);
}

.project-card.is-active {
  border-color: transparent;
  box-shadow: 0 16px 30px rgba(46,57,47,0.16);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}

.card-title-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.card-icon svg {
  width: 18px;
  height: 18px;
}

.card-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.28;
}

.card-subtitle,
.card-meta,
.card-summary {
  margin: 0;
  color: #5b625a;
  line-height: 1.7;
}

.card-subtitle {
  font-size: 14px;
  line-height: 1.55;
}

.card-meta {
  font-size: 13px;
  color: #6b644f;
  line-height: 1.6;
}

.card-summary {
  font-size: 14px;
  color: #4f564e;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.7em * 2);
}

.card-action {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(204,184,144,0.46);
  display: flex;
  align-items: center;
}

.card-action span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 64, 58, 0.08);
  color: #22403a;
  font-size: 13px;
  font-weight: 700;
}

.official-note-block h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  color: #f7ecd4;
}

.hidden {
  display: none !important;
}

body[data-map-mode="reference-calibrated-handdrawn"][data-map-context-panel="disabled"] .map-layout {
  grid-template-columns: 1fr;
}

body[data-map-zoom-pan="disabled"] .official-map-stage {
  min-height: 0;
  cursor: default;
  touch-action: auto;
}

body[data-map-search="disabled"] .search-row,
body[data-map-zoom-pan="disabled"] .map-toolbar,
body[data-map-zoom-pan="disabled"] .map-hint,
body[data-map-legend="disabled"] .map-legend,
body[data-map-context-panel="disabled"] .map-context-panel {
  display: none !important;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(20px, -18px, 0) scale(1.04);
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .breadcrumb,
  .site-actions {
    width: 100%;
  }

  .hero,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-context-panel {
    position: static;
    height: auto;
    min-height: 0;
  }

  .map-context-scroll {
    height: auto;
  }

  .map-frame {
    height: auto;
  }

  .official-map-stage {
    height: auto;
    min-height: 640px;
  }

  .hero {
    min-height: auto;
  }

  .detail-media-card.has-image {
    grid-template-columns: 1fr;
  }

  body[data-nav-mode="compact"] .brand-subtitle {
    opacity: 1;
    transform: none;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 820px) {
  :root {
    --shell-w: min(100vw - 24px, 1380px);
  }

  .site-header {
    top: 12px;
    padding: 12px;
    border-radius: 22px;
  }

  .site-main {
    padding-top: calc(var(--header-h) + 72px);
  }

  body[data-nav-mode="compact"] .site-header {
    min-height: auto;
    padding: 11px 12px;
    border-radius: 18px;
  }

  body[data-nav-mode="compact"] .site-main {
    padding-top: calc(var(--header-h-compact) + 56px);
  }

  .hero,
  .stage-shell {
    padding: 20px;
    border-radius: 24px;
  }

  .hero {
    gap: 18px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .detail-quick-nav-links,
  .detail-status-strip,
  .detail-media-actions {
    gap: 8px;
  }

  .detail-lead-card,
  .detail-media-card,
  .detail-section {
    padding: 16px;
  }

  .detail-media-heading,
  .detail-accordion-title {
    font-size: 20px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 0;
  }

  .search-row {
    justify-content: stretch;
  }

  .search-box {
    width: 100%;
  }

  .map-preview-header,
  .preview-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .map-preview-grid {
    grid-template-columns: 1fr;
  }

  .detail-fact-grid {
    grid-template-columns: 1fr;
  }

  .province-mode-scroll {
    grid-template-rows: auto;
  }

  .detail-fact-wide {
    grid-column: auto;
  }

  .preview-fact-wide {
    grid-column: auto;
  }

  .map-compliance-grid {
    grid-template-columns: 1fr;
  }

  .map-compliance-item-wide {
    grid-column: auto;
  }

  .map-toolbar {
    left: 16px;
    right: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .map-hint {
    top: 88px;
    right: 16px;
    max-width: calc(100% - 32px);
  }

  .map-inset-button {
    right: 16px;
    bottom: 16px;
  }

  .south-sea-float-panel {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: 64px;
    max-height: min(340px, calc(100% - 120px));
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    white-space: normal;
  }

  body[data-nav-mode="compact"] .brand-title {
    font-size: 16px;
  }
}
