/* Ported verbatim from minusPHI dashboard/styles.css (heat section) */
/*
   Standalone on purpose: styles.css/graph.css are owned by a separate
   re-theme pass — this file must survive that untouched and keep the heat
   tab rendering exactly like minusPHI's.

   Every declaration below the "ported verbatim" marker is copied 1:1 from
   minusPHI (values and order — including the later .seg refinement that
   minusPHI's own cascade also applies to the heat segments, so the rendered
   segment style matches what they actually ship). One deliberate deviation:
   selectors are prefixed with .heattab — the tab's root wrapper, added by
   js/heat.js — so minusPHI's light-theme rules and generic class names
   (.seg, .tile, .skel-s…) cannot leak into the rest of the obsidian
   dashboard or fight the re-theme. Class names themselves are preserved.

   The glue section at the bottom is NOT from minusPHI: it pins their
   palette as locally-scoped custom properties, restyles the few shell
   pieces the tab reuses (.card, code, the month input) and neutralizes
   graph.css's legacy .heatwrap scroller.
*/

/* ---- minusPHI's palette (their :root values), scoped to the heat tab.
   Custom properties inherit, so every ported var() below resolves to the
   minusPHI value inside .heattab and to nothing outside it. ---- */
.heattab {
  --brand: #026c39;
  --brand-tint: rgba(2, 108, 57, 0.1);
  --brand-dark: #015a2f;
  --ink: #0f172a;
  --muted: #4b5563;
  --faint: #94a3b8;
  --bg: #f5f8fc;
  --line: rgba(0, 0, 0, 0.08);
  --line-dark: rgba(15, 23, 42, 0.15);
  --heading: 'Poppins', 'Inter', system-ui, sans-serif; /* minusPHI: Playfair Display; our shell loads Poppins */
  color: var(--ink);
}

/* ==== ported verbatim below (minusPHI dashboard/styles.css) ==== */

/* ---- heat maps tab ---- */
.heattab .heatctl { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.heattab .heatctl .meta { margin-left: auto; font-size: 12.5px; color: var(--faint); }
.heattab .seg { display: inline-flex; border: 1px solid var(--line-dark); border-radius: 8px; overflow: hidden; flex: none; }
.heattab .seg button { background: #fff; color: var(--muted); border: 0; border-radius: 0; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.heattab .seg button + button { border-left: 1px solid var(--line-dark); }
.heattab .seg button:hover { background: #f8fafc; color: var(--ink); }
.heattab .seg button.on, .heattab .seg button.on:hover { background: var(--brand); color: #fff; }
.heattab select.pagesel {
  font: inherit; font-size: 13.5px; padding: 8px 12px; border: 1px solid var(--line-dark);
  border-radius: 8px; background: #fff; color: var(--ink); min-width: 170px; max-width: 100%;
}
.heattab .heatwrap { display: flex; gap: 14px; align-items: flex-start; }
.heattab .heatstage { flex: 1; min-width: 0; }
.heattab .heatside { width: 280px; flex: none; display: grid; gap: 12px; }
@media (max-width: 900px) { .heattab .heatwrap { flex-direction: column; } .heattab .heatside { width: 100%; } }
.heattab .framescroll { max-height: 68vh; overflow-y: auto; border-radius: 10px; border: 1px solid var(--line-dark); }
.heattab .pageframe { position: relative; background: #fff; overflow: hidden; }
.heattab .pageframe .ghost {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.07) 0 9%, transparent 9%),
    repeating-linear-gradient(180deg, transparent 0 30px, rgba(15, 23, 42, 0.05) 30px 39px);
}
/* The live-page snapshot behind the overlay. Absolutely positioned so it
   paints above the ghost but below the later-in-DOM veil/canvas/bands;
   height:auto keeps the page's own proportions — the frame's overflow crops
   any excess, the ghost shows through any shortfall. */
.heattab .pageframe img.shot { position: absolute; top: 0; left: 0; width: 100%; height: auto; }
.heattab .pageframe .shotveil { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.24); }
.heattab .pageframe canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.heattab .pageframe .noclicks {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.55); text-align: center; padding: 20px;
}
.heattab .sband {
  position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: flex-end;
  border-top: 1px dashed rgba(15, 23, 42, 0.22); padding: 3px 8px 0 8px;
}
.heattab .sband span {
  font-size: 10.5px; font-weight: 700; color: var(--ink);
  background: rgba(255, 255, 255, 0.85); border-radius: 5px; padding: 1px 7px;
}
.heattab .heatlegend { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--faint); margin-top: 10px; }
.heattab .heatlegend .grad { width: 150px; height: 8px; border-radius: 99px; }
.heattab .elrow { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 7px 0; border-top: 1px solid var(--line); }
.heattab .elrow:first-of-type { border-top: 0; padding-top: 2px; }
.heattab .elrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heattab .elrow .bar { width: 64px; height: 4px; border-radius: 99px; background: rgba(15, 23, 42, 0.08); flex: none; }
.heattab .elrow .bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.heattab .elrow .cnt { font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.heattab .reachrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); padding: 2px 0; }
.heattab .reachrow .lbl { width: 38px; flex: none; font-variant-numeric: tabular-nums; }
.heattab .reachrow .bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(15, 23, 42, 0.06); }
.heattab .reachrow .bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); opacity: 0.85; }
.heattab .reachrow .pct { width: 36px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }

/* collecting state: a miniature page with heat blobs fading in/out */
.heattab .heatwait { text-align: center; padding: 40px 24px 34px; }
.heattab .heatwait .mini {
  position: relative; width: 150px; height: 190px; margin: 0 auto 20px; overflow: hidden;
  border: 1px solid var(--line-dark); border-radius: 9px; background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0 16%, transparent 16%),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(15, 23, 42, 0.06) 18px 24px);
  background-color: #fff;
}
.heattab .heatwait .blob {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  filter: blur(11px); opacity: 0; animation: heatpulse 3.2s ease-in-out infinite;
}
@keyframes heatpulse {
  0%, 100% { opacity: 0; transform: scale(0.55); }
  50% { opacity: 0.75; transform: scale(1); }
}
.heattab .heatwait h3 { font-family: var(--heading); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; }
.heattab .heatwait p { max-width: 460px; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) {
  .heattab .heatwait .blob { animation: none; opacity: 0.5; }
}

/* KPI tiles (minusPHI's .tile — the heat side panel's stat cards) */
.heattab .tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.heattab .tile .tl { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.heattab .tile .tv { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.heattab .tile .ts { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

/* skeleton shimmer (loading state; keyframe renamed heat-shimmer so the
   global animation registry can't collide with a future re-theme) */
.heattab .skel-s { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; position: relative; background: #fff; height: 36px; }
.heattab .skel-s::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(15, 23, 42, 0.04) 50%, transparent 70%);
  animation: heat-shimmer 1.4s infinite; transform: translateX(-100%);
}
@keyframes heat-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .heattab .skel-s::after { animation: none; }
}

/* minusPHI defines .seg twice; this later (consent-tab) block wins for the
   shared properties in their cascade and is what the heat segments actually
   render with — ported in the same order so the result is identical:
   a padded pill group with a white, shadowed active button. */
.heattab .seg { display: inline-flex; background: #eef2f6; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; flex-wrap: wrap; }
.heattab .seg button {
  background: transparent; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: none;
}
.heattab .seg button:hover { background: transparent; color: var(--ink); }
.heattab .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14); }
.heattab .seg button.on:hover { background: #fff; }

/* mobile bits from minusPHI's mobile-shell block that touch the heat tab */
@media (max-width: 760px) {
  .heattab .tile { padding: 11px 13px; }
  .heattab .tile .tv { font-size: 21px; }
  /* 16px inputs: anything smaller makes iOS Safari zoom the page on focus. */
  .heattab select.pagesel { font-size: 16px; }
}

/* ==== glue for the AnvixaAI shell (NOT from minusPHI) ==== */

/* Shell cards are obsidian; inside the heat tab they take minusPHI's white
   card recipe (padding/margin already match the shell's). */
.heattab .card { background: #fff; border: 1px solid var(--line); border-radius: 12px; }

/* The shell dims every button on hover (opacity .88); minusPHI's segments
   don't. */
.heattab .seg button:hover, .heattab .seg button.on:hover { opacity: 1; }

/* Inline code chips (top-clicked selectors): minusPHI's global `code` rule,
   scoped — the shell's code chip is dark-on-dark. */
.heattab code {
  font-family: var(--mono); font-size: 12.5px; color: #334155; background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.05); padding: 1px 6px; border-radius: 5px;
}

/* graph.css (the pre-port heat skin) turns .heatwrap into a scroll box; in
   this port scrolling lives in .framescroll — undo the leaked properties. */
.heattab .heatwrap { max-height: none; overflow: visible; border: 0; border-radius: 0; background: transparent; }

/* The privacy footnote sits on the page background, not in a card — keep it
   readable on the obsidian shell (and it matches minusPHI's faint on light). */
.heattab > .tiny { color: var(--faint); }
