:root {
  --bg: #0b1f15; --panel: #12301f; --line: #1f4a33; --text: #eef5ef; --muted: #9fb8a8;
  --gold: #e8c55a; --gold-dim: rgba(232, 197, 90, .35); --ly: #7f9c8b; --up: #6fd19a; --down: #f08a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--gold); }
.hq-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.hq-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .08em; }
.hq-brand img { height: 28px; }
.hq-nav { display: flex; gap: 14px; align-items: center; font-size: 14px; white-space: nowrap; }
.hq-nav a { color: var(--muted); text-decoration: none; }
.hq-nav button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.hq-muted { color: var(--muted); }
.hq-gate { text-align: center; padding: 48px 8px; }
.hq-gate h1 { font-size: 24px; margin: 12px 0 6px; }
.hq-face { width: 76px; height: 76px; margin: 0 auto; border-radius: 22px; border: 2px solid var(--gold); display: grid; place-items: center; color: var(--gold); }
.hq-btn { display: inline-block; margin-top: 18px; padding: 14px 26px; border-radius: 14px; border: 0; background: var(--gold); color: #1b291f; font: 700 17px/1 inherit; font-family: inherit; cursor: pointer; }
.hq-btn:disabled { opacity: .5; }
.hq-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.hq-tabs button { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; }
.hq-tabs button[aria-pressed="true"] { background: var(--panel); color: var(--text); border-color: var(--gold-dim); }
.hq-kpi { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hq-kpi .big { font-size: 34px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hq-kpi .chg { font-weight: 700; font-variant-numeric: tabular-nums; }
.hq-kpi .chg.up { color: var(--up); } .hq-kpi .chg.down { color: var(--down); }
.hq-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hq-chart { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px 6px; }
.hq-chart svg { display: block; width: 100%; height: auto; }
.hq-legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); padding: 6px 0 4px; }
.hq-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.hq-mel { position: sticky; bottom: 0; margin-top: 22px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); text-align: center; }
.hq-mic { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--gold); color: #1b291f; font: 800 15px/1.1 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 0 0 0 var(--gold-dim); transition: box-shadow .3s; }
.hq-mic.on { animation: pulse 1.8s infinite; }
.hq-mic.thinking { background: #f3dc8f; }
.hq-mic.listening { background: var(--panel); color: var(--gold); border: 2px solid var(--gold); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--gold-dim); } 70% { box-shadow: 0 0 0 22px rgba(232,197,90,0); } 100% { box-shadow: 0 0 0 0 rgba(232,197,90,0); } }
.hq-caption { min-height: 44px; margin: 12px auto 0; max-width: 560px; color: var(--muted); font-size: 15px; }
.hq-caption b { color: var(--text); font-weight: 600; }
.hq-end { margin-top: 8px; background: none; border: 0; color: var(--muted); font: 14px inherit; font-family: inherit; text-decoration: underline; cursor: pointer; }
.hq-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #213f2e; color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
.hq-toast.show { opacity: 1; }
.hq-login { max-width: 360px; margin: 40px auto; display: grid; gap: 10px; }
.hq-login input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 16px inherit; font-family: inherit; }
/* V1.2 team live view */
.hq-team { margin-top: 18px; }
.hq-team h2 { font-size: 18px; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.hq-team h2 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.hq-rep { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--text); font: inherit; cursor: pointer; }
.hq-rep b { display: block; }
.hq-rep small { color: var(--muted); display: block; font-size: 13px; }
.hq-dot { flex: 0 0 12px; height: 12px; border-radius: 50%; background: #6b7d72; }
.hq-dot.driving { background: #5aa9ff; box-shadow: 0 0 0 4px rgba(90,169,255,.25); }
.hq-dot.at_store { background: var(--up); box-shadow: 0 0 0 4px rgba(111,209,154,.25); }
.hq-dot.stopped { background: var(--gold); }
.hq-panel { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; padding: calc(10px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.hq-panel .bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hq-panel .bar button, .hq-chip-btn { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 12px; font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; }
.hq-panel h1 { font-size: 20px; margin: 0; flex: 1; }
.hq-map { height: 46vh; min-height: 280px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0f2a1d; }
.hq-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.hq-stats span { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.hq-stats b { color: var(--text); }
.hq-stop { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.hq-stop .n { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--up); color: #0b1f15; font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.hq-stop small { color: var(--muted); display: block; font-size: 13px; }
.hq-sheet { position: fixed; inset: auto 0 0 0; z-index: 60; max-height: 82vh; overflow-y: auto; background: #102a1c; border-top: 1px solid var(--gold-dim); border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.hq-sheet img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin: 6px 0; }
.hq-thumbs { display: flex; gap: 6px; overflow-x: auto; }
.hq-thumbs img { width: 120px; height: 120px; flex: 0 0 120px; }
.hq-task { display: flex; gap: 6px; margin-top: 12px; }
.hq-task input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 15px inherit; font-family: inherit; }
.hq-live-pin { width: 16px; height: 16px; border-radius: 50%; background: #5aa9ff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(90,169,255,.35); }
.hq-num-pin { width: 26px; height: 26px; border-radius: 50%; background: var(--up); color: #0b1f15; font: 800 12px/26px sans-serif; text-align: center; border: 2px solid #0b1f15; }
.hq-num-pin.plan { background: #8a94a0; }
.hq-num-pin.order { background: #b48cff; }

/* owner 2026-10-05: the listening center (call center lines, live) — opens the calling center's page */
.hq-listen { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: #1a2b4a; color: #fff; text-decoration: none; border: 1px solid #4a8cff; }
.hq-listen small { color: #cfe0ff; }

/* V1.2.43 call reports, transcripts, recordings */
button.hq-listen { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.hq-reports { background: #2a2140; border-color: #8a6fd1; }
.hq-reports small { color: #ddd0ff; }
.hq-head { font-size: 17px; line-height: 1.5; margin: 6px 0 10px; }
.hq-rsec { margin-top: 18px; }
.hq-rsec h2 { font-size: 16px; margin: 0 0 8px; color: var(--gold); }
.hq-pt { display: flex; gap: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.hq-pt .k { flex: 0 0 22px; font-size: 18px; line-height: 1.3; }
.hq-pt p { margin: 4px 0 0; color: var(--text); font-size: 15px; }
.hq-pt p.q { color: var(--muted); font-style: italic; }
.hq-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hq-ref { background: #0f2a1d; border: 1px solid var(--gold-dim); color: var(--text); border-radius: 99px; padding: 5px 10px; font: 13px/1.2 inherit; font-family: inherit; cursor: pointer; text-align: left; }
.hq-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.hq-tbl th, .hq-tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.hq-tbl th:first-child, .hq-tbl td:first-child { text-align: left; }
.hq-tbl th { color: var(--muted); font-weight: 600; }
.hq-words { margin-top: 10px; display: grid; gap: 6px; }
.hq-words .w { padding: 8px 10px; border-radius: 12px; max-width: 88%; font-size: 15px; }
.hq-words .w small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.hq-words .w.store { background: #1b3a2a; justify-self: start; }
.hq-words .w.us { background: #2b2a1a; justify-self: end; }
.hq-recs { position: fixed; left: 12px; right: 12px; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 70; max-width: 640px; margin: 0 auto; max-height: 50vh; overflow-y: auto; background: #102a1c; border: 1px solid var(--gold-dim); border-radius: 16px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.hq-rec { margin-top: 10px; }
.hq-rec audio { width: 100%; margin-top: 6px; }

/* V1.2.44 coaching notes */
.hq-coach textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 15px/1.4 inherit; font-family: inherit; }
.hq-coach-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.hq-coach-bar span { flex: 1; font-size: 13px; }

.hq-review { background: #3a2a14; border-color: #e8a53a; }
.hq-review small { color: #f3d6a8; }

/* V1.2.47 calls Gizzy already played */
.heard { opacity: .55; }
.hq-ref.heard::before, .hq-rep.heard b::before { content: "✓ "; color: var(--up); }
.hq-ref.heard { border-color: var(--line); }
/* V1.2.103 Today — the briefing */
.hq-today { margin-bottom: 16px; }
.hq-today h2 { font-size: 18px; margin: 0 0 8px; }
.hq-today h2 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.hq-brief { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
.hq-brief summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.hq-brief summary::-webkit-details-marker { display: none; }
.hq-brief .n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #1b291f; font: 800 13px/22px inherit; text-align: center; }
.hq-brief p { margin: 8px 0 0; }
.hq-brief p small { display: block; color: var(--gold); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.hq-today .meta, .hq-brief .meta { font-size: 12px; margin-top: 6px; }
.hq-depts { list-style: none; padding: 0; margin: 0; }
.hq-depts li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.hq-listen.hq-alert { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }

/* V1.2.135 rep panel: the last 7 days at a glance */
.hq-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 0 10px; }
.hq-week button { background: var(--card, #12301f); color: inherit; border: 1px solid #1f4a33; border-radius: 10px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; cursor: pointer; }
.hq-week button.on { border-color: var(--gold, #e8c55a); }
.hq-week small { font-size: 11px; color: var(--muted, #9fb8a8); }
.hq-week b { font-size: 16px; }
.hq-week i { font-style: normal; font-size: 10px; color: var(--muted, #9fb8a8); }
.hq-sub { font-size: 15px; }
.hq-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; font-size: 12px; color: var(--muted, #9fb8a8); }
.hq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hq-legend .hq-num-pin, .hq-legend .hq-live-pin { display: inline-block; border-width: 1px; }

/* V1.2.137 messages from people */
.hq-msg-count { display: inline-block; margin-left: 4px; background: #e5397a; color: #fff; border-radius: 99px; font-size: .68rem; padding: 1px 6px; font-weight: 800; }
.hq-msg-count[hidden] { display: none; }

/* V1.2.155 color (Gizzy 2026-10-19: "even my HQ, just like little different sections, make it more colorful") */
.hq-top { background: linear-gradient(90deg, #0f2a1d, #14382a 55%, #2a2a12); border-bottom: 1px solid var(--gold-dim); }
.hq-today, .hq-team, #kpi { position: relative; padding: 12px 14px; border-radius: 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.hq-today { background: linear-gradient(160deg, rgba(232,197,90,.16), rgba(232,197,90,.03) 60%); border-color: rgba(232,197,90,.4); }
.hq-today h2 { color: #f3dc8f; }
.hq-team { background: linear-gradient(160deg, rgba(90,169,255,.16), rgba(90,169,255,.03) 60%); border-color: rgba(90,169,255,.4); }
.hq-team h2 { color: #9cc9ff; }
#kpi { background: linear-gradient(160deg, rgba(111,209,154,.16), rgba(111,209,154,.03) 60%); border-color: rgba(111,209,154,.4); margin-bottom: 0; }
.hq-chart { border-color: rgba(111,209,154,.35); }
.hq-brief { border-left: 4px solid var(--gold); }
.hq-brief:nth-of-type(5n+2) { border-left-color: #6fd19a; } .hq-brief:nth-of-type(5n+2) .n { background: #6fd19a; }
.hq-brief:nth-of-type(5n+3) { border-left-color: #5aa9ff; } .hq-brief:nth-of-type(5n+3) .n { background: #5aa9ff; }
.hq-brief:nth-of-type(5n+4) { border-left-color: #ff7aa8; } .hq-brief:nth-of-type(5n+4) .n { background: #ff7aa8; }
.hq-brief:nth-of-type(5n+5) { border-left-color: #b48cff; } .hq-brief:nth-of-type(5n+5) .n { background: #b48cff; }
.hq-rep { border-left: 4px solid #5aa9ff; }
.hq-tabs button[aria-pressed="true"] { background: #6fd19a; color: #10231a; border-color: #6fd19a; }
.hq-listen { background: linear-gradient(135deg, #1a2b4a, #23407a); transition: transform .15s; }
.hq-listen:active { transform: scale(.98); }
.hq-listen.hq-review { background: linear-gradient(135deg, #3a2a14, #6a4a14); }
.hq-listen.hq-corp { background: linear-gradient(135deg, #123a3a, #1b5a5a); border-color: #4fc4c4; }
#fbBtn { background: linear-gradient(135deg, #3a1a2e, #6a2350); border-color: #ff7aa8; }
#fbBtn small { color: #ffd0e2; }
.hq-listen.hq-reports { background: linear-gradient(135deg, #2a2140, #4a3478); }
.hq-listen.hq-wh { background: linear-gradient(135deg, #3d2410, #7a4314); border-color: #ffa94d; }
.hq-listen.hq-wh small { color: #ffdcb5; }
.hq-mic { background: radial-gradient(circle at 35% 30%, #fff1b8, #e8c55a 55%, #d79b2b); }
.hq-nav a:hover { color: var(--gold); }
/* STATION #56b (Gizzy's phone 11/2: "black screens"): the ~20-link tab strip made the whole page wider than the phone, so a sideways swipe
   slid HQ's content off the screen and left only the strip over an empty dark page. The strip now scrolls inside itself; the page never moves sideways. */
html, body { overflow-x: clip; }
.hq-top { gap: 12px; min-width: 0; max-width: 100vw; }
.hq-brand { flex: 0 0 auto; }
.hq-nav { min-width: 0; flex: 1 1 auto; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 4px 0; }
.hq-nav::-webkit-scrollbar { display: none; }
.hq-nav a, .hq-nav button { flex: 0 0 auto; }
/* CALLING 2 #9 📍 Calling map */
.hq-listen.hq-cmap { background: #13321f; border-color: var(--gold-dim); }
.hq-listen.hq-cmap small { color: var(--muted); }
.cmap .cmap-map { height: 58vh; min-height: 320px; }
.cmap-states { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.cmap-states .on { border-color: var(--gold); color: var(--gold); }
.cmap-states small { color: var(--muted); font-weight: 400; }
.cmap-key { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.cmap-k { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 99px; padding: 5px 10px; font: 13px/1.2 inherit; font-family: inherit; cursor: pointer; }
.cmap-k i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.cmap-k b { color: var(--muted); font-weight: 600; }
.cmap-k.off { opacity: .4; text-decoration: line-through; }
.cmap-note { font-size: 12px; margin: 6px 0 0; }
.cmap-h { margin: 14px 0 6px; }
.cmap-z { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 10px 12px; margin: 0 0 6px; font: inherit; cursor: pointer; }
.cmap-zn { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cmap-zn small, .cmap-yr small { color: var(--muted); font-size: 12px; }
.cmap-yr { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; }
.cmap-yr b { font-size: 18px; color: var(--gold); }
.cmap-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #0f2a1d; }
.cmap-bar i { display: block; height: 100%; }
