/* ===========================================================================
   Sales dashboard styles. Plain CSS - no framework, no build step.

   Light and dark are two complete token sets on <html data-theme>, not a base
   theme plus a patch. The old dark mode was a short prefers-color-scheme block
   that only overrode six variables, so anything added later was styled for
   light only and quietly broke in dark. Every colour below resolves through a
   token, so a component cannot be built for one theme and forgotten in the
   other.

   Palette is walkweltech.com's: deep blue carries authority on white, the
   light-blue accent carries it on near-black.
   =========================================================================== */

:root {
  --deep-blue: #2E3C91;
  --light-blue: #8AE2FF;
  --pale-green: #B4EDC6;
  --beige: #F5F4D6;
  --peach: #F0C9A5;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  /* Lead temperature and priority read the same in both themes. */
  --hot: #E5484D;
  --warm: #F76B15;
  --lukewarm: #D9A400;
  --cold: #7B879D;
  --ok: #30A46C;
  --info: #3E8AD8;
}

html[data-theme="light"] {
  --bg: #F4F8FC;
  --bg-2: #EAF1F8;
  --panel: #FFFFFF;
  --panel-2: #F8FBFE;
  --fg: #0D0F1A;
  --muted: #5B6478;
  --faint: #8A93A6;
  --line: #E1E8F2;
  --line-strong: #C7D5E8;
  --accent: #2E3C91;
  --accent-2: #4A63C8;
  --on-accent: #FFFFFF;
  --accent-soft: #EDF2FF;
  --shadow: 0 1px 2px rgba(15,23,66,.06), 0 4px 14px -6px rgba(15,23,66,.10);
  --shadow-lg: 0 20px 50px -20px rgba(15,23,66,.28);
  --glow: rgba(46,60,145,.20);
  --hero: linear-gradient(135deg, #2E3C91 0%, #4A63C8 58%, #37A9D6 100%);
  --code-bg: #0D0F1A;
  --code-fg: #E7F3FF;
}

html[data-theme="dark"] {
  --bg: #0D0F1A;
  --bg-2: #0A0C16;
  --panel: #131628;
  --panel-2: #1A1F3A;
  --fg: #F2F6FF;
  --muted: rgba(242,246,255,.62);
  --faint: rgba(242,246,255,.40);
  --line: rgba(138,226,255,.14);
  --line-strong: rgba(138,226,255,.30);
  --accent: #8AE2FF;
  --accent-2: #B4EDC6;
  --on-accent: #0D0F1A;
  --accent-soft: rgba(138,226,255,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 70px -20px rgba(0,0,0,.75);
  --glow: rgba(138,226,255,.28);
  --hero: linear-gradient(135deg, #1A1F3A 0%, #131628 60%, #0D0F1A 100%);
  --code-bg: #0A0C16;
  --code-fg: #E7F3FF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Urbanist', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
code { background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 5px; font-size: 12px; font-weight: 600; }

::selection { background: var(--accent); color: var(--on-accent); }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; }
*::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------- login */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 460px at 15% -10%, var(--accent-soft), transparent 62%),
    radial-gradient(700px 400px at 88% 5%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; width: 100%; max-width: 430px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--light-blue), var(--pale-green));
  color: #0D0F1A; font-weight: 900; font-size: 18px; flex: 0 0 auto;
  box-shadow: 0 6px 18px -6px var(--glow);
}
.login-card h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.025em; }
.login-card input {
  width: 100%; padding: 13px 15px; margin: 20px 0 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--fg);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .16s, box-shadow .16s;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn { width: 100%; justify-content: center; }
.error { color: var(--hot); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* -------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.logo {
  font-weight: 800; font-size: 19px; padding: 0 8px 22px; letter-spacing: -.03em;
  display: flex; align-items: center; gap: 10px;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--light-blue), var(--pale-green));
  color: #0D0F1A; font-weight: 900; font-size: 15px; flex: 0 0 auto;
  box-shadow: 0 4px 14px -5px var(--glow);
}
.logo span { color: var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--muted); font-weight: 600; text-decoration: none; font-size: 14px;
  position: relative; transition: background .15s, color .15s;
}
.sidebar nav a i { font-style: normal; width: 16px; text-align: center; opacity: .85; }
.sidebar nav a:hover { background: var(--bg); color: var(--fg); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.pill {
  margin-left: auto; background: var(--accent); color: var(--on-accent); border-radius: 99px;
  padding: 1px 8px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.conn { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.conn::before { content: '●'; color: var(--faint); }
.conn.on::before { color: var(--ok); animation: conn-pulse 2.4s ease-out infinite; }
.conn.off::before { color: var(--hot); }
@keyframes conn-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.theme-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--radius-sm); padding: 8px 12px; font: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: all .16s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--fg); }

.content { padding: 26px 30px 60px; max-width: 1560px; overflow-x: hidden; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.view-head h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.03em; }
.view-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.back { color: var(--accent); cursor: pointer; font-size: 13px; display: block; margin-bottom: 5px; font-weight: 600; }

/* ------------------------------------------------------------ controls */
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; transition: all .16s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 6px 18px -8px var(--glow); }
.btn.primary:hover { color: var(--on-accent); box-shadow: 0 10px 26px -8px var(--glow); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters input, .filters select, .view-head select {
  padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--fg); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .16s, box-shadow .16s;
}
.filters input:focus, .filters select:focus, .view-head select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.filters input { min-width: 280px; flex: 1; max-width: 440px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600; }
.check input { accent-color: var(--accent); }

/* --------------------------------------------------------------- cards */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 19px; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card.flat { cursor: default; }
.card.flat:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.card-title { font-weight: 700; font-size: 15px; letter-spacing: -.015em; }
.card-sub { font-size: 12.5px; color: var(--muted); }
.card-body { font-size: 13px; margin-top: 8px; }
.kv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.kv span {
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  padding: 3px 9px; font-size: 11.5px; color: var(--muted); font-weight: 600;
}

/* --------------------------------------------------------------- score */
.score { font-weight: 900; font-size: 21px; line-height: 1; text-align: right; white-space: nowrap; letter-spacing: -.03em; }
.score small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-top: 4px; }
.t-hot { color: var(--hot); } .t-warm { color: var(--warm); }
.t-lukewarm { color: var(--lukewarm); } .t-cold { color: var(--cold); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid transparent;
}
/* color-mix keeps one definition per state working on both backgrounds. */
.badge.hot, .badge.urgent { background: color-mix(in srgb, var(--hot) 16%, transparent); color: var(--hot); border-color: color-mix(in srgb, var(--hot) 34%, transparent); }
.badge.warm, .badge.high { background: color-mix(in srgb, var(--warm) 16%, transparent); color: var(--warm); border-color: color-mix(in srgb, var(--warm) 34%, transparent); }
.badge.lukewarm, .badge.medium { background: color-mix(in srgb, var(--lukewarm) 18%, transparent); color: var(--lukewarm); border-color: color-mix(in srgb, var(--lukewarm) 36%, transparent); }
.badge.cold, .badge.low { background: color-mix(in srgb, var(--cold) 16%, transparent); color: var(--cold); border-color: color-mix(in srgb, var(--cold) 32%, transparent); }
.badge.live { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 34%, transparent); }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: var(--line-strong); }

/* --------------------------------------------------------------- stats */
.stat-row { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
  background: var(--accent); opacity: .8;
}
.stat b { display: block; font-size: 26px; font-weight: 900; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* -------------------------------------------------------------- tables */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 12px 15px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); font-weight: 800;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2);
}
td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; transition: background .13s; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: 0; }
.trunc { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------- panels */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.panel h4 {
  margin: 18px 0 7px; font-size: 11.5px; color: var(--faint); font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
}
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) {
  .two-col { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 20px 16px 50px; }
}

.dl { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 6px 14px; font-size: 13px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; word-break: break-word; }

/* ================================================== EXECUTIVE REPORT ==== */
/* The report is what sales actually reads, so it gets the strongest visual
   hierarchy in the product: verdict first, evidence second, detail last. */

.report-hero {
  border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 16px;
  background: var(--hero); color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.report-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(138,226,255,.30), transparent 68%);
  pointer-events: none;
}
.report-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; position: relative; }
.report-hero h3 { margin: 0 0 10px; font-size: 25px; font-weight: 900; letter-spacing: -.035em; line-height: 1.2; position: relative; max-width: 34ch; }
.report-hero p { margin: 0; font-size: 14.5px; line-height: 1.65; color: rgba(255,255,255,.86); position: relative; max-width: 78ch; }
.report-hero .badge { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.30); }
.report-hero .badge.urgent { background: var(--hot); border-color: var(--hot); color: #fff; }

/* Ring gauge - one glance tells you the score and the band it falls in. */
.gauge { display: flex; align-items: center; gap: 18px; }
.gauge-ring {
  --pct: 0; --ring: var(--accent);
  width: 92px; height: 92px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--line) 0);
  position: relative;
}
.gauge-ring::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel);
}
.gauge-num { position: relative; font-size: 25px; font-weight: 900; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.gauge-meta b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.gauge-meta span { font-size: 12.5px; color: var(--muted); }

/* Score breakdown meters */
.meter-row { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 54px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.meter-row > span:first-child { color: var(--muted); font-weight: 600; }
.meter { background: var(--bg); border-radius: 99px; height: 8px; overflow: hidden; }
.meter > div {
  height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .55s cubic-bezier(.22,1,.36,1);
}
.meter-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 800; font-size: 12.5px; }

/* Insight tiles - the "so what" of the report */
.insight-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.insight {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; position: relative;
}
.insight-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 800; margin-bottom: 6px; }
.insight-value { font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.35; }
.insight-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* The next action deserves to look like an instruction, not a paragraph. */
.action-card {
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 17px 19px; background: var(--accent-soft);
}
.action-card .insight-label { color: var(--accent); }
.action-card p { margin: 0; font-size: 14.5px; line-height: 1.6; font-weight: 600; }
.quote {
  margin: 10px 0 0; padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px dashed var(--line-strong);
  font-style: italic; font-size: 13.5px; color: var(--fg); line-height: 1.6;
}

/* Contactability ladder */
.ladder { display: flex; flex-direction: column; gap: 8px; }
.ladder-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
  font-size: 13px;
}
.ladder-item.have { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.ladder-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.ladder-item.have .ladder-dot { background: var(--ok); }
.ladder-key { color: var(--muted); font-weight: 700; min-width: 88px; }
.ladder-val { font-weight: 700; word-break: break-all; }
.ladder-src { margin-left: auto; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }

/* Collapsible detail so the report opens short and expands on demand */
details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
details.fold > summary {
  cursor: pointer; padding: 14px 20px; font-weight: 800; font-size: 14px; list-style: none;
  display: flex; align-items: center; gap: 9px; letter-spacing: -.015em;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: var(--accent); transition: transform .2s ease; display: inline-block; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { color: var(--accent); }
details.fold .fold-body { padding: 0 20px 18px; }

/* ------------------------------------------------------------ timeline */
.timeline { border-left: 2px solid var(--line); padding-left: 18px; margin-left: 6px; max-height: 460px; overflow-y: auto; }
.tl-item { position: relative; padding: 5px 0 11px; font-size: 13px; }
.tl-item::before {
  content: ''; position: absolute; left: -23px; top: 10px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--panel);
}
.tl-item.business::before { background: var(--hot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hot) 22%, transparent); }
.tl-time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 600; }

/* --------------------------------------------------------- chat replay */
.replay { max-height: 480px; overflow-y: auto; padding-right: 8px; }
.msg { margin-bottom: 12px; display: flex; }
.msg.visitor { justify-content: flex-end; }
.msg .bubble { max-width: 78%; padding: 10px 14px; border-radius: 15px; font-size: 13px; white-space: pre-wrap; line-height: 1.55; }
.msg.assistant .bubble { background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.visitor .bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; font-weight: 500; }
.msg .meta { font-size: 10.5px; color: var(--faint); margin-top: 5px; }

/* ---------------------------------------------------------------- bars */
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 60px; gap: 11px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.bar { background: var(--bg); border-radius: 99px; height: 9px; overflow: hidden; }
.bar > div { background: linear-gradient(90deg, var(--accent), var(--accent-2)); height: 100%; border-radius: 99px; transition: width .5s cubic-bezier(.22,1,.36,1); }
.bar.hot > div { background: linear-gradient(90deg, var(--hot), var(--warm)); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }

.funnel-step { display: grid; grid-template-columns: 170px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 9px; font-size: 13px; }

/* ------------------------------------------------------------- heatmap */
.heat-canvas {
  position: relative; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); height: 320px; overflow: hidden;
}
.heat-dot {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: radial-gradient(circle, rgba(239,68,68,.8) 0%, rgba(239,68,68,0) 70%);
}
.heat-dot.rage { background: radial-gradient(circle, rgba(220,38,38,1) 0%, rgba(220,38,38,0) 70%); width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* --------------------------------------------------------------- toast */
.toast-host { position: fixed; top: 18px; right: 22px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-lg);
  max-width: 340px; font-size: 13px; animation: slide .28s cubic-bezier(.22,1,.36,1);
}
.toast b { display: block; margin-bottom: 3px; font-weight: 800; }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty b { display: block; font-size: 16px; color: var(--fg); margin-bottom: 7px; font-weight: 800; }

pre.json {
  background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; font-size: 11.5px; overflow-x: auto; max-height: 340px;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, monospace;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
ul.plain { margin: 6px 0; padding-left: 20px; font-size: 13px; }
ul.plain li { margin-bottom: 6px; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
