/* Discoverer Lead Capture. One phone-width column: yellow brand band, capture form, then the rep's queue. */
:root {
  --yellow: #FCB722;
  --carbon: #151515;
  --iron: #3C3C3E;
  --steel: #576167;
  --alu: #B4BCBC;
  --dirty: #ECECEA;

  --bg: #ECECEA;
  --surface: #FFFFFF;
  --fg: #151515;
  --muted: #576167;
  --line: #D6D8D4;
  --field: #F6F6F4;
  --invert-bg: #151515;
  --invert-fg: #ECECEA;
  --ok: #2E9E5B;
  --wait: #D97706;
  --bad: #C62828;
  --hot: #C62828;
  --warm: #D97706;
  --cold: #3D7EA6;

  --display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515; --surface: #222224; --fg: #ECECEA; --muted: #B4BCBC;
    --line: #3C3C3E; --field: #1B1B1C; --invert-bg: #ECECEA; --invert-fg: #151515;
    --ok: #4CC184; --wait: #F0962B; --bad: #EF5350; --hot: #EF5350; --warm: #F0962B; --cold: #6FB2DA;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.display { font-family: var(--display); font-variation-settings: "wdth" 125; font-weight: 850; text-transform: uppercase; letter-spacing: .01em; line-height: 1.02; text-wrap: balance; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label.on-yellow { color: var(--carbon); }

/* Brand band */
.band { background: var(--yellow); color: var(--carbon); padding-top: env(safe-area-inset-top, 0px); }
.band-inner, .wrap { max-width: 520px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.band-inner { padding-block: 14px 18px; display: grid; gap: 14px; }
.band-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { height: 30px; width: auto; filter: brightness(0); display: block; }
.net { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; border: 2px solid var(--carbon); padding: 5px 10px; }
.net .dot { width: 9px; height: 9px; border-radius: 50%; background: #1E7A45; }
.net.off .dot { background: #B3261E; }
.event { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.event h1 { margin: 0; font-size: clamp(24px, 7.5vw, 34px); }
.event .meta { font-size: 14px; font-weight: 600; }
.event button { background: var(--carbon); color: var(--yellow); border: 0; padding: 8px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }

.settings { background: var(--carbon); color: var(--dirty); }
.settings .wrap { padding-block: 16px; display: grid; gap: 12px; }
.settings label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--alu); }
.settings select { background: #222224; border: 1px solid var(--iron); color: var(--dirty); padding: 10px 12px; font-size: 16px; text-transform: none; letter-spacing: 0; font-weight: 500; }

main.wrap { padding-block: 20px 40px; display: grid; gap: 28px; }
section { display: grid; gap: 14px; }
section > h2, .section-head h2 { margin: 0; font-size: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* Capture card */
.capture { background: var(--surface); border: 1px solid var(--line); padding: 18px 16px 20px; display: grid; gap: 22px; }
.field { display: grid; gap: 8px; min-width: 0; }
input.text { width: 100%; background: var(--field); border: 1.5px solid var(--line); padding: 11px 12px; font-size: 16px; }
input.text:focus, textarea:focus { border-color: var(--yellow); outline: none; }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot { position: relative; aspect-ratio: 1.6; max-width: 100%; border: 2px dashed var(--alu); background: var(--field); display: grid; place-items: center; cursor: pointer; overflow: hidden; text-align: center; padding: 8px; }
.shot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.shot .hint { display: grid; gap: 4px; justify-items: center; font-size: 13px; font-weight: 600; color: var(--muted); pointer-events: none; }
.shot svg { width: 28px; height: 28px; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.has { border-style: solid; border-color: var(--fg); }
.shot .remove { position: absolute; top: 6px; right: 6px; z-index: 2; background: var(--carbon); color: var(--yellow); border: 0; width: 32px; height: 32px; font-weight: 800; font-size: 18px; cursor: pointer; }
.req { color: var(--bad); }

.name-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin-top: 4px; }
.name-wrap { position: relative; min-width: 0; }
.name-wrap input { font-weight: 700; }
.reading { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--field); padding-left: 6px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* Warmth icons */
.temps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.temp { display: grid; place-items: center; height: 58px; border: 1.5px solid var(--line); background: var(--field); cursor: pointer; color: var(--muted); }
.temp svg { width: 32px; height: 32px; fill: currentColor; stroke: currentColor; }
.temp[data-v="Cold"] svg, .temp[data-v="Warm"] svg path { fill: none; }
.temp[data-v="Hot"][aria-checked="true"] { background: var(--hot); border-color: var(--hot); color: #fff; }
.temp[data-v="Warm"][aria-checked="true"] { background: var(--warm); border-color: var(--warm); color: #fff; }
.temp[data-v="Cold"][aria-checked="true"] { background: var(--cold); border-color: var(--cold); color: #fff; }

/* Notes: one field, voice or text */
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seg { display: inline-flex; border: 1.5px solid var(--fg); }
.seg button { border: 0; background: transparent; padding: 6px 14px; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.seg .has { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.notes-box { border: 1.5px solid var(--line); background: var(--field); padding: 12px; min-height: 120px; display: grid; align-content: start; }
.voice { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rec { display: inline-flex; align-items: center; gap: 10px; background: var(--invert-bg); color: var(--invert-fg); border: 0; padding: 14px 18px; font-weight: 700; cursor: pointer; }
.rec .ring { width: 14px; height: 14px; border-radius: 50%; background: var(--bad); }
.rec.on .ring { animation: blink 1s infinite; }
.timer { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; }
.clip { display: flex; align-items: center; gap: 10px; margin-top: 12px; min-width: 0; }
.clip audio { flex: 1; min-width: 0; height: 36px; }
textarea { width: 100%; min-height: 96px; resize: vertical; background: transparent; border: 0; padding: 0; font-size: 16px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }
.linkish.light { color: var(--alu); justify-self: start; }
.note-sm { font-size: 13px; color: var(--muted); margin: 0; }
#mic-help { margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--field); padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--carbon); }

/* Tick boxes */
.ticks { gap: 4px; }
.tick { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; font-weight: 600; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick .box { flex: none; width: 24px; height: 24px; border: 2px solid var(--fg); display: grid; place-items: center; }
.tick input:checked + .box { background: var(--yellow); border-color: var(--yellow); }
.tick input:checked + .box::after { content: ""; width: 6px; height: 12px; border: solid var(--carbon); border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.tick input:focus-visible + .box { outline: 3px solid var(--yellow); outline-offset: 2px; }

.save { background: var(--yellow); color: var(--carbon); border: 0; padding: 16px; font-family: var(--display); font-variation-settings: "wdth" 125; font-weight: 850; text-transform: uppercase; font-size: 18px; letter-spacing: .02em; cursor: pointer; }
.save:active { transform: translateY(1px); }
.save:disabled { opacity: .6; }
.error { color: var(--bad); font-weight: 600; font-size: 14px; margin: -8px 0 0; }

/* Queue */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--surface); }
.summary div { padding: 12px; display: grid; gap: 2px; min-width: 0; }
.summary div + div { border-left: 1px solid var(--line); }
.summary b { font-family: var(--display); font-variation-settings: "wdth" 125; font-size: 26px; font-weight: 850; font-variant-numeric: tabular-nums; }
.leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lead { background: var(--surface); border: 1px solid var(--line); }
.lead > button { width: 100%; display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 10px; background: none; border: 0; text-align: left; cursor: pointer; }
.thumb { width: 72px; aspect-ratio: 1.6; object-fit: cover; background: var(--field); display: block; }
.lead-main { min-width: 0; display: grid; gap: 2px; }
.lead-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-title.pending { color: var(--muted); font-weight: 600; font-style: italic; }
.lead-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 8px; border: 1.5px solid currentColor; white-space: nowrap; }
.pill.saved { color: var(--ok); }
.pill.waiting { color: var(--wait); }
.pill.uploading { color: var(--muted); }
.pill.error { color: var(--bad); }
.detail { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 10px; font-size: 14px; }
.detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.path { font-family: var(--mono); font-size: 12px; background: var(--field); padding: 8px 10px; overflow-x: auto; white-space: nowrap; }
.detail a { color: var(--fg); font-weight: 700; }
.detail .actions { display: flex; gap: 16px; flex-wrap: wrap; }
.empty { color: var(--muted); margin: 0; }
.closed { background: var(--surface); border: 1.5px solid var(--line); border-left: 4px solid var(--yellow); padding: 14px 16px; }
.closed p { margin: 0; font-weight: 600; }
.name-row .label { min-width: 44px; }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1.5px solid var(--wait); font-size: 14px; font-weight: 600; }
.banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--wait); flex: none; }
.banner span:nth-child(2) { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--carbon); color: var(--yellow); padding: 12px 16px; font-weight: 700; font-size: 14px; width: max-content; max-width: calc(100% - 32px); z-index: 10; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

@media (prefers-reduced-motion: reduce) { .reading, .rec.on .ring { animation: none; } }

.tip { margin-top: 12px; border-left: 4px solid var(--yellow); background: var(--surface); padding: 12px 14px; display: grid; gap: 6px; font-size: 14px; }
.tip p { margin: 0; }
.tip .linkish { justify-self: start; }
.banner.stuck { border-color: var(--bad); }
.banner.stuck .dot { background: var(--bad); }
.banner #backup-all { color: var(--bad); font-weight: 700; }
.closed.warn { border-left-color: var(--bad); display: grid; gap: 6px; }
.closed.warn p { font-weight: 500; }
