/*
 * theme.css — GBP Audit by Integration Lab.
 *
 * Direction: a diagnostic report, like a Lighthouse score crossed with a lab
 * result. Cool green-grey paper, near-black green ink, one deep "pass" green
 * as the brand, and a lime marker used once per page under a headline word.
 * Dark mode is a night-shift lab: deep green-black with a mint accent.
 */

:root {
  --canvas: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #e8ece7;
  --border: #d5dbd4;
  --border-strong: #a7b2a7;
  --ink: #0e1a16;
  --muted: #56635d;
  --accent: #0b6b4f;
  --accent-hover: #085a42;
  --accent-ink: #ffffff;
  --accent-text: #0a6247;
  --accent-strong: #064a36;
  --accent-soft: #d8efe5;
  --accent-border: #9fd3be;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #dcefe2;
  --success-strong: #126a33;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f6e7d6;
  --warning-strong: #8f4207;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #f6dfdd;
  --danger-strong: #a11818;
  --chart-1: #0b6b4f;
  --chart-2: #b45309;
  --chart-3: #3f5bd1;
  --chart-4: #8a3a8f;
  --chart-5: #0e7490;
  --chart-6: #6b7d10;

  --x-signal: #b9e84a;
  --x-band: #0e1a16;
  --x-band-ink: #eaf2ee;
  --x-band-muted: #9fb2a9;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 800;
  --display-tracking: -0.035em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 10px;
  --radius-input: 10px;
  --radius-card: 16px;
  --shadow-card: none;
  --shadow-btn: none;
  --card-pad: 1.5rem;
  --btn-weight: 600;
}

html[data-theme="dark"] {
  --canvas: #0b1210;
  --surface: #121c19;
  --surface-2: #19251f;
  --border: #25342e;
  --border-strong: #3c4e46;
  --ink: #e8f0ec;
  --muted: #95a59e;
  --accent: #3dd6a0;
  --accent-hover: #5fe2b4;
  --accent-ink: #04140e;
  --accent-text: #5adcae;
  --accent-strong: #8eebc9;
  --accent-soft: #123528;
  --accent-border: #1f5a43;
  --success: #22a35c;
  --success-ink: #04140e;
  --success-soft: #133222;
  --success-strong: #6fd39a;
  --warning: #e08a2c;
  --warning-ink: #1a0e02;
  --warning-soft: #3a2614;
  --warning-strong: #f0b06a;
  --danger: #e2574c;
  --danger-ink: #1c0504;
  --danger-soft: #3b1917;
  --danger-strong: #f08f86;
  --chart-1: #3dd6a0;
  --chart-2: #e08a2c;
  --chart-3: #8ea2f2;
  --chart-4: #d08ad4;
  --chart-5: #4cc3dc;
  --chart-6: #b7c95a;

  --x-signal: #7fb51f;
  --x-band: #0f2a20;
  --x-band-ink: #e8f0ec;
  --x-band-muted: #9fb8ad;
}

/* app.css — GBP Audit's own pieces: the audit bar, the score dial, the report rows, the listing data, the review sentiment, the admin costs. Tokens only. */

body { font-family: var(--font-body); }

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* The lime marker under one headline word per page. */
.mark {
  text-decoration-line: underline;
  text-decoration-color: var(--x-signal);
  text-decoration-thickness: 0.16em;
  text-underline-offset: 0.06em;
  text-decoration-skip-ink: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}

/* The sprite's star is an outline; ratings are drawn filled. */
.star-svg path { fill: currentColor; stroke: none; }

/* ---- Hero ground: a faint dot grid that fades out ---- */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 12%, transparent) 1px, transparent 1px);
  background-size: 1.5rem 1.5rem;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

/* ---- The audit bar: one device, three slots ---- */
.audit-bar {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 20px 40px -24px color-mix(in srgb, var(--ink) 45%, transparent);
}
.audit-bar:focus-within { border-color: var(--accent); }
@media (min-width: 768px) {
  .audit-bar { grid-template-columns: minmax(0, 1fr) 14rem auto; align-items: center; }
  .audit-slot + .audit-slot { border-left: 1px solid var(--border); }
}
.audit-slot { display: flex; align-items: center; gap: 0.5rem; min-width: 0; padding-left: 0.75rem; color: var(--muted); }
.bar-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 3rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.0625rem;
  outline: none;
}
.bar-input::placeholder { color: var(--muted); opacity: 0.85; }
.audit-bar .btn { height: 3rem; }

/* ---- The ledger of checks on the landing page ---- */
.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.ledger-head { padding-top: 2rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--ink); }
.ledger-head:first-child { padding-top: 0; }

/* ---- Dark statement band ---- */
.band-dark { background: var(--x-band); color: var(--x-band-ink); }
.band-muted { color: var(--x-band-muted); }
.band-card {
  border: 1px solid color-mix(in srgb, var(--x-band-ink) 16%, transparent);
  background: color-mix(in srgb, var(--x-band-ink) 5%, transparent);
  border-radius: var(--radius-card);
}
.band-rule { border-top: 1px solid color-mix(in srgb, var(--x-band-ink) 14%, transparent); }
.band-gain {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  min-width: 3.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--x-signal);
  color: var(--x-band);
  font-weight: 600;
}

/* ---- The score dial: one conic ring, swept in once ---- */
@property --pct {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@keyframes dial-sweep { from { --pct: 0; } }
.dial {
  --dial-color: var(--accent);
  --dial-hole: var(--surface);
  position: relative;
  display: grid;
  place-items: center;
  width: 11.5rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: conic-gradient(var(--dial-color) calc(var(--pct) * 1%), var(--surface-2) 0);
  animation: dial-sweep 1.2s var(--ease-out, ease-out) both;
}
.dial::before {
  content: "";
  position: absolute;
  inset: 0.85rem;
  border-radius: 999px;
  background: var(--dial-hole);
}
.dial > * { position: relative; }
.dial.tone-good { --dial-color: var(--success); }
.dial.tone-ok { --dial-color: var(--warning); }
.dial.tone-bad { --dial-color: var(--danger); }
.dial-band { --dial-hole: var(--x-band); background: conic-gradient(var(--x-signal) calc(var(--pct) * 1%), color-mix(in srgb, var(--x-band-ink) 14%, transparent) 0); }
html.reduced-motion .dial { animation: none; }

/* ---- Report rows ---- */
.fix-gain {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.125rem;
  font-weight: 500;
}
.check-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.5rem; background: var(--surface-2); border-top: 1px solid var(--border); }
.section-row:first-child { border-top: 0; }
.fix-note { border-left: 3px solid var(--accent); padding-left: 0.875rem; }

/* ---- Review sentiment ---- */
.senti-bar {
  display: flex;
  gap: 2px;
  height: 0.875rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.senti-bar > span { display: block; flex: 1 1 0; min-width: 0.25rem; height: 100%; }
.senti-pos { background: var(--success); }
.senti-neu { background: var(--border-strong); }
.senti-mix { background: var(--warning); }
.senti-neg { background: var(--danger); }
.senti-dot { display: inline-block; flex-shrink: 0; width: 0.625rem; height: 0.625rem; border-radius: 999px; }
.senti-summary { border-left: 3px solid var(--accent); padding-left: 1rem; }
.theme-row { padding-block: 0.75rem; border-top: 1px solid var(--border); }
.theme-row:first-child { border-top: 0; padding-top: 0; }
.draft-box { padding: 1rem; border-radius: 12px; background: var(--surface-2); }

/* ---- Listing data ---- */
@media (min-width: 768px) { .data-list { columns: 2; column-gap: 2.5rem; } }
.data-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.75rem;
  border-top: 1px solid var(--border);
  break-inside: avoid;
}
.data-row dd { overflow-wrap: anywhere; }
@media (max-width: 30rem) { .data-row { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; } }

/* IDs: label and hint, then the value and its copy button. */
.id-list { display: grid; }
@media (min-width: 768px) { .id-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }
.id-row {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
  padding-block: 0.875rem;
  border-top: 1px solid var(--border);
}

/* Month-by-month counts when they are too small for a chart axis. */
.month-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.375rem; }
@media (min-width: 768px) { .month-strip { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.month-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  min-width: 0;
  padding: 0.5rem 0.25rem;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.month-cell.is-on { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.month-label { font-size: 0.75rem; white-space: nowrap; }

.hours-row { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.6rem; border-top: 1px solid var(--border); }
.hours-row:first-child { border-top: 0; }
.desc-quote { border-left: 3px solid var(--border-strong); padding-left: 1rem; line-height: 1.65; }
.review-row { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.stat-cell { padding-top: 1rem; border-top: 1px solid var(--border); min-width: 0; }
.attr-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.875rem;
  line-height: 1.25;
}
.attr-chip.is-off { border-color: var(--border); background: transparent; color: var(--muted); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.25;
}

/* ---- Admin: a run's cost and its breakdown ---- */
.cost-details summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.cost-details summary::-webkit-details-marker { display: none; }
.cost-lines { display: grid; gap: 0.25rem; margin-top: 0.5rem; font-size: 0.75rem; color: var(--muted); }
.cost-lines li { display: flex; justify-content: space-between; gap: 1rem; }

/* ---- Locked report: a blurred placeholder under the lead form ---- */
.locked { display: grid; }
.locked > * { grid-area: 1 / 1; }
.locked-preview {
  min-height: 52rem;
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
}
.lead-card {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(100%, 32rem);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--ink) 55%, transparent);
}

/* ---- Progress steps ---- */
.step { display: flex; align-items: center; gap: 0.75rem; padding-block: 0.6rem; color: var(--muted); }
.step.is-done { color: var(--ink); }
.step.is-current { color: var(--ink); font-weight: 600; }
.step-dot { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; flex-shrink: 0; border-radius: 999px; border: 1px solid var(--border-strong); }
.step.is-done .step-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.is-current .step-dot { border-color: var(--accent); color: var(--accent-text); }
