/* Lodeline owner console — same brand tokens as website/styles.css */
:root {
  --gold:        #E0A52A;
  --gold-bright: #F1BE4B;
  --gold-deep:   #B9821B;
  --gold-ink:    #201703;
  --bg:        #14110B;
  --surface:   #1C1813;
  --surface-2: #241F17;
  --surface-3: #2E281D;
  --line:        #35301F;
  --line-strong: #4A4230;
  --text:    #F7EFDC;
  --muted:   #B3A78F;
  --muted-2: #948B79;
  --danger:  #F0776A;
  --rose:    #F0776A;
  --cyan:    #6FC7D6;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --r: 14px;
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 50px -30px rgba(0,0,0,.8);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
[hidden] { display: none !important; }

/* ---- controls ---- */
.btn {
  font: inherit; font-weight: 600; font-size: .875rem;
  padding: 8px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
}
.btn:hover { background: var(--surface-3); }
.btn-gold { background: var(--gold); border-color: var(--gold-deep); color: var(--gold-ink); }
.btn-gold:hover { background: var(--gold-bright); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(240,119,106,.12); }
.icon-btn { padding: 6px 10px; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; width: 100%; }
select { cursor: pointer; }

.card {
  background: rgba(28,24,19,.85);
  border: 1px solid #3a3226;
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
}

/* ---- login gate ---- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(80% 60% at 50% 0%, rgba(224,165,42,.07), transparent), var(--bg);
  padding: 24px;
}
.gate-card {
  background: rgba(28,24,19,.9); border: 1px solid #3a3226; border-radius: var(--r);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  padding: 40px 32px; width: min(360px, 100%); text-align: center;
}
.gate-card h1 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.gate-sub { color: var(--muted); font-size: .875rem; margin-top: -8px; }
.gate-card input, .gate-card .btn { width: 100%; }
.gate-err { color: var(--danger); font-size: .8125rem; }
/* Google Identity Services renders its own iframe button into this wrapper. */
.gsi-wrap { display: flex; justify-content: center; width: 100%; min-height: 40px; }
.gate-or {
  color: var(--muted); font-size: .6875rem; text-transform: uppercase; letter-spacing: .12em;
  margin: -4px 0;
}

/* ---- shell ---- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(20,17,11,.9); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand .peak, .gate-card .peak { display: block; flex-shrink: 0; object-fit: contain; }
.wordmark { font-weight: 700; letter-spacing: -0.01em; }
.console-tag { color: var(--muted-2); font-size: .75rem; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a {
  color: var(--muted); text-decoration: none; font-size: .875rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--gold-ink); background: var(--gold); }
main { padding: clamp(16px, 3vw, 32px); max-width: 1280px; margin-inline: auto; }

/* ---- backlog ---- */
.composer { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.composer-row { display: flex; gap: 10px; flex-wrap: wrap; }
#c-title { width: 100%; }

/* Summary bar: count chips (status + priority + origin) that double as quick filters. Kept as a
 * lightweight strip — the primary filtering surface is the dropdown row + search above it, so this
 * bar must read as a compact summary and never dominate the page (Magpie-parity feedback). */
.bl-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; margin-bottom: 12px;
  background: var(--surface-2); box-shadow: none;
}
.bl-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.bl-sep { width: 1px; height: 16px; background: var(--line-strong); }
.bl-search-wrap { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bl-match-count { color: var(--muted); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.bl-search-box { position: relative; display: inline-flex; }
#bl-search { min-width: 240px; padding: 6px 28px 6px 10px; font-size: .8125rem; }
.bl-search-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: .75rem; line-height: 1; cursor: pointer;
  color: var(--muted); background: none; border: 0; border-radius: 6px; padding: 4px 6px;
}
.bl-search-clear:hover { color: var(--text); }
mark.hl { background: rgba(224, 165, 42, .3); color: inherit; border-radius: 3px; padding: 0 1px; }

.fchip {
  font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer;
  color: var(--muted); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
}
.fchip b { font-weight: 700; color: var(--text); }
.fchip:hover { border-color: var(--line-strong); color: var(--text); }
.fchip.on { background: var(--gold); border-color: var(--gold-deep); color: var(--gold-ink); }
.fchip.on b { color: var(--gold-ink); }
.fchip-P0:not(.on) { color: var(--danger); }
.fchip-P1:not(.on) { color: var(--gold-bright); }

/* Status groups: collapsible sections of compact single-line rows. */
.bl-group { margin-bottom: 12px; overflow: hidden; }
.bl-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font: inherit; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 12px 16px; text-align: left;
}
.bl-group-head:hover:not(:disabled) { color: var(--text); }
.bl-group-head:disabled { cursor: default; }
.bl-group-head .caret { color: var(--muted-2); width: 12px; flex: none; }
.bl-group-head .count { color: var(--muted-2); font-weight: 600; }
.bl-rows { border-top: 1px solid var(--line); }

.bl-row { border-bottom: 1px solid var(--line); }
.bl-row:last-child { border-bottom: 0; }
.bl-row.flash .bl-line { animation: row-flash 1.6s ease; }
@keyframes row-flash { 0%, 40% { background: rgba(224,165,42,.2); } 100% { background: transparent; } }

.bl-line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; cursor: pointer; min-width: 0;
}
.bl-line:hover { background: var(--surface-2); }
.bl-uid {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  color: var(--gold-bright); text-decoration: none; min-width: 44px; flex: none;
}
.bl-uid:hover { text-decoration: underline; }
.bl-uid.dim { color: var(--muted-2); }
.bl-pri {
  appearance: none; -webkit-appearance: none; flex: none;
  font-size: .6875rem; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted);
  cursor: pointer;
}
.bl-pri.pri-P0 { color: var(--danger); border-color: var(--danger); }
.bl-pri.pri-P1 { color: var(--gold-bright); border-color: var(--gold-deep); }
.bl-kind { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kind-feature { background: var(--gold); }
.kind-fix { background: var(--rose); }
.kind-idea { background: var(--cyan); }
.bl-title {
  font-size: .875rem; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bl-notes { font-size: .75rem; color: var(--muted-2); white-space: nowrap; flex: none; }
.bl-notes.claude { color: var(--gold-bright); }
.bl-age {
  font-size: .75rem; color: var(--muted-2); font-variant-numeric: tabular-nums;
  white-space: nowrap; flex: none; min-width: 48px; text-align: right;
}

/* Expanded row: full edit controls + the updates timeline + add-note. */
.bl-detail {
  padding: 6px 16px 14px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(0,0,0,.14); border-top: 1px dashed var(--line);
}
.bl-detail .e-title { font-weight: 600; }
.bl-edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bl-edit-row .spacer { flex: 1; }
.empty { color: var(--muted-2); font-size: .875rem; padding: 16px; text-align: center; }

.updates { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.updates li { font-size: .8125rem; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.updates li.by-claude { border-left: 3px solid var(--gold); }
.updates .up-meta { color: var(--muted-2); font-size: .6875rem; display: block; margin-bottom: 2px; }
.note-form { display: flex; gap: 8px; }
.note-form input { flex: 1; }

/* ---- md-lite rendered ticket bodies (detail pane + note entries) ---- */
.e-detail-view {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px;
}
.md { font-size: .8125rem; line-height: 1.6; color: var(--text); min-width: 0; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md-plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.md-p { margin: 6px 0; overflow-wrap: anywhere; }
.md h3, .md h4 { letter-spacing: -0.01em; margin: 14px 0 4px; }
.md h3 { font-size: .875rem; font-weight: 700; color: var(--gold-bright); }
.md h4 { font-size: .8125rem; font-weight: 700; color: var(--text); }
.md-list { margin: 6px 0; padding-left: 20px; }
.md-list li { margin: 2px 0; overflow-wrap: anywhere; }
.md-list .md-list { margin: 2px 0; }
.md li::marker { color: var(--gold-deep); }
.md strong { font-weight: 700; color: var(--gold-bright); }
.md-code {
  font-family: var(--font-mono); font-size: .75rem;
  background: rgba(224,165,42,.08); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere;
}
.md-pre {
  font-family: var(--font-mono); font-size: .75rem; line-height: 1.5;
  background: rgba(0,0,0,.3); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; margin: 8px 0;
  overflow-x: auto; white-space: pre;
}
.md-table {
  border-collapse: collapse; margin: 8px 0; font-size: .75rem;
  display: block; max-width: 100%; overflow-x: auto;
}
.md-table th, .md-table td {
  border: 1px solid var(--line-strong); padding: 5px 10px; text-align: left;
  vertical-align: top;
}
.md-table th {
  font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: rgba(224,165,42,.05); white-space: nowrap;
}
.md-table td { color: var(--text); }
.md-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.md-hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.md-link { color: var(--cyan); text-decoration: none; overflow-wrap: anywhere; }
.md-link:hover { text-decoration: underline; }
.md-uid {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  color: var(--gold-bright); text-decoration: none;
}
.md-uid:hover { text-decoration: underline; }
.md-ok, .md-bad, .md-warn { font-size: .75rem; }

/* ---- signups ---- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h2 { font-size: 1.125rem; letter-spacing: -0.01em; }
#signup-search { margin-left: auto; min-width: 200px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted-2); padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .email { font-family: var(--font-mono); font-size: .8125rem; }
.email-relay-label { font-family: var(--font-sans, inherit); font-size: .75rem; color: var(--fg, #e8e0d0); font-style: italic; }
.email-relay-addr { font-size: .7rem; }
.signup-actions { display: flex; gap: 4px; align-items: center; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--line-strong); transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s;
}
.switch input:checked + .track { background: var(--gold-deep); border-color: var(--gold-deep); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--gold-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- users ---- */
.grant-col { text-align: center; width: 56px; }
th.grant-col { color: var(--muted); }
.place-col { white-space: nowrap; }
.mono-dim { font-family: var(--font-mono); font-size: .75rem; color: var(--muted-2); }
.save-flag { font-size: .75rem; color: var(--muted-2); white-space: nowrap; }
.save-flag.saving { color: var(--muted); }
.save-flag.ok { color: var(--gold-bright); }
.save-flag.err { color: var(--danger); }

/* ---- stats ---- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.tile { padding: 20px; }
.tile .n { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--gold-bright); }
.tile .l { color: var(--muted); font-size: .8125rem; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { padding: 20px; }
.chart-card h3 { font-size: .8125rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.chart-note { color: var(--muted-2); font-size: .8125rem; }
.bar { fill: var(--gold-deep); }
.bar:hover { fill: var(--gold-bright); }
.axis-label { fill: var(--muted-2); font-size: 9px; font-family: var(--font-mono); }

/* ---- website traffic ---- */
.section-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 24px 0 12px;
}
.traffic-note { color: var(--muted); font-size: .875rem; }
#traffic-body .tiles { margin-bottom: 14px; }
#traffic-body .charts { margin-bottom: 14px; }
.span-2 { grid-column: 1 / -1; }
.charts-3 { grid-template-columns: repeat(3, 1fr); }
.chart-card h3 .legend { float: right; font-weight: 500; color: var(--muted-2); font-size: .75rem; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  margin: 0 4px 0 10px; vertical-align: baseline;
}
.dot:first-child { margin-left: 0; }
.dot-gold, .dot-gold-deep { background: var(--gold-deep); }
.dot-gold-bright { background: var(--gold-bright); }
.dot-dim { background: var(--line-strong); }
.bar-dim { fill: var(--line-strong); }
.bar-dim:hover { fill: var(--muted-2); }
.bar-zero { fill: var(--line); }

.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-list li { display: flex; align-items: center; gap: 8px; font-size: .8125rem; }
.rank-label {
  font-family: var(--font-mono); font-size: .75rem; color: var(--text);
  flex: 0 1 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; background: var(--gold-deep); }
.rank-count { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; }
.rank-empty { color: var(--muted-2); font-size: .8125rem; list-style: none; }

.seg-mobile { fill: var(--gold-bright); }
.seg-desktop { fill: var(--gold-deep); }
.seg-other { fill: var(--line-strong); }
.device-legend { color: var(--muted); font-size: .75rem; margin-top: 8px; }

.ga4-card { margin-bottom: 14px; }
.ga4-line { font-size: .875rem; color: var(--muted); }
.ga4-line strong { color: var(--gold-bright); font-weight: 700; }

.pending-card { border-style: dashed; opacity: .75; }

/* ---- stats dashboard ---- */
#stats-refresh { margin-left: auto; }
.stats-lead { margin: -6px 0 14px; }
.stats-filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; margin-bottom: 8px; }
.stats-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-presets button[aria-pressed="true"] {
  background: var(--gold); color: var(--gold-ink); border-color: var(--gold-deep);
}
.stats-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.stats-custom label {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--muted); font-size: .75rem;
}
.stats-custom input[type="date"] { color-scheme: dark; }
.stats-form-error { color: var(--danger); font-size: .8125rem; margin: 0 0 10px; }
.stats-window { margin: 8px 0 4px; font-size: .875rem; }
.stats-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 8px;
}
.stats-kpi { padding: 14px 16px; min-width: 0; }
.stats-kpi .n {
  font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--gold-bright); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stats-kpi .l { color: var(--text); font-size: .8125rem; font-weight: 600; margin-bottom: 4px; }
.stats-kpi .hint, .stats-kpi .stats-note { color: var(--muted); font-size: .75rem; margin-top: 6px; }
.stats-delta { color: var(--muted); font-size: .75rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stats-delta.up { color: var(--gold-bright); }
.stats-delta.down { color: var(--danger); }
.stats-delta.flat { color: var(--muted); }
.stats-na { font-size: 1rem; font-weight: 600; color: var(--text); margin-top: 4px; }
.stats-kicker {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 22px 0 10px;
}
.stats-block { margin-top: 28px; }
.stats-block-head h2 {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; text-transform: none;
  color: var(--text); margin: 0 0 4px;
}
.stats-block-head p { color: var(--muted); font-size: .8125rem; margin: 0 0 12px; max-width: 72ch; }
.stats-compare { margin: 0 0 8px; color: var(--muted); font-size: .8125rem; }
.stats-mix { margin: 0 0 12px; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-kpis-quiet .stats-kpi .n { font-size: 1.25rem; color: var(--text); }
.stats-rank-share {
  color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: right; font-size: .75rem;
}
.stats-feature-rank .rank-label { flex-basis: 34%; }
.stats-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats-stores article { padding: 12px 14px; }
.stats-stores h3 { font-size: .875rem; margin-bottom: 2px; }
.stats-stores p { color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.stats-stores .stats-na { margin-top: 0; }
.bar-gap { fill: transparent; stroke: var(--line-strong); stroke-width: 1; }
.device-legend span { margin-right: 10px; white-space: nowrap; }
.stats-missing { padding: 16px 18px; border-style: dashed; }
.stats-missing h3 { font-size: .95rem; color: var(--text); margin-bottom: 6px; }
.stats-missing p, .stats-prose { color: var(--text); font-size: .875rem; }
.stats-prose { margin: 0 0 12px; }
.stats-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.stats-callout h3 { font-size: .8125rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.stats-callout ol { margin: 0; padding-left: 1.1rem; font-size: .875rem; }
.stats-callout li { margin: 2px 0; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-plain { margin: 8px 0 0; padding-left: 1.1rem; color: var(--text); font-size: .875rem; }
.seg-web { fill: var(--cyan); }
.dot-cyan { background: var(--cyan); }
.stats-user-picker { padding: 14px 16px; margin: 8px 0 14px; }
.stats-user-picker h3 { font-size: .95rem; margin: 0 0 4px; }
.stats-user-label { display: block; color: var(--muted); font-size: .75rem; margin: 10px 0 4px; }
#stats-user-query { width: min(420px, 100%); }
.stats-user-matches {
  list-style: none; margin: 6px 0 0; padding: 4px; max-width: 420px;
  background: var(--surface-2, var(--bg-elev)); border: 1px solid var(--line); border-radius: 8px;
}
.stats-user-matches li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .875rem; }
.stats-user-matches li[aria-selected="true"], .stats-user-matches li:hover { background: var(--line); }
.stats-user-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.stats-chip {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  border-radius: 999px; padding: 4px 10px; font-size: .8125rem; cursor: pointer;
}
.stats-person { padding: 14px 16px; margin: 0 0 12px; }
.stats-person h3 { font-size: 1rem; margin: 0 0 6px; }
#view-stats.stats-report-open #stats-body { display: none; }
#view-stats { padding-bottom: 88px; }
.stats-place {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(320px, calc(100vw - 32px));
}
.stats-place-panel {
  width: min(280px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
}
.stats-place-panel label { font-size: .75rem; color: var(--muted); }
.stats-place-panel input { width: 100%; }
.stats-place-actions { display: flex; justify-content: flex-end; }
.stats-place-note { min-height: 1.2em; margin: 0; font-size: .8125rem; color: var(--text); }
.stats-place-note.is-error { color: var(--danger); }
.stats-sessions { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.stats-sessions button[aria-selected="true"] {
  background: var(--gold); color: var(--gold-ink); border-color: var(--gold-deep);
}
.stats-map-legend { margin: 0 0 10px; max-width: 72ch; }
#stats-map-note { margin: 0 0 10px; }
#stats-map-note.is-error { color: var(--danger); }
.stats-map-wrap { position: relative; }
#stats-map {
  height: min(70vh, 720px);
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #14110B;
}
#stats-map .maplibregl-ctrl-attrib {
  background: rgba(20, 17, 11, .78);
  color: var(--muted);
  font-size: 10px;
}
#stats-map .maplibregl-ctrl-attrib a { color: var(--text); }
.stats-map-detail {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(20, 17, 11, .94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
}
.stats-map-detail h3 { font-size: 1rem; margin: 0 0 8px; }
.stats-map-detail h4 { font-size: .8125rem; margin: 12px 0 6px; color: var(--text); }
.stats-map-detail .stats-map-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.stats-map-times, .stats-map-places { list-style: none; margin: 0; padding: 0; }
.stats-map-times li, .stats-map-places li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
}
.stats-map-detail .is-error { color: var(--danger); }
.stats-activity li > span { flex: 1; min-width: 0; }
.stats-send-coord { flex: none; margin-left: auto; padding: 2px 8px; font-size: .75rem; }
.stats-report { margin: 4px 0 28px; }
.stats-report-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 12px;
}
.stats-report-head h2 { margin: 0; font-size: 1.35rem; }
.stats-person-report { padding: 18px 18px 8px; margin: 0 0 16px; }
.stats-person-report > h3 { font-size: 1.15rem; margin: 0 0 2px; }
.stats-section { padding: 14px 0 4px; border-top: 1px solid var(--line); }
.stats-section h4 {
  margin: 0 0 8px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.stats-facts { display: grid; grid-template-columns: 9rem 1fr; gap: 6px 12px; margin: 0; font-size: .875rem; }
.stats-facts dt { color: var(--muted); }
.stats-facts dd { margin: 0; overflow-wrap: anywhere; }
.stats-day { margin: 14px 0 0; font-size: .8rem; letter-spacing: .04em; }
.stats-activity { list-style: none; margin: 4px 0 0; padding: 0; }
.stats-activity li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: .875rem;
}
.stats-activity time {
  color: var(--muted); font-variant-numeric: tabular-nums; flex: none; min-width: 6.5rem;
}
.stats-timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.stats-timeline li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: .875rem;
}
.stats-timeline time {
  color: var(--muted); font-variant-numeric: tabular-nums; flex: none;
}
.stats-order { display: flex; gap: 8px; margin: 8px 0 0; }
.stats-order .btn[aria-pressed="true"] { border-color: var(--line-strong); color: var(--text); }
.stats-funnel { list-style: none; margin: 0; padding: 0; }
.stats-funnel li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: .875rem;
}
.stats-funnel li:first-child { border-top: 0; }
.stats-movement .chart-note { margin: 0; }
#view-stats .charts { margin-bottom: 14px; }
#view-stats .section-title:first-of-type { margin-top: 8px; }

/* ---- crawler ---- */
#crawler-run-select { margin-left: auto; max-width: 260px; }
.cr-refresh {
  color: var(--gold-bright); font-size: .75rem; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.cr-refresh::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright);
  animation: cr-pulse 1.2s ease-in-out infinite;
}
@keyframes cr-pulse { 50% { opacity: .25; } }
.cr-sub { font-weight: 500; color: var(--muted-2); font-size: .75rem; }
.charts-2 { grid-template-columns: 1fr 1fr; }

.cr-overall { padding: 20px; margin-bottom: 14px; }
.cr-overall-top { display: flex; align-items: center; gap: 20px; }
.cr-ring { position: relative; width: 92px; height: 92px; flex: none; }
.cr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cr-ring-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.cr-ring-fill { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.cr-ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.cr-overall-meta { min-width: 0; }
.cr-overall-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-badge {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted);
}
.cr-badge.cr-running { color: var(--gold-ink); background: var(--gold); border-color: var(--gold-deep); }
.cr-badge.cr-done { color: var(--gold-bright); border-color: var(--gold-deep); }
.cr-badge.cr-error { color: var(--danger); border-color: var(--danger); }
.cr-mode { color: var(--muted); font-size: .8125rem; }
.cr-zrange { color: var(--text); font-size: .875rem; margin-top: 6px; }
.cr-updated { color: var(--muted-2); font-size: .75rem; margin-top: 2px; }
.cr-counts {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.cr-count { text-align: center; }
.cr-count-n { display: block; font-size: 1.25rem; font-weight: 700; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.cr-count-l { display: block; color: var(--muted-2); font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; }

/* crawled-vs-pending headline block inside the overall card */
.cr-crawled { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cr-crawled-nums { display: flex; gap: 28px; align-items: baseline; flex-wrap: wrap; }
.cr-crawled-stat { display: flex; flex-direction: column; gap: 2px; }
.cr-crawled-n { font-size: 1.75rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.cr-crawled-n.cr-c-done { color: var(--gold-bright); }
.cr-crawled-n.cr-c-pending { color: var(--muted); }
.cr-crawled-l { color: var(--muted-2); font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; }
.cr-bigbar { display: block; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.cr-bigbar i { display: block; height: 100%; border-radius: 6px; transition: width .4s ease; }

/* live stats strip */
.cr-stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.cr-stat {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; text-align: center;
}
.cr-stat-v { display: block; font-size: 1.375rem; font-weight: 700; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.cr-stat-l { display: block; color: var(--muted-2); font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* "what's being cached" info panel */
.cr-info { margin-top: 14px; }
.cr-info-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.cr-info-list div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; }
.cr-info-list dt { color: var(--gold-bright); font-size: .8125rem; font-weight: 700; }
.cr-info-list dd { color: var(--muted); font-size: .8125rem; margin: 0; }

/* per-zoom source badge */
.cr-zoom-src {
  flex: none; font-family: var(--font-mono); font-size: .625rem; text-transform: uppercase;
  letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--muted); min-width: 68px; text-align: center;
}
.cr-src-terrarium { color: var(--gold); border-color: var(--gold-deep); }
.cr-src-1m { color: var(--gold-bright); border-color: var(--gold-deep); }
.cr-src-none { color: var(--muted-2); }

.cr-bar { flex: 1; height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cr-bar i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }

.cr-zoom-row { display: flex; align-items: center; gap: 10px; font-size: .8125rem; margin-bottom: 8px; }
.cr-zoom-label { font-family: var(--font-mono); color: var(--muted); width: 3ch; flex: none; }
.cr-zoom-pct { color: var(--text); font-variant-numeric: tabular-nums; width: 3.5ch; text-align: right; flex: none; }
.cr-zoom-counts { color: var(--muted-2); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }

.cr-state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.cr-state-cell {
  border: 1px solid var(--line); border-left: 3px solid var(--cr-c, var(--line-strong));
  background: var(--surface-2); border-radius: 6px; padding: 6px 8px; text-align: left;
  font: inherit; cursor: pointer; width: 100%; display: block;
}
.cr-state-cell:hover { background: var(--surface-3); border-color: var(--line-strong); }
.cr-state-code { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--text); font-weight: 600; }
.cr-state-pct { display: block; font-size: .6875rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ---- per-state drill-down drawer ---- */
.cr-drawer {
  position: fixed; inset: 0; z-index: 55;
  display: flex; justify-content: flex-end;
  background: rgba(10,8,5,.6); backdrop-filter: blur(4px);
  animation: cr-fade .16s ease;
}
@keyframes cr-fade { from { opacity: 0; } }
.cr-drawer-panel {
  width: min(480px, 100%); height: 100%; overflow-y: auto;
  border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0;
  padding: 20px clamp(16px, 3vw, 24px);
  animation: cr-slide .2s ease;
}
@keyframes cr-slide { from { transform: translateX(24px); opacity: .4; } }
.cr-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cr-drawer-head h3 { font-size: 1rem; font-weight: 600; }
.cr-drawer-code { font-family: var(--font-mono); color: var(--gold-bright); font-weight: 700; }
.cr-drawer-totals { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.cr-drawer-totals .cr-stat-v { font-size: 1.05rem; }
.cr-drawer-sub {
  font-size: .8125rem; font-weight: 700; color: var(--gold-bright);
  margin: 18px 0 10px; display: flex; align-items: baseline; gap: 8px;
}
.cr-mode-name {
  font-family: var(--font-mono); color: var(--text); font-size: .8125rem;
  width: 11ch; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 720px) {
  .cr-drawer-panel { width: 100%; }
  .cr-drawer-totals { grid-template-columns: repeat(2, 1fr); }
}

/* ---- tiles ---- */
.tiles-truncated { color: var(--danger); font-size: .8125rem; }
.tiles-generated { color: var(--muted-2); font-size: .75rem; margin-left: auto; }
#tiles-refresh { margin-left: 12px; }
.tl-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.tl-strip .cr-stat-l { text-transform: none; letter-spacing: 0; font-size: .75rem; }

/* by-state highlight: dim the field once a state is picked, keep the selected one lit */
.cr-state-grid.has-selection .cr-state-cell { opacity: .4; }
.cr-state-grid.has-selection .cr-state-cell.on { opacity: 1; }
.cr-state-cell.on { border-color: var(--gold); background: var(--surface-3); }
.tiles-state-note {
  color: var(--gold-bright); font-size: .8125rem; font-weight: 600;
  margin-bottom: 12px; font-variant-numeric: tabular-nums;
}

/* GPS lookup */
.tl-lookup { display: flex; gap: 10px; padding: 16px; margin-bottom: 16px; }
.tl-lookup input { flex: 1; }
.tl-result-wrap { padding: 16px; }
.tl-result-head {
  color: var(--muted); font-size: .8125rem; margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.tl-grid-scroll { overflow-x: auto; }
.tl-grid { width: auto; min-width: 100%; }
.tl-grid th {
  font-family: var(--font-mono); font-size: .6875rem; text-transform: uppercase;
  letter-spacing: .03em; white-space: nowrap; text-align: center;
}
.tl-grid td { text-align: center; border-bottom: 1px solid var(--line); padding: 8px 10px; }
.tl-grid .tl-zh {
  font-family: var(--font-mono); color: var(--muted); font-size: .75rem;
  text-align: left; position: sticky; left: 0; background: var(--surface);
}
.tl-cell { min-width: 60px; }
.tl-cell.tl-miss { color: var(--muted-2); }
.tl-cell.tl-empty { background: transparent; }
.tl-hit .tl-thumb {
  display: block; width: 48px; height: 48px; margin: 0 auto 4px;
  border-radius: 4px; border: 1px solid var(--line-strong); object-fit: cover;
  background: var(--surface-2); image-rendering: pixelated;
}
.tl-hit .tl-thumb-err { opacity: .4; }
.tl-size {
  display: block; color: var(--muted-2); font-size: .625rem;
  font-variant-numeric: tabular-nums;
}

/* ---- toasts ---- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: .875rem; box-shadow: var(--shadow-card);
  animation: toast-in .18s ease;
}
.toast.err { border-color: var(--danger); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- unified work items (badges shared by compact row + expanded card) ---- */
.work-composer .composer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.work-composer #c-title { flex: 1; min-width: 180px; }
.work-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 14px; margin-bottom: 12px;
}
.work-filters select { min-width: 120px; }
.work-filters .bl-search-wrap { flex: 1; min-width: 200px; }
/* Magpie-style "Tickets N" section header sitting above the dense table. */
.work-tablehead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 2px 6px;
}
.work-tablehead-title {
  font-size: .95rem; font-weight: 700; color: var(--text); margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.work-count {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 9px; font-variant-numeric: tabular-nums;
}

/* Column visibility picker (Columns button → checklist). */
.work-colpicker { position: relative; }
.work-colpicker-btn { font-size: .75rem; padding: 4px 10px; }
.work-colpicker-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 180px; padding: 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 2px;
}
.work-colpicker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: .8125rem; color: var(--text); user-select: none;
}
.work-colpicker-item:hover { background: rgba(224,165,42,.08); }
.work-colpicker-item input { accent-color: var(--gold-deep); }
.work-colpicker-item.is-locked { opacity: .55; cursor: default; }
.work-colpicker-item.is-locked:hover { background: transparent; }

.work-table-wrap { margin-top: 0; overflow-x: auto; }
.work-table {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
}
.work-table th,
.work-table td {
  padding: 8px 10px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-table th {
  position: relative;
  white-space: nowrap;
  user-select: none;
}
.work-th-btn {
  all: unset;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit;
  text-transform: inherit; max-width: 100%;
}
.work-th-btn:hover { color: var(--text); }
.work-th-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.work-th-btn .work-sort-ind {
  font-size: .625rem; color: var(--muted-2); min-width: 0.7em;
}
.work-th-btn[aria-sort="ascending"] .work-sort-ind,
.work-th-btn[aria-sort="descending"] .work-sort-ind {
  color: var(--gold-bright);
}
.work-col-resizer {
  position: absolute; top: 0; right: 0; width: 7px; height: 100%;
  cursor: col-resize; user-select: none; touch-action: none;
}
.work-col-resizer::after {
  content: ""; position: absolute; top: 22%; bottom: 22%; left: 3px;
  width: 1px; background: transparent;
}
.work-table th:hover .work-col-resizer::after,
.work-col-resizer:hover::after,
.work-col-resizer.is-dragging::after {
  background: var(--line-strong);
}
body.work-col-resizing { cursor: col-resize !important; user-select: none !important; }
body.work-col-resizing * { cursor: col-resize !important; }

.work-assignee { white-space: nowrap; }
.work-assignee-name { font-size: .8125rem; color: var(--text); }
.work-assignee-none { color: var(--muted-2); }
.work-key {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 700;
  color: var(--gold-bright); text-decoration: none; white-space: nowrap;
}
.work-key:hover { text-decoration: underline; }
.work-key.dim { color: var(--muted-2); font-weight: 500; }
.work-title-cell { overflow: hidden; }
.work-title-btn {
  all: unset; cursor: pointer; font-weight: 600; font-size: .875rem;
  color: var(--text); display: block; width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.work-title-btn:hover { color: var(--gold-bright); }
.work-ver, .work-age {
  font-size: .75rem; color: var(--muted-2); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.work-status-sel {
  font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  max-width: 100%;
}
.work-actions { text-align: right; }
.work-actions .btn { padding: 4px 10px; font-size: .75rem; }
.work-detail-row td { background: var(--surface-2); padding: 0; white-space: normal; overflow: visible; }
.work-detail-row .bl-detail { border-top: 0; }
.work-row:hover td { background: rgba(224,165,42,.04); }
.work-row.flash td { animation: row-flash 1.6s ease; }

/* Magpie-ish type pills already via .badge-* */
.bl-origin {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .625rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
  vertical-align: middle;
}
.bl-origin-console { border-color: var(--gold-deep); color: var(--gold-bright); }
.bl-origin-app { border-color: var(--rose); color: var(--rose); }
/* The bug badge palette (reused in workItemEl's compact-row badges). */
.badge {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text);
}
.badge-bug { background: rgba(240,119,106,.16); border-color: var(--rose); color: var(--rose); }
.badge-feature { background: rgba(224,165,42,.16); border-color: var(--gold-deep); color: var(--gold-bright); }
.badge-fix { background: rgba(96,165,250,.16); border-color: rgba(96,165,250,.5); color: rgba(96,165,250,.9); }
.badge-idea { background: var(--surface-3); border-color: var(--line-strong); color: var(--muted); }
/* Bug card extras that ride inside the unified expanded detail */
.bl-meta { font-size: .75rem; color: var(--muted-2); margin-top: 2px; }
.bl-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bl-thumb {
  width: 96px; height: 96px; object-fit: cover; border-radius: 8px; cursor: zoom-in;
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.bl-thumb-err { opacity: .4; cursor: default; }

/* -- screenshot lightbox (reused from bug reports, unchanged) -- */
.br-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,17,11,.92); display: flex; align-items: center; justify-content: center;
}
.br-lightbox-close {
  position: absolute; top: 16px; right: 16px; font-size: 1.5rem; color: var(--text);
}
.br-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.br-thumb-err { cursor: default; }
.br-lightbox {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.8); padding: 24px;
}
.br-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; border: 1px solid var(--line-strong); }
.br-lightbox-close { position: absolute; top: 16px; right: 16px; font-size: 1.5rem; }

/* outreach queue */
.or-click { cursor: pointer; }
.or-click:hover td { background: rgba(224, 165, 42, .06); }
.or-subject { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or-detail td { background: var(--surface-2); }
.or-pre {
  white-space: pre-wrap;
  font: inherit;
  font-size: .875rem;
  margin: 0 0 12px;
  color: var(--text);
}
.or-events { width: 100%; border-collapse: collapse; }
.or-events th, .or-events td {
  padding: 4px 8px;
  text-align: left;
  font-size: .8125rem;
  border-bottom: 1px solid var(--line);
}
.or-code {
  font-family: var(--font-mono);
  font-size: .75rem;
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.or-none { color: var(--muted-2); }
.or-redeem { padding: 16px; margin-bottom: 16px; }
.or-redeem h3 { font-size: 1rem; font-weight: 650; margin: 0 0 8px; }
.or-redeem-block { margin-top: 14px; }
.or-redeem-block h4 { font-size: .875rem; margin: 0 0 6px; }
.or-owner-note { color: var(--muted); font-size: .8125rem; margin: 0 0 8px; }
.or-codes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
  align-items: end;
}
.or-codes label { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; color: var(--muted); }
.or-code-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.or-filled { margin: 0 0 12px; }
.or-filled h4 { font-size: .8125rem; margin: 8px 0 4px; }
#outreach-detail > .chart-note { margin: 0 0 14px; }
#outreach-send-form .chart-note { margin-top: 4px; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .charts-3 { grid-template-columns: 1fr; }
  .charts-2 { grid-template-columns: 1fr; }
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-split, .stats-stores { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tiles, .charts, .stats-kpis { grid-template-columns: 1fr; }
  .cr-counts { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .cr-stats-strip { grid-template-columns: repeat(2, 1fr); }
  .cr-info-list div { grid-template-columns: 1fr; gap: 2px; }
  .or-codes { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  #lock-btn { margin-left: auto; }
  #signup-search { margin-left: 0; width: 100%; }
  #bl-search { margin-left: 0; width: 100%; }
  .bl-age { display: none; }
}
