/* Fire Brain — Lewis Marine Demo
   ABC-123: base type 19px, every tap target at least 56px tall,
   states shown in color AND words. House black-and-gold underneath. */

* { box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --panel: #161616;
  --panel-2: #1e1e1e;
  --gold: #d4af37;
  --gold-dim: #9a7f24;
  --text: #f5efdb;
  --muted: #b3a983;
  --danger: #e0655a;
  --line: #2c2c2c;
  --green: #1e9e57;
  --green-dark: #0d3a22;
  --red: #c1121f;
  --red-dark: #5c0a10;
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 19px;
  line-height: 1.45;
  padding: 0 12px 32px;
  max-width: 860px;
  margin: 0 auto;
}

h1 { font-size: 1.4rem; margin: 0; color: var(--gold); letter-spacing: 0.02em; }
h2 { font-size: 1.15rem; margin: 22px 0 10px; color: var(--gold); }
h3 { font-size: 1.05rem; margin: 18px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 0.92rem; }
.big-muted { font-size: 1.05rem; }

/* header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 0 10px; border-bottom: 2px solid var(--gold);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 48px; height: 48px; border: 2px solid var(--gold); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-weight: 800; font-size: 1.05rem; background: var(--panel);
}
.subtitle { margin: 0; color: var(--muted); font-size: 0.85rem; }
.offline-badge {
  background: var(--gold); color: #000; font-weight: 700; font-size: 0.78rem;
  padding: 5px 9px; border-radius: 4px;
}

/* inputs & buttons — nothing tappable under 56px */
input, select, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 1.05rem; width: 100%;
  min-height: 56px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-dim); }
button, .import-label {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--gold-dim);
  border-radius: 10px; padding: 12px 16px; font-size: 1rem; cursor: pointer;
  display: inline-block; min-height: 56px;
}
button.gold, .import-label { background: var(--gold); color: #000; font-weight: 700; border-color: var(--gold); }
button.ghost { background: transparent; }
button.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
button:active { transform: translateY(1px); }
.big-btn { min-height: 64px; font-size: 1.15rem; font-weight: 700; width: 100%; }
.btn-gold { background: var(--gold); color: #000; border-color: var(--gold); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); font-size: 1.3rem; }
.btn-white { background: #fff; color: #000; border-color: #fff; }
.big-input { font-size: 1.25rem; min-height: 64px; }

/* THE HIDDEN LAW: hidden must always hide. An author display rule
   (like .home-btn's display:block) otherwise beats the browser's
   own [hidden] rule, and a control the code believes is gone
   stands on screen — the v11 live-proof failure: plain workers
   facing the paperwork buttons. This one line is the lock under
   every hidden toggle in the app. */
[hidden] { display: none !important; }

/* views */
.view { display: none; }
.view.active { display: block; }
.screen-title { font-size: 1.5rem; color: var(--text); margin: 10px 0 14px; }
.sub-title { font-size: 1.15rem; color: var(--text); margin: 20px 0 10px; }
.back-btn {
  background: transparent; border: none; color: var(--gold);
  font-size: 1.05rem; font-weight: 700; padding: 10px 4px; min-height: 56px;
}
.stack { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }

/* HOME — three giant buttons, that is all */
.home-btn {
  display: block; width: 100%; min-height: 112px; margin: 12px 0;
  text-align: left; padding: 18px 20px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--gold-dim);
}
.home-btn-gold { background: var(--gold); border-color: var(--gold); color: #000; }
.home-btn-title { display: block; font-size: 1.65rem; font-weight: 800; letter-spacing: 0.01em; }
.home-btn-sub { display: block; font-size: 1rem; margin-top: 4px; opacity: 0.85; }
.home-links { display: flex; gap: 8px; margin-top: 18px; }
.link-btn {
  flex: 1; background: transparent; border: 1px solid var(--line);
  color: var(--muted); font-size: 0.95rem; min-height: 56px;
}

/* orders */
.order-btn {
  display: block; width: 100%; min-height: 84px; text-align: left;
  padding: 14px 18px; border-radius: 12px; background: var(--panel);
  border: 2px solid var(--gold-dim);
}
.order-label { display: block; font-size: 1.3rem; font-weight: 700; }
.order-state { display: block; font-size: 1rem; color: var(--gold); margin-top: 3px; }
.order-done { border-color: var(--green); }
.order-done .order-state { color: var(--green); font-weight: 800; }

/* CHECK THE BOX */
.progress-word { font-size: 1.05rem; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; margin: 6px 0; }
.pick-card {
  background: var(--panel); border: 2px solid var(--gold); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.pick-label { font-size: 0.95rem; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; }
.pick-name { font-size: 2rem; font-weight: 800; line-height: 1.15; margin: 4px 0; }
.pick-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.pick-addr { font-size: 1.9rem; font-weight: 800; color: var(--gold); margin: 8px 0 2px; line-height: 1.2; }
.pick-loc { font-size: 1rem; color: var(--muted); }
.pick-need { font-size: 1.3rem; font-weight: 700; margin-top: 10px; }
.ask-word { font-size: 1.25rem; font-weight: 700; margin: 14px 0 8px; }
.ask-word.small { font-size: 1.05rem; color: var(--muted); }
.pick-input-row { display: flex; gap: 8px; }
.pick-input-row input { flex: 1.4; }
.pick-input-row button { flex: 1; }
.cand-btn {
  display: block; width: 100%; min-height: 68px; text-align: left;
  padding: 10px 16px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line);
}
.cand-name { display: block; font-size: 1.2rem; font-weight: 700; }
.cand-code { display: block; font-family: ui-monospace, Menlo, monospace; color: var(--gold); font-size: 0.95rem; margin-top: 2px; }
.cand-on { border: 2px solid var(--gold); background: var(--panel-2); }

/* right item / stepper */
.right-panel {
  background: var(--green-dark); border: 2px solid var(--green);
  border-radius: 14px; padding: 16px;
}
.right-word { font-size: 1.9rem; font-weight: 800; color: #7be2a8; text-align: center; }
.stepper-row { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; }
.step-btn {
  flex: 1; min-height: 76px; font-size: 2.2rem; font-weight: 800;
  background: var(--panel); border: 2px solid var(--gold-dim); border-radius: 12px;
}
.step-val { flex: 1; text-align: center; font-size: 2.6rem; font-weight: 800; }
.step-caption { text-align: center; color: var(--muted); font-size: 1rem; margin-bottom: 12px; }

/* complete panel */
.complete-panel {
  background: var(--green-dark); border: 2px solid var(--green);
  border-radius: 14px; padding: 22px 16px; text-align: center; margin-top: 12px;
}
.complete-title { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.1em; color: #7be2a8; }
.complete-word { font-size: 2.3rem; font-weight: 800; color: #fff; margin: 6px 0; line-height: 1.15; }
.complete-note { font-size: 1.05rem; color: var(--text); }

/* STOP overlay — full screen red, words and color together */
.stop-overlay {
  position: fixed; inset: 0; background: var(--red); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.stop-overlay[hidden] { display: none; }
.stop-inner { width: 100%; max-width: 560px; text-align: center; }
.stop-title { font-size: 3.6rem; font-weight: 900; color: #fff; letter-spacing: 0.04em; line-height: 1; }
.stop-word { font-size: 1.8rem; font-weight: 800; color: #ffd9dc; margin-bottom: 18px; letter-spacing: 0.06em; }
.stop-block { background: var(--red-dark); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.stop-label { font-size: 0.95rem; color: #ffb3b8; font-weight: 700; letter-spacing: 0.05em; }
.stop-value { font-size: 1.45rem; font-weight: 800; color: #fff; line-height: 1.25; }
.stop-btn {
  width: 100%; min-height: 76px; margin-top: 16px;
  background: #fff; color: var(--red); border: none;
  font-size: 1.35rem; font-weight: 900; border-radius: 12px;
}

/* FIND IT */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { min-height: 56px; padding: 10px 16px; font-size: 1.05rem; border-radius: 999px; }
.chip-on { background: var(--gold); color: #000; font-weight: 800; border-color: var(--gold); }
.find-card {
  display: block; width: 100%; text-align: left; min-height: 84px;
  padding: 12px 16px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line);
}
.find-name { display: block; font-size: 1.25rem; font-weight: 700; }
.find-addr { display: block; font-size: 1.75rem; font-weight: 800; color: var(--gold); line-height: 1.2; margin: 3px 0; }
.find-sub { display: block; font-size: 1rem; color: var(--muted); }

/* PUT IT AWAY */
.away-item-word { font-size: 1.6rem; font-weight: 800; margin: 8px 0; line-height: 1.2; }
.giant-addr {
  font-size: 2.1rem; font-weight: 800; color: var(--gold);
  background: var(--panel); border: 2px solid var(--gold); border-radius: 12px;
  padding: 14px 16px; margin: 10px 0; line-height: 1.25; word-break: break-word;
}
.giant-addr.addr-none, .addr-none { color: var(--danger); border-color: var(--danger); }

/* dashboard cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card.warn { border-color: var(--danger); }
.card-value { font-size: 1.7rem; font-weight: 800; color: var(--gold); }
.card.warn .card-value { color: var(--danger); }
.card-label { font-size: 0.82rem; color: var(--muted); }

/* rows */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; display: flex; justify-content: space-between; gap: 10px;
  cursor: pointer; min-height: 56px;
}
.row.static { cursor: default; }
.row-title { font-weight: 600; }
.row-title .code, .code { color: var(--gold); font-weight: 800; font-family: ui-monospace, Menlo, monospace; }
.row-sub { color: var(--muted); font-size: 0.9rem; }
.row-extra { color: var(--text); font-size: 0.88rem; margin-top: 2px; }
.badge {
  font-size: 0.7rem; font-weight: 800; padding: 4px 7px; border-radius: 4px;
  white-space: nowrap; letter-spacing: 0.04em;
}
.badge-incomplete { background: var(--danger); color: #000; }
.badge-low { background: var(--gold); color: #000; }

/* toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.toolbar input { flex: 2; min-width: 160px; }
.toolbar select { flex: 1; min-width: 140px; width: auto; }
.toolbar button { flex: 0 0 auto; }

/* detail */
.detail-code {
  font-family: ui-monospace, Menlo, monospace; font-size: 2.3rem; font-weight: 800;
  color: var(--gold); letter-spacing: 0.04em; margin: 12px 0 0; word-break: break-all;
}
.detail-name { margin-top: 2px; color: var(--text); font-size: 1.5rem; }
.alert {
  background: #2a1414; border: 1px solid var(--danger); color: #ffb3ab;
  border-radius: 8px; padding: 12px; margin: 10px 0; font-size: 0.95rem;
}
.alert-low { background: #2a2210; border-color: var(--gold-dim); color: var(--gold); }
.fields { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 12px 0; }
.field {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px;
}
.field-label { color: var(--muted); font-size: 0.9rem; }
.field-value { text-align: right; font-weight: 600; }
.field-value.missing { color: var(--danger); font-weight: 400; font-style: italic; }

/* forms */
.form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; color: var(--muted); }
.form label input, .form label select, .form label textarea { color: var(--text); }
.formrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.formrow .big-btn { flex: 1; width: auto; }
.hint { font-size: 0.88rem; color: var(--muted); }
.scan-msg { min-height: 1.2em; margin: 6px 0 0; font-size: 1rem; color: var(--gold); }

/* modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.78);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 16px 10px; z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 12px;
  padding: 16px; width: 100%; max-width: 560px;
}
.modal-card h2 { margin-top: 0; }

/* data view */
.datarow { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.datarow .big-btn { flex: 1; width: auto; text-align: center; }

footer {
  margin-top: 30px; border-top: 1px solid var(--line); padding-top: 10px;
  color: var(--muted); font-size: 0.82rem; text-align: center;
}

@media (min-width: 640px) {
  .fields { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.6rem; }
  .home-btn-title { font-size: 1.9rem; }
}

/* ================= v2 — THREE DOORS / OWNER / HOUSE CHECK ================= */

.demo-tag {
  display: inline-block; background: var(--gold); color: #000; font-weight: 800;
  font-size: 0.8rem; letter-spacing: 0.12em; padding: 4px 10px; border-radius: 4px;
  margin-top: 10px;
}

/* owner PIN pad */
.pin-dots {
  font-size: 2.2rem; letter-spacing: 0.5em; text-align: center;
  color: var(--gold); margin: 14px 0; min-height: 56px;
}
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; margin: 0 auto; }
.pin-key {
  min-height: 72px; font-size: 1.7rem; font-weight: 800;
  background: var(--panel); border: 2px solid var(--gold-dim); border-radius: 12px;
}
.pin-key-word { font-size: 1rem; }

/* owner extras on home */
.owner-btn { border-color: var(--gold); background: var(--panel-2); }
.house-line {
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 10px;
  padding: 12px 14px; font-size: 1rem;
}

/* house check — read-only diagnostics */
.house-banner {
  background: var(--panel-2); border: 2px solid var(--gold); border-radius: 12px;
  padding: 16px; margin: 14px 0; font-size: 1.15rem; font-weight: 700; line-height: 1.4;
}
.health-word { font-size: 2rem; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.health-ok { color: #7be2a8; }
.health-warn { color: var(--danger); }

/* storage bars */
.storage-bar-wrap { margin: 14px 0; }
.storage-bar-label { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.storage-bar-label .storage-bar-num { color: var(--gold); }
.storage-bar {
  height: 34px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.storage-bar-fill { height: 100%; background: var(--gold); min-width: 3px; }
.storage-bar-fill.db { background: var(--green); }

/* access record */
.badge-house { background: var(--gold); color: #000; }
.badge-sent { background: var(--green); color: #fff; }
.badge-phone { background: var(--panel-2); color: var(--gold); border: 1px solid var(--gold-dim); }
.badge-recon { background: var(--panel-2); color: var(--green); border: 1px solid var(--green); }
.badge-lead { background: var(--gold); color: #000; }
.recon-line { color: var(--green); font-size: 1rem; margin: 10px 0; }
.recon-quiet { color: var(--muted); }
.access-house { border-color: var(--gold); }

/* ================= v3 — BRING IN YOUR LIST (the importer) ================= */

.import-label { text-align: center; }
.paste-box {
  min-height: 150px; width: 100%;
  font-family: ui-monospace, Menlo, monospace; font-size: 0.95rem;
}
.match-row { margin: 16px 0; }
.match-label { display: block; font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.map-select { font-size: 1.15rem; min-height: 64px; }

/* the landing — giant counts, color AND words */
.land-panel {
  border-radius: 14px; padding: 22px 16px; text-align: center;
  margin: 12px 0; border: 2px solid var(--line);
}
.land-ok { background: var(--green-dark); border-color: var(--green); }
.land-warn { background: #2a2210; border-color: var(--gold); }
.land-num { font-size: 3.2rem; font-weight: 900; line-height: 1.05; }
.land-ok .land-num { color: #7be2a8; }
.land-warn .land-num { color: var(--gold); }
.land-word { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.05em; margin-top: 4px; }
.land-note { font-size: 1.05rem; margin: 8px 0 0; }


/* --- the agent clean-up: work report + count walk-list --- */
.report-head { font-size: 1.3rem; font-weight: 800; letter-spacing: 0.04em; color: var(--gold); margin: 24px 0 8px; }
.report-list { margin: 6px 0; padding-left: 22px; font-size: 1.05rem; line-height: 1.5; }
.report-list li { margin: 6px 0; }
.prop-card { background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 14px; margin: 12px 0; }
.walk-entry { display: flex; gap: 10px; margin-top: 12px; align-items: stretch; }
.walk-entry .big-btn { flex: 1; }
.walk-input { flex: 1; font-size: 1.3rem; min-height: 64px; padding: 10px 14px; }

/* File inputs: rendered but invisible — display:none/hidden inputs do not
   reliably open the picker in Android WebViews; a 1px transparent input does. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.import-label { position: relative; }

/* your people — owner-side roster cards */
.people-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 10px 0; }
.people-actions { display: flex; gap: 8px; margin-top: 10px; }
.people-actions .big-btn { flex: 1; width: auto; }

/* the day book + print sheet (v14) */
.day-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
#printSheet { display: none; }
@media print {
  body > *:not(#printSheet) { display: none !important; }
  #printSheet { display: block; color: #000; background: #fff; padding: 24px; }
  #printSheet pre { white-space: pre-wrap; font: 14px/1.5 monospace; }
}

/* v34: a sleeping door — visible, readable, untouchable. */
.grayed { opacity: .45; pointer-events: none; }
