/* Max Event Tracker — one stylesheet, phone first.
   Tokens are defined light-first on :root, overridden for dark. Print rules
   live at the bottom and turn the Report tab into a provider handout. */

:root {
  color-scheme: light dark;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --line: #dcdfe6;
  --text: #16181d;
  --text-2: #5b6070;
  --text-3: #878da0;

  --accent: #3b5bdb;
  --accent-ink: #ffffff;
  --accent-soft: #e7ebfd;

  --seizure: #6741d9;
  --seizure-soft: #ede7fb;
  --headache: #c2410c;
  --headache-soft: #fceee6;
  --other: #5b6070;
  --other-soft: #e9ebef;

  --danger: #b3261e;
  --ok: #1f7a4d;

  --seizure-grad: linear-gradient(160deg, #6741d9, #5333b8);
  --headache-grad: linear-gradient(160deg, #cd6316, #a94e0c);
  --toast-bg: #16181d;
  --toast-ink: #ffffff;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(16, 18, 24, .07), 0 4px 14px rgba(16, 18, 24, .05);

  --tap: 48px;
  --gutter: 16px;
}

/* Dark palette, defined for all three viewer states: OS preference with no
   explicit choice, and an explicit choice stamped on the root element. Only
   tokens are redefined here; components always read the tokens. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --surface: #181b21;
    --surface-2: #21252d;
    --line: #2c313b;
    --text: #eceef3;
    --text-2: #a2a9b8;
    --text-3: #767d8d;

    --accent: #8ea2ff;
    --accent-ink: #10131c;
    --accent-soft: #1e2440;

    --seizure: #b197fc;
    --seizure-soft: #241d3a;
    --headache: #ffa94d;
    --headache-soft: #33220f;
    --other: #a2a9b8;
    --other-soft: #242830;

    --danger: #ff8a80;
    --ok: #6ee7a8;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4);

    --seizure-grad: linear-gradient(160deg, #5b39c0, #46299a);
    --headache-grad: linear-gradient(160deg, #a83a0b, #8a3009);
    --toast-bg: #343a46;
    --toast-ink: #ffffff;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1014;
  --surface: #181b21;
  --surface-2: #21252d;
  --line: #2c313b;
  --text: #eceef3;
  --text-2: #a2a9b8;
  --text-3: #767d8d;

  --accent: #8ea2ff;
  --accent-ink: #10131c;
  --accent-soft: #1e2440;

  --seizure: #b197fc;
  --seizure-soft: #241d3a;
  --headache: #ffa94d;
  --headache-soft: #33220f;
  --other: #a2a9b8;
  --other-soft: #242830;

  --danger: #ff8a80;
  --ok: #6ee7a8;

  --shadow: 0 1px 2px rgba(0, 0, 0, .4);

  --seizure-grad: linear-gradient(160deg, #5b39c0, #46299a);
  --headache-grad: linear-gradient(160deg, #a83a0b, #8a3009);
  --toast-bg: #343a46;
  --toast-ink: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  font-size: 16px; /* below 16px Safari zooms the page on focus */
}

button { touch-action: manipulation; cursor: pointer; }

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; }
p { margin: 0 0 .6em; }

.muted { color: var(--text-2); }
.tiny { font-size: .8rem; }
.hide { display: none !important; }

/* ---------- shell ---------- */

#app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .who { font-size: .82rem; color: var(--text-2); }

main { padding: var(--gutter); max-width: 720px; margin: 0 auto; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  background: none;
  border: 0;
  padding: 9px 4px 7px;
  color: var(--text-3);
  font-size: .68rem;
  font-weight: 550;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: var(--tap);
}
.tabbar button svg { width: 23px; height: 23px; stroke-width: 1.7; }
.tabbar button[aria-selected="true"] { color: var(--accent); }

/* ---------- cards & controls ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card > h2 { margin-bottom: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-quiet { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn:disabled { opacity: .45; }

/* the two capture buttons — deliberately enormous */
.capture {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 104px;
  padding: 18px 20px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow);
}
.capture .big { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.capture .sub { font-size: .84rem; opacity: .92; font-weight: 500; }
.capture-seizure { background: var(--seizure-grad); }
.capture-headache { background: var(--headache-grad); }
.capture-other {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  min-height: 60px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

/* ---------- live timer ---------- */

.timer {
  text-align: center;
  padding: 22px 16px 18px;
  border-radius: 20px;
  background: var(--seizure-soft);
  border: 1px solid color-mix(in srgb, var(--seizure) 35%, transparent);
  margin-bottom: 14px;
}
.timer .clock {
  font-size: 3.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  color: var(--seizure);
  line-height: 1.05;
}
.timer .label { font-size: .85rem; color: var(--text-2); margin-bottom: 8px; }
.timer .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--seizure);
  margin-right: 7px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .timer .dot { animation: none; } }

/* ---------- chips ---------- */

.field { margin-bottom: 18px; }
.field > label, .field-label {
  display: block;
  font-size: .78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
}
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.chip-group + .chip-group { margin-top: 14px; }
.chip-group > .sub-label {
  font-size: .8rem;
  color: var(--text-3);
  margin-bottom: 7px;
  font-weight: 550;
}

/* Adding your own option. The dashed outline marks it as an action rather than
   another thing to tick. */
.chip-add { margin-top: 12px; }
.chip-new {
  border: 1px dashed var(--text-3);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
}
.chip-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.chip-add-form input[type="text"] { flex: 1 1 100%; min-width: 0; }
.chip-add-form .btn { flex: 1 1 0; min-height: 44px; }

/* Managing added options in Settings. */
.opt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.opt-row:last-child { border-bottom: 0; }
.opt-row .tiny { grid-column: 1 / -1; margin-top: -2px; }
.opt-row .btn { padding: 0 14px; min-height: 44px; }

input[type="text"], input[type="number"], input[type="password"],
input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  min-height: var(--tap);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

input[type="range"] { width: 100%; height: 36px; accent-color: var(--accent); }
.severity-readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.severity-readout b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }

details.section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
details.section > summary {
  padding: 15px 16px;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform .18s;
  margin-left: 10px;
  flex: none;
}
details.section[open] > summary::after { transform: rotate(-135deg); }
details.section > summary .count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin-left: auto;
  margin-right: 4px;
}
details.section .body { padding: 4px 16px 16px; }

/* ---------- history ---------- */

.day-head {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin: 20px 0 8px;
}
.event {
  display: flex;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.event .bar { width: 4px; border-radius: 3px; flex: none; align-self: stretch; }
.event .bar.seizure { background: var(--seizure); }
.event .bar.headache { background: var(--headache); }
.event .bar.other { background: var(--other); }
.event .meta { flex: 1; min-width: 0; }
.event .meta > span { display: block; }
.event .row1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: nowrap; }
.event .kind { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event .row1 .badge { flex: none; }
.event .time { color: var(--text-2); font-size: .85rem; margin-left: auto; flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.event .row2 { color: var(--text-2); font-size: .86rem; margin-top: 3px; }
.event .tags {
  margin-top: 4px;
  color: var(--text-3);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge.warn { background: var(--headache-soft); color: var(--headache); }

.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--text-2);
}
.empty .mark { font-size: 2.2rem; margin-bottom: 10px; opacity: .55; }

.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 11px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
}
.seg button {
  flex: 1;
  border: 0;
  background: none;
  border-radius: 9px;
  padding: 9px 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
  min-height: 40px;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- report ---------- */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
}
.stat .n { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .k { font-size: .78rem; color: var(--text-2); margin-top: 1px; }

.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(104px, 38%) 1fr 34px; align-items: center; gap: 9px; font-size: .84rem; }
.bar-row .track { display: block; background: var(--surface-2); border-radius: 5px; height: 20px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 5px; background: var(--accent); min-width: 3px; }
.bar-row .fill.seizure { background: var(--seizure); }
.bar-row .fill.headache { background: var(--headache); }
.bar-row .v { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-row .lab { color: var(--text-2); line-height: 1.25; }

.clock-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; height: 92px; margin-bottom: 6px; }
.clock-chart .col { background: var(--surface-2); border-radius: 3px 3px 0 0; position: relative; min-height: 3px; }
.clock-chart .col .seg-s { background: var(--seizure); border-radius: 3px 3px 0 0; }
.clock-chart .col .seg-h { background: var(--headache); }
.clock-chart .col .seg-o { background: var(--other); border-radius: 0 0 3px 3px; }
.clock-chart .col > div { width: 100%; }
.clock-axis { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; font-size: .62rem; color: var(--text-3); text-align: center; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.disclaimer {
  font-size: .78rem;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 6px;
}

/* ---------- lock screen ---------- */

.lock {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  max-width: 420px;
  margin: 0 auto;
}
.lock h1 { margin-bottom: 6px; }
.lock .sub { color: var(--text-2); margin-bottom: 26px; }
.lock .field { margin-bottom: 14px; }
.err { color: var(--danger); font-size: .87rem; min-height: 1.2em; margin-top: 8px; }

/* ---------- banners ---------- */

.banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .85rem;
  margin-bottom: 14px;
  border: 1px solid;
}
.banner-preview { background: var(--headache-soft); border-color: color-mix(in srgb, var(--headache) 35%, transparent); color: var(--text); }
.banner-offline { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
.banner b { display: block; margin-bottom: 2px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 550;
  z-index: 60;
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
  max-width: calc(100vw - 32px);
}

/* ---------- print: the provider handout ---------- */

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff;
    --text: #000; --text-2: #333; --text-3: #555; --line: #bbb;
    --accent: #000; --seizure: #444; --headache: #777; --other: #999;
    --shadow: none;
  }
  .topbar, .tabbar, .no-print, .btn, .seg, .banner { display: none !important; }
  #app { padding: 0; }
  main { max-width: none; padding: 0; }
  body { font-size: 11pt; background: #fff; }
  .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 14pt; break-inside: avoid; }
  .print-only { display: block !important; }
  .print-head { border-bottom: 2px solid #000; padding-bottom: 8pt; margin-bottom: 12pt; }
  .print-head h1 { font-size: 16pt; }
  .print-head .line { font-size: 10pt; color: #333; margin-top: 3pt; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 8pt; }
  .stat { border: 1px solid #bbb; padding: 7pt 8pt; }
  .stat .n { font-size: 13pt; }
  .stat .k { font-size: 8pt; }
  .bar-row .track { border: 1px solid #ccc; }
  .bar-row .fill { background: #666 !important; }
  .clock-chart .col .seg-s { background: #555 !important; }
  .clock-chart .col .seg-h { background: #999 !important; }
  .clock-chart .col .seg-o { background: #ccc !important; }
  .event { border: 0; border-bottom: 1px solid #ddd; border-radius: 0; padding: 6pt 0; margin: 0; break-inside: avoid; }
  .day-head { margin: 10pt 0 4pt; }
  .disclaimer { color: #444; }
  a { text-decoration: none; color: #000; }
}
.print-only { display: none; }

/* Keyboard focus. Pointer users never see it; keyboard users always do. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:active { transform: none; }
}

/* ---------- other people's accounts ---------- */

.logged-by { margin: -4px 0 14px; }

.others { margin: 4px 0 16px; }
.others > .field-label { margin-bottom: 10px; }

/* Someone else's account reads as a quoted document, not a form: no inputs,
   nothing that looks tappable except the parent-only remove link. */
.acct {
  border-left: 3px solid var(--line);
  padding: 2px 0 2px 14px;
  margin-bottom: 16px;
}
.acct-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 8px;
}
.acct-notes {
  margin: 8px 0 0;
  font-size: .94rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chips.small { gap: 6px; }
.chip-static {
  cursor: default;
  min-height: 0;
  padding: 5px 11px;
  font-size: .82rem;
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text-2);
}

.linklike {
  background: none;
  border: 0;
  padding: 6px 0;
  margin-top: 6px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linklike.danger { color: var(--danger); }
.banner .linklike { display: inline; padding: 0; margin: 0; font-size: inherit; }

/* ---------- who are you ---------- */

.name-list { display: flex; flex-direction: column; gap: 8px; }
.name-pick { justify-content: flex-start; font-size: 1.02rem; }

/* ---------- home screen prompt ---------- */

.card.install { position: relative; margin-top: 14px; }
.card.install h2 { padding-right: 44px; }
.close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 40px;
  padding: 0 12px;
}

.window-note { text-align: center; margin: 18px 0 8px; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .84em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
  word-break: break-word;
}

@media print {
  .acct-print { font-size: 10pt; margin: 3pt 0 0 10pt; }
}

/* "Add what you saw", collapsed: an invitation, so it reads as an action. */
details.section.invite:not([open]) {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--accent-soft);
}
details.section.invite:not([open]) > summary { color: var(--accent); }

/* ---------- filming an event ---------- */

/* The viewfinder takes the screen: the job is to keep him in frame. */
.rec {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
  max-height: 58vh;
  width: 100%;
  margin-bottom: 12px;
}
.rec video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rec-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.rec-badge .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff3b30;
  animation: pulse 1.2s ease-in-out infinite;
}
.rec-note {
  font-size: .9rem;
  color: var(--text-2);
  margin: 0 0 12px;
}
.btn-big { min-height: 64px; font-size: 1.15rem; }

.cam-error { color: var(--danger); margin: 12px 0 0; }
.tiny.ok { color: var(--ok); margin: 10px 0 0; }

.file-btn { position: relative; cursor: pointer; }
.file-btn input[type="file"] { display: none; }

/* ---------- clips in the editor ---------- */

.videos { margin-bottom: 18px; }
.clip-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.clip-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 4px;
}
video.clip, video.camtest {
  width: 100%;
  max-height: 60vh;
  border-radius: 10px;
  background: #000;
  display: block;
  margin: 8px 0 4px;
}
.clip-actions { margin-top: 6px; }
.clip-actions .btn { min-height: 40px; font-size: .9rem; }

.badge.video { background: var(--seizure-soft); color: var(--seizure); }

@media print {
  .rec, video.clip, .clip-actions, .file-btn { display: none !important; }
}
