/* One phone-width column with big touch targets for outdoor use; "Ver lo subido" widens on desktop. */
:root {
  /* Taken from Safeway Security's own panel: warm white, near-black fading to maroon, red only in details */
  --bg: #f4f3f0;
  --surface: #ffffff;
  --ink: #121317;
  --muted: #66666c;
  --line: #e4e2de;
  --accent: #c8102e;
  --accent-soft: #fbe9ec;
  --head: #15161b;        /* black band, like their side menu */
  --dark-grad: linear-gradient(100deg, #15161b 55%, #4a0f1c);
  --ok: #1f8a4c;
  --ok-bg: #e2f4e9;
  --wait: #9a5b00;
  --wait-bg: #fff2d6;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --chip: #ecebe8;
  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Consolas", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1014; --surface: #1a1b20; --ink: #f0f0f2; --muted: #9c9ca4; --line: #2c2d34;
  --accent: #e0243f; --accent-soft: #3a1219; --head: #000000; --dark-grad: linear-gradient(100deg, #2a2b33 40%, #6a1527); --ok: #4cc27f; --ok-bg: #12301f; --wait: #f5b623; --wait-bg: #2f2510;
  --bad: #ff8a80; --bad-bg: #3a1714; --chip: #26272d; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1014; --surface: #1a1b20; --ink: #f0f0f2; --muted: #9c9ca4; --line: #2c2d34;
  --accent: #e0243f; --accent-soft: #3a1219; --head: #000000; --dark-grad: linear-gradient(100deg, #2a2b33 40%, #6a1527); --ok: #4cc27f; --ok-bg: #12301f; --wait: #f5b623; --wait-bg: #2f2510;
  --bad: #ff8a80; --bad-bg: #3a1714; --chip: #26272d; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--f-body); }
.wrap { max-width: 440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body.viewing .wrap { max-width: 1100px; }
body.viewing #status { display: none; }
main.wrap { padding-bottom: 32px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Black band edge to edge (border-image outset paints past the column without adding scroll) */
header.top { display: flex; align-items: center; gap: 10px; padding-block: 12px; color: #fff;
  border-image: linear-gradient(var(--head) calc(100% - 1px), var(--line) 0) fill 0 / 0 / 0 100vmax; }
header.top .kicker { color: #8d8d96; }
.logo { flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.logo svg { width: 20px; height: 20px; }
.brand { min-width: 0; line-height: 1.1; }
h1 { font: 700 21px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: .01em; margin: 0; }
.kicker { display: block; font: 500 10.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.who { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 600 13px var(--f-body); }
.who:empty { visibility: hidden; }
h2 { font: 500 11.5px var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 22px 0 10px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 600 16px var(--f-body); padding: 12px 4px 10px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
body.viewing .tabs button { flex: 0 1 auto; padding-inline: 16px; }

.banner { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 12px 14px; font-weight: 600; margin: 8px 0; }
.banner a { color: inherit; }

.primary { width: 100%; min-height: 58px; border: 0; border-radius: 12px; background: var(--dark-grad); color: #fff; font: 700 21px var(--f-display); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.primary:disabled { background: var(--chip); color: var(--muted); cursor: not-allowed; }
.link { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--muted); font: 500 15px var(--f-body); text-decoration: underline; padding: 8px; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, label.cap:focus-within, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.pick { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font: 500 17px var(--f-body); color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; }
.pick small { color: var(--muted); font-size: 14px; white-space: nowrap; }
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.list.dim .pick { opacity: .4; }
.pick.add { border-style: dashed; color: var(--muted); }
.pick:disabled { cursor: default; opacity: .7; }
/* Red rule on top, like the cards in their panel */
.newcard, .cap, .entry { position: relative; overflow: hidden; }
.newcard::before, .cap::before, .entry::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 15%, transparent)); }
.newcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px 14px; margin-top: 10px; }
.newcard .kicker { color: var(--accent); margin-bottom: 10px; }
.newcard > .link { margin-top: 6px; }
.go-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.go-row .primary { flex: 1; min-height: 52px; }
.go-row .link { margin: 0; flex: none; }

.capture { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 600 15px var(--f-body); color: var(--ink); cursor: pointer; text-align: center; }
.cap svg { width: 40px; height: 40px; padding: 8px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.cap.rec svg { color: var(--bad); background: var(--bad-bg); }
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; background: var(--surface); color: var(--ink); }
.sheet::backdrop { background: rgb(0 0 0 / .45); }
.sheet .in, .sheet [data-for] { display: grid; gap: 10px; }
.sheet .in { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.opt { display: flex; align-items: center; justify-content: center; min-height: 54px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font: 600 17px var(--f-body); color: var(--ink); cursor: pointer; }
.opt.cancel { border-color: transparent; background: transparent; color: var(--muted); }
label.opt:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.cap.rec { border-color: var(--bad); color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.cap.rec svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
fieldset:disabled .cap { opacity: .6; cursor: default; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs:empty { display: none; }
.thumb { width: 78px; height: 78px; border-radius: 10px; background: var(--chip); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); position: relative; overflow: hidden; }
.thumb svg { width: 22px; height: 22px; color: var(--ink); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.img { justify-content: flex-end; padding-bottom: 4px; }
.thumb.img span { position: relative; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 4px; padding: 0 4px; }
.thumb .rm { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
fieldset:disabled .thumb .rm { display: none; }

.f { display: block; font: 600 14px var(--f-body); color: var(--muted); margin: 14px 0 6px; }
.t { width: 100%; font: 17px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.t.gap { margin-top: 10px; }
textarea.t { min-height: 92px; resize: vertical; }
.t:disabled { opacity: .7; }
.stepper { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: max-content; }
.stepper button { width: 54px; height: 50px; border: 0; background: none; font: 600 24px var(--f-body); color: var(--ink); cursor: pointer; }
.stepper output { min-width: 48px; text-align: center; font: 600 22px var(--f-mono); font-variant-numeric: tabular-nums; }
.stepper output:empty::before { content: "?"; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 9px 14px; font: 500 15px var(--f-body); cursor: pointer; min-height: 42px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.sticky { position: sticky; bottom: 0; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 75%, transparent); margin-top: 18px; }
.bar { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; }
.queue { margin-top: 14px; }
.qitem { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.qitem .what { font-weight: 600; margin: 0 0 8px; overflow-wrap: anywhere; }
.qitem .state { font-weight: 600; font-size: 15px; color: var(--wait); }
.qitem.failed .state { color: var(--bad); }
.qitem.failed .bar i { background: var(--bad); }
.num { font-family: var(--f-mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.toast { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: 15px; margin: 14px 0 0; }
.toast.bad { background: var(--bad-bg); color: var(--bad); }
.empty { color: var(--muted); font-size: 15px; padding: 6px 0; }

/* Ver lo subido */
.back { background: none; border: 0; color: var(--muted); font: 600 15px var(--f-body); padding: 14px 0 0; cursor: pointer; }
.hero { margin-top: 10px; }
.hero .kicker { color: var(--accent); }
.where { font: 700 28px/1.05 var(--f-display); text-transform: uppercase; margin: 4px 0 0; overflow-wrap: anywhere; }
.where span { color: var(--muted); font-weight: 600; }
.entries { display: grid; gap: 14px; margin-top: 14px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.entry .row { margin: 0 0 8px; }
.entry .title { font: 600 18px/1.25 var(--f-body); margin: 0 0 4px; }
.entry .title.none { color: var(--muted); font-weight: 500; }
.entry.void { opacity: .55; }
.entry .tag { display: inline-block; background: var(--chip); border-radius: 6px; padding: 1px 8px; font-size: 13px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.entry .link { margin: 6px 0 0; padding: 6px 0; }
.entry b { font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.facts li { background: var(--chip); border-radius: 999px; padding: 3px 10px; font-size: 14px; }
.facts li.high { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.entry p { margin: 0 0 10px; white-space: pre-wrap; }
.entry a.map { font-size: 14px; color: var(--muted); }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.media a, .media img { display: block; }
.media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--chip); }
.media video { grid-column: 1 / -1; width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
.media audio { grid-column: 1 / -1; width: 100%; }
.media .pending { grid-column: 1 / -1; color: var(--wait); font-size: 14px; font-weight: 600; }
@media (min-width: 900px) {
  .entries { grid-template-columns: repeat(2, 1fr); }
  .media { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } .cap.rec svg { animation: none; } }
