:root {
  --navy: #0f172a; --navy-soft: #1e293b; --cyan: #06b6d4; --cyan-dark: #0e7490;
  --emerald: #047857; --bg: #f1f5f9; --white: #fff; --text: #0f172a; --muted: #526072;
  --line: #e2e8f0; --radius: 14px; --red: #b91c1c; --amber-bg: #fff7ed;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 28px rgba(15, 23, 42, .07);
  --tap: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--cyan-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--navy); color: var(--white); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--white); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand .mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg); }
.brand .mark img { display: block; }
.link-btn { min-height: var(--tap); background: none; border: 1px solid rgba(255,255,255,.5); color: var(--white); border-radius: 999px; padding: 6px 16px; font: inherit; font-size: 15px; cursor: pointer; }
h1 { font-size: 24px; margin: 24px 0 4px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 6px; color: var(--navy-soft); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
form.card { display: grid; gap: 8px; margin: 16px 0; }
label { font-weight: 600; font-size: 14px; }
input, select { font: inherit; min-height: var(--tap); padding: 10px 12px; border: 1px solid #94a3b8; border-radius: 10px; background: var(--white); color: var(--text); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.btn { min-height: var(--tap); margin-top: 8px; background: var(--cyan-dark); color: var(--white); border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: #155e75; }
.btn:disabled { opacity: .6; }
.error { color: var(--red); margin: 4px 0 0; }
.note { background: var(--amber-bg); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.demo-banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #fef9c3; color: #713f12; font-weight: 600; font-size: 14px; }
.title-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px; }
.shop-pick { display: grid; gap: 2px; min-width: 200px; }
.who { margin: 4px 0 0; }

/* Stat strip: 2 x 2 on phones, 4 across from 640px. */
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.count { display: grid; gap: 2px; padding: 12px 14px; }
.count .label { font-size: 13px; line-height: 1.3; color: var(--muted); }
.num { font-size: 26px; line-height: 1.15; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.count.money .num { color: var(--emerald); }

/* Lead cards */
.leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lead { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 16px; border-left: 5px solid transparent; }
.lead.is-urgent { border-left-color: var(--red); }
.lead.is-spam { background: #fbfcfd; }
.lead.is-spam .phone { color: var(--muted); }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.kind { font-weight: 700; color: var(--navy-soft); }
.kind::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan-dark); margin-right: 8px; vertical-align: middle; }
.kind.web_form::before { background: var(--emerald); }
.kind.voicemail::before, .kind.has-vm::before { background: #7c3aed; }
.kind.reply::before, .kind.opt_out::before, .kind.opt_in::before { background: #64748b; }
.when { color: var(--muted); }
.who-row { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-top: 4px; }
.name { font-weight: 800; font-size: 20px; line-height: 1.25; }
.phone { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 800; font-size: 20px; line-height: 1.25; text-decoration: none; color: var(--cyan-dark); }
.phone.phone-secondary { font-weight: 600; font-size: 16px; margin-top: -6px; }
.lead-call { margin: 10px 0 2px; }
a.btn.call-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 148px; margin-top: 0; padding: 12px 22px; font-size: 18px; font-weight: 800; line-height: 1.2; text-decoration: none; }
a.btn.call-btn.call-prominent { width: 100%; min-height: 56px; font-size: 20px; }
.story { margin: 8px 0 0; font-size: 18px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.story-bits { white-space: nowrap; }
.story-problem + .story-bits::before { content: " · "; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; line-height: 1.2; border-radius: 999px; padding: 4px 10px; background: #ecfeff; color: #155e75; }
.pill.urgent { background: var(--red); color: var(--white); font-weight: 800; letter-spacing: .04em; }
.pill.lang { background: #ede9fe; color: #5b21b6; }
.pill.replied { background: #dcfce7; color: #166534; }
.pill.skip, .pill.hours { background: #f1f5f9; color: #475569; }
.pill.fail { background: #fef2f2; color: var(--red); }
.pill.spam { background: #fff7ed; color: #9a3412; }
.pill.spam.yes { background: #fef2f2; color: var(--red); }
.pill.repeat { background: #e0e7ff; color: #312e81; }
.spam-why { margin: 6px 0 0; }
.answers { display: grid; gap: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.answer { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.answer:first-child { border-top: 0; }
.answer dt { font-size: 13px; color: var(--muted); padding-top: 1px; }
.answer dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.msg { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { margin-top: 10px; padding: 10px 12px; background: #f8fafc; border-radius: 10px; }
.reply-head { font-size: 13px; font-weight: 600; color: var(--muted); }
.reply .msg { margin-top: 2px; }
.media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: zoom-in; width: 96px; height: 96px; overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attach { display: inline-flex; align-items: center; min-height: var(--tap); }
.vm { margin-top: 10px; padding: 10px 12px; background: #f5f3ff; border-radius: 10px; }
.vm-label { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; color: #5b21b6; }
audio { display: block; width: 100%; height: var(--tap); margin-top: 4px; }
.vm-pending { margin: 8px 0 0; font-style: italic; }
.vm-summary { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.vm-full { margin-top: 6px; }
.vm-full > summary { display: flex; align-items: center; min-height: var(--tap); cursor: pointer; font-size: 14px; color: var(--cyan-dark); font-weight: 600; }
.texts { margin-top: 4px; }
.texts > summary { display: flex; align-items: center; min-height: var(--tap); cursor: pointer; font-size: 15px; font-weight: 700; color: var(--cyan-dark); }
.text-line { margin: 0 0 12px; padding: 0 0 0 10px; }
.text-line.out { border-left: 3px solid #cbd5e1; }
.text-line.in { border-left: 3px solid var(--cyan); }
.text-who { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.text-line .msg { margin: 0; }
.text-hint { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: #dcfce7; color: #166534; font-weight: 800; font-size: 14px; vertical-align: 1px; }
.lead.focus { outline: 3px solid var(--cyan); outline-offset: 2px; }
.transcript { margin: 0 0 4px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--navy-soft); overflow-wrap: anywhere; }

/* Won $ */
.won { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.won-label { font-weight: 800; font-size: 15px; color: var(--navy); }
.won input { width: 132px; font-weight: 700; }
.won .btn { margin-top: 0; }
.won-msg { color: var(--muted); flex-basis: 100%; }
.won.is-won input { border-color: var(--emerald); background: #f0fdf4; }
.won.is-won .won-msg { color: var(--emerald); font-weight: 600; }
.small-btn { font-size: 15px; width: auto; }

/* Photo lightbox */
.lightbox { border: 0; padding: 12px; border-radius: var(--radius); max-width: min(96vw, 900px); background: var(--white); }
.lightbox::backdrop { background: rgba(15, 23, 42, .8); }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 8px; }
.lightbox form { display: flex; justify-content: center; }
.lightbox .btn { min-width: 120px; }

dl { margin: 0; display: grid; gap: 8px; }
dt { font-size: 13px; color: var(--muted); }
dd { margin: 0 0 4px; overflow-wrap: anywhere; }
.hours { border-collapse: collapse; width: 100%; max-width: 360px; }
.hours td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.hours td:first-child { width: 56px; color: var(--muted); }
.foot { padding: 28px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.foot a { display: inline-flex; align-items: center; min-height: var(--tap); }
.foot .oak { gap: 6px; color: var(--navy-soft); font-weight: 600; text-decoration: none; }
.foot .oak img { display: block; }
label.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); margin-top: 8px; }
label.check input { width: 22px; height: 22px; min-height: 0; }
@media (min-width: 640px) {
  h1 { font-size: 28px; }
  .settings dl { grid-template-columns: 180px 1fr; }
  dt { padding-top: 2px; }
  .counts { grid-template-columns: repeat(4, 1fr); }
  .answer { grid-template-columns: 140px 1fr; }
  .thumb { width: 120px; height: 120px; }
  .won-msg { flex-basis: auto; }
}

.pill.held { background: #fef9c3; color: #713f12; }
.hold-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.btn.ghost { margin-top: 0; background: var(--white); color: var(--cyan-dark); border: 1px solid var(--cyan-dark); }
.btn.ghost:hover { background: #ecfeff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two label { display: grid; gap: 4px; }

.card.highlight { outline: 3px solid var(--cyan-dark); }

/* register.html: "What happens next" */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 10px 10px 10px 48px; margin: 0 0 6px; border-radius: 8px; line-height: 1.45; }
.steps li::before { content: counter(step); position: absolute; left: 10px; top: 10px; width: 28px; height: 28px; line-height: 28px; border-radius: 14px; text-align: center; font-weight: bold; background: #e4e7eb; color: #52606d; }
.steps li.done::before { content: "\2713"; background: #2f855a; color: #fff; }
.steps li.done .tag { color: #2f855a; }
.steps li.here { background: #eff6ff; border: 1px solid #bfdbfe; }
.steps li.here::before { background: #1d4ed8; color: #fff; }
.steps li.here .tag { color: #1d4ed8; font-weight: bold; }
.fw-ph{background:#fff4d6;border:1px dashed #c08a00;border-radius:4px;padding:0 4px;font-style:italic;color:#7a5600;white-space:nowrap}
.fw-nonum{background:#fff4d6;border-left:4px solid #c08a00;padding:8px 12px}
/* Login code step: large digits, phone friendly */
.code-form #code { font-size: 28px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.code-form .link-btn { border-color: var(--line, #d0d7de); color: inherit; padding: 6px 14px; }
.code-form .link-btn:disabled { opacity: .5; cursor: default; }
/* Greeting voice picker */
fieldset.voice-list { border: 0; padding: 0; margin: 8px 0 0; }
fieldset.voice-list legend { padding: 0; margin-bottom: 4px; }
.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #e5e7eb; }
.voice-row:last-child { border-bottom: 0; }
.voice-row label.voice-pick { flex: 1 1 220px; margin-top: 0; }
.voice-row .btn.small-btn { margin-top: 0; padding: 8px 14px; }

/* Admin console */
.table-wrap { overflow-x: auto; max-width: 100%; padding: 8px; -webkit-overflow-scrolling: touch; }
table.admin-shops, table.audit, table.failed-texts { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-shops th, table.admin-shops td, table.audit th, table.audit td, table.failed-texts th, table.failed-texts td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
table.admin-shops th, table.audit th, table.failed-texts th { font-size: 12px; color: #52606d; font-weight: 600; }
table.admin-shops td.nowrap { white-space: nowrap; }
table.admin-shops a.stripe-link { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; white-space: nowrap; }
table.failed-texts td { overflow-wrap: anywhere; }
table.failed-texts .pill { margin: 0; }
@media (max-width: 639px) {
  table.failed-texts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.failed-texts tr { display: block; padding: 8px 0 10px; border-bottom: 1px solid #e5e7eb; }
  table.failed-texts td { display: block; border: 0; padding: 1px 0; }
  table.failed-texts td::before { content: attr(data-label); display: inline-block; min-width: 5.6rem; margin-right: 8px; font-size: 12px; font-weight: 600; color: #52606d; }
}
/* Headers stay whole words. Cell text wraps on spaces; a long token can break.
   On a phone the shop log fits the card so Old and New stay on screen. */
table.audit th { white-space: nowrap; }
table.audit td { overflow-wrap: break-word; }
.card > .table-wrap { max-width: 100%; padding: 0; }
@media (max-width: 639px) {
  .card > .table-wrap { overflow-x: hidden; }
  .card > .table-wrap table.audit { table-layout: fixed; width: 100%; font-size: 13px; }
  .card > .table-wrap table.audit th:nth-child(1) { width: 16%; }
  .card > .table-wrap table.audit th:nth-child(2) { width: 22%; }
  .card > .table-wrap table.audit th:nth-child(3) { width: 24%; }
}
.flag { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fee2e2; color: #991b1b; }
.flag.ok { background: #dcfce7; color: #166534; }
.flag.paused { background: #fef3c7; color: #92400e; }
.health-list { list-style: none; padding: 0; margin: 0 0 8px; }
.health-why { display: block; margin: 0 0 6px; font-size: 12px; line-height: 1.35; color: #991b1b; }
.health-banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #fee2e2; color: #991b1b; font-weight: 600; font-size: 14px; }
.health-banner.idle { background: #e5e7eb; color: #1f2937; }
.health-banner p { margin: 0; }
.health-banner p + p { margin-top: 6px; }
.viewas-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #dbeafe; color: #1e3a8a; font-weight: 600; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.paused-banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #fef3c7; color: #92400e; font-weight: 600; font-size: 14px; }
.season-banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #dbeafe; color: #1e3a8a; font-weight: 600; font-size: 14px; }
.season-choices { margin: 8px 0; }
.season-choices label.check { font-weight: 500; }
.billing-plan { margin: 0; font-weight: 700; }
.billing-status { margin: 2px 0 0; }
.billing-status.bad { color: var(--red); font-weight: 700; }
.billing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; }
.billing-actions .btn { margin-top: 0; }
.billing-actions .text-link { background: none; border: 0; padding: 8px 0; min-height: var(--tap); color: var(--cyan-dark); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.billing-actions .text-link:disabled { opacity: .5; cursor: not-allowed; text-decoration: none; }
.billing-pause { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.billing-pause h3 { margin: 0 0 4px; }
#billing-card .season-choices { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; }
#billing-card .season-choices label.check { width: auto; margin-top: 0; }
.billing-how { margin-top: 4px; }
.billing-how summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; min-height: var(--tap); display: flex; align-items: center; }
.billing-how summary::-webkit-details-marker { display: none; }
.billing-how summary::after { content: " \25B8"; }
.billing-how[open] summary::after { content: " \25BE"; }
.billing-how ul { margin: 0 0 4px; padding-left: 18px; }
.billing-how li { margin: 2px 0; }
.billing-cancel { margin: 8px 0 0; border-top: 1px solid var(--line); }
.billing-cancel a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-size: 13px; }
.btn.danger { background: #b91c1c; }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.small-btn { padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.confirm-dialog { max-width: 440px; border: 0; border-radius: 12px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.confirm-dialog form { display: grid; gap: 10px; }
.confirm-dialog input { padding: 10px; font-size: 16px; border: 1px solid #cbd5e1; border-radius: 8px; }
.row-btns { display: flex; gap: 8px; justify-content: flex-end; }
.greet-form { border-top: 1px solid #e5e7eb; padding-top: 12px; margin-top: 12px; }
.greet-form h4 { margin: 0 0 6px; }
.greet-form h5 { margin: 14px 0 4px; font-size: 15px; }
.greet-text { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border: 1px solid #cbd5e1; border-radius: 10px; resize: vertical; }
.greet-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.greet-count.warn { color: #b45309; font-weight: 700; }
.greet-closing { margin: 6px 0 0; }
.greet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.greet-actions .btn { margin-top: 0; padding: 8px 14px; }
.greet-recnote { background: #fef3c7; border-radius: 8px; padding: 8px 10px; }
.greet-rec { background: #f8fafc; border-radius: 10px; padding: 4px 12px 10px; margin-top: 12px; }
.greet-player { display: block; width: 100%; margin-top: 8px; }
.greet-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: #b91c1c; }
.greet-upload { margin-top: 10px; }
.greet-upload input { display: block; margin-top: 4px; font-size: 14px; }
.btn.danger-text { color: #b91c1c; border-color: #b91c1c; }
.greet-rec-tip { font-weight: 700; color: #92400e; margin: 4px 0 0; }
/* Greeting options A and B */
.greet-now { margin: 0 0 4px; }
.greet-now-msg:empty { display: none; }
.greet-opt { border: 2px solid #e5e7eb; border-radius: 12px; padding: 4px 12px 12px; margin-top: 10px; background: #fff; }
.greet-opt.on { border-color: var(--emerald); background: #f0fdf4; }
.greet-opt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.greet-opt-head h5 { margin: 0; font-size: 16px; }
.greet-opt-head .btn { margin-top: 0; padding: 6px 14px; }
.pill.greet-on { background: var(--emerald); color: #fff; font-weight: 700; }
.greet-asis { margin: 6px 0 0; }
.greet-script-label { margin: 10px 0 2px; font-weight: 600; }
.greet-script { margin: 0; padding: 10px 12px; background: #fff; border-left: 4px solid var(--cyan); border-radius: 6px; font-size: 16px; }
.greet-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.greet-voice select { width: auto; min-width: 180px; }
.greet-opt .greet-rec { background: transparent; padding: 0; margin-top: 6px; }
/* One greeting card: Computer voice / My recording. Only the active pane shows. */
.greet-switch { display: flex; margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f8fafc; }
.greet-switch-btn { flex: 1 1 0; margin: 0; min-height: var(--tap); border: 0; border-radius: 0; background: transparent; color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
.greet-switch-btn + .greet-switch-btn { border-left: 1px solid var(--line); }
.greet-switch-btn.on { background: var(--white); color: var(--cyan-dark); box-shadow: inset 0 -3px 0 var(--cyan-dark); }
.greet-pane { margin-top: 8px; }
.voice-beside { display: grid; gap: 8px; margin: 4px 0 0; }
#voice-settings { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
#voice-settings h3 { margin: 8px 0 0; }
.hours-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; }
.hours-copy .btn { margin-top: 0; }
.lead-more { position: relative; }
.won-more { min-width: 44px; letter-spacing: .12em; }
.lead-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 180px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.lead-menu .btn { width: 100%; margin-top: 0; text-align: left; }

.hours-form h4 { margin: 14px 0 4px; }
.hours-days { margin-top: 10px; }
.hours-day { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-day .day-name { font-weight: 700; padding-top: 6px; }
.hours-day .check { margin: 0; }
.hours-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.hours-range input[type=time] { width: auto; min-width: 130px; flex: 0 1 auto; }
.hours-day .check input { width: auto; min-height: 0; }
.hours-day .closed-label { color: var(--muted); }
.link-btn.small { font-size: 14px; }
.date-add { display: flex; gap: 8px; align-items: center; }
.date-add input { width: auto; }
.vip-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.vip-list .vip-empty { margin: 0; }
.vip-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.vip-row span { flex: 1; min-width: 0; }
.vip-row .btn { margin-top: 0; width: auto; }
#vip-form .date-add input { flex: 1; min-width: 0; width: auto; }
#vip-form .date-add .btn { margin-top: 0; }
.date-chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.date-chips li { background: #f1f5f9; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.date-chips button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; color: #475569; }
.text-form { border-top: 1px solid #e5e7eb; padding-top: 12px; margin-top: 12px; }
.text-form h4 { margin: 0 0 6px; }
.text-fixed { background: #f1f5f9; border-radius: 8px; padding: 6px 10px; margin: 4px 0; color: #334155; }
.text-preview { background: #e8f5e9; border-radius: 14px 14px 14px 4px; padding: 10px 12px; margin: 8px 0 0; white-space: pre-wrap; max-width: 520px; }
.text-count.warn { color: #b45309; font-weight: 700; }
.text-count.over { color: #b91c1c; font-weight: 700; }
.greet-msg.error, .text-msg.error { color: #b91c1c; }
/* Read mode and edit mode */
.read-view .read-line { margin: 2px 0; }
.read-view .read-line b { font-weight: 600; }
.read-actions { margin-top: 6px; }
.edit-view[hidden], .read-view[hidden] { display: none; }
.is-editing { box-shadow: 0 0 0 2px var(--cyan) inset; border-radius: 12px; }
form.text-form.is-editing, form.greet-form.is-editing { box-shadow: none; }
.text-form.is-editing .edit-view, .greet-opt-a .edit-view:not([hidden]) { border-left: 3px solid var(--cyan); padding-left: 10px; }
.confirm-inline { background: #fff7ed; border: 1px solid #fdba74; border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.confirm-inline p { margin: 0 0 4px; }
.won-read, .won-edit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.won-read .read-summary { font-weight: 700; }
.won-read .read-actions { margin-top: 0; }
.won .won-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
#pw-edit:not([hidden]), #pw-cur-wrap:not([hidden]), #pw-code-wrap:not([hidden]) { display: grid; gap: 8px; }
#pw-edit > label { margin-top: 8px; }
#pw-rules { margin: -2px 0 0; }
#pw-change .pw-code-btn { justify-self: start; margin: 2px 0 0; }
#pw-msg:empty { display: none; }
#pw-code-sent { margin: 0 0 6px; }
/* Password fields with a Show / Hide button (login, Change password). */
.pw-wrap { display: flex; gap: 8px; align-items: stretch; }
.pw-wrap input { flex: 1 1 auto; min-width: 0; }
.pw-toggle { flex: none; min-width: 72px; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--cyan-dark); border-radius: 10px; background: var(--white); color: var(--cyan-dark); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pw-toggle[aria-pressed="true"] { background: #ecfeff; }
.pw-toggle:hover { background: #ecfeff; }

.link-warn { font-size: 14px; color: #713f12; background: #fef9c3; border-radius: 6px; padding: 6px 10px; margin: 6px 0; }
.link-warn.bad { color: var(--white); background: var(--red); font-weight: 700; }

.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.google-login { text-align: left; }
/* Google's button: its own CSS is injected inline by gsi/client (needs style-src 'unsafe-inline'); this only caps the icon if that CSS is missing. */
#google-btn, #google-link-btn { min-height: 44px; }
#google-btn svg, #google-link-btn svg { width: 18px; height: 18px; max-width: 18px; }

/* Section menu (portal.html #portal-nav). Phones: a navy tab bar fixed to the bottom of the
   screen. Wide screens: a sticky side menu next to the open section. One section shows at a
   time; the URL hash (#/leads, #/messages, #/hours, #/settings, #/admin) picks it. */
.pnav-list { list-style: none; margin: 0; padding: 0; }
.pnav-link { display: flex; align-items: center; min-height: var(--tap); text-decoration: none; font-weight: 600; -webkit-tap-highlight-color: transparent; }
.pnav-icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.psec-title { font-size: 20px; margin: 22px 0 6px; }
.psec-title:focus { outline: none; }
.psec-title:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.psec > section > h2:first-child, .psec .counts + h2, #sec-leads > h2 { font-size: 17px; }
.psec .card.settings { margin: 12px 0; }
.psec .card.settings > h3.first { margin-top: 0; }
/* Shop details and the old Shop options edit form share one card. */
#shop-card #set-edit { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
#shop-card #set-edit > p { margin: 0; }
#shop-card .read-summary:empty { display: none; }
.psec #carrier-wait { margin: 12px 0 0; }
.psec #test-call-line { margin: 0 0 12px; }
.psec .counts { margin-top: 12px; }
@media (max-width: 899.98px) {
  .has-pnav body, body.has-pnav { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .pnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--navy); border-top: 1px solid var(--navy-soft); padding: 0 4px env(safe-area-inset-bottom, 0px); box-shadow: 0 -6px 20px rgba(15, 23, 42, .18); }
  .pnav-list { display: flex; max-width: 640px; margin: 0 auto; }
  .pnav-list li { flex: 1 1 0; min-width: 0; }
  .pnav-link { position: relative; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 2px 6px; color: #cbd5e1; font-size: 12px; line-height: 1.2; text-align: center; border-radius: 12px; }
  .pnav-link .pnav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pnav-link .pnav-icon { width: 24px; height: 24px; padding: 3px 14px; box-sizing: content-box; border-radius: 999px; transition: background-color .15s; }
  .pnav-link[aria-current="page"] { color: var(--white); }
  .pnav-link[aria-current="page"] .pnav-icon { background: var(--cyan-dark); color: var(--white); }
  .pnav-link:focus-visible { outline-offset: -3px; }
}
@media (min-width: 900px) {
  .wrap { max-width: 1080px; }
  #login-view { max-width: 728px; margin: 0 auto; }
  .pshell { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 18px; }
  .pnav { position: sticky; top: 16px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
  .pnav-list { display: grid; gap: 2px; }
  .pnav-link { gap: 12px; padding: 8px 12px; color: var(--navy-soft); font-size: 15px; border-radius: 10px; border-left: 4px solid transparent; }
  .pnav-link:hover { background: var(--bg); }
  .pnav-link .pnav-icon { width: 22px; height: 22px; color: var(--muted); }
  .pnav-link[aria-current="page"] { background: #ecfeff; color: #155e75; border-left-color: var(--cyan-dark); }
  .pnav-link[aria-current="page"] .pnav-icon { color: var(--cyan-dark); }
  .psecs { min-width: 0; }
  .psec-title { margin-top: 2px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .pnav-link .pnav-icon { transition: none; } }
/* "All shops" (admin) sits on the light page, not the navy header. */
#back-wrap .link-btn { color: var(--cyan-dark); border-color: var(--cyan-dark); }

/* Leads and jobs stats stay pinned at the top of the Leads section while Recent leads scrolls
   under them. Own deep teal band so it stands out from the white lead cards (AA contrast:
   white 9.18:1, labels #b9e6ee 6.83:1, booked green #6ee7b7 6.02:1 on #0b4f5c).
   portal.js sets .is-stuck from an IntersectionObserver on #leads-stick-sentinel (no scroll
   listener). On phones the stuck bar shrinks to one row of the four numbers; the spacer below
   it takes up the height it gave back, so the leads do not jump and the observer cannot loop. */
.leads-stick {
  --stick-bg: #0b4f5c; --stick-num: #ffffff; --stick-label: #b9e6ee; --stick-money: #6ee7b7; --stick-line: rgba(255, 255, 255, .16);
  position: sticky; top: max(0px, env(safe-area-inset-top, 0px)); z-index: 10;
  margin: 0; padding: 12px 14px 14px; border-radius: var(--radius);
  background: var(--stick-bg); color: var(--stick-num);
  box-shadow: var(--shadow);
}
.leads-stick .psec-title { margin: 0; color: var(--stick-num); }
.leads-stick .psec-title:focus-visible { outline-color: var(--stick-money); }
.psec .leads-stick .counts { margin-top: 10px; }
.leads-stick .count { background: transparent; box-shadow: none; border: 1px solid var(--stick-line); border-radius: 12px; }
.leads-stick .num { color: var(--stick-num); }
.leads-stick .count .label { color: var(--stick-label); }
.leads-stick .count.money .num { color: var(--stick-money); }
.leads-stick .label-short { display: none; }
.leads-stick.is-stuck { border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 8px 20px rgba(15, 23, 42, .22); }
/* Chrome's scroll anchoring would undo the spacer and jump the page when the bar shrinks. */
#sec-leads { overflow-anchor: none; }
.stick-sentinel { height: 1px; margin: 11px 0 0; }
.stick-spacer { height: 0; }
@media (max-width: 899.98px) {
  .leads-stick.is-stuck { padding: 6px 8px; }
  .leads-stick.is-stuck .psec-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .psec .leads-stick.is-stuck .counts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 0; }
  .leads-stick.is-stuck .count { gap: 0; padding: 4px 4px 5px; text-align: center; border: 0; }
  .leads-stick.is-stuck .num { font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .leads-stick.is-stuck .count .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .leads-stick.is-stuck .label-short { display: block; font-size: 12px; line-height: 1.25; color: var(--stick-label); white-space: nowrap; }
}
@media (min-width: 900px) {
  .stick-sentinel { margin-top: 1px; }
}
@media (prefers-reduced-motion: no-preference) {
  .leads-stick { transition: box-shadow .15s; }
}

/* Greeting code card (Messages and greetings) */
.gc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; }
.gc-code { font: 600 1.35rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.3em; padding: 6px 12px; border: 1px solid #d6dbe1; border-radius: 8px; background: #f7f8fa; min-width: 9ch; }
.gc-code.shown { letter-spacing: 0.25em; }
#gc-edit input { max-width: 14ch; font-variant-numeric: tabular-nums; letter-spacing: 0.15em; }
#gc-edit label { display: block; margin: 12px 0 4px; font-weight: 600; }
#gc-edit input { display: block; }
#gc-edit #gc-rules { margin: 0 0 6px; }
/* Several shops on one email: pick one after logging in. */
.pick-list .pick-row { margin: 0 0 8px; }
.pick-list .pick-btn { width: 100%; text-align: left; }

/* Customers tab (portal.html #sec-customers, portal.js custDraw / custPage). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cust-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cust-head .psec-title { margin-bottom: 0; }
.btn.cust-csv { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; text-decoration: none; }
.btn.ghost.cust-csv { background: transparent; border-color: transparent; color: var(--muted); font-weight: 600; }
.btn.ghost.cust-csv:hover { background: transparent; border-color: transparent; color: var(--cyan-dark); }
.btn-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cust-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip { min-height: var(--tap); padding: 6px 14px; border: 1px solid #94a3b8; border-radius: 999px; background: var(--white); color: var(--navy-soft); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--cyan-dark); border-color: var(--cyan-dark); color: var(--white); }
.chip-n { font-variant-numeric: tabular-nums; opacity: .85; margin-left: 2px; }
.lead-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
/* Phones: once the stats bar sticks, these chips scroll underneath it. Pin them just below the compact bar. */
@media (max-width: 899.98px) {
  #leads-filters.lead-filters {
    position: sticky;
    top: calc(72px + env(safe-area-inset-top, 0px));
    z-index: 9;
    background: var(--bg);
    padding-top: 8px;
    padding-bottom: 4px;
  }
}
.lead-day { margin: 0; padding: 2px 2px 0; }
.lead-day-label { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.lead-window-note { margin: -4px 0 12px; }
.leads-more { margin: 4px 0 12px; }
.leads-more .btn { margin-top: 0; }
#cust-search { margin: 0 0 10px; }
.cust-note { margin: 0 0 10px; }
.cust-retry { margin: 0 0 10px; }
.cust-retry .btn { margin-top: 0; }
.cust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cust-row { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.cust-row.is-hidden { opacity: .85; }
.cust-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px; color: inherit; text-decoration: none; border-radius: var(--radius); }
.cust-link:hover { background: #f8fafc; }
.cust-main { display: grid; gap: 2px; min-width: 0; }
.cust-name { font-weight: 700; font-size: 17px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-phone { font-weight: 600; }
.cust-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.cust-money { font-weight: 800; color: var(--emerald); font-variant-numeric: tabular-nums; }
.cust-follow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }
.cust-follow .btn { margin-top: 0; }
.btn.cust-tel { margin-left: auto; min-width: 88px; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.pill.st-new { background: #e0f2fe; color: #075985; }
.pill.st-replied { background: #ecfeff; color: #155e75; }
.pill.st-won { background: #dcfce7; color: #166534; font-weight: 700; }
.pill.st-hidden { background: #f1f5f9; color: var(--muted); }
.cust-back { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; text-decoration: none; }
.cust-card { margin-bottom: 14px; }
.cust-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cust-title { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.cust-title:focus { outline: none; }
.cust-call-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 0; }
.btn.cust-call { text-decoration: none; }
@media (max-width: 639px) {
  a.btn.call-btn { width: 100%; }
  .cust-call-row { align-items: stretch; }
}
.cust-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.cust-stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cust-stat dt { font-size: 12px; }
.cust-stat dd { margin: 0; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.cust-form { display: grid; gap: 4px; border-top: 1px dashed var(--line); padding-top: 10px; }
.cust-form label { font-weight: 600; margin-top: 6px; }
textarea { font: inherit; min-height: 88px; padding: 10px 12px; border: 1px solid #94a3b8; border-radius: 10px; background: var(--white); color: var(--text); width: 100%; resize: vertical; }
textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.cust-actions { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.cust-actions p { margin: 6px 0 0; }
.cust-tl-title { font-size: 17px; margin: 18px 0 8px; }
.cust-danger { margin-top: 18px; }
.cust-danger h3 { margin-top: 0; }
.kind.sent::before { background: var(--muted); }
.lead.sent-item { border-left-color: var(--line); }
@media (min-width: 640px) {
  .cust-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
/* Phone tab bar with six tabs (owner tabs plus Admin): a narrower icon pill and label. */
@media (max-width: 899.98px) {
  .pnav-list.pnav-six .pnav-link { font-size: 11px; }
  .pnav-list.pnav-six .pnav-link .pnav-icon { padding: 3px 9px; }
}
