/* Hallmark · macrostructure: Ledger (report/app family, see design.md)
 * genre: modern-minimal · theme: Coral (design-system: design.md) · designed-as-app
 * enrichment: none — function and data carry the page
 * pre-emit critique: P5 H4 E4 S5 R5 V4
 *
 * DOM/JS contract: every id and class listing.js reads via getElementById /
 * querySelector, or assigns via className, is used here unchanged. This file
 * only restyles those exact selectors — see design.md "Implementation notes".
 */

html, body { overflow-x: clip; }
* , *::before, *::after { box-sizing: border-box; }

body.hm-report {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.hm-report a { color: inherit; }
body.hm-report ::selection { background: var(--color-accent); color: var(--color-accent-ink); }
body.hm-report .hidden { display: none !important; }

body.hm-report .page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 1.5rem) var(--space-3xl);
}

/* ─── Nav ────────────────────────────────────────────────────────────────── */

body.hm-report .navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin: 0 calc(-1 * clamp(1rem, 4vw, 1.5rem));
  padding: var(--space-md) clamp(1rem, 4vw, 1.5rem);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
  margin-bottom: var(--space-2xl);
}

body.hm-report .brand {
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--color-ink);
  white-space: nowrap;
}
body.hm-report .brand span { color: var(--color-ink-3); }

body.hm-report .nav-actions { display: flex; align-items: center; gap: var(--space-sm); }

body.hm-report .hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--color-ink-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
body.hm-report .hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  transition: transform var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}
body.hm-report .navbar.open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.hm-report .navbar.open .hamburger span:nth-child(2) { opacity: 0; }
body.hm-report .navbar.open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 40rem) {
  body.hm-report .nav-actions .btn { display: none; }
  body.hm-report .hamburger { display: flex; }
  body.hm-report .navbar.open .nav-actions {
    display: flex;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-paper);
    border-bottom: 1px solid var(--color-rule);
    padding: var(--space-sm) clamp(1rem, 4vw, 1.5rem) var(--space-md);
  }
  body.hm-report .navbar.open .nav-actions .btn { display: flex; width: 100%; }
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

body.hm-report .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.7em 1.4em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out),
              transform 100ms var(--ease-out);
}
body.hm-report .btn:active { transform: translateY(1px); }
body.hm-report .btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

body.hm-report .btn.primary {
  background: var(--color-ink);
  color: var(--color-paper);
  border-color: var(--color-ink);
}
body.hm-report .btn.primary:hover { background: var(--color-ink-hover); border-color: var(--color-ink-hover); }
body.hm-report .btn.primary:disabled { opacity: 0.6; cursor: default; }

body.hm-report .btn.ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-ink-3);
}
body.hm-report .btn.ghost:hover { border-color: var(--color-ink); }

/* ─── Loading / not-found states ────────────────────────────────────────── */

body.hm-report .listing-state {
  padding: var(--space-3xl) 0;
  text-align: center;
  color: var(--color-ink-2);
  font-size: var(--text-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

body.hm-report .listing-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

body.hm-report .type-badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: var(--radius-pill);
  font-family: var(--font-outlier);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  color: var(--color-ink-3);
  white-space: nowrap;
}

body.hm-report .listing-pitch {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}

body.hm-report .original-listing-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--color-rule-2);
}
body.hm-report .original-listing-link:hover { color: var(--color-ink); border-color: var(--color-ink); }

/* ─── Financial strip ────────────────────────────────────────────────────── */

body.hm-report .financial-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-2xs);
}

/* Plain label/value pairs — no boxed chip. The section border already
 * contains this content; a border-per-number would be a container in a
 * container. */
body.hm-report .financial-chip {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

body.hm-report .chip-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-ink-3);
}

body.hm-report .chip-value {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
}

/* ─── Scores strip ───────────────────────────────────────────────────────── */

body.hm-report .scores-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: var(--space-xl) 0;
}

body.hm-report .score-card {
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-top-width: 3px;
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

body.hm-report .score-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-xs); }

body.hm-report .score-number {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}
body.hm-report .score-denom { font-size: var(--text-md); font-weight: 500; opacity: 0.55; }

body.hm-report .score-bar-track { height: 4px; background: var(--color-rule); border-radius: 2px; overflow: hidden; margin-top: var(--space-2xs); }
body.hm-report .score-bar-fill { height: 100%; border-radius: 2px; transition: width var(--dur-long) var(--ease-out); }

body.hm-report .score-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-ink-3);
}

body.hm-report .score-rationale { margin: var(--space-2xs) 0 0; font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.55; }

@media (max-width: 40rem) {
  body.hm-report .scores-strip { grid-template-columns: 1fr; }
  body.hm-report .score-card { flex-direction: row; align-items: flex-start; gap: var(--space-md); }
}

/* ─── Insight sections ───────────────────────────────────────────────────── */

body.hm-report .insight-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
@media (max-width: 40rem) {
  body.hm-report .insight-sections { grid-template-columns: 1fr; }
}

body.hm-report .insight-section {
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
/* Sections whose content should read full-width regardless of the 2-col grid */
body.hm-report .insight-section:has(.playbook-steps),
body.hm-report .insight-section:has(.keyword-table),
body.hm-report .insight-section:has(.spark-block) {
  grid-column: 1 / -1;
}

/* Earning Potential — full-width, thin: label top-left like every other
 * section, numbers as a plain row underneath (no nested boxes). */
body.hm-report .insight-section:has(.financial-strip) {
  grid-column: 1 / -1;
  padding: var(--space-md) var(--space-lg);
}

body.hm-report .section-label {
  font-family: var(--font-outlier);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

body.hm-report .section-body { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.65; }

/* Competition bullets */
body.hm-report .bullet-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-xs); }
body.hm-report .bullet-list li { font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.55; padding-left: var(--space-md); position: relative; }
body.hm-report .bullet-list li::before { content: "—"; position: absolute; left: 0; color: var(--color-ink-3); }
body.hm-report .bullet-list li strong { color: var(--color-ink); font-weight: 600; }

/* Playbook stepper */
body.hm-report .playbook-steps { display: flex; flex-direction: column; }
body.hm-report .playbook-step { display: flex; gap: var(--space-md); align-items: flex-start; }
body.hm-report .step-indicator { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 26px; }
body.hm-report .step-number {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-accent); color: var(--color-accent-ink);
  font-family: var(--font-outlier); font-size: var(--text-xs); font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
body.hm-report .step-line { width: 1px; flex: 1; min-height: 12px; background: var(--color-rule-2); margin: var(--space-3xs) 0; }
body.hm-report .step-text { margin: var(--space-3xs) 0 var(--space-md); font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.55; }

/* Risk callout */
body.hm-report .risk-section { border-left: 3px solid var(--danger); background: var(--color-paper-2); }
body.hm-report .risk-section .section-label { color: var(--danger); }
body.hm-report .risk-section .section-body { color: var(--color-ink-2); }

/* Keywords */
body.hm-report .keywords-list { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
body.hm-report .keyword-pill {
  display: inline-block; padding: 0.2em 0.7em; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 500;
  background: var(--color-paper-2); border: 1px solid var(--color-rule); color: var(--color-ink-2);
}

/* Placeholders (locked gated preview) */
body.hm-report .placeholder-lines { display: flex; flex-direction: column; gap: var(--space-xs); margin-top: var(--space-2xs); }
body.hm-report .placeholder-line { height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--color-rule) 0%, var(--color-paper-2) 100%); }

/* ─── Search demand chart ────────────────────────────────────────────────── */

body.hm-report .spark-block { display: flex; flex-direction: column; gap: var(--space-2xs); }
body.hm-report .spark-head { display: flex; align-items: baseline; gap: var(--space-sm); flex-wrap: wrap; }
body.hm-report .spark-keyword { font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; color: var(--color-ink); }
body.hm-report .spark-volume { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--color-ink-2); }
body.hm-report .spark-svg { width: 100%; height: 90px; display: block; }
body.hm-report .spark-hit:hover { fill: var(--color-accent); fill-opacity: 0.15; }
body.hm-report .spark-months { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--color-ink-3); }
body.hm-report .keyword-chart-empty { margin: 0; height: 90px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: var(--text-sm); color: var(--color-ink-2); }

body.hm-report .keyword-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin-top: var(--space-sm); }
body.hm-report .keyword-table th {
  text-align: left; font-family: var(--font-outlier); font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-3);
  padding: var(--space-xs) var(--space-xs); border-bottom: 1px solid var(--color-rule);
}
body.hm-report .keyword-table td { padding: var(--space-xs); border-bottom: 1px solid var(--color-rule); color: var(--color-ink); }
body.hm-report .keyword-table tr:last-child td { border-bottom: none; }
body.hm-report .keyword-table td.num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; color: var(--color-ink-2); }
body.hm-report .keyword-table tbody tr.clickable { cursor: pointer; transition: background var(--dur-short) var(--ease-out); }
body.hm-report .keyword-table tbody tr.clickable:hover,
body.hm-report .keyword-table tbody tr.selected { background: var(--color-paper-2); }

body.hm-report .trend-badge { display: inline-block; padding: 0.15em 0.6em; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; }
body.hm-report .trend-rising    { background: color-mix(in oklch, var(--success) 15%, var(--color-paper)); color: var(--success); }
body.hm-report .trend-declining { background: color-mix(in oklch, var(--danger) 15%, var(--color-paper)); color: var(--danger); }
body.hm-report .trend-flat      { background: var(--color-paper-2); color: var(--color-ink-2); }
body.hm-report .trend-new       { background: color-mix(in oklch, var(--color-accent) 15%, var(--color-paper)); color: var(--color-accent); }

/* ─── Gated wrapper / paywall ────────────────────────────────────────────── */

body.hm-report .gated-wrapper { position: relative; }
body.hm-report .gated-peek { position: relative; }
body.hm-report .gated-peek.locked-preview { height: 140px; overflow: hidden; }
body.hm-report .gated-sections.locked { filter: blur(5px); pointer-events: none; user-select: none; }

body.hm-report .table-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 240px;
  background: linear-gradient(to bottom, transparent 0%, var(--color-paper) 75%);
  pointer-events: none;
}
body.hm-report .gated-peek .table-fade { height: 100%; }

/* Pull the gate card up to overlap the faded/blurred preview above it —
 * geometry kept identical to the pre-redesign values so the overlap still lands right. */
body.hm-report #signup-gate,
body.hm-report #listing-paywall {
  position: relative;
  z-index: 2;
  margin-top: -100px;
}
body.hm-report #database-paywall {
  position: relative;
  z-index: 2;
  margin-top: -60px;
}

body.hm-report .paywall-card {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  width: 100%;
  margin: var(--space-sm) 0 0;
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
}
body.hm-report .paywall-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
body.hm-report .paywall-right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-sm); flex-shrink: 0; }

body.hm-report .paywall-headline {
  margin: 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600;
  letter-spacing: -0.01em; color: var(--color-ink);
}
body.hm-report .paywall-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
body.hm-report .paywall-features li { display: flex; align-items: flex-start; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.45; }
body.hm-report .paywall-features li::before { content: "✓"; font-weight: 600; color: var(--success); flex-shrink: 0; }

body.hm-report .unlock-auth { width: 280px; }

@media (max-width: 40rem) {
  body.hm-report .paywall-card { flex-direction: column; align-items: stretch; gap: var(--space-md); padding: var(--space-md); }
  body.hm-report .paywall-right { align-items: stretch; width: 100%; }
  body.hm-report .unlock-auth { width: 100%; }
}

body.hm-report .start-card-fields { display: flex; flex-direction: column; gap: var(--space-sm); }
body.hm-report .start-card-headline { margin: 0 0 var(--space-3xs); font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; color: var(--color-ink); }
body.hm-report .start-card-sub { margin: 0 0 var(--space-md); font-size: var(--text-sm); color: var(--color-ink-2); }
body.hm-report .start-sent { display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; }

body.hm-report .otp-input {
  width: 100%; border: 1px solid var(--color-rule-2); border-radius: var(--radius-sm);
  padding: 0.7em 0.85em; font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--color-ink); background: var(--color-surface); outline: none; min-height: 44px;
  transition: border-color var(--dur-short) var(--ease-out);
}
body.hm-report .otp-input:focus-visible { border-color: var(--color-focus); outline: 2px solid var(--color-focus); outline-offset: 1px; }
body.hm-report .otp-input::placeholder { color: var(--color-ink-3); }

body.hm-report .auth-submit { width: 100%; justify-content: center; }

body.hm-report .auth-error {
  font-size: var(--text-sm); color: var(--danger); background: var(--color-paper-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm); padding: var(--space-xs) var(--space-sm); margin: 0;
}

body.hm-report .auth-divider { display: flex; align-items: center; gap: var(--space-sm); margin: var(--space-md) 0; color: var(--color-ink-3); font-size: var(--text-xs); }
body.hm-report .auth-divider::before,
body.hm-report .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-rule); }

body.hm-report .btn-google {
  display: flex; align-items: center; justify-content: center; gap: var(--space-sm); width: 100%;
  padding: 0.65em 0.9em; min-height: 44px; background: var(--color-surface);
  border: 1px solid var(--color-rule-2); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink);
  cursor: pointer; transition: border-color var(--dur-short) var(--ease-out);
}
body.hm-report .btn-google:hover { border-color: var(--color-ink); }
body.hm-report .btn-google:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ─── Idea database teaser ───────────────────────────────────────────────── */

body.hm-report .idea-db-section { margin-top: var(--space-3xl); padding-top: var(--space-xl); border-top: 1px solid var(--color-rule); }
body.hm-report .idea-db-section__head { max-width: 38rem; margin-bottom: var(--space-lg); }
body.hm-report .idea-db-section__head h2 {
  margin: 0 0 var(--space-xs); font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 600; letter-spacing: -0.015em; color: var(--color-ink);
}
body.hm-report .idea-db-section__head p { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.6; }

body.hm-report .table-wrap { position: relative; }

body.hm-report .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
body.hm-report .card-grid.locked { filter: blur(5px); pointer-events: none; user-select: none; }
@media (max-width: 48rem) { body.hm-report .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { body.hm-report .card-grid { grid-template-columns: 1fr; } }

body.hm-report .idea-card {
  display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-md);
  background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: border-color var(--dur-short) var(--ease-out);
}
body.hm-report .idea-card:hover { border-color: var(--color-ink-3); }
body.hm-report .idea-card-head { display: flex; align-items: center; gap: var(--space-2xs); }
body.hm-report .idea-card-title { margin: 0; font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; line-height: 1.35; color: var(--color-ink); overflow-wrap: anywhere; min-width: 0; }
body.hm-report .card-spark .spark-svg { height: 48px; }

/* ─── Footer (Ft2) ───────────────────────────────────────────────────────── */

body.hm-report .hm-report-footer { margin-top: var(--space-3xl); border-top: 1px solid var(--color-rule); padding: var(--space-lg) 0; }
body.hm-report .hm-report-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-sm) var(--space-lg); font-size: var(--text-xs); color: var(--color-ink-3);
}
body.hm-report .hm-report-footer__brand { font-family: var(--font-outlier); color: var(--color-ink-2); }
body.hm-report .hm-report-footer__links { display: flex; gap: var(--space-md); }
body.hm-report .hm-report-footer__links a { text-decoration: none; color: var(--color-ink-3); }
body.hm-report .hm-report-footer__links a:hover { color: var(--color-ink); }
body.hm-report .hm-report-footer__note { margin-left: auto; }
@media (max-width: 40rem) {
  body.hm-report .hm-report-footer__inner { justify-content: flex-start; }
  body.hm-report .hm-report-footer__note { margin-left: 0; width: 100%; }
}
