/* Shared site chrome (header, navigation, footer) and the overview page. Loaded after style.css on every page. */
:root {
  --brand-ink: #13233f;
  --brand-accent: #1f5fbf;
  --brand-warm: #c2571a;
  --paper: #fbfbf8;
  --rule: #e3e1da;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* ---------------------------------------------------------------- header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap;
  padding-block: 0.55rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--brand-ink); color: #fff;
}
.site-brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; min-width: 0; }
.site-brand svg { flex: none; }
.site-brand .name { font-weight: 650; font-size: 1rem; letter-spacing: 0.01em; line-height: 1.15; }
.site-brand .sub { display: block; font-size: 0.74rem; color: #b9c6dc; font-weight: 400; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.site-nav a {
  color: #d6dfee; text-decoration: none; font-size: 0.88rem; padding: 0.35rem 0.7rem; border-radius: 6px;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.site-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.site-nav a:focus-visible, .site-brand:focus-visible { outline: 2px solid #8fb4f0; outline-offset: 2px; }

/* the tool pages keep their own toolbar under the site header */
.topbar .brand h1 { font-size: 1.05rem; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  margin-top: 2rem; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.8rem;
  padding-block: 1rem 1.4rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; justify-content: space-between; }
.site-footer a { color: inherit; }
.site-footer b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- overview page */
body.overview { background: var(--paper); font-family: var(--sans); }
.ov { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ov section { padding-block: 2.6rem; border-bottom: 1px solid var(--rule); }
.ov section:last-of-type { border-bottom: 0; }
.ov h2 { font-family: var(--serif); font-weight: 600; font-size: 1.65rem; line-height: 1.2; margin: 0 0 0.4rem; color: var(--brand-ink); text-wrap: balance; }
.ov h3 { font-size: 1rem; margin: 0 0 0.35rem; color: var(--brand-ink); }
.ov p { font-size: 0.98rem; line-height: 1.6; max-width: 68ch; }
.ov .kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 650; color: var(--brand-warm); margin: 0 0 0.6rem; }
.ov .lede { font-size: 1.1rem; color: #36404f; }
.ov .section-intro { color: var(--muted); margin-bottom: 1.4rem; }

.ov .hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding-block: 3rem 2.6rem; }
.ov .hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.12; color: var(--brand-ink); margin: 0 0 1rem; text-wrap: balance; }
.ov .hero .cta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.ov .btn { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 0.6rem 1rem; border-radius: 7px; border: 1px solid transparent; }
.ov .btn.solid { background: var(--brand-accent); color: #fff; }
.ov .btn.solid:hover { filter: brightness(1.08); }
.ov .btn.line { border-color: #b8c7e2; color: var(--brand-accent); background: #fff; }
.ov .btn.line:hover { background: var(--accent-soft); }
.ov .hero-fig { margin: 0; background: #fff; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.ov .hero-fig .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ov .hero-fig img, .ov .hero-fig canvas, .ov .hero-fig svg { display: block; width: 100%; height: auto; max-width: 100%; aspect-ratio: 1; }
.ov .hero-fig canvas { border-right: 1px solid var(--rule); }
.ov .hero-fig figcaption { font-size: 0.78rem; color: var(--muted); padding: 0.55rem 0.8rem; border-top: 1px solid var(--rule); line-height: 1.45; }

.ov .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.ov .stat { padding: 1.1rem 1.2rem; border-left: 1px solid var(--rule); min-width: 0; }
.ov .stat:first-child { border-left: 0; }
.ov .stat .v { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--brand-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov .stat .v small { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-left: 0.15rem; }
.ov .stat .k { font-size: 0.84rem; color: #3d4757; margin-top: 0.3rem; line-height: 1.4; }

.ov .tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ov .tool { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.ov .tool p { font-size: 0.9rem; margin: 0; color: #3d4757; }
.ov .tool ul { margin: 0.2rem 0 0; padding-left: 1.1rem; font-size: 0.86rem; color: #3d4757; line-height: 1.55; }
.ov .tool .go { margin-top: auto; padding-top: 0.6rem; font-weight: 600; font-size: 0.9rem; color: var(--brand-accent); text-decoration: none; }
.ov .tool .go:hover { text-decoration: underline; }

.ov .pipeline { overflow-x: auto; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 1rem; }
.ov .pipeline svg { display: block; min-width: 860px; width: 100%; height: auto; }

.ov .results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.ov .panel-w { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem; min-width: 0; }
.ov .panel-w h3 { margin-bottom: 0.6rem; }
.ov .tbl-wrap { overflow-x: auto; }
.ov table.acc { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.ov table.acc th, .ov table.acc td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid #eceae4; }
.ov table.acc th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.ov table.acc td.n { text-align: right; }
.ov table.acc th.n { text-align: right; }
.ov #hist { width: 100%; height: auto; display: block; }
.ov .fig-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.45; }

.ov .cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem 2.5rem; }
.ov .cols2 > div { min-width: 0; }
.ov dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.45rem 1rem; font-size: 0.9rem; }
.ov dt { font-weight: 600; color: var(--brand-ink); }
.ov dd { margin: 0; color: #3d4757; line-height: 1.5; }
.ov ul.plain { padding-left: 1.1rem; margin: 0.3rem 0; font-size: 0.92rem; line-height: 1.6; color: #3d4757; max-width: 68ch; }
.ov .ack { max-width: 48rem; background: #fff; border-left: 3px solid var(--brand-warm); padding: 0.8rem 1rem; border-radius: 0 8px 8px 0; font-size: 0.92rem; line-height: 1.55; }

@media (max-width: 900px) {
  .ov .hero, .ov .results, .ov .cols2 { grid-template-columns: minmax(0, 1fr); }
  .ov .tools { grid-template-columns: minmax(0, 1fr); }
  .ov .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov .stat:nth-child(3) { border-left: 0; }
  .ov .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 520px) {
  .site-brand .sub { display: none; }
  .ov section { padding-block: 1.8rem; }
  .ov .stat .v { font-size: 1.6rem; }
  .ov .hero-fig .pair { grid-template-columns: minmax(0, 1fr); }
}

/* print / save as PDF from the browser: the overview as a report page */
@media print {
  .site-nav, .ov .hero .cta, .ov .tool .go, .no-print { display: none !important; }
  .site-header { background: #fff; color: var(--brand-ink); border-bottom: 1px solid #999; }
  .site-brand, .site-brand .sub { color: var(--brand-ink); }
  body.overview { background: #fff; }
  .ov section { padding-block: 1.1rem; break-inside: avoid; }
  .ov .hero { grid-template-columns: 1fr 1fr; }
  .ov .pipeline svg { min-width: 0; }
  a { color: inherit; text-decoration: none; }
}

/* builder toolbar: the example picker holds long names; keep it inside the screen */
.topbar-actions, .topbar .examples { min-width: 0; max-width: 100%; }
#example-select { min-width: 0; max-width: min(28rem, 100%); flex: 1 1 auto; }
