#banner {
  position: fixed; top: 86px; left: 50%; transform: translateX(-50%); z-index: 3;
  background: #7a5b12; color: #fff6dc; padding: 6px 14px; border-radius: 0 0 8px 8px;
  font: 13px system-ui, sans-serif;
}
#hard-error {
  position: fixed; inset: 0; z-index: 10; overflow: auto; padding: 24px;
  background: #2a0d0d; color: #ffe9e9; font: 14px system-ui, sans-serif;
}
#hard-error h1 { font-size: 20px; color: #ff9b9b; }
#hard-error pre { white-space: pre-wrap; background: #00000055; padding: 8px; }
#hard-error button { padding: 6px 12px; }
#perf.bad { color: #ffb3a3; }
#perf.good { color: #b6f3c4; }
body { overflow: hidden; }
#mobile-settings { display: contents; }
#mobile-settings > summary { display: none; }
#panel { position: fixed; top: 100px; max-height: calc(100vh - 120px); overflow: auto; overscroll-behavior: contain; z-index: 3; }
[hidden] { display: none !important; }
#voyage-bar {
  position: fixed; top: 16px; left: 20px; right: 20px; z-index: 4;
  display: flex; align-items: center; gap: 14px; padding: 8px 12px;
  border: 1px solid #e8dfc440; border-radius: 16px;
  background: #182b30d9; box-shadow: 0 8px 32px #0003; backdrop-filter: blur(14px);
  color: #f5efdf; font: 13px/1.3 system-ui, sans-serif;
}
.icon { display: block; width: 22px; height: 22px; flex: none; }
.icon.small { width: 18px; height: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Two-state buttons carry both icons; aria-checked / aria-pressed picks the visible one. */
[aria-checked="true"] > .when-off, [aria-pressed="true"] > .when-off,
[aria-checked="false"] > .when-on, [aria-pressed="false"] > .when-on { display: none; }
.icon-button { display: flex; align-items: center; gap: 5px; padding: 5px 7px; border: 0; border-radius: 9px; background: #ffffff10; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; text-decoration: none; }
.icon-button:hover { background: #ffffff20; }
.sound-switch[aria-checked="true"] { background: #699d86; color: #10251f; }
.segment-slider { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; align-items: center; gap: 6px; }
.segment-slider legend { float: left; color: #c6cabc; margin: 0; padding: 0; }
.segments { position: relative; display: grid; grid-template-columns: repeat(var(--count), minmax(0, 1fr)); background: #081c2380; border-radius: 9px; padding: 3px; --selected: 1; }
.segments label { position: relative; display: flex; justify-content: center; padding: 3px 6px; cursor: pointer; white-space: nowrap; z-index: 1; }
.segments input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segments label:has(input:checked) { color: #15292b; }
.selection { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--count)); background: #e6d9ba; border-radius: 7px; transform: translateX(calc(var(--selected) * 100%)); transition: transform .22s ease; }
.segments label:has(input:focus-visible), .sound-switch:focus-visible, #voyage-back:focus-visible { outline: 2px solid #ccebdc; outline-offset: 3px; border-radius: 7px; }
.clock-control { border: 0; margin: 0; padding: 0; min-width: 150px; }
.clock-control legend { display: flex; align-items: center; gap: 5px; color: #c6cabc; margin-bottom: 2px; padding: 0; }
.clock-control output { color: #f5efdf; font-size: 13px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock-row { display: flex; align-items: center; gap: 8px; }
.clock-row input { flex: 1; min-width: 100px; height: 18px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; --dawn: 25%; --dusk: 75%; }
.clock-row input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #1b2b4a 0, #1b2b4a var(--dawn), #e6d9ba var(--dawn), #e6d9ba var(--dusk), #1b2b4a var(--dusk)); }
.clock-row input::-moz-range-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #1b2b4a 0, #1b2b4a var(--dawn), #e6d9ba var(--dawn), #e6d9ba var(--dusk), #1b2b4a var(--dusk)); }
.clock-row input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4px; border-radius: 50%;
  background: #f5efdf; border: 2px solid #15292b; }
.clock-row input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #f5efdf; border: 2px solid #15292b; }
.clock-row input:focus-visible { outline: 2px solid #ccebdc; outline-offset: 2px; border-radius: 4px; }
#clock-play { display: flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: #081c2380; color: inherit; cursor: pointer; }
#clock-play .icon { width: 14px; height: 14px; }
#clock-play[aria-pressed="true"] { background: #e6d9ba; color: #15292b; }
#clock-play:focus-visible { outline: 2px solid #ccebdc; outline-offset: 2px; }
.clock-bounds { display: flex; justify-content: space-between; color: #c6cabc; font-size: 10px; margin-top: 1px; padding-left: 36px; font-variant-numeric: tabular-nums; }
#preset-tag { margin-left: auto; font-variant-numeric: tabular-nums; }
#view-toggle[aria-pressed="true"] { background: #e6d9ba; color: #15292b; }
#view-toggle:focus-visible, #preset-tag:focus-visible, #performance-chip:focus-visible { outline: 2px solid #ccebdc; outline-offset: 2px; }
#effects-panel { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; padding: 6px 10px; border: 1px solid #ffffff30; border-radius: 6px; }
#effects-panel legend { padding: 0 4px; font-size: 12px; }
#effects-panel label { display: flex; align-items: center; gap: 5px; }
#effects-panel label:has(input:disabled) { opacity: .5; }
#shortcuts { max-width: 330px; line-height: 1.9; }
#shortcuts kbd { display: inline-block; min-width: 1.4em; padding: 0 4px; margin-right: 2px; border: 1px solid #ffffff50; border-radius: 4px; background: #ffffff14; font: 11px/1.5 system-ui, sans-serif; text-align: center; }
#performance-chip { margin-left: auto; padding: 4px 7px; border: 1px solid #e3b35a80; background: #e3b35a24; color: #f3d9a4; font-size: 12px; font-variant-numeric: tabular-nums; }
#performance-chip:hover { background: #e3b35a40; }
#performance-chip:not([hidden]) + #preset-tag { margin-left: 0; }
#voyage-status { position: fixed; left: 24px; top: 90px; z-index: 4; max-width: calc(100vw - 48px); padding: 7px 12px; border-radius: 8px; background: #182b30e8; color: #f5efdf; font-size: 12px; }
#sound-notice { position: fixed; right: 24px; top: 90px; z-index: 4; max-width: min(460px, calc(100vw - 48px)); padding: 10px 14px; border-radius: 8px; background: #182b30ed; font-size: 12px; }
.reality-home { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 20%, #446b6e, #162e36 55%, #0c202a); color: #f1e7ce; }
.reality-home main { text-align: center; padding: 32px; }
.reality-home h1 { font-size: clamp(72px, 16vw, 190px); font-weight: 350; letter-spacing: -.075em; line-height: 1.15; margin: 0 0 36px; }
.home-eyebrow { text-transform: uppercase; letter-spacing: .3em; font-size: 11px; color: #c2cfc8; }
.home-launch { display: inline-flex; gap: 30px; color: inherit; text-decoration: none; border: 1px solid #c4d2c66b; border-radius: 30px; padding: 13px 25px; }
/* Icons shrink before anything wraps; very narrow windows wrap the bar onto two rows. */
@media (max-width: 1100px) {
  #voyage-bar { gap: 8px; padding: 6px 8px; }
  .icon { width: 18px; height: 18px; }
  .icon.small { width: 16px; height: 16px; }
  .segments label { padding: 3px 4px; }
  .segment-slider { gap: 4px; }
  .clock-control { min-width: 120px; }
  .clock-row input { min-width: 70px; }
}
@media (max-width: 900px) {
  #mobile-settings {
    display: block; position: fixed; top: 8px; left: 8px; right: 8px; z-index: 4;
    max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain;
  }
  #mobile-settings:not([open]) { right: auto; }
  #mobile-settings > summary {
    display: flex; align-items: center; position: sticky; top: 0; z-index: 5;
    width: max-content; min-width: 44px; min-height: 44px; padding: 8px 14px;
    border: 1px solid #e8dfc440; border-radius: 10px; background: #182b30f2;
    color: #f5efdf; font: 14px/1.3 system-ui, sans-serif; cursor: pointer;
    list-style: none; touch-action: manipulation;
  }
  #mobile-settings > summary::-webkit-details-marker { display: none; }
  #mobile-settings > summary:focus-visible { outline: 2px solid #ccebdc; outline-offset: -3px; }
  #voyage-bar { position: relative; top: auto; left: auto; right: auto; margin-top: 8px; flex-wrap: wrap; row-gap: 6px; }
  .clock-control { flex: 1 1 100%; order: 2; }
  .clock-bounds { display: none; }
  #voyage-status, #sound-notice, #banner { top: 132px; }
  #panel, body.panel-simple #panel {
    position: relative; top: auto; left: auto; right: auto; margin-top: 8px;
    max-height: none; max-width: none; overflow: visible;
  }
}
@media (prefers-reduced-motion: reduce) { .selection { transition: none; } }
#quality-panel { margin: 8px 0; }
#quality-panel select { max-width: 180px; }
/* Compact H panel (default; `?dev=1` shows everything): quality choice, FPS line and Recalculate under the preset tag. */
body.panel-simple #panel { left: auto; right: 16px; padding: 10px 14px; }
body.panel-simple #panel > :not(#monitor-result):not(#quality-panel):not(#effects-panel):not(#shortcuts):not(#device):not(#graphics-help):not(#helm-controls),
body.panel-simple #quality-panel > :not(.controls),
body.panel-simple #quality-panel .controls > :not(label:first-child):not(#quality-assess):not(#quality-short) { display: none; }
body.panel-simple #panel p, body.panel-simple #quality-panel { margin: 0 0 6px; }
#quality-short { font-variant-numeric: tabular-nums; }
#performance-warning {
  max-width: min(560px, calc(100vw - 64px)); max-height: calc(100vh - 64px);
  overflow: auto; background: #10232c; color: #eef7fa; border: 1px solid #76949d;
  border-radius: 8px; padding: 20px; font: 14px/1.5 system-ui, sans-serif;
}
#performance-warning::backdrop { background: #0006; }
#performance-choices button[data-current] { outline: 1px solid #ccebdc; }
#helm-controls {
  margin-top: 12px; padding: 10px 12px; border: 1px solid #76949d; border-radius: 8px;
  background: #10232ce8; font: 12px/1.35 system-ui, sans-serif;
}
#helm-controls label { justify-content: space-between; }
#helm-controls summary { cursor: pointer; font-weight: 650; }
.helm-body { margin-top: 8px; }
#helm-controls input { width: 100%; margin: 6px 0; touch-action: none; }
#helm-controls output { color: #b6f3c4; }
.helm-ends, .helm-actions { display: flex; justify-content: space-between; gap: 8px; }
.helm-ends { color: #b7cbd4; font-size: 11px; margin-bottom: 6px; }
.helm-actions button { padding: 4px 6px; font-size: 12px; }
#helm-hint { margin-bottom: 0; }
#graphics-help { max-width: 460px; margin: 10px 0; font-size: 13px; }
#graphics-help summary { cursor: pointer; }
#graphics-help li { margin-bottom: 8px; }
#graphics-help code { overflow-wrap: anywhere; }
#performance-help { margin-top: 12px; }
.gpu-guide { margin: 12px 0; }
.gpu-guide img { display: block; width: 100%; height: auto; border-radius: 10px; }
.gpu-guide figcaption { margin-top: 6px; color: #b7cbd4; font-size: 12px; }
.settings-link { display: inline-block; padding: 8px 12px; margin: 8px 0; border: 1px solid #9de2ff; border-radius: 6px; }
.settings-link:focus-visible { outline: 2px solid #ccebdc; outline-offset: 3px; }
.windows-graphics-actions code { overflow-wrap: anywhere; }
#scene:focus-visible { outline: 2px solid #9de2ff; outline-offset: -2px; }
#boat-readout { bottom: 12px; max-width: calc(100vw - 310px); }
@media (max-width: 699px) {
  #helm-controls input { min-height: 32px; }
  #boat-readout { bottom: 62px; max-width: calc(100vw - 24px); }
  #helm-controls[open] ~ #boat-readout { bottom: 284px; }
}
