:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #eee9d9;
  background: #101918;
  --ink: #eee9d9;
  --muted: #acb7ad;
  --gold: #e2bd76;
  --brass: #916d39;
  --line: #35443b;
  --panel: #1b2724;
  --raised: #242f29;
  --dark: #121e1c;
  --shadow: 0 8px 22px #070c0a70;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 58% 0%, #283126, #141e1b 41%, #101918 100%); min-height: 100vh; }
h1, h2, h3, h4, h5, p { margin: 0; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: #91561e; }
button:focus-visible, canvas:focus-visible, a:focus-visible { outline: 2px solid #eac47a; outline-offset: 3px; }
.app-bar {
  min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 8px clamp(14px, 2.5vw, 42px); border-bottom: 1px solid #a38e553c; background: #141f1d;
  box-shadow: 0 4px 20px #070c0a82;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-icon {
  width: 40px; height: 42px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid #b18d52; background: linear-gradient(155deg, #655132, #352c21 80%); color: #f5d58f;
  font: 26px Georgia, serif;
}
.brand strong { font: 700 25px/.96 Georgia, "Times New Roman", serif; display: block; letter-spacing: .45px; }
.brand small { color: #c9bea4; display: block; margin-top: 4px; font-size: 11px; letter-spacing: 1px; }
#scenarios, .app-tools { display: flex; align-items: center; gap: 6px; }
.scenario-button {
  display: flex; gap: 8px; align-items: center; padding: 5px 11px; min-height: 40px;
  color: #c4c6b7; background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left;
}
.scenario-button:hover { background: #24312b; }
.scenario-button[aria-current="true"] { background: #302d20; color: #f1d699; border-color: #937344; }
.scenario-button strong { font-size: 13px; display: block; }
.scenario-button small { color: #b9b8a5; display: block; font-size: 11px; margin-top: 2px; }
.scenario-icon { font-size: 17px; width: 25px; text-align: center; }
.main { max-width: 1650px; margin: 0 auto; padding: 16px clamp(12px, 2.45vw, 40px) 25px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eyebrow { color: var(--gold); font-size: 12px; letter-spacing: 1.2px; font-weight: 750; }
h1 { font-family: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif; font-size: clamp(26px, 3vw, 44px); letter-spacing: .3px; line-height: 1.12; margin: 4px 0 5px; }
.subtitle { color: var(--muted); font-size: 13px; line-height: 1.45; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.era, .map-size, .brief-round, .build-tag {
  white-space: nowrap; border: 1px solid #7b6942; background: #302a1d; color: #ead19a;
  border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 750;
}
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 6px 10px;
  border-radius: 7px; font-size: 13px; font-weight: 750; white-space: nowrap; transition: background .16s, color .16s, border-color .16s;
}
.button span { font-size: 16px; line-height: 1; }
.button.subtle { color: #dedcc9; border: 1px solid #46544b; background: #202c27; }
.button.subtle:hover:not(:disabled) { background: #34423a; border-color: #798170; }
.button.primary { color: #302511; border: 1px solid #f1cc87; background: linear-gradient(180deg, #f0d296, #d4a554); box-shadow: 0 2px 10px #ad75383b; }
.button.primary:hover:not(:disabled) { background: #ffe2a4; }
.button:disabled { opacity: .5; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.metric, .panel, .turn-strip, .mission-panel, .wisdom { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); }
.metric {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon title" "icon value" "status status";
  gap: 2px 9px; min-width: 0; padding: 9px 10px; border-top-color: var(--tone);
}
.metric-icon, .heading-icon {
  width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px;
  background: #263b32; border: 1px solid #547162; color: #a6ddc1; font: 20px system-ui, sans-serif;
}
.metric-icon { grid-area: icon; align-self: center; width: 38px; height: 38px; background: var(--tint); color: var(--tone); border-color: var(--tone); }
.metric h2 { grid-area: title; color: #c5cabc; font-size: 12px; }
.metric-values { grid-area: value; display: flex; align-items: baseline; justify-content: space-between; gap: 2px 6px; flex-wrap: wrap; }
.metric-value { font: 750 27px/.95 system-ui, sans-serif; letter-spacing: -.65px; }
.metric-value small { font: 650 12px system-ui, sans-serif; padding-left: 3px; color: #bec4b5; }
.delta { color: #92d0ad; font-size: 11px; font-weight: 750; white-space: nowrap; }
.delta.negative, .metric.critical .metric-status { color: #ffaaa5; }
.delta.neutral { color: var(--muted); }
.metric-status { grid-area: status; font-size: 12px; line-height: 1.4; color: var(--tone); margin-top: 4px; font-weight: 700; }
.metric.warning { border-color: #976444; }
.metric.critical { background: #3b2825; border-color: #ce796f; }
.metric.pulse { animation: warning 2.6s ease-in-out infinite; }
@keyframes warning { 50% { box-shadow: 0 0 14px #df6f6574, inset 0 0 12px #cd5d502b; } }
.meter { display: block; height: 6px; overflow: hidden; border-radius: 20px; background: #131e1b; }
.meter i { display: block; height: 100%; width: var(--width); border-radius: inherit; background: var(--tone); transition: width .25s ease; }
.mission-panel { margin-top: 9px; display: flex; align-items: stretch; gap: 8px; padding: 8px; background: #292a20; border-color: #68583a; }
.mission-header { display: flex; align-items: center; gap: 8px; min-width: 145px; padding-left: 3px; }
.mission-header h2 { font-size: 14px; color: #f2dbab; }
.mission-header p { font-size: 12px; color: #bdaf90; margin-top: 2px; }
.missions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; flex: 1; }
.mission { padding: 4px 8px; border: 1px solid #564c35; border-radius: 6px; background: #302e22; min-width: 0; }
.mission.done { border-color: #667b59; background: #293627; }
.mission strong { color: #efe4c6; font-size: 13px; line-height: 1.4; }
.mission small { display: block; color: #cfc091; font-size: 11px; line-height: 1.4; margin-top: 2px; }
.mission.done small { color: #b2d095; }
.turn-strip { display: flex; gap: 14px; align-items: center; padding: 7px 10px; margin: 9px 0; }
.round-counter { display: flex; align-items: center; gap: 8px; border-right: 1px solid #4a574c; padding-right: 10px; }
.round-counter strong, .round-counter small { display: block; white-space: nowrap; }
.round-counter strong { font-size: 13px; }
.round-counter small { color: var(--muted); font-size: 11px; }
.round-icon { color: #dfbe7d; font: 25px/.9 Georgia, serif; }
#steps { list-style: none; display: flex; flex: 1; gap: 5px; padding: 0; margin: 0; }
#steps li { display: flex; flex: 1; align-items: center; gap: 6px; color: #bac3b8; font-size: 12px; font-weight: 700; white-space: nowrap; }
#steps li::after { content: ""; height: 1px; background: #455249; flex: 1; margin-left: 4px; }
#steps li:last-child::after { display: none; }
#steps li span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 100%; background: #303b33; color: #d2d8c6; font-size: 11px; }
#steps li[aria-current="step"] { color: #f1d496; }
#steps li[aria-current="step"] span { background: #e5bd72; color: #39290f; }
#steps li.done span { background: #3f604c; color: #daf3d7; }
.turn-track { display: flex; gap: 4px; }
.turn-track i { display: block; width: 7px; height: 7px; border-radius: 2px; background: #46564d; }
.turn-track i.done { background: #89794f; }
.turn-track i.active { background: #ebc47b; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(295px, 347px); gap: 10px; align-items: start; }
.panel, .head-group { min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px; }
.head-group { display: flex; align-items: center; gap: 8px; }
.panel-head h2 { font-size: 16px; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.heading-icon.amber { color: #ebc37a; background: #413823; border-color: #78613b; }
.heading-icon.lavender { color: #dac2e8; background: #3b3246; border-color: #665778; }
.map-wrap {
  height: clamp(348px, min(38vw, 100vh - 530px), 560px); margin: 0 8px; position: relative; isolation: isolate;
  border: 1px solid #5e6248; border-radius: 8px; background: radial-gradient(ellipse at 50% 42%, #425344, #253831 65%, #192925); overflow: hidden;
}
#map { width: 100%; height: 100%; display: block; touch-action: manipulation; outline-offset: -4px; }
.map-controls { position: absolute; display: grid; gap: 3px; bottom: 10px; right: 9px; z-index: 1; }
.map-controls button { width: 29px; height: 28px; padding: 0; border: 1px solid #ae9461; border-radius: 6px; background: #172824eb; color: #f3d49a; font: 700 18px system-ui, sans-serif; }
.map-controls button:hover:not(:disabled) { background: #3c4c3b; }
.map-controls button:disabled { opacity: .45; }
.map-coordinates, .map-condition, .compass { position: absolute; pointer-events: none; color: #f0dcae; }
.map-coordinates, .map-condition { padding: 4px 7px; border: 1px solid #b291555e; background: #162622e8; border-radius: 5px; font-size: 11px; font-weight: 700; }
.map-coordinates { bottom: 9px; left: 9px; }
.map-condition { top: 9px; left: 9px; }
.compass { top: 10px; right: 14px; text-align: center; font: 28px/.9 Georgia, serif; }
.compass span { display: block; font: 700 10px system-ui, sans-serif; margin-bottom: 4px; }
.legend { display: flex; justify-content: center; gap: 5px 12px; flex-wrap: wrap; padding: 8px; color: #c3cbbd; }
.legend span { display: flex; align-items: center; gap: 5px; font-size: 11px; white-space: nowrap; }
.legend i { width: 12px; height: 11px; background: var(--terrain); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.tutorial { display: flex; align-items: center; gap: 7px; margin: 7px 8px; padding: 5px 7px; background: #39412c; border: 1px solid #a59959; border-radius: 7px; }
.tutorial > b { flex: none; color: #ffe5a9; font-size: 12px; }
.tutorial p { flex: 1; color: #eeeacf; font-size: 12px; line-height: 1.45; }
.tutorial .button { font-size: 11px; min-height: 27px; padding: 4px 6px; }
.guide-pulse { animation: guidance 1.8s ease-in-out infinite; outline: 2px solid #e6cb81; outline-offset: 1px; }
@keyframes guidance { 50% { outline-color: #fff1b7; box-shadow: 0 0 17px #dfc56b80; } }
.round-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.round-actions small { color: var(--muted); font-size: 11px; white-space: nowrap; }
#inspector { scroll-margin-top: 10px; }
.adjacency-key { margin: 0 8px 7px; padding: 5px 7px; border: 1px dashed #5d7864; background: #23362e; border-radius: 6px; color: #c1dac5; font-size: 12px; }
.workforce, .scout-box { margin: 0 8px 7px; padding: 7px; background: #23332d; border: 1px solid #4b6154; border-radius: 7px; }
.workforce-head { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.workforce strong, .scout-box strong { font-size: 13px; color: #e0e7d4; }
.workforce small, .scout-box p { display: block; color: #c3d1c1; font-size: 12px; line-height: 1.45; margin-top: 4px; }
.worker-controls { display: flex; align-items: center; gap: 4px; }
.worker-controls .button { padding: 0 7px; font-size: 17px; min-height: 27px; min-width: 27px; }
.workforce .worker-total { font-size: 12px; white-space: nowrap; font-weight: 750; color: #b6deb7; }
.scout-box .button { margin-top: 7px; width: 100%; }
.discovery { margin: 0 8px 7px; padding: 6px 8px; border: 1px solid #827044; border-radius: 6px; background: #392e20; color: #f1d59e; font-size: 12px; line-height: 1.4; }
.buildings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 8px 7px; }
.building {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; align-items: center; gap: 3px 6px;
  padding: 7px; min-width: 0; text-align: left; color: #f1eddb; background: #26372f; border: 1px solid #4d6859; border-radius: 7px;
}
.building:hover:not(:disabled) { background: #374c3e; border-color: #96a676; }
.building:disabled { border-color: #424e44; background: #232e29; color: #c7ccbf; }
.building .b-icon { font-size: 19px; line-height: 1; }
.building strong { font-size: 13px; }
.building small { grid-column: 1 / -1; color: #bfcabb; font-size: 11px; line-height: 1.35; }
.building .build-gains { color: #acdbac; font-weight: 750; }
.building .cost { grid-column: 1 / -1; color: #e3c78d; font-size: 11px; font-weight: 750; }
.building:disabled .cost { color: #c7ae80; }
.wonder { margin: 0 8px 8px; padding: 8px; border: 1px solid #8b7045; border-radius: 7px; background: linear-gradient(150deg, #3f3524, #262c24 78%); }
.wonder h3 { font-size: 14px; color: #f2d391; }
.wonder-top { display: flex; gap: 7px; justify-content: space-between; align-items: center; }
.wonder-top .button { min-height: 26px; font-size: 11px; padding: 4px 6px; }
.wonder p { color: #ddceac; font-size: 12px; margin-top: 4px; line-height: 1.45; }
.wonder-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 7px 0; }
.wonder-stages span { padding: 4px 2px; border: 1px solid #776342; border-radius: 5px; color: #d6c7a7; font-size: 10px; text-align: center; }
.wonder-stages span.done { background: #5a492c; color: #ffdfa0; }
.wonder .wonder-build { width: 100%; }
.intel { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.brief-body { padding: 0 10px; }
.brief-body h3 { font-size: 16px; margin-bottom: 3px; }
.brief-body p, .advisor p { color: #c9d2c3; font-size: 13px; line-height: 1.55; }
.status { margin-top: 7px; padding: 6px 8px; border-radius: 6px; background: #3c3022; color: #f0cea1; font-size: 12px; line-height: 1.55; }
.advisor-label { font-size: 13px; color: #c9d4c3; margin: 9px 10px 4px; }
.advisors { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 0 8px 8px; }
.advisor { display: flex; gap: 6px; padding: 7px; background: #283831; border-radius: 6px; }
.advisor:nth-child(2) { background: #383426; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 6px; background: #42574a; font-size: 17px; }
.advisor:nth-child(2) .avatar { background: #5d4d32; }
.advisor strong { font-size: 12px; }
#comparison { padding: 3px 10px 9px; }
.faction + .faction { border-top: 1px solid #46574e; margin-top: 7px; padding-top: 7px; }
.faction h3 { display: flex; justify-content: space-between; gap: 3px; font-size: 13px; margin-bottom: 4px; }
.faction h3 small { font-size: 11px; color: #c4c9bc; }
.faction .rank-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 31px; gap: 5px; align-items: center; margin-top: 3px; font-size: 12px; color: #c7cebe; }
.rank-row strong { font: 700 12px system-ui, sans-serif; text-align: right; }
.wisdom { margin-top: 10px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; background: #292a20; }
.wisdom strong { color: #edce93; font-size: 13px; }
.wisdom p { color: #d5cfb7; font-size: 13px; }
.wisdom small { margin-left: auto; white-space: nowrap; color: #cab686; font-size: 11px; }
body.unrest::after { content: ""; position: fixed; z-index: 2; inset: 0; pointer-events: none; box-shadow: inset 0 0 46px #d35d5275; }
.toast { position: fixed; z-index: 6; right: 16px; bottom: 16px; max-width: min(480px, 92vw); opacity: 0; transform: translateY(8px); pointer-events: none; padding: 9px 12px; border: 1px solid #9a8352; background: #273a2d; color: #f4e2b8; border-radius: 7px; font-size: 13px; box-shadow: var(--shadow); transition: .2s ease; }
.toast.visible { opacity: 1; transform: none; }
.celebration { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; overflow: hidden; background: radial-gradient(ellipse, #f7c45b49, transparent 69%); animation: festival 2.6s ease both; }
.celebration strong { z-index: 1; padding: 12px 20px; border: 1px solid #f3d891; border-radius: 8px; background: #3c3023ed; color: #ffe7a8; box-shadow: 0 0 70px #f8ce7463; font-size: clamp(19px, 3vw, 35px); }
.celebration i { position: absolute; top: 50%; left: 50%; color: var(--spark); font: normal 22px Georgia, serif; animation: spark 2.3s var(--delay) cubic-bezier(.12,.45,.47,.98) both; }
@keyframes spark { 0% { transform: rotate(var(--angle)) translateX(0); opacity: 0; } 19% { opacity: 1; } 100% { transform: rotate(var(--angle)) translateX(var(--travel)) rotate(120deg); opacity: 0; } }
@keyframes festival { 0%, 100% { opacity: 0; } 15%, 70% { opacity: 1; } }
dialog { color-scheme: light; color: #2c3024; background: #eeeade; border: 1px solid #bd9b60; border-radius: 13px; padding: 0; width: min(644px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 85px #070d0c9c; }
dialog::backdrop { background: #0e1916a9; backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: start; gap: 8px; padding: 12px 15px; border-bottom: 1px solid #8d774e; background: #29352c; color: #f6e8ca; }
.dialog-head h2 { margin-top: 3px; font-size: 23px; }
.dialog-head h2:focus { outline: none; }
.dialog-body { padding: 13px 15px 15px; }
.dialog-body p { color: #474b3b; line-height: 1.6; font-size: 14px; }
.dialog-body p + p { margin-top: 7px; }
.dialog-body .button.subtle { color: #354333; background: #f7f2e7; border-color: #bdb8a1; }
.dialog-body .button.subtle:hover:not(:disabled) { background: #e6eadb; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 13px; }
.options { display: grid; gap: 6px; margin-top: 11px; }
.option { text-align: left; padding: 8px 10px; border: 1px solid #b6bea9; background: #f7f4eb; color: #294633; border-radius: 7px; }
.option:hover:not(:disabled), .option:focus-visible { background: #e5efdc; border-color: #7b9a78; }
.option strong { display: block; font-size: 15px; }
.option small { display: block; margin-top: 3px; font-size: 12px; color: #615448; line-height: 1.4; }
.option:disabled { border-style: dashed; color: #5e6154; background: #e6e5d9; }
.timeline, .feedback-notes { padding-left: 19px; margin: 8px 0 0; color: #444e3e; font-size: 14px; line-height: 1.6; }
.timeline li + li, .feedback-notes li + li { margin-top: 5px; }
.timeline strong, .report-points h4 { color: #346043; }
.report-score { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.grade { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 9px; background: #315d44; color: #f7e8c3; font: 800 38px system-ui, sans-serif; }
.report-heading { font-size: 16px; margin: 12px 0 4px; }
.report-points { display: grid; gap: 6px; margin-top: 7px; }
.report-points article { padding: 7px 9px; border: 1px solid #c8cfb9; border-radius: 7px; background: #f3f3e9; }
.report-points h4 { margin-bottom: 3px; }
.review-reason, .dialog-body .causal-note { padding: 7px 9px; border-radius: 6px; background: #efe0c0; margin-top: 7px; }
.review-reason h5 { color: #705629; font-size: 13px; margin-bottom: 3px; }
.dialog-body .causal-note { border-left: 3px solid #a77e42; }
.dialog-body .decision-effects { color: #315742; font-weight: 750; }
.feedback-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.feedback-metric { display: grid; gap: 3px; padding: 6px 4px; border-radius: 7px; text-align: center; background: #e0eadb; border: 1px solid #c1cfb4; }
.feedback-metric span { font-size: 12px; font-weight: 700; }
.feedback-metric strong { color: #276147; font: 800 22px/1.05 system-ui, sans-serif; }
.feedback-metric .loss { color: #953f45; }
.feedback-metric small { font-size: 11px; color: #4b5d49; }
@media (max-width: 1000px) {
  .dashboard { grid-template-columns: minmax(0, 1fr) minmax(274px, 304px); }
  .turn-track { display: none; }
  .map-wrap { height: clamp(365px, 49vw, 500px); }
  .app-bar { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .app-bar { gap: 6px; padding: 8px 10px; }
  .brand-icon { width: 31px; height: 32px; }
  .brand strong { font-size: 20px; }
  .brand small { display: none; }
  #scenarios { order: 3; width: 100%; }
  .scenario-button { flex: 1; padding: 3px 7px; min-height: 32px; }
  .scenario-button small { display: none; }
  .app-tools { gap: 3px; }
  .app-tools .button { min-height: 29px; padding: 4px 5px; font-size: 11px; }
  .main { padding: 10px 8px; }
  .dashboard, .intel { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .metric-icon { width: 30px; height: 30px; font-size: 17px; }
  .metric { padding: 6px 7px; gap: 2px 6px; }
  .metric-value { font-size: 22px; }
  .mission-panel { flex-wrap: wrap; }
  .missions { flex-basis: 100%; }
  .map-wrap { height: clamp(325px, 82vw, 470px); }
  .map-controls { top: 7px; bottom: auto; right: 7px; display: flex; }
  .compass { font-size: 20px; top: auto; bottom: 9px; right: 9px; }
  .map-condition { max-width: 50%; }
  .round-actions { gap: 4px; }
  .round-actions .button { padding: 5px 6px; font-size: 12px; }
  .header-actions { flex-wrap: wrap; justify-content: end; }
  .turn-strip { gap: 6px; padding-inline: 6px; flex-wrap: wrap; }
  .round-actions { flex-basis: 100%; padding-top: 5px; border-top: 1px solid var(--line); }
  .round-actions small { margin-right: auto; }
  #steps li { font-size: 11px; gap: 3px; }
  #steps li::after { display: none; }
}
@media (max-width: 370px) {
  #steps li span { display: none; }
  .round-counter { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .metric.pulse, .guide-pulse, .celebration, .celebration i { animation: none; }
  .celebration i { display: none; }
}


/* Storybook colors and resource illustrations */
:root {
  color-scheme: light;
  color: var(--ink);
  --ink: #233f36;
  --muted: #526e63;
  --gold: #ac681e;
  --line: #d1e2d9;
  --panel: #fffcf2;
  --shadow: 0 5px 0 #5f897217, 0 8px 22px #4b796419;
}
body {
  background: radial-gradient(ellipse at 72% 5%, #fff4cc 0, #fff4cc00 30%),
              linear-gradient(165deg, #e5f7ec, #f1faef 65%, #e5f5e9);
}
.app-bar { background: #236758; color: #fff7e5; border-bottom: 3px solid #174a42; box-shadow: 0 5px 11px #2265582d; }
.brand-icon { background: linear-gradient(145deg, #ffd887, #e9ac58); color: #654319; border: 2px solid #ffe9aa; border-radius: 12px; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-weight: 800; }
.brand small { color: #d3f2dd; }
.scenario-button { color: #e5f6eb; border-radius: 12px; }
.scenario-button small { color: #d6eee2; }
.scenario-button:hover { background: #357b6c; }
.scenario-button[aria-current="true"] { color: #1b5a45; border: 2px solid #81bc9b; background: #eef9df; box-shadow: 0 2px 0 #144b3e66; }
.scenario-button[aria-current="true"] small { color: #48775d; }
.app-tools .button.subtle { background: #347767; border-color: #8ec7aa; color: #fff8e9; }
.app-tools .button.subtle:hover { background: #448a78; }
h1 { color: #1e5a48; font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; font-weight: 850; letter-spacing: -.8px; }
.eyebrow { color: #776025; }
.era, .map-size, .brief-round, .build-tag { color: #67532f; background: #fff0cb; border-color: #e8cd8a; border-radius: 20px; }
.button { border-radius: 9px; }
.button.subtle { color: #286450; background: #f0faf2; border-color: #a7cdb6; }
.button.subtle:hover:not(:disabled) { color: #175c43; background: #dff2e6; border-color: #78aa8e; }
.button.primary { color: #614016; background: linear-gradient(180deg, #ffe491, #ffc75b); border: 1px solid #eab348; box-shadow: 0 3px 0 #d79b31; }
.button.primary:hover:not(:disabled) { background: #ffecac; }
.panel, .turn-strip, .mission-panel, .wisdom { border-radius: 15px; }
.metrics { position: sticky; top: 4px; z-index: 3; gap: 9px; }
.metric {
  grid-template-columns: minmax(0, 1fr) clamp(53px, 40%, 129px);
  grid-template-areas: "title art" "value art" "status art";
  min-height: 94px; align-content: center; gap: 4px 6px; border: 1px solid var(--stock-edge);
  background: linear-gradient(145deg, var(--stock-bg), #fffefa 90%); border-radius: 15px;
  color: #314338; padding: 8px 10px; box-shadow: 0 4px 0 var(--stock-edge), 0 6px 12px #3f755320;
}
.metric-food { --stock-bg: #e6f3cf; --stock-edge: #c2da9c; --tone: #426c2e; }
.metric-gold { --stock-bg: #fff0c0; --stock-edge: #ead091; --tone: #866122; }
.metric-morale { --stock-bg: #fce7e4; --stock-edge: #efc4bb; --tone: #9d4c58; }
.metric-covenant { --stock-bg: #f0e5fa; --stock-edge: #d5c0ea; --tone: #765291; }
.metric-title { grid-area: title; display: flex; align-items: center; gap: 4px; }
.metric-title span { font-size: 15px; color: var(--tone); }
.metric h2 { color: var(--tone); font-weight: 800; font-size: 13px; }
.metric-values { justify-content: flex-start; gap: 3px 6px; }
.metric-value { color: #233e33; white-space: nowrap; line-height: 1.08; }
.metric-value small { color: #52685a; }
.delta { color: #3a754b; }
.delta.negative, .metric.critical .metric-status { color: #9c3d4c; }
.delta.neutral { color: #5e756a; }
.metric-status { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.metric.warning { border-color: #dfb76e; }
.metric.critical { border-color: #e59b99; background: linear-gradient(150deg, #ffdfd4, #fff6e7); }
.metric-food.critical .stock-art { animation: jitter 1.4s ease-in-out infinite; }
@keyframes jitter { 0%, 80%, 100% { transform: none; } 84%, 92% { transform: translateX(-2px); } 88%, 96% { transform: translateX(2px); } }
.stock-art { grid-area: art; display: block; align-self: center; width: 100%; max-width: 126px; height: auto; overflow: visible; }
.mission-panel { color: #564923; background: #fff5d6; border-color: #ecd592; }
.mission-header h2 { color: #6c4e20; }
.mission-header p, .mission small { color: #71572d; }
.mission { background: #fff9e9; border-color: #ead7a2; }
.mission strong { color: #5d4828; }
.mission.done { background: #e7f5d8; border-color: #bdd8a3; }
.mission.done small { color: #427041; }
.turn-track i { background: #d3e8dc; }
.turn-track i.done { background: #a6c7ab; }
.turn-track i.active { background: #5b9f72; }
.round-counter { border-color: #c7dccd; }
.round-icon { color: #3b865e; }
#steps li { color: #507367; }
#steps li::after { background: #c7e0d2; }
#steps li span { color: #476c61; background: #e5f4ee; }
#steps li[aria-current="step"] { color: #266247; }
#steps li[aria-current="step"] span { color: #fffdef; background: #4b956b; }
#steps li.done span { color: #286341; background: #d3edce; }
.heading-icon { color: #31836c; background: #e1f7ec; border-color: #bddfcd; border-radius: 10px; }
.heading-icon.amber { color: #b07525; background: #fff1ce; border-color: #ecd28b; }
.heading-icon.lavender { color: #815aa2; background: #eee1f9; border-color: #dbc7ea; }
.map-wrap { border-color: #9ccab0; border-radius: 12px; background: radial-gradient(ellipse at 52% 45%, #ecf8d6, #c3e6ce 82%, #b8dfcb); }
.map-coordinates, .map-condition { color: #285b48; background: #fffdf0ee; border-color: #9ebfac; border-radius: 12px; }
.map-controls button { color: #407659; background: #fbfff0eb; border-color: #a9cbb4; }
.map-controls button:hover:not(:disabled) { background: #daf3db; }
.compass { color: #39745d; }
.legend { color: #4f7863; }
.tutorial {
  position: absolute; z-index: 2; width: max-content; max-width: min(224px, 76%);
  top: var(--guide-y); left: var(--guide-x); transform: translate(-50%, calc(-100% - 24px));
  display: block; margin: 0; padding: 8px; border: 2px solid #72b394; background: #fffbed;
  border-radius: 12px; box-shadow: 0 0 17px #feefa8, 0 4px 0 #4782664f;
}
.tutorial.below { transform: translate(-50%, 22px); }
.tutorial::after {
  content: ""; position: absolute; width: 11px; height: 11px; left: calc(50% + var(--pointer-offset));
  bottom: -7px; transform: translateX(-50%) rotate(45deg); background: #fffbed;
  border-right: 2px solid #72b394; border-bottom: 2px solid #72b394;
}
.tutorial.below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(225deg); }
.tutorial p { color: #266548; font-size: 13px; font-weight: 800; }
.tutorial div { display: flex; gap: 5px; margin-top: 4px; }
.tutorial .button { min-height: 23px; padding: 2px 5px; }
.adjacency-key { background: #eaf7eb; color: #39634f; border-color: #9ecbb0; }
.workforce, .scout-box { background: #edf8ed; border-color: #bbd9c3; border-radius: 12px; }
.workforce strong, .scout-box strong { color: #28614b; font-size: 14px; }
.workforce small, .scout-box p { color: #4b705c; }
.workforce .worker-total { color: #337058; }
.worker-controls { margin-top: 5px; gap: 6px; flex-wrap: wrap; }
.worker-controls .button { padding: 4px 6px; font-size: 12px; }
.discovery { background: #fff3cf; border-color: #e7c784; color: #775316; }
.building { color: #295941; background: #eaf7ec; border-color: #b2d4bd; border-radius: 11px; }
.building:hover:not(:disabled) { background: #d8f0dc; border-color: #85bd97; }
.building:disabled { color: #4a6c5d; background: #f5f7ef; border-color: #dbe4d4; }
.building small { color: #567260; }
.building .build-gains { color: #317447; }
.building .cost, .building:disabled .cost { color: #86662c; }
.wonder { border-color: #ebce85; background: linear-gradient(140deg, #fff0bd, #fff9e9); border-radius: 11px; }
.wonder h3 { color: #895825; }
.wonder p { color: #73582f; }
.wonder-stages span { color: #836936; border-color: #e4ca89; background: #fff9e4; font-size: 11px; }
.wonder-stages span.done { color: #557031; background: #e7f3cf; border-color: #b9d392; }
.status { background: #fff0d4; color: #7e502a; }
.advisor-label { color: #41775d; }
.advisor { background: #e9f7ec; border-radius: 12px; padding: 8px; }
.advisor:nth-child(2) { background: #fff2d7; }
.avatar, .advisor:nth-child(2) .avatar { background: #fffaf0; border-radius: 50%; width: 38px; height: 38px; font-size: 24px; }
.brief-body p, .advisor p { color: #446454; font-size: 14px; }
.advisors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.advisor:nth-child(3) { background: #e9f2fa; }
.advisor { align-items: flex-start; }
.advisor-body { min-width: 0; }
.advisor-body h4 { margin: 0; color: #2d4f3f; font-size: 14px; }
.advisor-heading { display: flex; gap: 3px 8px; flex-wrap: wrap; color: #3e5e52; margin: 1px 0 4px; }
.advisor-stars { color: #855414; white-space: nowrap; letter-spacing: 1px; }
.advisor .advisor-view { margin-top: 3px; }
.advisor .advisor-pick { font-weight: 700; color: #2d4f3f; }
.decision-advisors { padding: 0; }
.advisor-review > details { padding: 5px 7px; background: #edf5e9; border-radius: 7px; }
.advisor-review .feedback-notes ul { padding-left: 16px; }
@media (max-width: 720px) {
  .advisors { grid-template-columns: 1fr; }
}
.faction + .faction { border-color: #d6e8dc; }
.faction h3 small, .faction .rank-row { color: #597968; }
.meter { background: #e4eee6; }
.wisdom { background: #fff5d9; }
.wisdom strong, .wisdom small { color: #8e6428; }
.wisdom p { color: #685933; }
.toast { background: #2f6f56; color: #fff7e4; border-color: #add3a5; }
dialog { background: #fff9e8; }
.dialog-head { background: #e9f7db; color: #285f48; border-color: #bed7ac; }
.dialog-head .eyebrow { color: #687439; }
.dialog-head .button.subtle { background: #fffef1; border-color: #a7c6ac; }
.dialog-body { padding: 15px 17px 17px; }
.dialog-body p, .timeline { font-size: 15px; line-height: 1.62; }
.story-advice { margin-top: 8px; border: 1px dashed #bfd2a7; background: #f3f7e6; border-radius: 9px; padding: 7px; color: #477351; }
.story-advice summary { font-size: 13px; font-weight: 750; cursor: pointer; }
.story-advice p:first-of-type { margin-top: 5px; }
.option { background: #fffef4; border-color: #c7d9bc; border-radius: 10px; padding: 9px 11px; }
.option:hover:not(:disabled) { background: #eaf7e5; }
.report-points article { background: #fffdf0; border-radius: 10px; }
.review-reason { background: #fff0c9; }
#resource-flight { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 7; pointer-events: none; }
@media (max-width: 720px) {
  .metrics { gap: 5px; }
  .metric { min-height: 72px; padding: 5px 6px; grid-template-columns: minmax(0, 1fr) 40%; gap: 2px 2px; }
  .metric h2, .metric-status { font-size: 11px; }
  .metric-value { font-size: 20px; }
  .metric-value small, .delta { font-size: 10px; }
  .tutorial { font-size: 12px; max-width: min(177px, 76%); }
  .tutorial p { font-size: 12px; }
}
@media (max-width: 370px) {
  .metric h2, .metric-status { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .metric-food.critical .stock-art { animation: none; }
}


/* Quick supplies, slow foundations, and causal feedback */
.variable-board { position: sticky; top: 4px; z-index: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.variable-group { min-width: 0; display: grid; grid-template-rows: auto 1fr; padding: 5px 6px 7px; border-radius: 13px; border: 1px solid #c8dbb7; background: #eff8e4fa; }
.slow-group { border-color: #dbcbe4; background: #f6edf7fa; }
.variable-group > h2 { display: flex; align-items: baseline; justify-content: space-between; color: #315f40; font-size: 13px; margin: 0 3px 4px; }
.slow-group > h2 { color: #694c7b; }
.variable-group > h2 small { font-size: 11px; color: #607665; font-weight: 600; }
.variable-group .metrics { position: static; z-index: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.variable-group .metric { min-height: 84px; padding: 6px 7px; border-radius: 10px; grid-template-columns: minmax(0, 1fr) 36%; }
.metric-title h3 { color: var(--tone); font-weight: 800; font-size: 12px; }
.variable-group .metric-value { font-size: 24px; }
.variable-group .metric-value small, .variable-group .delta { font-size: 10px; }
.variable-group .metric-status { font-size: 11px; }
.variable-group .extra-metric { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "value" "art" "status"; gap: 2px; }
.labor-card { --stock-bg: #e4f1fb; --stock-edge: #b8d4e8; --tone: #36668d; }
.crisis-card { --stock-bg: #fff0dd; --stock-edge: #e5c7a5; --tone: #89562f; }
.crew-pips { grid-area: art; display: flex; gap: 2px; align-items: center; line-height: 1; color: #397ca3; }
.crew-pips i { font: normal 14px Georgia, serif; }
.crew-pips .working { color: #3f8a59; }
.crew-pips .away { color: #b6bfc3; }
.crisis-meter { grid-area: value; position: relative; height: 11px; margin: 4px 5px 3px 0; overflow: hidden; border-radius: 10px; background: #e8dcbc; }
.crisis-meter i { display: block; width: var(--risk); height: 100%; background: linear-gradient(90deg, #d4a14c, #d17146); opacity: .69; transition: width .25s ease; }
.crisis-meter b { position: absolute; left: 80%; top: 0; bottom: 0; border-left: 2px dashed #a17249b0; }
.review-timeline { padding: 8px; margin-top: 9px; border: 1px solid #cfdfc3; background: #fbfdf2; border-radius: 10px; }
.review-timeline h3 { color: #315d48; font-size: 15px; }
#review-chart { display: block; width: 100%; height: 245px; }
.review-coach { padding: 5px 7px; border-radius: 6px; background: #edf6e1; }
.review-timeline details { margin-top: 6px; font-size: 13px; color: #355d49; }
.review-causes { margin-top: 8px; padding: 6px 8px; background: #fff2d5; border-radius: 8px; color: #694e30; }
.review-causes summary { font-weight: 750; font-size: 14px; cursor: pointer; }
.review-round { margin-left: 8px; padding-top: 3px; border-top: 1px solid #e7d3ad; }
.review-round li { margin-bottom: 3px; }
.history-table { overflow: auto; }
.history-table table { width: 100%; text-align: center; border-collapse: collapse; }
.history-table th, .history-table td { padding: 3px; border-bottom: 1px solid #dce7d2; white-space: nowrap; }
@media (max-width: 950px) {
  .variable-group .metric { grid-template-columns: minmax(0, 1fr) 25%; }
  .variable-group .extra-metric { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .variable-board { grid-template-columns: 1fr; gap: 3px; top: 2px; }
  .variable-group { padding: 3px 4px 4px; }
  .variable-group > h2 { font-size: 11px; margin-bottom: 2px; }
  .variable-group > h2 small { display: none; }
  .variable-group .metric { min-height: 60px; padding: 4px; grid-template-columns: minmax(0, 1fr) 27%; }
  .variable-group .extra-metric { grid-template-columns: minmax(0,1fr); }
  .variable-group .metric-title h3, .variable-group .metric-status { font-size: 10px; }
  .variable-group .metric-title span, .crew-pips i { font-size: 11px; }
  .variable-group .metric-value { font-size: 17px; }
  .variable-group .metric-value small, .variable-group .delta { font-size: 9px; }
}



.story-parts { display: grid; gap: 7px; }
.story-parts section { border: 1px solid #dddfc4; border-radius: 9px; padding: 8px 10px; background: #fffdf3; }
.story-parts h3 { color: #3e654f; font-size: 14px; margin-bottom: 3px; }
.story-parts .story-advice { margin-top: 0; background: #edf6de; }
.story-parts .story-advice p:first-of-type { margin-top: 0; }
.story-dialog { width: min(760px, calc(100vw - 20px)); overflow-y: auto; scrollbar-gutter: stable; scrollbar-color: #6b8b53 #f6efdb; }
.story-dialog .dialog-head { flex-wrap: wrap; }
.story-progress { display: block; width: 100%; flex: 0 0 100%; height: 6px; accent-color: #6c904d; }
.story-intro, .story-parts .story-npc { background: #edf5e5; border: 1px solid #b9d0a6; }
.story-intro { padding: 13px 16px; border-radius: 12px; margin-bottom: 10px; color: #305541; }
.story-intro h2, .story-parts h3 { font-size: 17px; }
.story-intro p, .story-dialog .dialog-body p, .brief-body p { font-size: 17px; line-height: 1.65; }
.story-intro p + p { margin-top: 7px; }
.story-parts .story-dilemma { background: #fff0ce; border-color: #dcb36d; border-left: 4px solid #ba7a38; }
.story-dialog .option strong { font-size: 18px; }
.story-dialog .option small { font-size: 15px; line-height: 1.45; }
.advisor { display: block; min-width: 0; }
.advisor > summary { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; }
.advisor > summary::after { content: "▾"; margin-left: auto; color: #45654f; }
.advisor[open] > summary::after { content: "▴"; }
.advisor > summary strong { font-size: 15px; }
.advisor .advisor-body { padding: 4px 1px; }
.advisor .advisor-body p { font-size: 16px; line-height: 1.55; }
.advisor .advisor-body p + p { margin-top: 6px; }
#scenarios { flex-wrap: wrap; }
@media (max-width: 560px) {
  #scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scenario-button { white-space: normal; min-height: 44px; min-width: 0; }
}
.dialog-body .fast-receipt { padding: 10px; border: 1px solid #ebd48c; border-radius: 9px; background: #fff0be; color: #634621; font-weight: 750; }
.turn-events { display: grid; gap: 6px; margin-top: 8px; }
.turn-event { border: 1px solid #d8badc; border-radius: 9px; background: #f7eef8; padding: 8px 10px; }
.turn-event h3 { color: #6b4f75; font-size: 16px; }
.turn-memory { margin-top: 8px; }
.turn-memory h3 { color: #44684c; font-size: 15px; }
.turn-trail, .payoff-notes { margin: 5px 0; padding-left: 19px; color: #4f6748; font-size: 13px; line-height: 1.5; }
.turn-trail li + li, .payoff-notes li + li { margin-top: 4px; }

.fast-metrics .metric-food, .fast-metrics .metric-gold {
  grid-template-areas: "title art" "value value" "status status";
}
.fast-metrics .stock-art { max-height: 33px; object-fit: contain; }
.metric[data-ledger-open] { position: relative; z-index: 2; }
.ledger-anchor { position: relative; }
.ledger-anchor[hidden], .budget-ledger[hidden], .ledger-note[hidden] { display: none; }
.ledger-anchor .delta {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid #b7d3a8;
  border-radius: 7px;
  color: #285e39;
  background: #e1f3d8;
  line-height: 1.3;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ledger-anchor .delta.negative { color: #8c2e34; background: #fce4e3; border-color: #eab4af; }
.ledger-anchor .delta.neutral { color: #51635a; background: #ebf0e8; border-color: #cbd8c8; }
.ledger-anchor .delta:focus-visible { outline: 2px solid #356f59; outline-offset: 2px; }
.budget-ledger {
  position: absolute;
  top: 100%;
  left: 0;
  width: min(285px, calc(100vw - 16px));
  overflow: auto;
  padding: 11px 12px;
  border: 1px solid #c4d2b4;
  border-radius: 10px;
  background: #fffdf3;
  box-shadow: 0 10px 25px #2b4d3b35;
  color: #304d3d;
  font-size: 12px;
  line-height: 1.4;
}
.budget-ledger h4 { margin: 0 0 7px; font-size: 14px; }
.budget-ledger dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; column-gap: 8px; margin: 0; }
.budget-ledger dd { margin: 0; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.budget-ledger .ledger-total { margin-top: 7px; padding-top: 6px; border-top: 1px solid #d5dfc7; font-weight: 800; }
.budget-ledger p { margin: 6px 0 0; }
.ledger-note { color: #744b2c; }
.ledger-scope { color: #536759; }
@media (max-width: 720px) {
  .fast-metrics .metric-values { column-gap: 3px; }
  .ledger-anchor .delta { padding-inline: 3px; }
}

.fast-metrics .metric-food { grid-template-areas: "title art" "value value" "status status" "reservoir reservoir"; }
.reservoir { grid-area: reservoir; min-width: 0; }
.reservoir meter { display: block; width: 100%; height: 12px; accent-color: #4d855b; }
.reservoir p { font-size: 11px; line-height: 1.3; color: #325c47; }
.reservoir small { font-size: 10px; font-weight: 750; color: #8a3d33; }
.turn-strip { flex-wrap: wrap; }
.turn-strip .turn-track { display: grid; order: 2; flex: 0 0 100%; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; padding: 0; margin: 0; list-style: none; }
.turn-track button {
  width: 100%; min-height: 40px; display: grid; justify-items: center; align-content: center;
  padding: 1px; border: 1px solid #a9c8ad; border-radius: 6px; background: #e5f4d9; color: #2d4e39; font-weight: 750;
}
.turn-track button.dry { background: #f7e7c4; border-color: #d9b87a; color: #65461f; }
.turn-track button small { line-height: 1; white-space: nowrap; font-size: 9px; }
.turn-track button[aria-current] { box-shadow: inset 0 -4px #398052; }
.turn-track button.source-round { border-top: 3px solid #ab7550; }
.turn-track button[aria-pressed="true"] { outline: 2px solid #496b61; outline-offset: -3px; }
.turn-track button:focus-visible { outline: 2px solid #133e6a; outline-offset: 1px; }
.turn-detail { order: 3; flex: 0 0 100%; margin: 0; font-size: 12px; color: #425f4d; }
.turn-legend { order: 3; flex: 0 0 100%; color: #425f4d; font-size: 11px; margin: 0; }
.causal-links { margin: 8px 0; background: #fff1d7; border-radius: 8px; padding: 8px; }
.causal-links summary, .budget-waterfall summary { font-weight: 750; cursor: pointer; }
.causal-links ul { padding: 0; margin: 5px 0 0; list-style: none; }
.causal-links li { display: grid; grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1fr); gap: 5px; align-items: center; margin-top: 5px; font-size: 12px; }
.cause-origin, .cause-result { background: #f3dfab; border-radius: 5px; padding: 4px 6px; overflow-wrap: anywhere; }
.cause-result { background: #e6f2df; }
.cause-result small { display: block; }
.cause-arrow { color: #654722; }
.budget-waterfall { font-size: 11px; margin-bottom: 6px; }
.budget-waterfall ol { list-style: none; padding: 0; margin: 0; }
.budget-waterfall li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 5px; margin-bottom: 4px; }
.budget-waterfall li i { grid-column: 1 / -1; display: block; margin-inline-start: var(--offset); width: var(--size); min-height: 5px; border-radius: 3px; background: #4d8260; }
.budget-waterfall i.loss { background: #b45b49; }
.budget-waterfall i.limit { background: #936733; }
.budget-waterfall i.net, .budget-waterfall i.total { background: #426987; }
.map-views { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 7px; }
.map-views .button[aria-pressed="true"] { color: #fffefa; background: #356a55; border-color: #356a55; }
.map-view-note { color: #355e4a; font-size: 12px; margin: 0 8px 5px; }
.build-payback, .building .build-tradeoff { display: block; color: #5f6240; }
.fork-panel select { max-width: 100%; padding: 5px; font: inherit; }
#fork-chart { display: block; width: 100%; height: 245px; }
.fork-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.fork-point { background: #f7e3b6; }
.scenario-import { display: grid; gap: 7px; }
.scenario-import label { font-weight: 750; color: #385c46; }
.scenario-import textarea, .scenario-import input { max-width: 100%; font: inherit; }
.scenario-import textarea { width: 100%; border: 1px solid #9dbda5; border-radius: 7px; padding: 6px; }
.scenario-import progress { width: 100%; accent-color: #4d855b; }
.scenario-import ul { padding-inline-start: 20px; overflow-wrap: anywhere; }
.app-tools { flex-wrap: wrap; }
