:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: #0b1724;
  --panel-2: #101f2d;
  --panel-3: #142536;
  --line: rgba(148, 180, 202, .15);
  --line-strong: rgba(148, 180, 202, .25);
  --text: #e6f0f6;
  --muted: #8ca4b4;
  --dim: #5f7788;
  --ice: #82dfff;
  --ice-bright: #b8efff;
  --water: #42b9ed;
  --accent: #8adcf5;
  --warm: #d2a47b;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.skip-link { position: fixed; top: -50px; left: 12px; z-index: 50; padding: 10px 14px; background: #d9f6ff; color: #07111d; border-radius: 6px; font-size: 12px; }
.skip-link:focus { top: 12px; }
.app-shell { height: 100vh; min-height: 620px; display: flex; flex-direction: column; background: radial-gradient(ellipse at 15% 0%, rgba(25, 67, 92, .18), transparent 45%), var(--bg); }
.topbar { height: 66px; min-height: 66px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7, 17, 29, .95); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(130, 223, 255, .45); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(45deg); background: rgba(56, 158, 199, .08); }
.brand-mark span { display: block; width: 3px; height: 13px; border-radius: 3px; background: var(--ice); transform: rotate(-45deg); opacity: .9; }
.brand-mark span:nth-child(2) { height: 19px; opacity: .65; }
.brand-mark span:nth-child(3) { height: 9px; opacity: .45; }
.brand-name { font-size: 11px; font-weight: 760; letter-spacing: .16em; color: #e6f2f8; }
.brand-name span { color: #54778b; padding: 0 5px; }
.brand-subtitle { margin-top: 4px; color: #6e8799; font-size: 8px; font-weight: 650; letter-spacing: .2em; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.field-chip, .run-status { font-size: 9px; font-weight: 700; letter-spacing: .12em; color: #a6bdcb; }
.field-chip { border: 1px solid var(--line-strong); border-radius: 5px; padding: 7px 9px; }
.field-chip i { display: inline-block; width: 3px; height: 3px; margin: 0 5px 2px; border-radius: 50%; background: var(--ice); }
.run-status { display: flex; align-items: center; gap: 7px; color: #93dcbf; }
.status-dot, .live-pip { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #65d9a5; box-shadow: 0 0 10px rgba(101, 217, 165, .5); }
.run-status.is-paused { color: #e1ba79; }
.run-status.is-paused .status-dot { background: #e1ba79; box-shadow: 0 0 8px rgba(225, 186, 121, .45); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 410px; }
.visual-column { min-width: 0; display: flex; flex-direction: column; padding: 16px 16px 12px 20px; }
.viewer-wrap { position: relative; flex: 1; min-height: 380px; overflow: hidden; border: 1px solid rgba(117, 162, 188, .18); border-radius: 13px; background: radial-gradient(ellipse at 52% 36%, #152b3a 0%, #0b1a29 53%, #07111d 100%); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 18px 48px rgba(0,0,0,.2); }
.viewer { position: absolute; inset: 0; overflow: hidden; background: #07111d; }
.scene-canvas, .scene-label-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-label-layer { pointer-events: none; overflow: hidden; }
.scene-label { padding: 5px 7px; border: 1px solid rgba(120, 218, 248, .36); border-radius: 4px; color: #d7f5ff; background: rgba(6, 24, 36, .78); font-size: 8px; line-height: 1; font-weight: 750; letter-spacing: .13em; white-space: nowrap; box-shadow: 0 3px 12px rgba(0,0,0,.22); }
.scene-label--water { border-color: rgba(61, 180, 226, .38); color: #8edbfa; }
.viewer-topline, .viewer-bottomline { position: absolute; left: 18px; right: 18px; z-index: 2; pointer-events: none; display: flex; align-items: center; justify-content: space-between; }
.viewer-topline { top: 17px; }
.viewer-kicker { color: #a8c4d3; font-size: 9px; font-weight: 750; letter-spacing: .15em; display: flex; align-items: center; gap: 8px; }
.live-pip { width: 5px; height: 5px; background: var(--ice); box-shadow: 0 0 9px rgba(130,223,255,.7); }
.phase-chip { padding: 6px 8px; border: 1px solid rgba(130,223,255,.22); border-radius: 4px; color: #9bdff4; background: rgba(11,34,48,.72); font-size: 7px; font-weight: 760; letter-spacing: .12em; }
.viewer-coordinates { color: #718c9f; font-size: 8px; font-weight: 650; letter-spacing: .13em; }
.viewer-coordinates b { color: #d0e6f1; margin-left: 4px; font-weight: 700; }
.viewer-coordinates span { padding: 0 7px; color: #3c5a6e; }
.viewer-bottomline { bottom: 16px; gap: 12px; align-items: end; }
.mechanism-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 11px; border: 1px solid rgba(137, 178, 199, .16); border-radius: 7px; background: rgba(5, 16, 26, .78); backdrop-filter: blur(8px); }
.mechanism-strip span { color: #90a9b9; font-size: 7px; font-weight: 750; letter-spacing: .09em; }
.mechanism-strip b { color: var(--ice); font-size: 8px; margin-right: 4px; }
.mechanism-strip i { color: #49687d; font-style: normal; font-size: 10px; }
.viewer-time { color: #7f9aab; font-size: 8px; font-weight: 700; letter-spacing: .12em; padding: 8px 10px; border-radius: 6px; background: rgba(5,16,26,.75); }
.viewer-time strong { display: inline-block; color: #e0f5ff; margin-left: 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.context-message { position: absolute; z-index: 4; left: 20px; right: 20px; top: 50%; transform: translateY(-50%); padding: 15px 17px; border: 1px solid rgba(235, 176, 111, .38); border-radius: 8px; background: rgba(34, 24, 18, .95); color: #f0d1ae; font-size: 12px; line-height: 1.5; }
.visual-footer { height: 31px; display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 3px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 15px; }
.legend-row span, .view-hint { display: inline-flex; align-items: center; gap: 6px; color: #70899a; font-size: 8px; font-weight: 680; letter-spacing: .08em; }
.legend-swatch { width: 7px; height: 7px; display: inline-block; border-radius: 2px; }
.legend-ice { background: #3d9fca; }
.legend-lens { background: #c5f1ff; box-shadow: 0 0 7px rgba(160,229,255,.5); }
.legend-water { background: #42b9ed; }
.legend-soil { background: #87634a; }
.view-hint { white-space: nowrap; }
.view-hint span { color: #46677c; }
.mouse-icon { font-size: 12px; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(14, 28, 42, .98), rgba(9, 20, 32, .98)); padding: 20px 20px 18px; scrollbar-width: thin; scrollbar-color: #294255 transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: #294255; border-radius: 8px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 0 17px; border-bottom: 1px solid var(--line); }
.eyebrow, .section-index { color: #668296; font-size: 8px; font-weight: 760; letter-spacing: .16em; }
h1 { margin: 7px 0 4px; color: #e7f2f8; font-size: 28px; line-height: 1.08; font-weight: 650; letter-spacing: -.045em; }
h1 em { color: var(--ice); font-style: normal; }
.panel-intro { margin: 0; color: #8ca5b5; font-size: 10px; line-height: 1.45; }
.ice-emblem { color: #9ce7ff; font-size: 27px; line-height: 1; padding: 8px 10px; border: 1px solid rgba(129, 220, 249, .2); border-radius: 9px; background: rgba(91, 186, 220, .06); text-shadow: 0 0 18px rgba(108,218,255,.4); }
.panel-section { padding: 15px 0 14px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading h2 { margin: 0; color: #b6cbd7; font-size: 9px; font-weight: 780; letter-spacing: .13em; }
.section-index { font-size: 7px; color: #536f82; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 8px 7px; border: 1px solid rgba(137, 177, 197, .16); border-radius: 7px; background: rgba(20, 38, 54, .58); text-align: left; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.preset-button:hover { border-color: rgba(129, 220, 249, .45); background: rgba(35, 67, 87, .55); }
.preset-button:active { transform: translateY(1px); }
.preset-button.is-active { border-color: rgba(130, 223, 255, .58); background: rgba(57, 134, 165, .16); box-shadow: inset 0 0 0 1px rgba(130,223,255,.08); }
.preset-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 6px; color: #9ddff3; background: rgba(86, 170, 205, .13); font-size: 15px; }
.preset-icon-sand { color: #e1c08e; background: rgba(207, 164, 100, .12); }
.preset-icon-gravel { color: #c0c8cc; background: rgba(173, 185, 193, .1); }
.preset-button b { display: block; color: #d5e3eb; font-size: 9px; font-weight: 730; }
.preset-button small { display: block; margin-top: 3px; color: #718a9b; font-size: 7px; line-height: 1.2; }
.preset-description { margin: 8px 1px 0; color: #748e9e; font-size: 8px; line-height: 1.4; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.readout-card { min-height: 68px; padding: 9px 10px 8px; border: 1px solid rgba(132, 170, 190, .13); border-radius: 7px; background: rgba(16, 34, 49, .72); }
.readout-primary { border-color: rgba(107, 202, 235, .26); background: linear-gradient(135deg, rgba(28, 75, 97, .4), rgba(16, 34, 49, .76)); }
.readout-label { color: #7f9aab; font-size: 7px; font-weight: 750; letter-spacing: .12em; }
.readout-label span { color: var(--ice); font-size: 10px; margin-left: 3px; }
.readout-value { margin-top: 5px; color: #e8f7fd; font-size: 19px; line-height: 1; font-weight: 620; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-primary .readout-value { color: #a9eaff; font-size: 21px; }
.readout-note { margin-top: 5px; color: #5e7a8d; font-size: 6px; font-weight: 700; letter-spacing: .12em; }
.flux-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; justify-content: space-between; align-items: center; gap: 9px; padding: 10px 2px 0; }
.flux-row > div:not(.supply-wrap) { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.flux-label, .supply-wrap > span { color: #6e899a; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.flux-row strong { color: #a4def3; font-size: 11px; font-variant-numeric: tabular-nums; }
.supply-wrap { display: grid; grid-template-columns: 43px auto; grid-template-rows: auto auto; align-items: center; gap: 4px 6px; }
.supply-wrap > span { grid-column: 1 / -1; }
.supply-track { width: 43px; height: 4px; overflow: hidden; border-radius: 4px; background: #20384a; }
.supply-track i { display: block; width: var(--supply,0%); height: 100%; border-radius: inherit; background: #4ebfe9; transition: width .2s; }
.supply-wrap b { color: #8dbed1; font-size: 8px; min-width: 22px; font-variant-numeric: tabular-nums; }
.controls-section { padding-bottom: 13px; }
.control-row { margin-top: 10px; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.control-label label { color: #a8bdc9; font-size: 9px; font-weight: 560; }
.control-label output { color: #c5e9f5; font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.label-tag { margin-left: 4px; padding: 2px 4px; border: 1px solid rgba(208, 174, 119, .25); border-radius: 3px; color: #d4b27f; font-size: 6px; letter-spacing: .08em; vertical-align: 1px; }
input[type="range"] { appearance: none; width: 100%; height: 4px; display: block; margin: 8px 0 4px; border-radius: 5px; background: linear-gradient(90deg, #4ca9d0, #28485d); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border: 2px solid #d9f5ff; border-radius: 50%; background: #4fa9cb; box-shadow: 0 0 0 3px rgba(82, 185, 224, .12), 0 1px 5px rgba(0,0,0,.35); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d9f5ff; border-radius: 50%; background: #4fa9cb; box-shadow: 0 0 0 3px rgba(82, 185, 224, .12); }
.range-ends { display: flex; justify-content: space-between; color: #536f82; font-size: 6px; font-weight: 700; letter-spacing: .07em; }
.compact-control { margin-top: 12px; }
.transport-row { display: grid; grid-template-columns: 1.35fr 1fr 40px; gap: 7px; }
.transport-button, .icon-button, .utility-button, .segmented-buttons button { min-height: 31px; border: 1px solid rgba(135, 177, 198, .2); border-radius: 6px; background: rgba(21, 41, 57, .82); color: #a9c2d0; font-size: 9px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.transport-button:hover, .icon-button:hover, .utility-button:hover, .segmented-buttons button:hover { border-color: rgba(130,223,255,.48); color: #e1f7ff; }
.transport-primary { border-color: rgba(111, 208, 239, .5); background: linear-gradient(135deg, rgba(56, 138, 169, .42), rgba(22, 62, 82, .5)); color: #d8f5ff; }
.button-icon { margin-right: 5px; color: var(--ice); font-size: 11px; }
.icon-button { font-size: 16px; }
.speed-label { margin-top: 13px; }
.speed-slider { margin-top: 8px !important; }
.quality-row { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.quality-row > span { margin-right: auto; color: #6d8799; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.segmented-buttons { display: flex; gap: 3px; padding: 2px; border: 1px solid rgba(135,177,198,.14); border-radius: 6px; background: rgba(5,15,25,.55); }
.segmented-buttons button { min-height: 22px; padding: 0 7px; border: 0; background: transparent; color: #718b9c; font-size: 7px; }
.segmented-buttons button.is-active { background: rgba(83, 159, 190, .22); color: #c9effa; }
.utility-button { min-height: 26px; padding: 0 7px; font-size: 7px; letter-spacing: .05em; }
.utility-button.is-confirmed { border-color: rgba(101,217,165,.6); color: #a3e9c7; }
.validation-section { padding-bottom: 13px; }
.validation-card { padding: 10px; border: 1px solid rgba(130, 186, 211, .18); border-radius: 7px; background: linear-gradient(130deg, rgba(20, 49, 67, .56), rgba(13, 29, 43, .65)); }
.validation-title { margin-bottom: 9px; color: #9cb8c7; font-size: 8px; font-weight: 650; }
.validation-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.validation-grid div { display: flex; flex-direction: column; gap: 4px; }
.validation-grid span { color: #5e7b8d; font-size: 6px; font-weight: 750; letter-spacing: .12em; }
.validation-grid b { color: #d8edf5; font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-grid .validation-pass { color: #91dfbd; }
.validation-note { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(140,180,201,.12); color: #7893a3; font-size: 7px; letter-spacing: .04em; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 1px; color: #b9ced9; font-size: 9px; font-weight: 780; letter-spacing: .13em; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-chevron { color: var(--ice); font-size: 14px; transition: transform .2s; }
.science-panel[open] .science-chevron { transform: rotate(45deg); }
.science-content { padding: 0 1px 14px; color: #8ba3b2; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 0 0 10px; }
.science-content .science-lead { color: #b3c8d3; font-size: 9px; }
.science-content h3 { margin: 13px 0 7px; color: #9db9c8; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.equation { padding: 8px 9px; margin-bottom: 6px; border-left: 2px solid rgba(113,207,239,.5); background: rgba(20, 41, 57, .55); }
.equation b { display: block; margin-bottom: 4px; color: #b5d8e7; font-size: 8px; }
.equation code { display: block; color: #9be4ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.equation small { display: block; margin-top: 4px; color: #7c96a6; font-size: 8px; line-height: 1.4; }
.science-list { margin: 0; padding-left: 15px; color: #8199a8; }
.science-list li { margin: 3px 0; }
.science-list b { color: #b7d7e4; }
.science-source { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: #69889b; font-size: 7px; line-height: 1.5; }
.panel-footer { padding: 13px 0 2px; }
.model-badge { display: inline-block; padding: 4px 6px; border: 1px solid rgba(122, 185, 211, .22); border-radius: 4px; color: #7eacbf; font-size: 6px; font-weight: 750; letter-spacing: .12em; }
.panel-footer p { margin: 7px 0; color: #5d7789; font-size: 7px; line-height: 1.4; }
.keyboard-hint { color: #526d7f; font-size: 7px; }
kbd { margin: 0 3px 0 6px; padding: 2px 4px; border: 1px solid rgba(126,161,182,.2); border-radius: 3px; color: #88a7b8; font: inherit; }
.embed-mode .topbar { display: none; }
.embed-mode .workspace { height: 100vh; }
.embed-mode .visual-column { padding-top: 10px; }
.embed-mode .control-panel { padding-top: 14px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 370px; }
  .control-panel { padding-left: 16px; padding-right: 16px; }
  .visual-column { padding-left: 14px; padding-right: 12px; }
  .mechanism-strip { gap: 5px; padding: 8px; }
  .mechanism-strip span { font-size: 6px; }
  .legend-row { gap: 9px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .topbar { height: 58px; min-height: 58px; padding: 0 14px; }
  .brand-name { font-size: 9px; }
  .brand-subtitle { font-size: 7px; }
  .topbar-right { gap: 9px; }
  .field-chip { font-size: 7px; padding: 6px 7px; }
  .run-status { font-size: 7px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .visual-column { padding: 10px 10px 5px; }
  .viewer-wrap { height: min(49vh, 470px); min-height: 310px; flex: 0 0 auto; }
  .viewer-topline { left: 12px; right: 12px; top: 12px; }
  .viewer-bottomline { left: 10px; right: 10px; bottom: 10px; }
  .mechanism-strip { gap: 5px; padding: 7px; }
  .mechanism-strip span { font-size: 6px; }
  .viewer-time { font-size: 6px; padding: 7px; }
  .viewer-time strong { font-size: 9px; margin-left: 3px; }
  .visual-footer { min-height: 29px; height: auto; padding: 7px 2px 3px; align-items: center; }
  .legend-row { gap: 8px; }
  .legend-row span, .view-hint { font-size: 6px; }
  .view-hint { display: none; }
  .control-panel { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 16px 14px 20px; }
  .panel-heading { padding-bottom: 13px; }
  h1 { font-size: 25px; }
  .panel-section { padding: 13px 0; }
  .preset-button { padding: 8px 6px; }
}
@media (max-width: 460px) {
  .topbar { padding: 0 11px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: 8px; letter-spacing: .12em; }
  .brand-subtitle { font-size: 6px; letter-spacing: .16em; }
  .field-chip { display: none; }
  .viewer-wrap { height: 43vh; min-height: 300px; }
  .viewer-coordinates { font-size: 6px; }
  .phase-chip { font-size: 6px; padding: 5px 6px; }
  .viewer-kicker { font-size: 7px; }
  .mechanism-strip { max-width: 75%; gap: 4px; }
  .mechanism-strip span { font-size: 5px; letter-spacing: .04em; }
  .mechanism-strip b { font-size: 6px; margin-right: 2px; }
  .mechanism-strip i { font-size: 8px; }
  .viewer-time { white-space: nowrap; }
  .legend-row { gap: 7px; }
  .legend-row span { font-size: 5.5px; gap: 4px; }
  .legend-swatch { width: 6px; height: 6px; }
  .control-panel { padding: 14px 12px 18px; }
  .panel-intro { font-size: 9px; }
  .preset-button { gap: 5px; }
  .preset-icon { width: 21px; height: 21px; flex-basis: 21px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .readout-value { font-size: 18px; }
  .readout-primary .readout-value { font-size: 20px; }
  .flux-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 6px; }
  .supply-wrap > span { font-size: 6px; }
  .quality-row { flex-wrap: wrap; }
  .quality-row > span { width: 100%; margin-bottom: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
