/**
 * Styling for the shared render.js components (stat tiles, ageing bars,
 * customer cards, the locked-plan teaser) — used by the marketing site's
 * free health check.
 *
 * These classes have always existed in style.css, but index.html only ever
 * linked tw.css. tw.css already carries every var(--…) token this file
 * needs (confirmed against its :root block) — it just never got the
 * component rules themselves, because the Tailwind migration swept static
 * page markup, not the dynamically-rendered report output. Without this,
 * the free result — the whole PLG growth loop, per MVP-PLAN.md — rendered
 * as an unstyled wall of text instead of the screenshot-shareable card
 * layout the app itself uses.
 *
 * Everything here is scoped under #result — render.js's classes (.btn,
 * .card, .tag, .notice…) share names with tw.css's own compiled marketing
 * classes, and an unscoped copy of the app's rules fought tw.css for every
 * button on the page, not just inside the report: it silently dropped the
 * topbar's mobile 44px tap-target minimum site-wide. #result is exactly
 * the container index.html renders every render.js output into (the free
 * result, the column mapper, the error state) — see index.html.
 */

#result .stack > * + * { margin-top: 10px; }
#result .row  { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#result .spread { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
#result .hide { display: none !important; }

#result .eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  margin: 34px 0 12px; display: flex; align-items: center; gap: 9px;
}
#result .eyebrow::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent-bg), transparent);
}
#result .eyebrow .count {
  background: var(--surface-2); color: var(--ink-2);
  padding: 1px 8px; border-radius: 20px; letter-spacing: 0; font-size: 12px;
}

#result .muted { color: var(--ink-2); }
#result .faint { color: var(--ink-3); }
#result .small { font-size: 13px; }
#result .tiny  { font-size: 12px; }

#result .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  box-shadow: var(--shadow);
}
#result .card.pad-lg { padding: 22px; }
#result .card.flat { box-shadow: none; }

#result .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  font: 600 14.5px/1 var(--sans); cursor: pointer;
  transition: border-color .13s, background .13s, color .13s;
  text-decoration: none; white-space: nowrap;
}
#result .btn:hover { border-color: var(--ink-3); }
#result .btn:active { transform: translateY(.5px); }
#result .btn:disabled { opacity: .45; cursor: not-allowed; }
#result .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-in); }
#result .btn.primary:hover { filter: brightness(1.08); border-color: var(--accent); }
#result .btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
#result .btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
#result .btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
#result .btn.block { width: 100%; }

#result label.field { display: block; }
#result label.field > span {
  display: block; font-size: 12.5px; font-weight: 560;
  color: var(--ink-2); margin-bottom: 5px;
}

#result .tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
#result .tag.red   { background: var(--red-bg);   color: var(--red); }
#result .tag.amber { background: var(--amber-bg); color: var(--amber); }
#result .tag.green { background: var(--green-bg); color: var(--green); }
#result .tag.accent{ background: var(--accent-bg);color: var(--accent); }

#result .num, #result .amt, #result .stat-value { font-variant-numeric: tabular-nums; }

#result .stats {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}
#result .stat { background: var(--surface); padding: 15px 16px 16px; }
#result .stat-key {
  font-size: 11.5px; font-weight: 580; letter-spacing: .045em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px;
}
#result .stat-value { font-size: 25px; font-weight: 660; letter-spacing: -.024em; line-height: 1.1; }
#result .stat-note  { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.4; }
#result .stat-value.green { color: var(--green); }
#result .stat-value.red   { color: var(--red); }

#result .age-row {
  display: grid; grid-template-columns: 62px 1fr 84px;
  gap: 12px; align-items: center; padding: 6px 0; font-size: 13.5px;
}
#result .age-track { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
#result .age-fill  { height: 100%; border-radius: 5px; background: var(--accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }
#result .age-fill.amber { background: var(--amber); }
#result .age-fill.red   { background: var(--red); }
#result .age-row .amt { text-align: right; font-weight: 560; }

#result .cust {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px; transition: opacity .2s;
}
#result .cust.is-call { border-left-color: var(--red); }
#result .cust.is-msg  { border-left-color: var(--amber); }
#result .cust.is-wait { border-left-color: var(--green); }

#result .cust-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
#result .cust-name { font-weight: 620; font-size: 15.5px; letter-spacing: -.005em; }
#result .cust-amt  { font-weight: 660; font-size: 16px; white-space: nowrap; }
#result .cust-line { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
#result .cust-line b { color: var(--ink); font-weight: 620; }
#result .cust-bills { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
#result .cust-bills .bill { display: inline-block; white-space: nowrap; margin-right: 16px; }
#result .cust-bills .bill:last-child { margin-right: 0; }
#result .cust-bills .bill-late { color: var(--red); }

#result .alert {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--red-bg); color: var(--red);
  padding: 10px 12px; border-radius: var(--radius-s);
  font-size: 13px; margin-top: 11px; line-height: 1.45;
}
#result .alert.amber { background: var(--amber-bg); color: var(--amber); }
#result .alert.green { background: var(--green-bg); color: var(--green); }

#result .msg-box {
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-s); padding: 12px 13px;
  font: 13.5px/1.6 var(--sans); color: var(--ink-2); margin: 11px 0 0;
}
#result .cust-actions { margin-top: 11px; }
#result .cust-actions input[type=tel] { width: 165px; }

#result .locked {
  position: relative; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; background: var(--surface);
}
#result .locked-blur { filter: blur(6px); opacity: .5; pointer-events: none; user-select: none; padding: 16px; }
#result .locked-over {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 24px; background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(2px);
}

#result .notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-s);
  font-size: 13.5px; line-height: 1.5;
  background: var(--amber-bg); color: var(--amber);
}
#result .notice.err  { background: var(--red-bg);   color: var(--red); }
#result .notice.ok   { background: var(--green-bg); color: var(--green); }
#result .notice.info { background: var(--accent-bg);color: var(--accent); }
#result .notice .hint { display: block; opacity: .85; margin-top: 3px; font-size: 12.5px; }

#result .spark { display: block; width: 100%; height: 42px; overflow: visible; }

#result .fade-in { animation: fade .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } }

#result .spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .65s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #result .fade-in, #result .spinner { animation-duration: .001ms !important; }
}

/* Same mobile tap-target minimum tw.css already gives every other button
   on this page — the free result is worked with a thumb just like the app. */
@media (max-width: 640px) {
  #result .btn, #result .btn.sm { min-height: 44px; }
}
