:root {
  color-scheme: light;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #172225;
  background: #f2f5f4;
  --line: #d9e2df;
  --ink: #172225;
  --muted: #4e6361;
  --accent: #006653;
  --mark: #ff7259;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; color: var(--ink); border: 1px solid #bfd0ca; border-radius: 8px; padding: .7rem 1rem; background: #fff; font-weight: 650; min-height: 44px; }
button:hover { background: #e7efeb; }
button:focus-visible { outline: 3px solid #259981; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .5; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.primary:hover { background: #004c40; }
button.plain { background: transparent; border-color: transparent; }
.bar { height: 70px; background: #11191c; color: white; display: flex; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1240px) / 2)); align-items: center; position: sticky; z-index: 2; top: 0; }
.bar button { color: #e4f6ef; }
.bar button:hover { background: #263635; }
.brand { display: flex; gap: 12px; align-items: center; font-size: 1.05rem; white-space: nowrap; }
.brand strong span { color: #85e3c9; font-weight: 500; margin-left: 4px; }
.brand-mark { width: 25px; height: 25px; border: 2px solid #85e3c9; border-radius: 8px; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border: 2px solid #85e3c9; border-radius: 50%; }
main { max-width: 1288px; margin: auto; padding: clamp(24px, 4vw, 52px) 24px 28px; }
.heading { margin-bottom: 25px; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.04em; margin: 0 0 7px; }
h2 { font-size: 1.05rem; margin: 0; }
p { margin: 0; }
.heading p, .note, footer, .meta { color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin-bottom: 12px; }
.meta { font-size: .8rem; }
.stage { display: grid; place-items: center; background: #142224; border-radius: 9px; min-height: 320px; overflow: hidden; position: relative; }
.empty { color: #e1eee9; text-align: center; padding: 26px; }
.empty p { margin: 20px 0 6px; font-weight: 650; }
.empty span { color: #adbfbb; font-size: .83rem; }
.reticle { width: 72px; height: 72px; margin: auto; position: relative; border: 1px dashed #75ab9f; border-radius: 18px; display: grid; place-items: center; }
.reticle i { width: 28px; height: 28px; border: 1px solid #8dd8c4; border-radius: 50%; }
.photo { width: fit-content; max-width: 100%; position: relative; line-height: 0; }
.photo img { display: block; width: auto; max-width: 100%; max-height: 63vh; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; min-width: 0; min-height: 0; border: 2px solid var(--mark); background: transparent; border-radius: 2px; box-shadow: 0 0 0 1px #271a165c; padding: 0; pointer-events: auto; }
.marker::before { content: ""; position: absolute; inset: -5px; }
.marker:hover, .marker.active { background: #ff725926; outline: 1px solid #fff; outline-offset: 1px; z-index: 1; }
.marker span { display: grid; place-items: center; min-width: 27px; height: 27px; border-radius: 15px; position: absolute; left: 50%; top: 0; transform: translate(-50%,-80%); color: #2c140d; background: var(--mark); font-size: .78rem; font-weight: 800; box-shadow: 0 0 0 1px #321c17; }
.controls { margin-top: 14px; display: flex; gap: 9px; flex-wrap: wrap; }
.note, footer { font-size: .78rem; line-height: 1.5; }
.note { margin-top: 11px; }
footer { margin-top: 16px; }
.status, .error-note { padding: 12px; background: #edf3f0; border-radius: 7px; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.status[data-tone="hold"], .error-note { background: #fff0e7; color: #703517; }
.status[data-tone="clear"] { color: #004b3b; background: #dcf3e7; }
.status[data-tone="error"] { color: #7a2717; background: #ffebe5; }
.error-note { position: absolute; inset: auto 8px 8px; }
.zoom { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.zoom-head { background: #edf3f0; padding: 3px 8px 3px 10px; min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: .86rem; font-weight: 700; }
.zoom-head button { padding: .3rem .5rem; font-size: .75rem; }
.zoom-body { min-height: 110px; display: grid; place-items: center; background: #142224; }
.zoom canvas { width: auto; height: auto; max-width: 100%; max-height: 285px; }
.finding { padding: 13px 0 0; margin-top: 13px; border-top: 1px solid var(--line); font-size: .88rem; }
.finding button { width: 100%; text-align: left; }
.finding button[aria-pressed="true"] { border-color: #17725c; background: #e9f4ef; }
.finding p { margin-top: 8px; line-height: 1.48; }
.report { margin-top: 14px; }
@media (max-width: 770px) {
  .bar { height: 57px; padding: 0 14px; }
  main { padding: 23px 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel { padding: 12px; }
  .stage { min-height: 245px; }
}
@media print {
  .bar { position: static; color: black; background: white; }
  .bar span { color: black; }
  .controls, .report, .bar button, .note, .zoom-head button { display: none !important; }
  .panel, .finding { break-inside: avoid; }
  main { padding: 0; }
}

.bar-controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
select { color: var(--ink); font: inherit; border: 1px solid #bfd0ca; border-radius: 8px; padding: .55rem .65rem; background: #fff; min-height: 42px; max-width: 100%; }
select:focus-visible { outline: 3px solid #259981; outline-offset: 2px; }
.bar select { color: #e4f6ef; background: #263635; border-color: #5a7771; font-size: .85rem; }
.surface-control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
.mode-help { margin: 7px 0 12px; }
.marker[data-kind="orange"] { border-style: dashed; --mark: #ffbc54; }
.marker[data-kind="crater"] { border-radius: 45%; }
@media (max-width: 520px) {
  .brand { gap: 6px; font-size: .88rem; }
  .brand-mark { width: 21px; height: 21px; }
  .brand-mark::after { inset: 4px; }
  .bar-controls button { font-size: .74rem; padding: .45rem .3rem; }
  .bar-controls select { min-height: 36px; padding: .35rem .2rem; max-width: 92px; }
}
@media print { .bar-controls { display: none; } }
#outline { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
#mask-controls { margin-top: 6px; }
