/* Field station: quiet paper surfaces, clear diagrams, generous touch targets. */
:root { --coral: #ef634d; --coral-dk: #b93526; --lagoon: #087e85; }
* { box-sizing: border-box; }
body { background-image: radial-gradient(ellipse at 10% 0%, #65dad0 0, transparent 40%), linear-gradient(165deg, #158a9c, #0a3d5c 80%); }
.panel, .map-card { border: 1px solid #ffffff80; }
.eyebrow { color: #08737a; }
.btn-coral { box-shadow: 0 4px 0 #a93226, 0 7px 14px #17344718; }
.btn, .choice, .item, .mission-card, .mode-tile { transition: transform .15s, box-shadow .15s, border-color .15s; }
.btn:hover, .mode-tile:hover { transform: translateY(-2px); }
.btn:active, .mode-tile:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid #062f49; box-shadow: 0 0 0 6px #ffdf79; outline-offset: 3px; }
h1:focus, h2:focus { outline: none; box-shadow: none; }
.storage-notice { margin: 12px auto; padding: 12px 20px; max-width: 960px; background: #fff0c4; border: 2px solid #b77b15; border-radius: 14px; color: #523600; }
.home { border: 1px solid #ffffff80; }
.home-logo span { letter-spacing: .01em; }
.mode-tile { border: 1px solid #ffffffbb; box-shadow: 0 5px 0 #123e5629, 0 10px 22px #123e5620; }
.mode-tile small { line-height: 1.4; }
.brief-banner { background: linear-gradient(125deg, #fff8e9, #e0f4ec); border: 1px solid #d3e2cd; border-radius: 22px; padding: 24px; }
.clue { border: 1px solid #d8ddcb; box-shadow: 0 4px 12px #17344708; }
.lab-canvas { background: #fbfcf6; border: 1px solid #d4e2d7; box-shadow: 0 8px 24px #123e5612; }
.visual-box, .web-preview { background: #fff; border: 1px solid #d4e2d7; border-radius: 18px; padding: clamp(12px, 2vw, 24px); }
.web-preview { display: grid; gap: 10px; margin-bottom: 18px; background: linear-gradient(145deg, #eef9f4, #fffdf4); }
.diagram-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .85rem; }
.energy-route { display: grid; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); align-items: center; gap: 8px; }
.energy-route span { padding: 8px 12px; border-radius: 12px; color: var(--t); background: var(--t-bg); font-weight: 700; }
.energy-route b { color: #ac402c; font-size: 1.5rem; text-align: center; }
.diagram-key { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; font-size: .85rem; font-weight: 700; }
.web-reading { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 0; margin: 4px 0; list-style: none; color: #254b58; font-size: .85rem; }
.svg-wrap { background: #fff; border: 1px solid #d9e2da; border-radius: 16px; padding: 12px; overflow-x: auto; }
.web { min-width: 0; }
.web .node-disc { stroke-width: 2; filter: drop-shadow(0 3px 2px #17344718); }
.web .node-label { font-size: 16px; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chart-grid { stroke: #dce6de; stroke-width: 1; stroke-dasharray: 3 5; }
.heatwave-band { fill: #f8b560; opacity: .22; }
.cascade-chart { min-width: 0; }
.cascade-chart .series { stroke-width: 3; }
.legend .swatch-pred { height: 0; border-top: 3px dotted var(--t); background: none; border-radius: 0; }
.legend .swatch-herb { height: 0; border-top: 3px dashed var(--t); background: none; border-radius: 0; }
.chart-note { color: #435d69; font-size: .85rem; text-align: center; margin-top: 10px; }
.chart-data { margin-top: 14px; text-align: left; font-size: .9rem; }
.chart-data summary { cursor: pointer; padding: 10px 12px; border: 1px solid #cadbd4; border-radius: 10px; color: #12565f; background: #edf7f1; font-weight: 700; }
.table-scroll { overflow-x: auto; }
.matrix caption { text-align: left; padding: 12px; font-weight: 700; }
.chart-data .matrix { width: 100%; margin-top: 8px; }
.chart-data th, .chart-data td { padding: 10px; font-variant-numeric: tabular-nums; }
.slot { background: #fff; border-color: #b9cfc4; }
.slot-place { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 8px 0; border: 1px dashed #087e85; border-radius: 10px; background: #e6f6f0; color: #075d65; font-weight: 700; cursor: pointer; }
.slot-place:disabled { color: #52666b; background: #f3f5ed; border-color: #c9d5cc; cursor: default; }
.slot-empty { color: #736039; }
.tier { position: relative; border: 1px solid #ffffffa0; box-shadow: 0 3px 0 #17344710; }
.tier:not(:last-child)::after { content: '↑ energy'; display: block; text-align: center; font-size: .75rem; color: #4b626b; margin-top: 8px; }
.map-wrap { position: relative; border: 4px solid #fff9e6; border-radius: 20px; box-shadow: 0 8px 18px #17344720; overflow: hidden; }
.map-label { letter-spacing: 2px; }
.map-biome { fill: #174d58; font: 700 13px var(--font-body); letter-spacing: 4px; paint-order: stroke; stroke: #fff4d6b3; stroke-width: 5px; stroke-linejoin: round; }
.island-map .site-hit { stroke-width: 3; }
.island-map .site:focus-visible { outline: none; }
.island-map .site:focus-visible .site-hit { stroke: #ffdf79; stroke-width: 7; }
@media (max-width: 600px) {
    .brief-banner { padding: 18px; }
    .energy-route { font-size: .85rem; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 4px; }
    .energy-route span { padding: 8px; }
    .diagram-key { font-size: .75rem; gap: 8px; }
    .cascade-chart { min-width: 360px; }
    .web { min-width: 0; }
    /* Keep reading order and arrows aligned for sequences of any length. */
    .loop { grid-template-columns: 1fr; gap: 26px; }
    .loop .loop-spot { order: initial; }
    .loop .loop-spot:not(:last-child)::after { content: '↓'; left: 50%; right: auto; top: auto; bottom: -26px; transform: translateX(-50%); }
    .loop .loop-spot:last-child::after { content: none; }
}
@media (max-height: 650px), (max-width: 450px) {
    html[data-screen='home'], html[data-screen='home'] body { height: auto; min-height: 100%; overflow: auto; }
    html[data-screen='home'] .app { flex: auto; }
    .home { height: auto; min-height: calc(100svh - 100px); grid-template-rows: auto auto 1fr; }
    .mode-board { min-height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
