@font-face {
  font-family: "Hanken Grotesk";
  src: url("./assets/hanken.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #101816;
  --panel: #17201d;
  --surface: #131c1a;
  --line: #314039;
  --text: #edf1eb;
  --muted: #a3b2aa;
  --mint: #98ebbd;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
svg { display: block; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
a { color: inherit; }
.top { border-bottom: 1px solid var(--line); }
.top-inner, main { width: min(100% - 64px, 1536px); margin: auto; }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 70px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.24rem; font-weight: 750; letter-spacing: -0.03em; }
.brand-mark { background: #2a4538; color: var(--mint); border-radius: 9px; padding: 7px; }
.brand-mark svg, button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.brand-divider { color: #718378; padding: 0 6px; font-weight: 400; }
.brand-subtitle { color: #c4d0c7; font-weight: 550; font-size: .94rem; letter-spacing: 0; }
.model-link { color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 4px; font-size: .88rem; white-space: nowrap; }
.model-link:hover { color: var(--mint); }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; padding: 33px 0 23px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 3.1vw, 3.1rem); font-weight: 720; letter-spacing: -.048em; line-height: 1.05; margin-bottom: 10px; }
.intro p { color: var(--muted); font-size: 1.02rem; }
.area-note { color: var(--muted); font-size: .88rem; padding-bottom: 2px; }
.area-note span { padding-inline: 4px; }
.workspace { display: grid; grid-template-columns: minmax(280px, 28%) minmax(0,1fr); gap: 16px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.panel-head { padding: 13px 16px; display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
h2 { font-size: 1.12rem; font-weight: 720; }
h3 { font-size: .94rem; font-weight: 690; }
.minor, .view-foot { font-size: .82rem; color: var(--muted); }
.map-wrap { position: relative; width: 100%; aspect-ratio: 1; background: #24372d; }
#map { width: 100%; height: 100%; user-select: none; }
#map.is-drawing { cursor: crosshair; touch-action: none; }
.aerial { filter: brightness(.75) saturate(.64); }
.map-grid { fill: none; stroke: #a6c3b3; stroke-opacity: .28; stroke-width: .7; }
.north { text-anchor: middle; fill: #f3f6f0; font-size: 12px; font-weight: 750; paint-order: stroke; stroke: #1b2b26; stroke-width: 1px; }
.map-scale { fill: #f3f6f0; font-size: 11px; }
.map-scale rect { fill: #16231f; fill-opacity: .88; }
.map-scale path { fill: none; stroke: #f3f6f0; stroke-width: 1.5; }
.transect, .transect-shadow { pointer-events: none; stroke-linecap: round; }
.transect { stroke: var(--mint); stroke-width: 3; }
.transect-shadow { stroke: #0e2119; stroke-width: 7; }
.endpoint { cursor: grab; touch-action: none; }
.endpoint:active { cursor: grabbing; }
.is-drawing .endpoint { pointer-events: none; }
.handle-target { fill: transparent; }
.handle-dot { fill: var(--mint); stroke: #1a3125; stroke-width: 2; }
.endpoint text { fill: #14251b; text-anchor: middle; font-weight: 800; font-size: 12px; pointer-events: none; }
.endpoint:focus-visible { outline: none; }
.endpoint:focus-visible .handle-dot, .endpoint:hover .handle-dot { stroke: #f1fff6; }
.map-station { fill: #f3fff7; stroke: #1b3325; stroke-width: 1.7; pointer-events: none; }
.map-actions { padding: 13px 14px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.coverage-key { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; white-space: nowrap; }
.coverage-key span { width: 12px; height: 12px; border-radius: 2px; border: 1px solid #54685d; background: repeating-linear-gradient(132deg, #25352d 0 3px, #64796d 3px 4px); }
.map-actions button { display: inline-flex; gap: 8px; align-items: center; border-radius: 6px; border: 1px solid transparent; min-height: 38px; padding: 6px 12px; font-size: .90rem; font-weight: 720; }
.map-actions svg { width: 16px; height: 16px; }
.primary { color: #142b1f; background: var(--mint); }
.primary:hover, .primary[aria-pressed="true"] { background: #c1f8d8; }
.map-actions .quiet { background: transparent; color: #d5e1d8; border-color: #3e5147; }
.quiet:hover, .icon-button:hover { background: #2b3b33; }
.map-hint { padding: 10px 15px 14px; min-height: 42px; }
.geology-panel { display: flex; flex-direction: column; }
.geology-head { min-height: 57px; }
.distance { background: #24372d; color: var(--mint); padding: 4px 9px; border-radius: 4px; font-size: .85rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.geology-views { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 375px; background: var(--surface); }
.model-pane, .section-pane { display: flex; flex-direction: column; min-width: 0; }
.section-pane { border-left: 1px solid var(--line); }
.view-head, .view-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-inline: 14px; }
.view-head { background: #17201d; min-height: 46px; }
.view-foot { min-height: 38px; }
.icon-button { display: grid; place-items: center; border: 1px solid #3a4c42; background: transparent; border-radius: 5px; color: #c7d7cd; width: 32px; height: 30px; }
.icon-button svg { width: 17px; height: 17px; }
#scene, .profile-wrap { flex: 1; width: 100%; min-height: 264px; position: relative; }
#scene canvas, #profile { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene canvas { cursor: grab; }
#scene canvas:active { cursor: grabbing; }
#scene-error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1rem; color: var(--muted); }
#profile { touch-action: pan-y; }
.profile-label { fill: #adbbb2; font: 12px "Hanken Grotesk", system-ui, sans-serif; }
.profile-main-label { fill: #e7f0e8; font-weight: 750; }
.profile-grid { stroke: #344139; stroke-width: 1; }
.profile-zero { stroke: #43564a; }
.profile-surface { stroke: #f1e5cc; stroke-width: 1.5; fill: none; }
.section-cursor { stroke: #e5fff0; stroke-width: 1.25; stroke-dasharray: 3 4; pointer-events: none; }
.legend { border-top: 1px solid var(--line); padding: 13px 16px; display: flex; align-items: center; gap: 14px; min-height: 53px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 5px 13px; }
.layer-control { display: inline-flex; align-items: center; gap: 7px; padding: 3px 4px; border: 1px solid transparent; background: transparent; border-radius: 4px; color: #d9e3db; font-size: .84rem; text-align: left; }
.layer-control:hover { background: #26352e; }
.layer-control[aria-pressed="false"] { color: #a1afa7; }
.layer-control[aria-pressed="false"] .swatch { background: transparent; }
.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--layer); border: 1px solid var(--layer); }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-block: 17px 24px; color: var(--muted); font-size: .79rem; }
#load-status { color: var(--muted); margin-block: 16px 52px; }
@media(max-width: 1120px) {
  .top-inner, main { width: calc(100% - 40px); }
  .workspace { grid-template-columns: minmax(250px, 29%) minmax(0,1fr); gap: 12px; }
  .legend { align-items: start; }
}
@media(max-width: 900px) {
  .workspace { grid-template-columns: minmax(235px, 36%) minmax(0,1fr); align-items: start; }
  .geology-views { grid-template-columns: 1fr; }
  .section-pane { border-left: 0; border-top: 1px solid var(--line); }
  #scene, .profile-wrap { min-height: 260px; }
}
@media(max-width: 590px) {
  .top-inner, main { width: calc(100% - 28px); }
  .top-inner { min-height: 60px; gap: 8px; }
  .brand { font-size: 1.15rem; }
  .brand-subtitle, .brand-divider { display: none; }
  .intro { padding-block: 25px 17px; }
  .workspace { grid-template-columns: 1fr; }
  .view-head, .view-foot { padding-inline: 12px; }
  footer { flex-direction: column; }
}

