/* Pace Tuner - standalone design system */
:root {
  --bg: #f6f5f1;
  --bg-soft: #ffffff;
  --ink: #1d2233;
  --ink-soft: #51586f;
  --ink-muted: #7b8298;
  --line: #d9d7cf;
  --line-soft: #e7e5dd;
  --accent: #2f6f4f;
  --accent-2: #c9742f;
  --accent-soft: #e4efe8;
  --warn: #b24a3a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(20, 24, 40, 0.04), 0 12px 30px rgba(20, 24, 40, 0.08);
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, 0.06);
  --max: 1180px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: #1f543b; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 24px;
  top: 12px;
  width: auto;
  height: auto;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
}

/* Header */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: 0.78rem; color: var(--ink-muted); }

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-color: var(--accent); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  padding: 56px 0 32px;
  align-items: start;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
  max-width: 52ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.hero-note { font-size: 0.82rem; color: var(--ink-muted); margin: 0; }

.hero-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.hero-card-title {
  margin: 0 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.hero-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}
.hero-card-stats dt {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hero-card-stats dd {
  margin: 2px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}
.hero-card-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #245840; color: #fff; }
.btn-secondary { background: var(--bg-soft); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-soft); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }

/* Section heads */
.section-head { margin-bottom: 20px; }
.section-head h2 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 700;
}
.section-head p { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* Tuner */
.tuner { padding: 40px 0; }
.tuner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.unit-toggle {
  display: inline-flex;
  background: var(--line-soft);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 18px;
}
.unit-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
}
.unit-btn.is-active {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.field-hint {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 0.82rem;
  margin-left: 6px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.stepper input[type="number"] {
  flex: 1;
  font-family: inherit;
  font-size: 1.1rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  min-width: 0;
}
.unit-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
  padding: 0 4px;
}
.step-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.step-btn:hover { background: var(--line-soft); }
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.presets { margin-top: 20px; }
.presets-label {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 7px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.preset:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.tuner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.save-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
  min-height: 1em;
}

/* Result panel */
.result-panel { background: linear-gradient(180deg, var(--bg-soft) 0%, #fdfdfb 100%); }
.readout {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.readout-primary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.readout-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  display: block;
}
.readout-value { font-weight: 700; }
.readout-primary .readout-value {
  font-size: 2.4rem;
  line-height: 1;
  color: var(--accent);
}
.readout-primary .readout-unit { color: var(--ink-muted); font-size: 0.95rem; }
.readout-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.readout-secondary .readout-value { font-size: 1.1rem; display: block; }
.readout-secondary .readout-unit { font-size: 0.78rem; color: var(--ink-muted); }

.delta-row, .form-quality {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.delta-title, .fq-title {
  margin: 0 0 4px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.delta-value, .fq-text { margin: 0; font-size: 0.95rem; color: var(--ink); }
.delta-value.is-good { color: var(--accent); }
.delta-value.is-warn { color: var(--warn); }

/* Impact table */
.impact { padding: 40px 0; }
.impact-tabs {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}
.impact-tab {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-soft);
}
.impact-tab.is-active { background: var(--accent); color: #fff; font-weight: 600; }

.table-wrap { overflow-x: auto; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.impact-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.impact-table th, .impact-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line-soft);
}
.impact-table th {
  background: var(--bg);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.impact-table tbody tr:last-child td { border-bottom: 0; }
.impact-table tbody tr:hover { background: var(--bg); }
.impact-table .is-current { background: var(--accent-soft); font-weight: 600; }
.impact-table .delta-pos { color: var(--accent); font-weight: 600; }
.impact-table .delta-neg { color: var(--warn); font-weight: 600; }
.table-footnote { font-size: 0.82rem; color: var(--ink-muted); margin: 10px 2px 0; }

/* Guidance */
.guidance { padding: 40px 0; }
.guidance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.guide-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: var(--accent);
}
.guide-card p { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.95rem; }
.guide-card p:last-child { margin-bottom: 0; }

/* Glossary */
.glossary { padding: 40px 0; }
.glossary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px 28px;
  margin: 0;
}
.glossary-list > div { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.glossary-list dt { font-weight: 700; margin: 0 0 4px; font-size: 0.95rem; }
.glossary-list dd { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* Related */
.related {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0 40px;
}
.related h2 { margin-top: 0; font-size: 1.3rem; }
.related p { margin: 0; color: var(--ink-soft); }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #e7e9f0;
  padding: 36px 0 24px;
  margin-top: 40px;
}
.site-footer a { color: #d4dccb; }
.site-footer a:hover { color: #fff; }
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand p { margin: 6px 0 0; font-size: 0.9rem; color: #b9bfcc; max-width: 40ch; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { text-decoration: none; font-size: 0.9rem; }
.footer-bottom { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.footer-bottom p { margin: 0; font-size: 0.82rem; color: #b9bfcc; }

/* Focus states */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .tuner-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .site-nav { gap: 10px; font-size: 0.85rem; }
  .hero-card-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .readout-secondary { grid-template-columns: 1fr 1fr; }
  .brand-sub { display: none; }
  .hero h1 { font-size: 1.7rem; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .tuner-actions, .impact-tabs, .presets, .btn, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .hero-card { break-inside: avoid; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
