/* Apex Camera Coverage Simulator. Same tokens as the rink light simulator:
   ink #16181a, off-white #fdfdfc, copper #b9733a / #cf9256 / #7c4719. */
:root {
  --bg: #16181a;
  --panel: #1c1f22;
  --panel-2: #23272b;
  --hair: rgba(253, 253, 252, .09);
  --hair-2: rgba(253, 253, 252, .16);
  --ink: #fdfdfc;
  --ink-2: #c9cbcd;
  --muted: #8d9195;
  --accent: #b9733a;
  --accent-2: #cf9256;
  --accent-3: #7c4719;
  --accent-ink: #fdfdfc;
  --hl: #c4a27c;
  --radius: 12px;
  --radius-s: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
#app { max-width: 1480px; margin: 0 auto; padding: 0 16px 28px; }

header { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 16px 0 14px; border-bottom: 1px solid var(--hair); }
header .brand { display: flex; align-items: center; gap: 11px; }
header .mark { width: 38px; height: 38px; display: block; border-radius: 9px; box-shadow: 0 0 0 1px var(--hair-2); }
header .wordmark { font-size: 17px; font-weight: 800; letter-spacing: .08em; line-height: 1.1; }
header .wordmark span { display: block; font-size: 9px; font-weight: 700; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
header .app { border-left: 1px solid var(--hair-2); padding-left: 18px; min-width: 0; }
header .t { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
header .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
header .s a { color: var(--hl); text-decoration: none; }
header .s a:hover { text-decoration: underline; }

#layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 980px) { #layout { grid-template-columns: minmax(0, 1fr); } }

#stageWrap { position: relative; border: 1px solid var(--hair-2); border-radius: var(--radius); overflow: hidden; background: #101214; }
#stage { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
#calBar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: rgba(22, 24, 26, .92); border: 1px solid var(--hair-2); border-radius: var(--radius-s); padding: 9px 12px; font-size: 12px; color: var(--ink-2); }
#calBar input { width: 72px; }

#toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: stretch; padding: 14px 0; }
#addBar, #planBar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#addBar select { width: auto; max-width: 260px; }
.btn { background: var(--panel-2); border: 1px solid var(--hair-2); color: var(--ink); border-radius: var(--radius-s);
  padding: 8px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; line-height: 1.3; white-space: nowrap; }
.btn:hover { border-color: rgba(253, 253, 252, .28); }
.btn:active { background: #2b2f34; }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.accent:active { background: var(--accent-3); }

#daynight, #modeRow { display: flex; border: 1px solid var(--hair-2); border-radius: var(--radius-s); overflow: hidden; }
#daynight button, #modeRow button { background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 12.5px;
  font-weight: 600; padding: 8px 16px; cursor: pointer; }
#daynight button.on, #modeRow button.on { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent-2); }
#modeRow { margin-bottom: 10px; }
#modeRow button { flex: 1; }

#panel { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 16px 16px; min-width: 0; }
#panel h2 { font-size: 10px; letter-spacing: .18em; color: var(--muted); font-weight: 700; margin: 16px 0 9px; text-transform: uppercase; }
#panel h2:first-child { margin-top: 0; }
#panel h2#selTitle { font-size: 13.5px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 700; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.row.gap { gap: 8px; }
.row .k { font-size: 12px; color: var(--ink-2); width: 56px; flex-shrink: 0; }
.row .k.narrow { width: auto; color: var(--muted); }
.row .v { font-size: 12px; font-weight: 600; text-align: right; flex-shrink: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.row .v.wide { flex: 1; color: var(--muted); font-weight: 500; }
.row .spec { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
select, input[type="text"], input[type="number"] {
  background: var(--panel-2); border: 1px solid var(--hair-2); color: var(--ink); border-radius: 7px;
  padding: 7px 9px; font-size: 12.5px; width: 100%; font-family: inherit; color-scheme: dark; }
select:focus, input[type="text"]:focus, input[type="number"]:focus { outline: none; border-color: var(--accent-2); }
input[type="number"] { width: 64px; }
#camActions { display: flex; gap: 8px; }
#camActions .btn { flex: 1; text-align: center; }
#noSel { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
#noSel .ctl { list-style: none; }
#noSel .ctl li { padding: 5px 0; border-bottom: 1px solid var(--hair); }
#noSel .ctl li:last-child { border-bottom: 0; }
#noSel .ctl b { color: var(--ink); font-weight: 600; }
.hl { color: var(--hl); }

.vh { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; min-height: 16px; }
.vh b { color: var(--hl); }
#face { width: 100%; max-width: 220px; height: auto; display: block; border-radius: var(--radius-s); border: 1px solid var(--hair-2); background: #0d0f11; }
#verdict { font-size: 12.5px; font-weight: 600; margin-top: 9px; line-height: 1.45; }
#zoneLegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; font-size: 11px; color: var(--ink-2); }
#zoneLegend .z { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#zoneLegend .d { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

#parts { border-top: 1px solid var(--hair); margin-top: 16px; padding-top: 2px; }
#parts .line { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); padding: 3px 0; gap: 8px; }
#parts .line b { color: var(--ink); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
#parts .tot { border-top: 1px solid var(--hair); margin-top: 7px; padding-top: 8px; font-size: 12.5px; }
#parts .tot b { color: var(--hl); }
.note { font-size: 10.5px; color: var(--muted); line-height: 1.5; margin-top: 10px; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  border-left: 3px solid var(--accent); padding: 9px 16px; border-radius: var(--radius-s); font-size: 12.5px; font-weight: 600;
  opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }

@media (max-width: 600px) {
  #app { padding: 0 12px 24px; }
  header { gap: 10px; padding: 12px 0; }
  header .app { border-left: 0; padding-left: 0; flex-basis: 100%; }
  #toolbar { gap: 8px; }
  #addBar, #planBar { width: 100%; }
  #addBar select { flex: 1; max-width: none; }
  #planBar .btn { flex: 1 1 auto; }
  #daynight { width: 100%; }
  #daynight button { flex: 1; }
  #panel { padding: 12px; }
}
