/* SyncFPV Slate: the SyncFPV design system (same tokens as skysync/ui/theme.py) */
@font-face { font-family: "Inter"; src: url(fonts/Inter-Regular.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Bold.woff2) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/JetBrainsMono-Medium.woff2) format("woff2"); font-weight: 500; font-display: block; }

:root {
  --bg0: #0A0B0D; --bg1: #111317; --bg2: #171A1F; --bg3: #1F232A; --bg4: #272C34;
  --line: #23272E; --line2: #2F343C;
  --text: #E7E9EC; --text2: #A0A6B0; --text3: #6A707B;
  --accent: #4C9DFF; --accent2: #7DB8FF; --accent-dim: #16263A; --on-accent: #06121F;
  --good: #33D49A; --warn: #F4B13E; --bad: #F25C5F;
  --r: 10px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg0); color: var(--text); }
body { font: 15px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; }
.hidden { display: none !important; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.caps { color: var(--text3); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.gap8 { gap: 8px; }
.grow { flex: 1; }
.pad { padding: 4px 4px 0; }
.two > * { flex: 1; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.rec { color: var(--bad); }

/* ------------------------------------------------------------- home */
.view { min-height: 100vh; min-height: 100dvh; }
#home, .page { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  padding: calc(14px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal)); }
.top { display: flex; align-items: center; gap: 12px; padding: 2px 0 4px; }
.logo { width: 40px; height: 40px; flex: none; }
.brand { flex: 1; min-width: 0; }
.title { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.sub { color: var(--text3); font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px;
  border: 1px solid var(--line2); background: var(--bg2); color: var(--text2); font: 600 12px "Inter", sans-serif; }
.chip .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--text3); }
.chip.good .dot { background: var(--good); } .chip.warn .dot { background: var(--warn); } .chip.bad .dot { background: var(--bad); }
.card { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex;
  flex-direction: column; gap: 10px; }
.card.center { align-items: center; text-align: center; }
.hint { border-color: #1E3A5E; background: var(--accent-dim); color: var(--accent2); font-size: 13px; }
.homeclock { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.homeclock .ms { color: var(--accent); font-size: 0.6em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text2); }
input, textarea { width: 100%; background: var(--bg3); color: var(--text); border: 1px solid var(--line2); border-radius: 8px;
  font: 600 16px "Inter", sans-serif; padding: 10px 12px; outline: none; text-transform: uppercase; }
textarea { font: 500 14px "JetBrains Mono", monospace; text-transform: none; resize: vertical; min-height: 180px; }
input:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: var(--text3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text);
  font: 600 14px "Inter", sans-serif; cursor: pointer; user-select: none; }
.btn:active { background: var(--bg4); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:active { background: var(--accent2); }
.btn.big { height: 56px; font-size: 17px; }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #4A2629; align-self: center; }
.btn.rec { background: #3A1618; border-color: #5A2427; color: #FFD9DA; width: 100%; }
.btn.rec .ic { color: var(--bad); }
.btn.rec.on { background: var(--bad); color: #fff; }
.btn.rec.on .ic { color: #fff; }
.btn.dark { background: #111; color: #fff; border-color: #333; }
.round { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.round:active { background: var(--bg4); }
.round.flat { border: none; background: transparent; }
.stepper { display: flex; align-items: center; gap: 10px; }
.takeval { min-width: 64px; text-align: center; font: 700 26px "Inter", sans-serif; color: var(--accent); font-variant-numeric: tabular-nums; }
.lineup { display: flex; flex-wrap: wrap; gap: 8px; }
.lineup button { height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line2); background: var(--bg2);
  color: var(--text); font: 600 13px "Inter", sans-serif; text-transform: uppercase; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; }
.lineup button .t { color: var(--text3); font: 500 11px "JetBrains Mono", monospace; }
.lineup button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lineup button.on .t { color: var(--on-accent); opacity: 0.75; }
.lineup button.now:not(.on) { border-color: var(--accent); }
.lineup button.auto { border-style: dashed; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle > span { flex: none; width: 42px; height: 26px; border-radius: 13px; background: var(--bg4); position: relative; margin-top: 1px;
  transition: background .15s; }
.toggle > span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 10px;
  background: var(--text2); transition: transform .15s, background .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); background: #fff; }
.toggle b { font-weight: 600; font-size: 14px; }
.foot { text-align: center; padding: 8px 12px; }
.foot .getapp { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; text-decoration: none; }
.pagehead { display: flex; align-items: center; gap: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex;
  gap: 10px; align-items: center; }
.item .grow { min-width: 0; }
.item .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: var(--text3); font-size: 12px; }
.rectime { font-size: 56px; font-weight: 500; }
.meter { width: 100%; height: 8px; border-radius: 4px; background: var(--bg3); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--good); transition: width .08s linear; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); background: var(--bg3);
  border: 1px solid var(--line2); color: var(--text); padding: 10px 16px; border-radius: 20px; font-size: 14px; z-index: 50;
  max-width: 90vw; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.dlg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
  z-index: 40; padding: 16px; }
.dlgbox { background: var(--bg1); border: 1px solid var(--line2); border-radius: 14px; padding: 16px; width: min(560px, 100%);
  display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }
.scanbox { background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------- slate (what the camera reads) */
.slate { position: fixed; inset: 0; z-index: 10; overflow: hidden; display: grid;
  grid-template-rows: auto 1fr auto; gap: 2vmin;
  padding: calc(3vmin + var(--sat)) calc(4vmin + var(--sar)) calc(3vmin + var(--sab)) calc(4vmin + var(--sal));
  --sbg: #000; --sfg: #fff; --slab: #9AA3AF; --sacc: #4C9DFF;
  background: var(--sbg); color: var(--sfg); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.slate.day { --sbg: #fff; --sfg: #000; --slab: #555D69; --sacc: #1F6FE5; }
.s-top, .s-bottom { display: flex; justify-content: space-between; gap: 4vmin; min-width: 0; }
.s-bottom { justify-content: flex-start; }
.s-bottom .s-field { flex: 1; min-width: 0; }
.s-field { min-width: 0; }
.s-label { color: var(--slab); font: 700 max(12px, 3vmin) "Inter", sans-serif; letter-spacing: 0.05em; }
.s-value { font: 700 max(16px, 6vmin) "Inter", sans-serif; text-transform: uppercase; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; line-height: 1.1; word-spacing: 0.5em; }
.s-value.big { font-size: max(22px, 8vmin); }
.s-take { text-align: right; flex: none; }
.accent { color: var(--sacc); }
.s-mid { display: flex; align-items: center; gap: 4vmin; min-height: 0; min-width: 0; }
.s-clockwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.s-clock { font: 700 100px "Inter", sans-serif; font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  white-space: nowrap; line-height: 1; letter-spacing: -0.01em; }
.s-ms { color: var(--sacc); font-size: 0.5em; letter-spacing: 0; }
.s-sub { display: flex; align-items: center; gap: 3vmin; margin-top: 1.5vmin; color: var(--slab);
  font: 600 max(13px, 3vmin) "Inter", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.s-beep { display: inline-flex; align-items: center; gap: 6px; color: var(--sacc); }
.s-beep .ic { width: 1.2em; height: 1.2em; }
.s-flash { position: absolute; inset: 0; pointer-events: none; border: 1.4vmin solid var(--sacc); opacity: 0; }
.s-flash.on { opacity: 1; }
.s-status { position: absolute; left: 50%; transform: translateX(-50%); top: calc(1.2vmin + var(--sat)); color: var(--slab);
  opacity: .6; font: 500 10px "JetBrains Mono", monospace; pointer-events: none; white-space: nowrap; }
.s-controls { position: absolute; left: 50%; bottom: calc(2.5vmin + var(--sab)); transform: translateX(-50%); display: flex; gap: 10px;
  padding: 8px; border-radius: 34px; background: rgba(28, 31, 36, .86); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .25s; z-index: 3; }
.s-controls .round { width: 50px; height: 50px; border-radius: 25px; background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14); color: #fff; }
.s-controls .round.main { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.s-controls .round.on { background: #fff; color: #000; }
.s-controls.gone { opacity: 0; pointer-events: none; }
.s-locked { position: absolute; right: calc(3vmin + var(--sar)); top: calc(2vmin + var(--sat)); z-index: 4; display: flex; gap: 8px;
  align-items: center; padding: 10px 14px; border-radius: 22px; background: rgba(28,31,36,.86); color: #fff; font-size: 13px; }

/* portrait: the clock on top, the QR under it */
@media (orientation: portrait) {
  .s-mid { flex-direction: column; justify-content: center; }
  .s-clockwrap { flex: none; width: 100%; align-items: center; }
  .s-bottom { flex-wrap: wrap; row-gap: 2vmin; }
  .s-bottom .s-field { flex: 1 1 40%; }
  .s-label { font-size: max(12px, 4.2vw); }
  .s-value { font-size: max(16px, 7vw); }
  .s-value.big { font-size: max(22px, 9vw); }
  .s-controls { gap: 6px; padding: 6px; }
  .s-controls .round { width: 42px; height: 42px; }
  .s-status { top: auto; bottom: calc(0.6vmin + var(--sab)); }
}

/* ------------------------------------------------------------- first step: the GoPro clock QR */
.step { border-color: #1E3A5E; }
.steptitle { font-weight: 600; font-size: 16px; margin: 2px 0; }
.step.done { border-color: #1E4A3A; }
.step.done #step1Text { color: var(--good); }
.stepline { padding: 8px 0 2px; }
.stepline + .stepline { border-top: 1px solid var(--line); margin-top: 8px; }
.steptitle .num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 10px; margin-right: 8px;
  background: var(--bg3); color: var(--text2); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.stepline.done .num { background: var(--good); color: #06120C; }
.stepline.done .small { color: var(--good); }
.slate.check .s-artist .s-value { color: var(--accent); white-space: nowrap; overflow: visible; text-overflow: clip; }
.slate.check .s-take { display: none; }
.slate.check .s-artist { max-width: none; flex: 1; }
.qrview { position: fixed; inset: 0; z-index: 20; background: #fff; color: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2.5vmin;
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); }
.qrview canvas { image-rendering: pixelated; display: block; }
.qrside { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 520px; }
.qrstep { font: 700 12px "Inter", sans-serif; letter-spacing: 0.12em; color: #1F6FE5; }
.qrtitle { font: 700 22px "Inter", sans-serif; text-align: center; }
.qrhelp { margin: 0; padding-left: 20px; font-size: 14px; color: #333; line-height: 1.45; }
.qrhelp b { color: #000; }
.qrtime { font-size: 15px; color: #555; }
.qrbtns { width: 100%; }
.qrbtns .btn { flex: 1; }
.btn.light { background: #fff; color: #111; border-color: #ccc; }
@media (orientation: landscape) {
  .qrview { flex-direction: row; gap: 5vw; }
  .qrside { align-items: flex-start; max-width: 42vw; }
  .qrtitle { text-align: left; }
}
@media (orientation: landscape) and (max-height: 430px) {
  .qrhelp { font-size: 12px; }
  .qrside { gap: 6px; }
  .qrtitle { font-size: 18px; }
  .qrbtns .btn { height: 40px; }
}
