:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  color: #fbf8f5;
  background: #151722;
  --surface: #202331;
  --stroke: #424656;
  --muted: #b9bdcd;
  --accent: #ff6b61;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; }
button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.app {
  width: min(100%, 470px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(30px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 22px;
  border-bottom: 1px solid #343747;
}
.app-name { font-size: 1.05rem; font-weight: 740; letter-spacing: -.02em; }
.demo-label { margin-left: auto; color: var(--muted); font-size: .875rem; }
.record-mark {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}
.record-mark::before, .capture-indicator {
  content: "";
  width: 11px;
  height: 11px;
  background: currentColor;
  color: var(--accent);
  border-radius: 50%;
}

.panel { padding-top: clamp(42px, 9svh, 80px); }
h1 {
  margin: 0 0 24px;
  font-size: clamp(2.6rem, 10vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -.056em;
  text-wrap: balance;
}
p { margin: 0 0 26px; color: var(--muted); line-height: 1.5; }
.brand-name { margin-bottom: 11px; color: var(--accent); font-weight: 670; }

fieldset { margin: 0 0 24px; padding: 0; border: none; }
legend, form label { display: block; margin-bottom: 10px; font-weight: 620; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.brand-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  min-height: 55px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  cursor: pointer;
}
.brand-option:has(:checked) { border-color: var(--accent); background: #352831; }
.brand-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

.series-options { margin: 0 0 20px; }
.series-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 2px;
  cursor: pointer;
}
.series-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
#series-picker { padding: 12px; border: 1px solid var(--stroke); border-radius: 12px; }
.field-label { display: block; margin-bottom: 8px; font-weight: 620; }
#series-picker select {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 9px;
  color: inherit;
}
#series-create { margin-top: 14px; }
#series-create input[type="text"] { margin-bottom: 0; }
#series-create .series-toggle { margin-top: 8px; margin-bottom: 0; font-weight: inherit; }
#broll-details { margin: 8px 0 4px; }
#finish-selected-series { min-height: 44px; }

button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 720;
  cursor: pointer;
}
.primary { background: var(--accent); color: #21151c; }
.primary:disabled { background: #343747; color: #afb2bf; cursor: default; }
.capture-indicator { width: 13px; height: 13px; color: inherit; }
.secondary { margin-top: 10px; background: var(--surface); border-color: var(--stroke); color: inherit; }
.text-button { margin-top: 8px; background: transparent; color: var(--muted); }
form input:not([type="checkbox"]), #broll-description, #recovery-code-value {
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: inherit;
}

progress { width: 100%; height: 12px; accent-color: var(--accent); display: block; }
progress::-webkit-progress-bar { background: var(--stroke); border-radius: 12px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 12px; }
.percentage { margin-top: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.job {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
}
.job p { margin: 0; }
.job .job-reference { margin-bottom: 4px; color: inherit; font-weight: 670; }
.series-result { margin-top: 20px; }
#series-done-status { margin-top: 8px; }
.job a { display: inline-block; margin-top: 8px; color: #ff948c; text-underline-offset: 3px; }
.message { margin: 16px 0 0; color: #ffb7b2; }

#camera-dialog, #recovery-code-dialog {
  width: min(calc(100% - 24px), 464px);
  max-height: calc(100% - 24px);
  padding: 17px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: #1c1e2a;
  color: inherit;
}
#camera-dialog::backdrop, #recovery-code-dialog::backdrop { background: #0b0c12df; }
#camera-title, #recovery-code-title { margin: 0 0 12px; font-size: 1.3rem; }
#recovery-code-value { font-family: ui-monospace, monospace; padding-inline: 8px; }
#recovery-code-message { margin: 12px 0 0; }
#camera-status { margin: 12px 0; }
#camera-status:empty { display: none; }
.camera-view { position: relative; margin-bottom: 12px; overflow: hidden; border-radius: 10px; background: #0a0b10; }
.camera-view video { display: block; width: 100%; height: min(52svh, 460px); object-fit: contain; }
.camera-timer {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #21151ce8;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.camera-timer::before { content: '●'; margin-right: 6px; color: var(--accent); }

@media (min-width: 600px) {
  .app { padding-inline: 32px; }
}
