/* Free GTM tools: gtm-health-check.html and icp-builder.html. Tokens follow DESIGN.md. */
.gtm-page {
  --gtm-ink: #0F1419;
  --gtm-slate: #475569;
  --gtm-muted: #64748B;
  --gtm-line: #E2E8F0;
  --gtm-surface: #FFFFFF;
  --gtm-canvas: #FAFAFA;
  --gtm-accent: #0E6BA8;
  --gtm-accent-dark: #0B5786;
  --gtm-accent-soft: rgba(14, 107, 168, 0.08);
  --gtm-error: #B42318;
  --gtm-ok: #059669;
  --gtm-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--gtm-ink);
}

.gtm-page *, .gtm-page *::before, .gtm-page *::after { box-sizing: border-box; }
.gtm-wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.gtm-hero { background: #F3F3F5; border-bottom: 1px solid var(--gtm-line); padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem); }
.gtm-eyebrow { font-family: var(--gtm-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gtm-accent); margin: 0 0 0.75rem; }
.gtm-hero h1 { font-size: clamp(2.1rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 1rem; }
.gtm-lede { font-size: 1.125rem; line-height: 1.6; color: var(--gtm-slate); max-width: 62ch; margin: 0; }
.gtm-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1.25rem; padding: 0; list-style: none; font-family: var(--gtm-mono); font-size: 0.8125rem; color: var(--gtm-slate); }
.gtm-meta li::before { content: '\2713'; color: var(--gtm-accent); margin-right: 0.35rem; }

/* Layout */
.gtm-main { padding: 2rem 0 4rem; background: var(--gtm-canvas); }
.gtm-card { background: var(--gtm-surface); border: 1px solid var(--gtm-line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.25rem; }
.gtm-card-head { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1.25rem; }
.gtm-step { font-family: var(--gtm-mono); font-size: 0.8125rem; color: var(--gtm-accent); font-weight: 500; }
.gtm-card h2 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.gtm-card-intro { color: var(--gtm-slate); margin: -0.5rem 0 1.25rem; line-height: 1.6; }

/* Questions */
.gtm-q { padding: 1rem 0; border-top: 1px solid var(--gtm-line); }
.gtm-qs > .gtm-q:first-child { border-top: 0; padding-top: 0; }
.gtm-q-label { display: block; font-weight: 600; font-size: 1.0625rem; line-height: 1.4; margin-bottom: 0.25rem; }
.gtm-q-help { display: block; color: var(--gtm-muted); font-size: 0.9375rem; margin-bottom: 0.75rem; }
.gtm-q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.gtm-q legend { padding: 0; }
.gtm-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; }
.gtm-chip { position: relative; display: inline-flex; }
.gtm-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.gtm-chip > span { display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0.95rem; border: 1px solid var(--gtm-line); border-radius: 10px; background: var(--gtm-surface); color: var(--gtm-ink); font-size: 0.9375rem; line-height: 1.3; cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease; }
.gtm-chip > span:hover { border-color: rgba(14, 107, 168, 0.45); }
.gtm-chip input:checked + span { border-color: var(--gtm-accent); background: var(--gtm-accent-soft); color: var(--gtm-accent-dark); font-weight: 600; }
.gtm-chip input:focus-visible + span { outline: 2px solid var(--gtm-accent); outline-offset: 2px; }
.gtm-q.is-missing { box-shadow: inset 3px 0 0 var(--gtm-error); padding-left: 12px; }
.gtm-q.is-missing .gtm-q-label::after { content: ' *'; color: var(--gtm-error); }

.gtm-num { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 0.625rem; }
.gtm-num-field { display: inline-flex; align-items: center; border: 1px solid var(--gtm-line); border-radius: 10px; background: var(--gtm-surface); overflow: hidden; }
.gtm-num-field:focus-within { border-color: var(--gtm-accent); box-shadow: 0 0 0 3px rgba(14, 107, 168, 0.15); }
.gtm-num-field input { width: 7.5rem; min-height: 44px; border: 0; padding: 0.5rem 0.75rem; font-size: 1rem; font-family: var(--gtm-mono); background: transparent; color: var(--gtm-ink); outline: none; }
.gtm-num-unit { padding: 0 0.85rem; color: var(--gtm-muted); font-family: var(--gtm-mono); font-size: 0.875rem; border-left: 1px solid var(--gtm-line); align-self: stretch; display: inline-flex; align-items: center; background: #F8FAFC; }
.gtm-check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; color: var(--gtm-slate); font-size: 0.9375rem; cursor: pointer; }
.gtm-check input { width: 18px; height: 18px; accent-color: var(--gtm-accent); }

/* Text fields */
.gtm-field { display: block; margin-bottom: 1rem; }
.gtm-field-label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.375rem; }
.gtm-field-label .gtm-req, .gtm-q-label .gtm-req { color: var(--gtm-error); }
.gtm-optional { font-weight: 400; color: var(--gtm-muted); font-size: 0.875em; }
.gtm-mt { margin-top: 1.25rem; }
.gtm-field-hint { display: block; color: var(--gtm-muted); font-size: 0.875rem; margin-top: 0.375rem; }
.gtm-input, .gtm-textarea, .gtm-select { width: 100%; min-height: 44px; border: 1px solid var(--gtm-line); border-radius: 10px; padding: 0.625rem 0.875rem; font-size: 1rem; font-family: inherit; color: var(--gtm-ink); background: var(--gtm-surface); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.gtm-textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.gtm-input:focus, .gtm-textarea:focus, .gtm-select:focus { outline: none; border-color: var(--gtm-accent); box-shadow: 0 0 0 3px rgba(14, 107, 168, 0.15); }
.gtm-field.is-invalid .gtm-input, .gtm-field.is-invalid .gtm-textarea, .gtm-field.is-invalid .gtm-select { border-color: var(--gtm-error); }
.gtm-field-error { display: none; color: var(--gtm-error); font-size: 0.875rem; margin-top: 0.375rem; }
.gtm-field.is-invalid .gtm-field-error { display: block; }
.gtm-grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .gtm-grid-2 { grid-template-columns: 1fr 1fr; } }
.gtm-hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.gtm-customer { border: 1px solid var(--gtm-line); border-radius: 12px; padding: 1rem 1rem 0.25rem; margin-bottom: 0.75rem; background: #FCFCFD; }
.gtm-customer.is-missing-row { border-color: var(--gtm-error); box-shadow: inset 3px 0 0 var(--gtm-error); }
.gtm-customer-tag { font-family: var(--gtm-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gtm-muted); margin-bottom: 0.625rem; }

/* Buttons */
.gtm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0.75rem 1.5rem; border-radius: 10px; border: 1px solid var(--gtm-accent); background: var(--gtm-accent); color: #fff; font-weight: 600; font-size: 1rem; font-family: inherit; cursor: pointer; text-decoration: none; transition: background-color 0.2s ease, transform 0.1s ease; }
.gtm-btn:hover { background: var(--gtm-accent-dark); border-color: var(--gtm-accent-dark); color: #fff; }
.gtm-btn:active { transform: translateY(1px); }
.gtm-btn:focus-visible { outline: 2px solid var(--gtm-accent); outline-offset: 3px; }
.gtm-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.gtm-btn-ghost { background: var(--gtm-surface); color: var(--gtm-ink); border-color: var(--gtm-line); }
.gtm-btn-ghost:hover { background: #F8FAFC; color: var(--gtm-ink); border-color: #CBD5E1; }
.gtm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }
@media (max-width: 480px) { .gtm-actions .gtm-btn { width: 100%; } }

.gtm-submit-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.gtm-progress { flex: 1 1 220px; min-width: 200px; }
.gtm-progress-text { font-family: var(--gtm-mono); font-size: 0.8125rem; color: var(--gtm-slate); margin-bottom: 0.375rem; }
.gtm-progress-track { height: 6px; border-radius: 999px; background: var(--gtm-line); overflow: hidden; }
.gtm-progress-fill { height: 100%; width: 0; background: var(--gtm-accent); transition: width 0.3s ease; }
.gtm-form-error { color: var(--gtm-error); font-size: 0.9375rem; margin: 0.75rem 0 0; }

/* Results */
.gtm-result-top { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 720px) { .gtm-result-top { grid-template-columns: auto 1fr; gap: 2.5rem; } }
.gtm-score { font-family: var(--gtm-mono); font-variant-numeric: tabular-nums; line-height: 1; }
.gtm-score-num { font-size: clamp(3.5rem, 10vw, 4.75rem); font-weight: 500; letter-spacing: -0.04em; }
.gtm-score-of { font-size: 1.25rem; color: var(--gtm-muted); margin-left: 0.25rem; }
.gtm-band { display: inline-block; margin-top: 0.75rem; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.875rem; font-weight: 600; background: var(--gtm-accent-soft); color: var(--gtm-accent-dark); }
.gtm-bars { display: grid; gap: 0.875rem; }
.gtm-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; gap: 0.25rem 0.75rem; align-items: center; }
.gtm-bar-label { font-size: 0.9375rem; color: var(--gtm-slate); grid-column: 1 / -1; }
.gtm-bar-track { height: 8px; border-radius: 999px; background: var(--gtm-line); overflow: hidden; }
.gtm-bar-fill { height: 100%; border-radius: 999px; background: var(--gtm-accent); }
.gtm-bar-num { font-family: var(--gtm-mono); font-size: 0.875rem; text-align: right; font-variant-numeric: tabular-nums; }

.gtm-subhead { font-size: 1.125rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.gtm-leaks { display: grid; gap: 0.75rem; }
.gtm-leak { border: 1px solid var(--gtm-line); border-radius: 12px; padding: 1rem 1.125rem; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.875rem; }
.gtm-leak-n { font-family: var(--gtm-mono); font-size: 0.875rem; color: var(--gtm-accent); padding-top: 0.15rem; grid-row: span 4; }
.gtm-leak-q { font-weight: 600; line-height: 1.4; }
.gtm-leak-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.75rem; margin: 0.375rem 0 0; font-size: 0.9375rem; }
.gtm-leak-dl dt { font-family: var(--gtm-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gtm-muted); padding-top: 0.2rem; }
.gtm-leak-dl dd { margin: 0; color: var(--gtm-ink); }
.gtm-leak-finding { color: var(--gtm-slate); margin: 0.375rem 0 0; line-height: 1.55; font-size: 0.9375rem; }
@media (max-width: 480px) { .gtm-leak { grid-template-columns: 1fr; } .gtm-leak-n { grid-row: auto; } }
.gtm-leak-link { font-size: 0.9375rem; color: var(--gtm-accent); text-decoration: underline; text-underline-offset: 3px; justify-self: start; }
.gtm-leak-link:hover { color: var(--gtm-accent-dark); }
.gtm-list { margin: 0; padding-left: 1.1rem; color: var(--gtm-slate); line-height: 1.6; }
.gtm-list li { margin-bottom: 0.25rem; }

/* AI report */
.gtm-status { display: flex; align-items: center; gap: 0.625rem; font-family: var(--gtm-mono); font-size: 0.875rem; color: var(--gtm-slate); margin: 1.25rem 0 1rem; }
.gtm-dots { display: inline-flex; gap: 4px; }
.gtm-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gtm-accent); animation: gtm-pulse 1.2s ease-in-out infinite; }
.gtm-dots i:nth-child(2) { animation-delay: 0.15s; }
.gtm-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes gtm-pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.gtm-report { font-size: 1.0625rem; line-height: 1.65; color: var(--gtm-ink); max-width: 72ch; margin-top: 1.25rem; }
.gtm-report h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; margin: 1.75rem 0 0.5rem; padding-top: 1.25rem; border-top: 1px solid var(--gtm-line); }
.gtm-report h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.gtm-report h4 { font-size: 1.0625rem; font-weight: 600; margin: 1.25rem 0 0.375rem; }
.gtm-report p { margin: 0 0 0.75rem; }
.gtm-report ol, .gtm-report ul { margin: 0 0 0.875rem; padding-left: 1.35rem; }
.gtm-report ol { list-style: decimal; }
.gtm-report ul { list-style: disc; }
.gtm-report li { margin-bottom: 0.375rem; }
.gtm-report code { font-family: var(--gtm-mono); font-size: 0.9em; background: #F1F5F9; padding: 0.05rem 0.3rem; border-radius: 4px; }
.gtm-track { background: #F8FAFC; border: 1px solid var(--gtm-line); border-radius: 10px; padding: 0.625rem 0.875rem; font-size: 0.9875rem; }
.gtm-track-label { font-family: var(--gtm-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gtm-accent); margin-right: 0.375rem; }
.gtm-report.is-streaming > :last-child::after { content: ''; display: inline-block; width: 0.5em; height: 1.05em; margin-left: 2px; vertical-align: text-bottom; background: var(--gtm-accent); opacity: 0.6; animation: gtm-pulse 1s steps(2, start) infinite; }
.gtm-note { font-size: 0.875rem; color: var(--gtm-muted); line-height: 1.55; margin-top: 1rem; }
.gtm-note a { color: var(--gtm-accent); text-decoration: underline; text-underline-offset: 2px; }
.gtm-alert { border: 1px solid #FECDCA; background: #FEF3F2; color: var(--gtm-error); border-radius: 10px; padding: 0.75rem 1rem; margin: 0.75rem 0 0; font-size: 0.9375rem; }
.gtm-success { color: var(--gtm-ok); font-size: 0.9375rem; }

.gtm-cta-band { background: var(--gtm-ink); color: #fff; border-radius: 16px; padding: clamp(1.5rem, 4vw, 2.25rem); display: grid; gap: 1rem; align-items: center; margin-top: 1.25rem; }
@media (min-width: 720px) { .gtm-cta-band { grid-template-columns: 1fr auto; } }
.gtm-cta-band h2 { font-size: 1.375rem; font-weight: 600; margin: 0 0 0.375rem; }
.gtm-cta-band p { margin: 0; color: #CBD5E1; line-height: 1.55; }
.gtm-cta-band .gtm-btn { background: #fff; color: var(--gtm-ink); border-color: #fff; }
.gtm-cta-band .gtm-btn:hover { background: #E2E8F0; border-color: #E2E8F0; color: var(--gtm-ink); }

.gtm-faq details { border-top: 1px solid var(--gtm-line); padding: 0.875rem 0; }
.gtm-faq details:first-of-type { border-top: 0; }
.gtm-faq summary { cursor: pointer; font-weight: 600; min-height: 32px; list-style-position: outside; }
.gtm-faq p { color: var(--gtm-slate); margin: 0.5rem 0 0; line-height: 1.6; }
.gtm-faq a { color: var(--gtm-accent); text-decoration: underline; text-underline-offset: 2px; }
.gtm-crosslink { display: block; border: 1px solid var(--gtm-line); border-radius: 12px; padding: 1rem 1.125rem; text-decoration: none; color: var(--gtm-ink); transition: border-color 0.2s ease; }
.gtm-crosslink:hover { border-color: rgba(14, 107, 168, 0.45); color: var(--gtm-ink); }
.gtm-crosslink strong { display: block; margin-bottom: 0.25rem; }
.gtm-crosslink span.gtm-crosslink-sub { color: var(--gtm-slate); font-size: 0.9375rem; }

.gtm-hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .gtm-dots i, .gtm-report.is-streaming > :last-child::after { animation: none; }
  .gtm-progress-fill, .gtm-chip > span, .gtm-btn { transition: none; }
}

@media print {
  nav, footer, .gtm-no-print, #mobile-menu, #mobile-menu-backdrop { display: none !important; }
  body, .gtm-main, .gtm-hero { background: #fff !important; }
  .gtm-card { border: 0; padding: 0; margin-bottom: 1.5rem; }
  .gtm-report { max-width: none; }
  .gtm-report.is-streaming > :last-child::after { display: none; }
}

/* ---- GTM Check v2: hero art, steps, section icons, sticky bar, score ring ---- */
.gtm-hero-grid { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 860px) { .gtm-hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 2.5rem; } }
.gtm-hero-art img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--gtm-line); background: #F8F4EC; }
@media (max-width: 859px) { .gtm-hero-art { max-width: 420px; } }
.gtm-hero .gtm-actions { margin-top: 1.5rem; }
.gtm-hero .gtm-meta { margin-top: 0.875rem; }

.gtm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.gtm-stepcard { background: var(--gtm-surface); border: 1px solid var(--gtm-line); border-radius: 14px; padding: 0.875rem; display: flex; gap: 0.75rem; align-items: center; }
.gtm-stepcard-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--gtm-accent-soft); color: var(--gtm-accent); display: inline-flex; align-items: center; justify-content: center; }
.gtm-stepcard-icon svg { width: 22px; height: 22px; }
.gtm-stepcard strong { display: block; font-size: 0.9375rem; line-height: 1.3; }
.gtm-stepcard span.gtm-stepcard-sub { display: block; font-size: 0.8125rem; color: var(--gtm-muted); line-height: 1.35; margin-top: 0.125rem; }
@media (max-width: 640px) {
  .gtm-steps { gap: 0.5rem; }
  .gtm-stepcard { flex-direction: column; text-align: center; padding: 0.75rem 0.5rem; gap: 0.5rem; }
  .gtm-stepcard strong { font-size: 0.8125rem; }
  .gtm-stepcard span.gtm-stepcard-sub { font-size: 0.75rem; }
}

.gtm-sec .gtm-card-head { align-items: center; margin-bottom: 0.75rem; }
.gtm-sec-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--gtm-accent-soft); color: var(--gtm-accent); display: inline-flex; align-items: center; justify-content: center; }
.gtm-sec-icon svg { width: 20px; height: 20px; }
.gtm-sec .gtm-q { padding: 0.875rem 0; }
.gtm-sec .gtm-q-help { margin-bottom: 0.25rem; }
.gtm-sec .gtm-chips { margin-top: 0.5rem; }

.gtm-submit-card { position: sticky; bottom: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30; padding: 0.875rem 1.25rem; box-shadow: 0 10px 30px rgba(15, 20, 25, 0.12); }
.gtm-progress-text strong { color: var(--gtm-ink); font-weight: 600; }
.gtm-btn.is-ready { box-shadow: 0 0 0 4px rgba(14, 107, 168, 0.18); }
@media (max-width: 480px) {
  .gtm-submit-card { padding: 0.75rem 0.875rem; }
  .gtm-submit-bar { flex-wrap: nowrap; gap: 0.75rem; }
  .gtm-submit-bar .gtm-progress { min-width: 0; flex: 1 1 auto; }
  .gtm-submit-bar .gtm-btn { width: auto; flex: none; padding: 0.75rem 1rem; }
}

.gtm-ring { width: 150px; height: 150px; display: block; }
.gtm-ring-track { fill: none; stroke: var(--gtm-line); stroke-width: 10; }
.gtm-ring-fill { fill: none; stroke: var(--gtm-accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.gtm-ring-num { font-family: var(--gtm-mono); font-size: 36px; font-weight: 500; fill: var(--gtm-ink); }
.gtm-ring-of { font-family: var(--gtm-mono); font-size: 12px; fill: var(--gtm-muted); }
#gtm-score { display: flex; flex-direction: column; align-items: center; }
#gtm-score .gtm-band { margin-top: 0.5rem; }

.gtm-plan-head { display: grid; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.gtm-plan-head .gtm-card-intro { margin: 0.25rem 0 0; }
.gtm-plan-art { display: none; }
@media (min-width: 720px) {
  .gtm-plan-head { grid-template-columns: 1fr 180px; }
  .gtm-plan-art { display: block; }
  .gtm-plan-art img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--gtm-line); }
}
.gtm-leak-finding:first-of-type { margin-top: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
  .gtm-ring-fill { transition: none; }
}
@media print {
  .gtm-submit-card, .gtm-steps, .gtm-hero-art, .gtm-plan-art { display: none !important; }
}
