/* Trailmark dashboard. Brand tokens only; fonts are linked by the layout views. */
:root {
  --charcoal: #1F2933;
  --charcoal-hover: #141C24;
  --navy: #1E2A38;
  --gold: #C8A96A;
  --gold-light: #E0CCA4;
  --gold-wash: #F1E7D2;
  --off-white: #F7F5F0;
  --white: #FFFFFF;
  --line-soft: #EEECE6;
  --muted: #6B7280;
  --line: #D1D5DB;
  --ink: #111111;
  --danger: #9B2C2C;
  --danger-hover: #7F1D1D;
  --radius: 4px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--off-white);
}

h1, h2, h3, h4 { font-weight: 500; line-height: 1.25; margin: 0 0 12px; color: var(--ink); }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--charcoal); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--charcoal-hover); }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Layout grid: 240px sidebar, header, main */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "sidebar header" "sidebar main";
  min-height: 100vh;
}
.sidebar { grid-area: sidebar; background: var(--navy); color: var(--white); padding: 24px 16px; display: flex; flex-direction: column; }
.sidebar-brand { font-size: 18px; font-weight: 500; color: var(--white); margin: 0 12px 24px; letter-spacing: 0.01em; }
.sidebar-nav { flex: 1; }
.nav-link { display: block; width: 100%; padding: 8px 12px; color: var(--gold-light); text-decoration: none; border-radius: var(--radius); border-left: 2px solid transparent; }
.nav-link:hover { background: var(--charcoal); color: var(--white); }
.nav-link.is-active { color: var(--white); border-left-color: var(--gold); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.nav-button { font: inherit; background: none; border-top: 0; border-right: 0; border-bottom: 0; border-left: 2px solid transparent; text-align: left; cursor: pointer; }
.sidebar-foot { border-top: 1px solid var(--charcoal); padding-top: 12px; margin-top: 24px; }
.sidebar-business { margin: 0 12px 8px; color: var(--white); font-weight: 500; overflow-wrap: anywhere; }
.header-title { margin: 0; font-size: 18px; }
.header-user { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.switcher-list { list-style: none; margin: 0 0 20px; padding: 0; }
.switcher-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--white); }
.switcher-item:hover { border-color: var(--charcoal); }
.header {
  grid-area: header;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.main { grid-area: main; background: var(--off-white); padding: 24px; min-width: 0; }

/* Phone: the Navy sidebar becomes a top bar (brand left, business and sign out right, nav row beneath) */
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "sidebar" "header" "main"; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 8px 16px 0; }
  .sidebar-brand { order: 1; margin: 0; }
  .sidebar-foot { order: 2; display: flex; align-items: center; gap: 12px; border-top: 0; margin: 0; padding: 0; min-width: 0; }
  .sidebar-foot form { margin: 0; }
  .sidebar-foot .nav-link { width: auto; min-height: 44px; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; }
  .sidebar-business { margin: 0; font-size: 13px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-nav { order: 3; flex: 1 0 100%; display: flex; gap: 4px; overflow-x: auto; }
  .sidebar-nav .nav-link { width: auto; min-height: 44px; display: flex; align-items: center; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; }
  .sidebar-nav .nav-link.is-active { border-left-color: transparent; border-bottom-color: var(--gold); }
  .header, .main { padding-left: 16px; padding-right: 16px; }
}

/* Leads list */
.leads-subline { margin: 0 0 12px; }
.lead-search { margin: 0 0 12px; }
.lead-search input { width: 100%; min-height: 44px; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; }
.lead-who { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin: 0 0 12px; overflow: hidden; }
.lead-who a { display: flex; align-items: center; min-height: 44px; padding: 0 20px; text-decoration: none; color: var(--muted); }
.lead-who a[aria-current="true"] { background: var(--charcoal); color: var(--white); }
.lead-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 4px; }
.lead-chips a { flex: none; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--charcoal); text-decoration: none; white-space: nowrap; }
.lead-chips a[aria-current="true"] { background: var(--gold-wash); border-color: var(--gold); }
.lead-list { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.lead-row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { background: var(--off-white); color: var(--ink); }
.lead-main { flex: 1; min-width: 0; display: block; }
.lead-line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lead-name { font-weight: 500; overflow-wrap: anywhere; }
.lead-score { flex: none; }
.lead-line2 { display: block; font-size: 13px; overflow-wrap: anywhere; }
.lead-arrow { flex: none; color: var(--gold); }
.lead-footer { margin-top: 16px; font-size: 13px; }
.empty-state a { display: inline-flex; align-items: center; min-height: 44px; }

/* Buttons */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--charcoal); color: var(--white); }
.btn-primary:hover { background: var(--charcoal-hover); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--charcoal); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--charcoal); color: var(--charcoal); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Card */
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* Table */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: 0; }

/* Form field */
.field { display: block; margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--charcoal); }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Chip: the only pill shape */
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold-wash);
  color: var(--charcoal);
  border: 1px solid var(--gold-light);
}

/* Empty state */
.empty-state {
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  color: var(--muted);
}
.empty-state h1, .empty-state h2 { color: var(--ink); }

.message-page { max-width: 480px; margin: 12vh auto 0; padding: 0 16px; }

/* Signed-out pages: wordmark above one centred card */
.auth-page { max-width: 420px; margin: 12vh auto 0; padding: 0 16px 48px; }
.auth-brand { font-size: 18px; font-weight: 500; color: var(--charcoal); text-align: center; margin-bottom: 20px; letter-spacing: 0.01em; }
.auth-card { padding: 28px; }
.auth-card form { margin-top: 20px; }
.btn-block { display: block; width: 100%; text-align: center; }
.form-error {
  background: var(--gold-wash);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 10px 12px;
}

/* Settings: team */
.team-section { margin-bottom: 32px; max-width: 760px; }
.team-section.card { padding: 20px; }
.table .table-action { text-align: right; width: 1%; white-space: nowrap; }
.table .table-action form { margin: 0; }
.notice {
  overflow-wrap: anywhere;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 10px 12px;
  margin: 0 0 20px;
  max-width: 760px;
}
.main > .form-error { max-width: 760px; margin: 0 0 20px; }

/* Leads: detail */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--gold-wash); border: 1px solid var(--gold-light); font-size: 13px; }
.lead-back { margin: 0 0 12px; }
.lead-header { margin-bottom: 24px; }
.lead-title { margin: 0 0 8px; overflow-wrap: anywhere; }
.lead-phone { margin: 0 0 12px; }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-actions .btn { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.lead-section { max-width: 760px; margin-bottom: 28px; }
.lead-when { display: block; font-size: 13px; }
.segmented { display: flex; flex-wrap: wrap; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.segmented button { flex: 1 1 auto; min-height: 44px; padding: 0 16px; font: inherit; color: var(--charcoal); background: var(--white); border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--gold-wash); }
.segmented button:focus-visible { outline: 2px solid var(--charcoal); outline-offset: -2px; }
.numbered { list-style: none; margin: 0; padding: 0; }
.numbered li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.numbered li:last-child { border-bottom: 0; }
.numbered .mono { flex: none; color: var(--gold); }
.credit-rows { list-style: none; margin: 0; padding: 0; }
.credit-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.inline-form { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1 1 220px; }
.lead-section textarea { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.lead-section .field { margin-bottom: 12px; }
.lead-section form + form { margin-top: 20px; }
.inline-form .field { margin-bottom: 0; }
.note-list { list-style: none; margin: 20px 0 0; padding: 0; }
.note-list li { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.note-body { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { margin: 0; font-size: 13px; overflow-wrap: anywhere; }

/* Leads: erase this person's data (owner only) */
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: var(--danger-hover); color: var(--white); }
.erase-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.erase-actions .btn { min-height: 44px; }
.lead-erase { font-size: 13px; }
.lead-erase a { color: var(--muted); }

/* Home */
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 4px; }
.tabs a { flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--charcoal); text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="true"] { background: var(--gold-wash); border-color: var(--gold); }
.home-greeting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; }
.home-greeting h2 { margin: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat { display: flex; flex-direction: column; gap: 4px; background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 13px; }
.stat-value { font-size: 22px; color: var(--ink); overflow-wrap: anywhere; }
.stat-note { font-size: 13px; }
.row-advice { display: block; font-family: var(--font-sans); font-size: 13px; color: var(--danger); margin-top: 2px; }
.alert { background: var(--gold-wash); border-left: 3px solid var(--gold); border-radius: var(--radius); color: var(--ink); padding: 12px 16px; margin: 0 0 20px; }
.alert p { margin: 0 0 4px; }
.alert a { display: inline-flex; align-items: center; min-height: 44px; }
.status-pill { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--gold-wash); border: 1px solid var(--gold-light); color: var(--charcoal); font-size: 13px; }
.home-section { margin: 0 0 20px; padding: 16px 20px; }
.home-section h2 { margin-top: 0; }
.call-list { list-style: none; margin: 0; padding: 0; }
.call-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.call-list li:last-child { border-bottom: 0; }
.call-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.call-actions { display: flex; gap: 8px; }
.plain-list { margin: 0; padding-left: 20px; }

/* Home: Performance */
.target-bar { display: block; width: 100%; max-width: 480px; height: 10px; margin: 8px 0; }
.target-track { fill: var(--line-soft); }
.target-fill { fill: var(--gold); }
.trend { display: block; width: 100%; max-width: 760px; height: 96px; margin-top: 12px; }
.trend-bar { fill: var(--gold); }

/* Setup */
.switcher-add { margin: 0 0 16px; }
.switcher-add a { display: inline-flex; align-items: center; min-height: 44px; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 0; max-width: 760px; }
.stepper-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.stepper-step + .stepper-step::before { content: ""; display: block; width: 24px; height: 1px; background: var(--line); }
.stepper-step > a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--charcoal); text-decoration: none; }
.stepper-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: 12px; }
.stepper-step.is-done .stepper-num { background: var(--gold-wash); border-color: var(--gold); color: var(--charcoal); }
.stepper-step.is-current { color: var(--ink); font-weight: 500; }
.stepper-step.is-current .stepper-num { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }
.stepper-step.is-upcoming { opacity: 0.7; }
.stepper-label { overflow-wrap: anywhere; }
.stepper-tick { color: var(--gold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.setup-card { max-width: 760px; }
.setup-heading { margin: 12px 0 16px; font-size: 22px; overflow-wrap: anywhere; }
.check-results { background: var(--off-white); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
.check-results h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.check-results ul { list-style: none; margin: 0; padding: 0; }
.check-results li { display: flex; gap: 8px; padding: 4px 0; overflow-wrap: anywhere; }
.check-mark { flex: none; color: var(--gold); }
.method-card { position: relative; border: 2px solid var(--charcoal); border-radius: var(--radius); padding: 20px; margin: 16px 0; background: var(--white); }
.method-card h3 { margin: 0 0 8px; font-size: 17px; }
.method-badge { display: inline-block; margin: 0 0 12px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 500; }
.snippet { display: block; width: 100%; font-size: 13px; color: var(--ink); background: var(--off-white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; resize: vertical; overflow-wrap: anywhere; }
.method-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.method-actions .btn, .alt-row .btn, .setup-footer .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.setup-steps { margin: 0; padding-left: 20px; }
.setup-steps > li { padding: 6px 0; overflow-wrap: anywhere; }
.key-row { margin: 10px 0; }
.key-row label, .key-row .key-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.key-value { display: flex; gap: 8px; align-items: center; min-width: 0; }
.key-value input { flex: 1 1 auto; min-width: 0; min-height: 44px; font-size: 13px; color: var(--ink); background: var(--off-white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 10px; }
.key-value form { margin: 0; }
.key-masked { flex: 1 1 auto; letter-spacing: 0.1em; color: var(--muted); }
.setup-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--muted); font-size: 13px; }
.setup-divider::before, .setup-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.alt-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.live-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 20px; background: var(--off-white); }
.live-box.is-working { border-style: solid; border-color: var(--gold); background: var(--gold-wash); }
.live-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 999px; background: var(--gold); animation: live-pulse 1.6s ease-in-out infinite; }
.live-box.is-working .live-dot { animation: none; background: var(--charcoal); }
.live-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.live-links a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.setup-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.setup-footer .muted { flex: 1 1 200px; text-align: right; font-size: 13px; }
@media (max-width: 720px) {
  .setup-card { padding: 16px; }
  .method-card { padding: 16px; }
  .alt-row { flex-direction: column; }
  .alt-row .btn { width: 100%; }
  .key-value { flex-wrap: wrap; }
  .key-value input { flex-basis: 100%; }
  .setup-footer .muted { order: -1; flex-basis: 100%; text-align: left; }
}

/* Links */
.links-intro { margin: 0 0 16px; max-width: 760px; }
.links-create { max-width: 760px; }
.links-channel { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.links-channel legend { padding: 0; font-weight: 500; margin-bottom: 6px; }
.segmented-radio { display: inline-flex; margin-top: 0; }
.segmented-radio label { position: relative; flex: 1 1 auto; display: flex; cursor: pointer; border-right: 1px solid var(--line); }
.segmented-radio label:last-child { border-right: 0; }
.segmented-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.segmented-radio span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; color: var(--charcoal); }
.segmented-radio label:hover span { background: var(--gold-wash); }
.segmented-radio input:checked + span { background: var(--charcoal); color: var(--white); }
.segmented-radio input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }
.links-list { min-width: 0; }
.links-table caption { caption-side: top; text-align: left; color: var(--muted); font-size: 13px; padding: 0 0 8px; }
.links-table td { white-space: nowrap; vertical-align: middle; }
.link-url { width: 15rem; min-height: 36px; font-size: 13px; color: var(--ink); background: var(--off-white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 8px; }
.link-opens { display: inline-block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.link-status { display: flex; align-items: center; gap: 8px; }
.link-status form { margin: 0; }
.btn-small { padding: 4px 10px; font-size: 13px; min-height: 36px; }
.pill-off { background: var(--off-white); border-color: var(--line); color: var(--muted); }
.link-row.is-off td { color: var(--muted); }
.link-row.is-off .link-url { color: var(--muted); }
.links-foot { margin: 12px 0 0; font-size: 13px; }
.links-name, .links-domain { max-width: 760px; }
.link-domain-actions { display: flex; gap: 8px; margin-top: 12px; }
.link-domain-actions form { margin: 0; }
@media (max-width: 720px) {
  .links-list, .links-create { padding: 16px; }
  .link-url { width: 12rem; }
}

/* Heatmaps */
.heat-intro { margin: 0 0 16px; }
.heat-filters { display: flex; flex-direction: column; gap: 12px; }
.heat-filters .tabs { margin: 0; }
.heat-page-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.heat-page-form label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.heat-page-form select { flex: 1 1 12rem; min-width: 0; max-width: 100%; min-height: 44px; font-size: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; text-overflow: ellipsis; }
.heat-page-form .btn { min-height: 44px; }
.heat-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.heat-cards .card, .heat-side .card { margin-bottom: 0; }
.heat-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
@media (min-width: 1100px) {
  .heat-cards { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
}
.heat-map { width: 100%; max-width: 320px; margin: 0 auto; }
.heat-edge { margin: 0 0 6px; font-size: 12px; }
.heat-grid + .heat-edge { margin: 6px 0 0; }
.heat-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.heat-cell { display: block; aspect-ratio: 1 / 1; border-radius: 1px; }
.heat-l0 { background: var(--off-white); }
.heat-l1 { background: #E5E7EB; }
.heat-l2 { background: #C9CDD2; }
.heat-l3 { background: #8E9399; }
.heat-l4 { background: #525A63; }
.heat-l5 { background: var(--charcoal); }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.heat-swatches { display: inline-flex; gap: 3px; }
.heat-swatch { display: block; width: 14px; height: 14px; border-radius: 1px; }
.heat-summary { margin: 0; font-size: 13px; }
.heat-table td { vertical-align: middle; }
.heat-table th:not(:first-child), .heat-table td:not(:first-child) { text-align: right; }
.heat-table td:not(:first-child) { white-space: nowrap; }
.heat-element { min-width: 7rem; overflow-wrap: break-word; }
.heat-note { margin: 12px 0 0; font-size: 13px; }
.heat-reach { list-style: none; margin: 0; padding: 0; }
.heat-reach li { padding: 10px 0; }
.heat-reach-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.heat-bar { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.heat-bar-fill { display: block; height: 100%; background: var(--charcoal); }
.heat-foot { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 13px; text-align: center; }
.heat-bar-fill.w-0 { width: 0; } .heat-bar-fill.w-5 { width: 5%; } .heat-bar-fill.w-10 { width: 10%; } .heat-bar-fill.w-15 { width: 15%; } .heat-bar-fill.w-20 { width: 20%; }
.heat-bar-fill.w-25 { width: 25%; } .heat-bar-fill.w-30 { width: 30%; } .heat-bar-fill.w-35 { width: 35%; } .heat-bar-fill.w-40 { width: 40%; } .heat-bar-fill.w-45 { width: 45%; }
.heat-bar-fill.w-50 { width: 50%; } .heat-bar-fill.w-55 { width: 55%; } .heat-bar-fill.w-60 { width: 60%; } .heat-bar-fill.w-65 { width: 65%; } .heat-bar-fill.w-70 { width: 70%; }
.heat-bar-fill.w-75 { width: 75%; } .heat-bar-fill.w-80 { width: 80%; } .heat-bar-fill.w-85 { width: 85%; } .heat-bar-fill.w-90 { width: 90%; } .heat-bar-fill.w-95 { width: 95%; } .heat-bar-fill.w-100 { width: 100%; }
@media (max-width: 720px) {
  .heat-filters, .heat-card { padding: 16px; }
  .heat-table th, .heat-table td { padding: 8px 6px; }
}

/* Setup step 3: connect ads */
.ads-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.ads-card { margin-bottom: 0; padding: 16px; min-width: 0; overflow-wrap: anywhere; }
.ads-card h3 { margin: 0 0 8px; }
.ads-card .status-pill { margin-bottom: 8px; }
.ads-form { margin: 12px 0; }
.ads-pixel-links { margin: 0 0 12px; padding-left: 20px; }
.ads-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ads-actions form { margin: 0; }
.ads-actions .btn, .ads-form .btn { min-height: 44px; }
.ads-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; }
.ads-facts dt { color: var(--muted); }
.ads-facts dd { margin: 0; }
