:root { color-scheme: dark; font: 100%/1.5 system-ui, sans-serif; color: #e7f5f4; background: #071923; --line: #2f515e; --muted: #adc9cc; --accent: #87efcf; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at top left,#143d4b,transparent 48rem); }
main { max-width: 94rem; margin: auto; padding: clamp(.8rem,3vw,2.5rem); }
main:fullscreen { background: #071923; overflow: auto; max-width: none; }
.masthead, .settings, .actions, nav { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem 1rem; }
.masthead { justify-content: space-between; align-items: start; }
.masthead strong { color: var(--accent); }
h1 { font-size: clamp(1.8rem,4vw,3.15rem); line-height: 1.1; margin: .2rem 0; letter-spacing: -.035em; }
.intro, .caption, .notice { color: var(--muted); }
.settings, .actions, nav { margin: .8rem 0; }
.settings > label { display: grid; gap: .2rem; font-size: .9rem; }
.settings .check { display: flex; align-items: center; gap: .35rem; min-height: 2.6rem; }
.distance { min-width: min(100%,16rem); grid-template-columns: 1fr auto; }
.distance input { grid-column: 1/-1; }
input, button, select { font: inherit; accent-color: var(--accent); }
button, select, input[type=number] { min-height: 2.6rem; color: inherit; background: #133441; border: 1px solid var(--line); border-radius: .55rem; padding: .35rem .7rem; }
input[type=number] { width: 9rem; }
button, select, summary { cursor: pointer; }
button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #092a30; }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 2px solid #f8d599; outline-offset: 2px; }
.cards { display: flex; flex-wrap: wrap; gap: .75rem; margin: .75rem 0; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .75rem; padding: .35rem .55rem .55rem; margin: 0; }
fieldset > div { display: flex; flex-wrap: wrap; gap: .45rem; }
.card { display: grid; grid-template-columns: 4.2rem 1fr; gap: .55rem; align-items: center; text-align: left; font-size: .89rem; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: .25rem; }
.card i { font-size: .78rem; display: block; }
.scenes { --split: 50%; display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; position: relative; }
figure { position: relative; margin: 0; overflow: hidden; background: #124253; border-radius: .65rem; }
canvas { display: block; width: 100%; aspect-ratio: 16/9; }
figcaption { position: absolute; top: .45rem; left: .45rem; padding: .18rem .5rem; color: white; background: #051e29e8; border-radius: .35rem; pointer-events: none; font-size: .87rem; }
#splitControl { display: none; }
#marker { position: absolute; border: 2px solid #ffdd84; width: 1.65rem; height: 1.65rem; transform: translate(-50%,-50%); border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 1px #142332; }
#target { position: absolute; inset: 0; opacity: 0; cursor: crosshair; }
#target:focus-visible { opacity: 1; background: transparent; border: 3px solid #f8d599; color: transparent; }
.scenes.search { grid-template-columns: 1fr; max-width: 64rem; margin-inline: auto; }
.scenes.search.ready { cursor: crosshair; }
details { border-top: 1px solid var(--line); padding-top: .7rem; }
a { color: var(--accent); }
.caption { margin: .3rem 0; font-size: .86rem; }
[hidden] { display: none !important; }
@media (max-width: 820px), (pointer: coarse) and (max-width: 1180px) {
  .scenes:not(.search) { grid-template-columns: 1fr; }
  .scenes:not(.search) #simulation { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }
  .scenes:not(.search) #simulation figcaption { left: auto; right: .45rem; }
  .scenes:not(.search)::after { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: var(--split); pointer-events: none; }
  #splitControl:not([hidden]) { display: flex; gap: .5rem; align-items: center; }
  #split { flex: 1; }
}

.filter-settings { align-items: start; }
.filter-controls { display: flex; flex-wrap: wrap; gap: .3rem 1rem; max-width: 100%; }
.filter-option { display: flex; align-items: center; gap: .25rem; }
.filter-help {
  display: grid;
  place-items: center;
  min-height: 2.5rem;
  width: 2.5rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}
.filter-help span { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border: 1px solid #61978f; border-radius: 50%; font-size: .85rem; font-weight: 700; }
.filter-help:hover, .filter-help[aria-expanded=true] { border-color: #4e827f; background: #1d454f; }
.filter-explanation {
  flex: 0 1 100%;
  position: relative;
  max-width: 33rem;
  margin: .25rem 0 0;
  padding: .75rem 1rem;
  border: 1px solid #4e827f;
  border-inline-start: .25rem solid var(--accent);
  border-radius: .8rem;
  background: linear-gradient(135deg,#163d49,#102b37);
  box-shadow: 0 .65rem 1.4rem #03101785;
}
.filter-explanation strong { color: var(--accent); }
.filter-explanation p { margin: .2rem 0 0; }

.pattern-settings { align-items: start; }
.pattern-option { display: flex; align-items: start; gap: .1rem; max-width: 100%; }
.pattern-option label { display: grid; gap: .2rem; min-width: 0; }
.pattern-option input { max-width: 100%; }
.pattern-settings .filter-explanation { flex-basis: 100%; }
.scenes.reference-only { grid-template-columns: 1fr; max-width: 64rem; margin-inline: auto; }
.scenes.reference-only::after { display: none; }

.depth-controls { margin: .9rem 0; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: .75rem; }
.depth-controls > label { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.6rem; cursor: pointer; }
.depth-controls output, #depthZone { color: var(--accent); }
#depthZone { margin: .2rem 0; }
.depth-zones figure::after {
  content: '';
  position: absolute;
  inset: 0 var(--overlap-edge);
  border-inline: 2px dashed #a5f6df;
  background: #74f1c818;
  box-shadow: 0 0 0 100vmax #06172635;
  pointer-events: none;
}
.depth-zones figcaption { z-index: 1; }

.eye-views { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; max-width: 64rem; margin: .7rem auto; }
.eye-views figure { border: 1px solid var(--line); }
@media (max-width: 420px) {
  .eye-views figcaption { top: .2rem; left: .2rem; font-size: .78rem; padding: .1rem .35rem; }
}
