/* Starlight Barcode Scanner: an observatory spectrograph display (sky band, starlight + candidate strips, zoom loupes).
   Scene by art.js; panel colors from the --sb-* properties below (light and dark). The instrument display stays dark
   in both themes. */
html {
  --sb-ink: #14232b; --sb-panel-bg1: #f3f8fa; --sb-panel-bg2: #e0ecf1; --sb-accent: #21576b; --sb-ok: #13704a; --sb-bad: #b3261e;
  --sb-chip: #ffffff; --sb-chip-on: #d6eaf1; --sb-line: #05071a; --sb-red: #b3261e; --sb-blue: #1f5fbf;
}
html[data-theme="dark"] {
  --sb-ink: #e6f0f4; --sb-panel-bg1: #1a252b; --sb-panel-bg2: #131c21; --sb-accent: #8fd0e6; --sb-ok: #4fd08c; --sb-bad: #ff8a80;
  --sb-chip: #121b20; --sb-chip-on: #1f3b47; --sb-line: #000000; --sb-red: #ff8a80; --sb-blue: #8fb8ff;
}
.sb { position: absolute; inset: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.sb input, .sb button { font: inherit; }
.sb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sb-controls { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--sb-panel-bg1), var(--sb-panel-bg2)); color: var(--sb-ink); border: 3px solid var(--sb-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.sb-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; overflow: auto; }
.sb-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sb-accent); }
.sb-step, .sb-step-b { display: grid; gap: 3px; }
.sb-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.sb-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sb-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .sb-n { color: #0d1a24; }
.sb-step.is-done .sb-n { background: var(--sb-ok); }
.sb-mark { margin-left: auto; font-weight: 800; white-space: nowrap; }
.sb-mark.is-ok, .sb-fmark.is-ok { color: var(--sb-ok); }
.sb-mark.is-bad, .sb-fmark.is-bad { color: var(--sb-bad); }

.sb-els { display: grid; gap: 3px; }
.sb-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.sb-chips .sb-chip { justify-content: center; padding: 3px 4px 3px 4px; text-align: center; }
.sb-chips .sb-chip.is-on::before { content: none; }
.sb-chips .sb-chip-m { display: none; }
.sb-mo { display: grid; justify-items: center; line-height: 1.2; }
.sb-mo-s { font-size: 16px; }
.sb-chip { position: relative; display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 22px 2px 8px; border: 2px solid #9fb0bc; border-radius: 10px;
  background: var(--sb-chip); color: var(--sb-ink); font-size: 16px; line-height: 1.15; text-align: left; cursor: pointer; }
html[data-theme="dark"] .sb-chip { border-color: #4d606d; }
.sb-chip:hover:not(:disabled) { border-color: var(--sb-accent); }
.sb-chip.is-on { border-color: var(--sb-accent); background: var(--sb-chip-on); box-shadow: inset 0 0 0 1px var(--sb-accent); }
.sb-chip.is-on { font-weight: 700; }
.sb-els .sb-chip.is-on::before { content: '●'; color: var(--sb-accent); }
.sb-chip-m { position: absolute; right: 5px; font-weight: 800; }
.sb-chip.is-key { border-color: var(--sb-ok); box-shadow: inset 0 0 0 2px var(--sb-ok); }
.sb-chip.is-key .sb-chip-m { color: var(--sb-ok); }
.sb-chip.is-wrong { border-color: var(--sb-bad); border-style: dashed; }
.sb-chip.is-wrong .sb-chip-m { color: var(--sb-bad); }
.sb-chip:disabled { cursor: default; opacity: 1; }
.sb-chip-name { flex: 1 1 auto; display: flex; align-items: baseline; gap: 5px; min-width: 0; white-space: nowrap; }
.sb-ion { font-size: 16px; opacity: .8; }
.sb-chip-bar { flex: none; display: block; line-height: 0; }
.sb-mini { width: 84px; height: 22px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.sb-mo-ic { font-weight: 800; white-space: nowrap; }
.sb-mo-away { color: var(--sb-red); }
.sb-mo-toward { color: var(--sb-blue); }


.sb-slider { display: grid; gap: 1px; }
.sb-slider-h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.sb-slider-v { font-weight: 800; color: var(--sb-accent); white-space: nowrap; }
.sb-slider.is-unset .sb-slider-v { font-weight: 600; font-style: italic; color: var(--sb-ink); opacity: .8; }
.sb-slider-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 6px; }
.sb-slider input { width: 100%; min-height: 30px; margin: 0; accent-color: var(--sb-accent); cursor: pointer; }
.sb-slider.is-unset input { opacity: .55; }
.sb-slider-ticks { display: flex; justify-content: space-between; margin: 0 40px; font-size: 16px; font-weight: 700; }
.sb-blue { color: var(--sb-blue); } .sb-red { color: var(--sb-red); }
.sb-step-btn { min-height: 38px; border-radius: 10px; border: 2px solid var(--sb-accent); background: var(--sb-chip); color: var(--sb-ink); font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer; }
.sb-step-btn:disabled { opacity: .45; cursor: default; }
.sb input:focus-visible, .sb button:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.sb-num { display: grid; gap: 1px; min-width: 0; }
.sb-num-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-weight: 700; line-height: 1.2; }
.sb-fmark { font-weight: 800; }
.sb-num-row { display: flex; align-items: center; gap: 6px; }
.sb-num input { flex: 1 1 auto; min-width: 0; width: 100%; font-size: 17px; min-height: 38px; padding: 3px 8px; border: 2px solid #8796a1; border-radius: 8px; background: #fff; color: #17242c; }
html[data-theme="dark"] .sb-num input { background: #10171c; color: #eef3f6; border-color: #6d7f8c; }
.sb-unit { flex: none; font-weight: 700; }

.sb-brief { flex: none; display: grid; gap: 2px; padding: 4px 12px; border: 2px solid var(--sb-accent); border-radius: 12px; background: var(--sb-panel-bg1); color: var(--sb-ink); }
.sb-brief p { margin: 0; line-height: 1.35; }
.sb-target, .sb-rest { display: grid; grid-template-columns: 140px minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
.sb-k { font-weight: 600; }
.sb-obs { font-variant-numeric: tabular-nums; }
.sb-target .sb-obs { font-size: 18px; }
.sb-scene { flex: none; border-radius: 12px; overflow: hidden; border: 2px solid var(--sb-line); background: #090e20; }
.sb-svg { display: block; width: 100%; height: auto; }
.sb-svg text { font-family: var(--tlg-font); }
.sb-lbl { font-size: 17px; font-weight: 700; fill: #eef3ff; paint-order: stroke; stroke: #05071a; stroke-width: 4px; stroke-linejoin: round; }
.sb-dim { fill: #b9c6ec; font-weight: 600; }
.sb-strip-l { font-size: 18px; font-weight: 800; fill: #eef3ff; }
.sb-strip-s { font-size: 16px; font-weight: 600; fill: #b9c6ec; }
.sb-tick { font-size: 16px; font-weight: 700; fill: #c7d2f7; }
.sb-tick.sb-dim { font-weight: 600; fill: #9fb0dc; }
.sb-line { fill: #05060c; }
.sb-cand-strip { transition: opacity .2s; }
.sb-cand-strip.is-empty { opacity: .25; }
.sb-cand-msg { font-size: 17px; font-weight: 700; fill: #ffffff; paint-order: stroke; stroke: #05071a; stroke-width: 4px; }
.sb-guide { stroke: #ffffff; stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .8; }
.sb-loupe-t { font-size: 16px; font-weight: 700; fill: #eef3ff; font-variant-numeric: tabular-nums; }
.sb-loupe-d { font-size: 16px; font-weight: 700; fill: #ffe68a; font-variant-numeric: tabular-nums; }
.sb-edge { font-size: 16px; font-weight: 800; fill: #ffffff; paint-order: stroke; stroke: #05071a; stroke-width: 4px; }
.sb-keymark { fill: none; stroke: #5ff0a8; stroke-width: 3; }
.sb-keybox { fill: none; stroke: #5ff0a8; stroke-width: 3; stroke-dasharray: 4 3; }
.sb-motion-p { fill: none; stroke-width: 5; stroke-linecap: round; }
.sb-motion-p.sb-mv-away { stroke: #ff7a5c; } .sb-motion-h.sb-mv-away { fill: #ff7a5c; }
.sb-motion-p.sb-mv-toward { stroke: #7cb8ff; } .sb-motion-h.sb-mv-toward { fill: #7cb8ff; }
.sb-twinkle { animation: sb-tw 2.6s ease-in-out infinite alternate; }
.sb-star-glow { animation: sb-pulse 3.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.sb.is-sliding .sb-los { animation: sb-beam .5s linear infinite; }
@keyframes sb-tw { from { opacity: .2; } to { opacity: 1; } }
@keyframes sb-pulse { from { transform: scale(.92); } to { transform: scale(1.06); } }
@keyframes sb-beam { 50% { opacity: .55; } }
.sb-readout { flex: none; margin: 0; padding: 5px 12px; border-radius: 10px; background: var(--sb-panel-bg2); color: var(--sb-ink); line-height: 1.3; }
.sb-about { flex: none; padding: 2px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.sb-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.sb-about p { margin: 4px 0; }
.sb-ex { display: grid; gap: 8px; }
.sb-ex-svg { border-radius: 10px; border: 2px solid var(--sb-line); width: 100% !important; max-width: 520px; height: auto !important; max-height: none; }
.sb-ex-t { border-collapse: collapse; font-size: 16px; }
.sb-ex-t th, .sb-ex-t td { padding: 3px 8px; border-bottom: 1px solid var(--tlg-border); text-align: left; }
.sb-ex-svg text.sb-ex-t { font-size: 18px; font-weight: 700; fill: #eef3ff; font-family: var(--tlg-font); }
.sb-ex-svg text.sb-ex-s { font-size: 16px; font-weight: 600; fill: #c7d2f7; }
@media (max-width: 900px) {
  .sb { position: static; grid-template-columns: 1fr; }
  .sb-controls, .sb-right { overflow: visible; }
  .sb-scene { overflow-x: auto; }
  .sb-svg { min-width: 680px; }
}
@media (prefers-reduced-motion: reduce) { .sb *, .sb *::before { animation: none !important; transition: none !important; } }
