/* HouseManual — mobile-first, warm & simple. Vanilla CSS, no external assets. */
:root {
  --teal: #0e5e57;
  --teal-dk: #0a4541;
  --teal-lt: #e6f2f0;
  --accent: #d97706;
  --accent-lt: #fdf3e3;
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #1f2a2a;
  --muted: #64716f;
  --line: #e3ded4;
  --red: #b42318;
  --red-bg: #fef3f2;
  --amber-bg: #fffaeb;
  --green: #027a48;
  --green-bg: #ecfdf3;
  --radius: 16px;
  --tap: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--teal); }

/* ---------- Chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 20px; }
.brand-mark { font-size: 26px; }
.brand strong { color: var(--teal); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.account-chip { font-size: 13px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }

main { max-width: 720px; margin: 0 auto; padding: 18px 14px 96px; }
.view { animation: fade .15s ease-in; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.page-head h1 { font-size: 28px; margin: 6px 0 4px; letter-spacing: -.3px; }
.page-head { margin-bottom: 14px; }
.back-btn { margin-bottom: 6px; }
.spacer { height: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Hero / login ---------- */
.hero { text-align: center; padding: 18px 6px 22px; }
.hero-mark { font-size: 52px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 10px 0 10px; letter-spacing: -.4px; }
.tagline { color: var(--muted); margin: 0 auto; max-width: 520px; }
.tagline strong { color: var(--teal); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(31,42,42,.06);
}
.card h2 { margin: 0 0 10px; font-size: 21px; }
.card h2 em { font-style: normal; color: var(--muted); font-size: 16px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.fineprint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.empty { text-align: center; padding: 28px 20px; }
.empty p { margin: 0 0 6px; }
.test-card { border: 2px dashed var(--accent); background: var(--accent-lt); }
.test-link { display: block; word-break: break-all; font-weight: 600; margin: 8px 0; }
.notice-card { border-color: var(--green); background: var(--green-bg); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span, .fieldset legend { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field em { font-style: normal; font-weight: 400; }
.fieldset { border: none; padding: 0; margin: 0 0 14px; }
.fieldset legend { padding: 0; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="password"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
  padding: 12px 14px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.field-row .field-sm { flex: 0 0 90px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap);
  padding: 12px 20px;
  border: none; border-radius: 12px;
  font-size: 17px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  background: #eceae4; color: var(--text);
  font-family: inherit;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:active { background: var(--teal-dk); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-secondary { background: #fff; border: 1.5px solid var(--teal); color: var(--teal); }
.btn-ghost { background: transparent; border: 1px solid var(--line); font-weight: 600; }
.btn-sm { min-height: 40px; font-size: 14px; padding: 7px 12px; }
.btn-big { width: 100%; margin-top: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

.error {
  background: var(--red-bg); border: 1px solid #fecdca; color: var(--red);
  border-radius: 10px; padding: 11px 13px; margin-bottom: 12px; font-size: 15px;
}
.notice {
  background: var(--green-bg); border: 1px solid #a6f4c5; color: #05603a;
  border-radius: 10px; padding: 12px; margin-bottom: 12px; font-size: 15px;
}
.notice.slim { margin: 0 0 12px; }

/* ---------- Steps ---------- */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; }
.steps li {
  flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted);
  background: #eceae4; border-radius: 20px; padding: 8px 4px;
}
.steps li.active { background: var(--teal); color: #fff; }
.steps li.done { background: var(--teal-lt); color: var(--teal); }

/* ---------- Photo ---------- */
.photo-drop {
  display: flex; align-items: center; gap: 14px;
  border: 2px dashed var(--teal); border-radius: 14px;
  background: var(--teal-lt);
  padding: 20px; margin-bottom: 14px; cursor: pointer; min-height: 84px;
}
.photo-drop-icon { font-size: 40px; }
.photo-drop-text { font-size: 17px; }
.plate-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 10px; background: #111; }
.plate-img.thumb { max-width: 220px; }
.confirm-grid { margin-bottom: 6px; }
.decode-box {
  background: var(--teal-lt); border: 1px solid #bcd9d5; border-radius: 12px;
  padding: 14px; margin-bottom: 14px; font-size: 15px;
}
.decode-box h3 { margin: 0 0 6px; font-size: 16px; }
.decode-box ul { margin: 6px 0; padding-left: 20px; }
.candidate-btn { margin: 4px 6px 4px 0; }

/* ---------- List cards ---------- */
.list-card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; font-family: inherit; font-size: 17px; color: var(--text);
  box-shadow: 0 2px 10px rgba(31,42,42,.06);
}
.list-card:active { transform: scale(.99); }
.list-card .lc-top { display: flex; align-items: center; gap: 12px; }
.lc-icon { font-size: 34px; flex-shrink: 0; }
.lc-title { font-weight: 700; font-size: 18px; }
.lc-sub { color: var(--muted); font-size: 14px; }
.lc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
  display: inline-block; font-size: 12.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; background: #eceae4; color: var(--muted);
}
.badge.teal { background: var(--teal-lt); color: var(--teal); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--accent); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.est { background: var(--amber-bg); color: #93370d; border: 1px dashed var(--accent); }

/* ---------- Detail ---------- */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; }
.kv.missing strong { color: var(--red); }
.kv.optional strong { color: var(--muted); font-weight: 600; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 2px 0 12px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.check-row em { color: var(--muted); font-style: normal; }
.life-bar { height: 14px; border-radius: 8px; background: #eceae4; overflow: hidden; margin: 10px 0 6px; }
.life-fill { height: 100%; background: var(--teal); border-radius: 8px; }
.life-fill.mid { background: var(--accent); }
.life-fill.old { background: var(--red); }
.cliff {
  border-radius: 12px; padding: 14px; margin-bottom: 14px; font-size: 16px; font-weight: 600;
  background: var(--amber-bg); border: 1.5px solid var(--accent); color: #7a2e0e;
}
.cliff.passed { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.chip {
  display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; background: var(--teal-lt); color: var(--teal); text-transform: capitalize;
}
.chip.due { background: var(--amber-bg); color: var(--accent); }
.chip.overdue { background: var(--red-bg); color: var(--red); }
.maint-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.maint-row:last-child { border-bottom: none; }
.maint-row .mt { font-weight: 600; }
.maint-row .md { color: var(--muted); font-size: 14px; }
.broke-card { border-color: var(--accent); background: var(--accent-lt); }
.radio-card {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; cursor: pointer;
}
.radio-card input { width: 22px; height: 22px; margin-top: 3px; flex-shrink: 0; accent-color: var(--teal); }

/* ---------- Estimator ---------- */
.est-card h3.est-h { margin: 18px 0 4px; font-size: 17px; }
.est-total {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--teal-lt); border: 1px solid #bcd9d5; border-radius: 12px;
  padding: 14px 16px; margin: 10px 0 4px;
}
.est-total span { color: var(--muted); font-size: 14px; font-weight: 600; }
.est-total strong { font-size: 30px; color: var(--teal-dk); letter-spacing: -.5px; }
.verdict { border-radius: 12px; padding: 14px; margin: 16px 0 10px; font-size: 16px; }
.verdict.repair { background: var(--green-bg); border: 1.5px solid var(--green); color: #05603a; }
.verdict.replace { background: var(--red-bg); border: 1.5px solid var(--red); color: var(--red); }
.verdict.borderline { background: var(--amber-bg); border: 1.5px solid var(--accent); color: #7a2e0e; }
.tutorial-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.diy-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 10px; }
.tutorial-tt { font-weight: 700; font-size: 15px; }

/* ---------- Replacement picks (small tier) ---------- */
.picks { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 4px; }
.pick-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: 12px; padding: 14px 16px;
}
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.level-badge {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; padding: 4px 10px; border-radius: 20px;
  background: var(--teal-lt); color: var(--teal);
}
.level-badge.good { background: var(--teal-lt); color: var(--teal); }
.level-badge.better { background: var(--teal); color: #fff; }
.level-badge.best { background: var(--teal-dk); color: #fff; }
.pick-price { font-weight: 700; font-size: 18px; color: var(--teal-dk); white-space: nowrap; }
.pick-name { font-weight: 700; font-size: 17px; }
.pick-why { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.pick-disclosure { margin-top: 10px; }

/* ---------- Provider ---------- */
.provider-card .modes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex;
  background: rgba(255,255,255,.98);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 9px 4px 7px; text-decoration: none; color: var(--muted);
  font-size: 21px; min-height: 58px; justify-content: center;
}
.bottomnav a span { font-size: 12px; font-weight: 700; }
.bottomnav a.active { color: var(--teal); }

/* ---------- Install assist ---------- */
.install-permanent .install-perm-text { font-size: 17px; margin: 0 0 6px; }
.install-sheet {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 40;
  width: min(680px, calc(100vw - 20px));
  max-height: calc(100vh - 110px); overflow-y: auto;
  background: var(--card); border: 2px solid var(--teal); border-radius: 20px;
  padding: 22px 20px 16px;
  box-shadow: 0 10px 34px rgba(31,42,42,.35);
}
.install-sheet h2 { font-size: 24px; margin: 0 0 10px; line-height: 1.25; }
.install-emoji { font-size: 44px; text-align: center; margin-bottom: 4px; }
.install-sheet .install-emoji + h2 { text-align: center; }
.install-big { font-size: 19px; line-height: 1.45; margin: 0 0 14px; }
.install-steps { list-style: none; padding: 0; margin: 0 0 14px; }
.install-steps li { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.install-num {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--teal); color: #fff;
  font-size: 21px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.install-step-text { font-size: 20px; line-height: 1.4; padding-top: 5px; }
.install-step-sub { display: block; font-size: 16px; color: var(--muted); margin-top: 2px; }
.share-glyph { width: 30px; height: 38px; vertical-align: -8px; margin: 0 2px; }
.install-sheet .btn-big { min-height: 58px; font-size: 19px; }
#install-btn-later { margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30;
  background: #1f2a2a; color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 15px;
  box-shadow: 0 4px 18px rgba(0,0,0,.35); max-width: 92vw; text-align: center;
}

@media (min-width: 700px) {
  .hero h1 { font-size: 36px; }
  main { padding-top: 26px; }
}

/* --- SPEC 134: guided plate capture (item 1a) --- */
.plate-guide {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel, #f6f8fa); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin: 0 0 14px;
}
.plate-frame {
  position: relative; flex: 0 0 128px; height: 96px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.pf-corner { position: absolute; width: 16px; height: 16px; border: 3px solid var(--accent, #b3541e); }
.pf-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.pf-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.pf-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.pf-br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
.pf-lines {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; gap: 6px; padding: 0 12px;
  font-size: 10px; letter-spacing: .08em; color: #555;
  font-family: ui-monospace, monospace;
}
.plate-tips { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.plate-tips li { margin-bottom: 4px; }
#plate-preview-wrap { position: relative; }
.plate-frame-overlay {
  position: absolute; inset: 6% 5%; pointer-events: none;
  border: 3px solid rgba(255, 255, 255, .85); border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}
@media (max-width: 480px) {
  .plate-guide { flex-direction: column; }
  .plate-frame { flex-basis: 110px; width: 150px; }
}

/* --- SPEC 134: service prefill chips (item 4, addendum C shape) --- */
.svc-section { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.svc-chip {
  border: 2px solid var(--line); background: #fff; color: inherit;
  border-radius: 999px; padding: 8px 14px; font-size: 15px; cursor: pointer;
}
.svc-chip.on { border-color: var(--accent, #b3541e); background: var(--amber-bg, #fdf3e7); font-weight: 600; }
.svc-chip .svc-chip-kind { font-size: 12px; opacity: .65; margin-right: 6px; }

/* --- SPEC 134: transfer box + tombstone (item 3) --- */
.transfer-notice { margin-bottom: 12px; }
.tag-transferred { background: #eceff1; color: #546e7a; }

/* --- Tech Walk-Through (paid video help) --- */
.wt-offer { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.5rem; }
.wt-book, .wt-soon { margin-top: 0.5rem; }
.wt-card .btn-big { margin-top: 0.6rem; }
.wt-followup { margin-top: 0.8rem; border-top: 1px dashed var(--line); padding-top: 0.6rem; }
.wt-admin-card { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.wt-admin-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.wt-slot { margin-top: 1rem; }

