/* ActiveGraph timeline — styles. Tokens from docs/timeline-handoff/tokens/tokens.json.
   Desktop = viewport >= 1000px; everything below is the mobile layout. */

:root {
  --bg: #F4F4F1; --surface: #FFFFFF; --surface2: #ECECE7; --line: #DAD9D3; --line2: #8A8984;
  --ink: #121214; --ink2: #3D3D42; --ink3: #5F5F66; --spine: #121214; --branch: #56565C;
  --accent: #FF4D2E; --on-accent: #121214; --accent-text: #C42A10;
  --accent-halo: rgba(255,77,46,0.24); --glow: rgba(255,77,46,0.24); --done-text: #3D3D42;
  --caution: #7A4F00; --caution-bg: #FFF3D1; --caution-line: #B07A00;
  --inv-bg: #121214; --inv-ink: #F4F4F1; --hatch: #DEDDD7;
  --shadow: 0 18px 40px rgba(18,18,20,0.16);
  --line-left: calc(50% - 1.5px);
  --gutter: 36px;
  --year-top: 90px;
  --story-year-top: 136px;
  color-scheme: light;
}
html.dark {
  --bg: #0F0F11; --surface: #18181B; --surface2: #242428; --line: #2F2F34; --line2: #6A6A71;
  --ink: #F3F2EE; --ink2: #C9C8C3; --ink3: #A1A0A7; --spine: #F3F2EE; --branch: #A9A8A3;
  --accent: #FF5A3C; --on-accent: #121214; --accent-text: #FF7A5C;
  --accent-halo: rgba(255,90,60,0.30); --glow: rgba(255,90,60,0.32); --done-text: #C9C8C3;
  --caution: #F2C14E; --caution-bg: #2E2408; --caution-line: #C9971A;
  --inv-bg: #F3F2EE; --inv-ink: #0F0F11; --hatch: #2A2A2F;
  --shadow: 0 18px 40px rgba(0,0,0,0.55);
  color-scheme: dark;
}
@media (max-width: 999px) {
  :root { --line-left: 38.5px; --gutter: 16px; --year-top: 57px; --story-year-top: 101px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body.ag-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sarabun', 'Noto Sans Thai Looped', 'Leelawadee UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.ag-root { position: relative; padding-bottom: 8px; min-height: 100vh; }
.ag-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ag-only-mob { display: none; }
@media (max-width: 999px) {
  .ag-only-desk { display: none !important; }
  .ag-only-mob { display: initial; }
}
button, input { font-family: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.ag-wrap { position: relative; max-width: 1440px; margin: 0 auto; }

/* ---- Pins, logo, chips, sparklines ------------------------------------------------- */
.ag-pin { display: block; color: var(--ink); flex: 0 0 auto; }
.ag-pin .pin-dot { fill: var(--ink); }
.ag-pin--ongoing .pin-dot { fill: var(--accent); }
.ag-pin--done .pin-dot { fill: var(--bg); stroke: var(--ink); stroke-width: 1.6; }
.ag-mark { display: block; }
.ag-mark-dot { fill: var(--accent); }
.ag-mark-pulse { stroke: var(--spine); }

.ag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 5px; font-size: 13.5px; font-weight: 800; line-height: 1.6; white-space: nowrap; }
.ag-chip--ongoing { background: var(--accent); color: var(--on-accent); }
.ag-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--on-accent); }
.ag-chip--done { gap: 5px; padding: 0 9px; border: 1.5px solid var(--line2); color: var(--done-text); }
.ag-chip--lg { font-size: 15px; }
.ag-chip--lg.ag-chip--ongoing { padding: 2px 12px; }
.ag-chip--lg.ag-chip--done { padding: 1px 11px; }
.ag-chip--lg .ag-chip-dot { width: 8px; height: 8px; }

.ag-spark { display: block; overflow: visible; }
.ag-spark path { fill: none; }
.ag-spark .sp-base { stroke: var(--line); stroke-width: 1.5; }
.ag-spark .sp-ticks { stroke: var(--line2); stroke-width: 1.2; }
.ag-spark .sp-tail { stroke: var(--ink3); stroke-width: 1.5; stroke-dasharray: 1.5 3.5; stroke-linecap: round; }
.ag-spark .sp-line { stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ag-spark .sp-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; }
.ag-spark.is-open .sp-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }

/* ---- Masthead ------------------------------------------------------------------------- */
.ag-masthead { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); view-transition-name: ag-masthead; }
.ag-masthead-inner { position: relative; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.ag-masthead-line { position: absolute; left: var(--line-left); top: 58px; bottom: -1px; width: 3px; background: var(--spine); }
.ag-masthead-row { height: 72px; display: grid; grid-template-columns: minmax(0, 1fr) 236px minmax(0, 1fr); align-items: center; }
.ag-search { position: relative; width: 100%; max-width: 400px; margin: 0; }
.ag-search input { width: 100%; height: 44px; padding: 0 16px 0 44px; border-radius: 22px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.5; }
.ag-search input::placeholder { color: var(--ink3); }
.ag-search-icon { position: absolute; left: 16px; top: 13px; color: var(--ink3); pointer-events: none; }
.ag-logo { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; height: 72px; text-decoration: none; color: var(--ink); }
.ag-logo-word { font-weight: 800; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.ag-logo-left { text-align: right; padding-right: 9px; }
.ag-logo-right { text-align: left; padding-left: 9px; }
.ag-logo-full { display: none; }
.ag-masthead-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.ag-iconbtn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: 22px; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; padding: 0; }
.ag-search-link { display: none; }
.ag-tools-btn { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); font-size: 15px; font-weight: 600; cursor: pointer; }
.ag-tools-btn[aria-expanded="true"] .ag-tools-chevron { transform: rotate(180deg); }
.ag-theme-btn .ag-icon-sun { display: none; }
html.dark .ag-theme-btn .ag-icon-sun { display: block; }
html.dark .ag-theme-btn .ag-icon-moon { display: none; }
.ag-tools-menu { position: absolute; top: 64px; right: 92px; width: 340px; max-height: calc(100vh - 80px); overflow: auto; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; }
.ag-tools-menu[hidden] { display: none; }
.ag-tools-group { padding: 8px 8px 4px; }
.ag-tools-title { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink3); padding: 0 8px 4px; }
.ag-tools-item { display: flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 15.5px; line-height: 1.5; }
.ag-tools-item:hover { background: var(--surface2); }
.ag-tools-item--all { font-weight: 700; }
.ag-masthead-nav { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; padding-bottom: 6px; }
.ag-masthead-nav-l { display: flex; justify-content: flex-end; }
.ag-back-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 12px; border-radius: 22px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; }
.ag-crumb { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink2); }
.ag-crumb-sep { color: var(--ink3); }
@media (max-width: 999px) {
  .ag-masthead-line { top: 50px; }
  .ag-masthead-row { height: 56px; display: flex; align-items: center; gap: 2px; padding: 0 6px 0 28px; margin: 0 calc(-1 * var(--gutter)); }
  .ag-search { display: none; }
  .ag-logo { display: flex; align-items: center; gap: 6px; min-height: 44px; height: auto; }
  .ag-logo .ag-mark { height: 44px; }
  .ag-logo-left, .ag-logo-right { display: none; }
  .ag-logo-full { display: inline; font-size: 21px; }
  .ag-masthead-actions { flex: 1 1 auto; }
  .ag-search-link { display: flex; border: 0; background: transparent; }
  .ag-tools-btn { padding: 0 10px; font-size: 14.5px; }
  .ag-tools-btn svg:first-child, .ag-tools-chevron { display: none; }
  .ag-theme-btn { border: 0; background: transparent; }
  .ag-tools-menu { top: 56px; right: 8px; width: calc(100% - 16px); }
  .ag-masthead-nav { display: flex; margin-left: calc(58px - var(--gutter)); height: 44px; align-items: center; padding: 0; }
  .ag-masthead-nav-l { justify-content: flex-start; }
  .ag-back-btn { padding: 0 8px 0 0; border: 0; background: transparent; font-size: 15.5px; gap: 6px; }
  .ag-crumb { display: none; }
}

/* ---- Sample-content banner ----------------------------------------------------------- */
.ag-sample-banner { background: var(--caution-bg); color: var(--caution); border-bottom: 1px solid var(--caution-line); padding: 8px var(--gutter); font-size: 14px; line-height: 1.6; text-align: center; }

/* ---- Sections that carry the line ---------------------------------------------------- */
.ag-section { position: relative; }
.ag-section::before { content: ''; position: absolute; left: var(--line-left); top: 0; bottom: 0; width: 3px; background: var(--spine); }
.ag-pill-title { position: relative; margin: 0; padding: 2px 20px 4px; border-radius: 22px; background: var(--bg); border: 2px solid var(--spine); font-size: 18px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.ag-stub { position: absolute; left: 41.5px; width: 11px; height: 2px; background: var(--branch); }

/* Latest-updates strip */
.ag-strip .ag-wrap { padding: 26px var(--gutter) 16px; }
.ag-strip-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 14px; }
.ag-strip-note { font-size: 14px; line-height: 1.5; color: var(--ink3); }
.ag-strip-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 64px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ag-strip-card:nth-child(3) { grid-column: 4; }
.ag-strip-card:nth-child(4) { grid-column: 5; }
.ag-strip-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.ag-strip-card:hover { border-color: var(--line2); }
.ag-strip-meta { display: flex; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.ag-strip-pin { flex: 0 0 auto; display: block; }
.ag-ago { font-weight: 700; color: var(--ink2); }
.is-new .ag-ago { color: var(--accent-text); }
.ag-strip-type { color: var(--ink3); }
.ag-strip-title { font-weight: 800; font-size: 17px; line-height: 1.4; }
.ag-strip-latest { font-size: 14px; line-height: 1.6; color: var(--ink2); }
@media (max-width: 999px) {
  .ag-strip .ag-wrap { padding: 20px 0 12px; }
  .ag-strip-head { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 16px 0 58px; margin-bottom: 10px; }
  .ag-strip-head > span:first-child { position: absolute; left: 41.5px; top: 15px; width: 11px; height: 2px; background: var(--branch); }
  .ag-strip-head .ag-pill-title { border: 0; padding: 0; font-size: 21px; line-height: 1.4; }
  .ag-strip-note { font-size: 13px; }
  .ag-strip-list { display: flex; gap: 10px; margin-left: 58px; overflow-x: auto; padding: 0 16px 4px 0; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ag-strip-list::-webkit-scrollbar { display: none; }
  .ag-strip-card { flex: 0 0 264px; scroll-snap-align: start; }
}

/* Legend */
.ag-legend .ag-wrap { padding: 10px var(--gutter) 22px; z-index: 12; }
.ag-legend-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }
.ag-legend-hint { font-size: 15px; line-height: 1.5; color: var(--ink2); }
.ag-legend-hint--l { text-align: right; }
.ag-legend-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 2px solid var(--spine); background: var(--bg); color: var(--ink); font-size: 16px; font-weight: 800; cursor: pointer; }
.ag-legend-box { position: absolute; top: calc(100% - 8px); left: calc(50% - 250px); width: 500px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.6; color: var(--ink2); z-index: 12; }
.ag-legend-box[hidden] { display: none; }
.ag-legend-title { font-size: 18px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.ag-legend-item { display: flex; gap: 12px; align-items: flex-start; }
.ag-legend-item > svg, .ag-legend-pin { flex: 0 0 28px; }
.ag-legend-pin { display: flex; justify-content: center; }
.lg-spine { stroke: var(--spine); fill: none; }
.lg-node { fill: var(--ink); stroke: var(--surface); stroke-width: 3; }
.lg-accent { stroke: var(--accent); }
.lg-accent-fill { fill: var(--accent); }
.lg-glow { fill: var(--glow); }
.lg-line2 { stroke: var(--line2); }
.lg-ink { stroke: var(--ink); }
.lg-dashed { stroke: var(--ink3); stroke-dasharray: 4 4; }
.lg-caution { fill: var(--caution-bg); stroke: var(--caution-line); stroke-width: 1.5; stroke-dasharray: 3 2; }
.lg-node-hollow { fill: var(--surface); stroke: var(--line2); stroke-width: 2.5; }
.lg-node-spine { fill: var(--spine); stroke: var(--surface); stroke-width: 2.5; }
@media (max-width: 999px) {
  .ag-legend .ag-wrap { padding: 6px 0 12px; }
  .ag-legend-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-left: 58px; padding-right: 16px; }
  .ag-legend-btn { padding: 0 16px; font-size: 15.5px; }
  .ag-legend-hint { font-size: 14px; }
  .ag-legend-box { position: static; width: auto; margin: 10px 16px 4px 58px; box-shadow: none; }
}

/* ---- The axis ------------------------------------------------------------------------ */
.ag-body-row { position: relative; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.ag-axis-col { position: relative; width: var(--axis-w, 928px); max-width: 100%; margin: 0 auto; }
.ag-axis { position: relative; width: 100%; }
.ag-chrome { position: absolute; inset: 0; pointer-events: none; }
.ag-chrome .ag-year-nav a { pointer-events: auto; }
.ag-axis.is-flow .ag-chrome, html.no-js .ag-chrome { display: none; }
.ag-axis.is-flow, html.no-js .ag-axis { display: flex; flex-direction: column; gap: 28px; align-items: center; padding: 24px 0; }
.ag-axis.is-flow .ag-card, html.no-js .ag-card { position: relative; width: 100%; max-width: 520px; }
.ag-glow { position: absolute; background: var(--glow); z-index: 0; view-transition-name: ag-glow; }
.ag-line { position: absolute; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.ag-line path { fill: none; }
.ag-line-path { stroke: var(--spine); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ag-line-hot { stroke: var(--accent); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.ag-line-future { stroke: var(--ink3); stroke-width: 3; stroke-dasharray: 6 6; }
.ag-line-muted { stroke: var(--line2); stroke-width: 2; }
.ag-year { position: absolute; z-index: 7; pointer-events: none; scroll-margin-top: var(--year-top); }
.ag-year-sticky { position: sticky; top: var(--year-top); display: flex; justify-content: center; padding-top: 14px; }
.ag-year-badge { background: var(--inv-bg); color: var(--inv-ink); font-weight: 800; font-size: 36px; line-height: 1.25; padding: 2px 18px 4px; border-radius: 8px; box-shadow: 0 0 0 6px var(--bg); }
.ag-year-bar { position: sticky; top: var(--year-top); height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 0 58px; background: var(--bg); border-bottom: 1px solid var(--line); pointer-events: auto; }
.ag-year-bar-line { position: absolute; left: 38.5px; top: 0; bottom: -1px; width: 3px; background: var(--spine); }
.ag-year-bar-line.is-muted { background: var(--line2); }
.ag-year-bar-label { display: flex; align-items: baseline; gap: 6px; }
.ag-year-num { font-weight: 800; font-size: 28px; line-height: 1.25; }
.ag-year-be { font-size: 13px; line-height: 1.5; color: var(--ink3); }
.ag-year-nav { display: flex; gap: 2px; }
.ag-year-nav a { min-width: 54px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 14.5px; font-weight: 700; line-height: 1.5; text-decoration: none; font-variant-numeric: tabular-nums; color: var(--ink2); }
.ag-year-nav a[aria-current="true"] { background: var(--inv-bg); color: var(--inv-ink); }
.ag-tick { position: absolute; height: 2px; background: var(--line2); z-index: 2; }
.ag-tick-label { position: absolute; display: flex; gap: 8px; font-size: 13px; line-height: 22px; font-weight: 700; color: var(--ink3); white-space: nowrap; z-index: 2; }
.ag-tick-label.is-end { justify-content: flex-end; }
.ag-tick-extra { font-weight: 800; color: var(--ink); }
.ag-today { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg), 0 0 0 8px var(--accent-halo); z-index: 6; }
.ag-today-label { position: absolute; font-size: 13.5px; line-height: 22px; font-weight: 800; color: var(--ink); white-space: nowrap; z-index: 3; }
.ag-today-label.is-end { text-align: right; }
.ag-today-label.is-boxed { padding: 0 6px; background: var(--bg); }
.ag-conn { position: absolute; height: 2px; background: var(--branch); z-index: 2; }
.ag-node { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--spine); border: 3px solid var(--spine); box-shadow: 0 0 0 3px var(--bg); z-index: 5; }
.ag-node.is-done { background: var(--bg); }
.ag-node.is-new { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
.ag-dlabel { position: absolute; display: flex; gap: 6px; align-items: center; font-size: 13.5px; line-height: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; z-index: 3; }
.ag-dlabel.is-end { justify-content: flex-end; }
.ag-newtag { font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); }

/* Story card */
.ag-card { position: absolute; display: block; width: var(--card-w, 520px); overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; z-index: 3; scroll-margin-top: 120px; }
.ag-card.is-new { border-color: var(--line2); }
.ag-card.is-lit, .ag-card:hover { border-color: var(--spine); box-shadow: 0 0 0 1px var(--spine); }
.ag-card-hero { position: relative; display: flex; align-items: center; justify-content: center; height: 230px; background-color: var(--surface2); background-image: repeating-linear-gradient(135deg, var(--hatch) 0px, var(--hatch) 1px, transparent 1px, transparent 12px); }
.ag-card-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-card-hero-label { font-size: 13.5px; line-height: 1.5; color: var(--ink3); }
.ag-card-hero-credit { position: absolute; left: 14px; bottom: 10px; padding: 0 8px; border-radius: 4px; background: var(--surface); font-size: 12.5px; line-height: 1.7; color: var(--ink2); }
.ag-card-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 26px 24px; }
.ag-card-head { display: flex; flex-direction: column; gap: 8px; }
.ag-card-kicker { display: flex; align-items: center; gap: 10px; }
.ag-card-pin { display: block; flex: 0 0 auto; }
.ag-card-pin .ag-pin { width: 44px; height: 44px; }
.ag-card-type { font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--ink2); }
.ag-card-title { display: block; font-weight: 800; font-size: 32px; line-height: 1.25; letter-spacing: -0.005em; text-wrap: pretty; }
.ag-hook { display: flex; flex-direction: column; gap: 2px; }
.ag-hook-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.ag-hook-num { font-weight: 300; font-size: 60px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ag-hook-unit { font-weight: 800; font-size: 22px; line-height: 1.3; }
.ag-hook-cap { font-size: 14.5px; line-height: 1.55; color: var(--ink2); }
.ag-card-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.ag-when { font-size: 14px; line-height: 1.6; color: var(--ink2); }
.ag-latest { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 8px; background: var(--surface2); }
.ag-latest-label { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink3); }
.ag-latest-text { font-size: 16.5px; font-weight: 700; line-height: 1.5; }
.ag-card-sum { font-size: 16px; line-height: 1.7; color: var(--ink2); }
.ag-card-spark { display: flex; flex-direction: column; gap: 3px; }
.ag-spark-wrap { display: block; }
.ag-range { font-size: 13px; line-height: 1.6; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ag-card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.ag-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ag-srcs-label { font-size: 13px; line-height: 1.5; color: var(--ink3); }
.ag-src-chip { font-size: 13px; font-weight: 600; line-height: 1.5; padding: 2px 8px; border-radius: 4px; background: var(--surface2); color: var(--ink2); }
.ag-card-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; line-height: 1.5; color: var(--ink); }
.ag-card-new { position: absolute; top: 0; right: 16px; padding: 1px 10px 3px; border-radius: 0 0 6px 6px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; line-height: 1.5; }
.ag-card-new[hidden] { display: none; }
@media (max-width: 999px) {
  .ag-body-row { display: block; padding: 0; }
  .ag-axis-col { width: 100%; }
  .ag-axis.is-flow, html.no-js .ag-axis { padding: 24px 16px; }
  .ag-card-hero { height: 170px; }
  .ag-card-body { padding: 16px 18px 18px; }
  .ag-card-pin .ag-pin { width: 36px; height: 36px; }
  .ag-card-title { font-size: 26px; letter-spacing: 0; }
  .ag-hook-num { font-size: 46px; }
  .ag-hook-unit { font-size: 18px; }
}

/* End cap and empty state */
.ag-endcap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 50px; text-align: center; }
.ag-endcap-line { position: absolute; left: var(--line-left); top: 0; height: 26px; width: 3px; background: var(--spine); }
.ag-endcap-ring { position: absolute; left: calc(50% - 7px); top: 22px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--spine); background: var(--bg); }
.ag-endcap-text { font-size: 14.5px; line-height: 1.6; color: var(--ink3); }
.ag-endcap-note { margin: 0; max-width: 640px; font-size: 15px; line-height: 1.7; color: var(--ink2); }
.ag-endcap-note a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.ag-empty { position: relative; margin: 32px auto 24px; max-width: 440px; padding: 32px 24px; text-align: center; border: 1px dashed var(--line2); border-radius: 12px; background: var(--bg); }
.ag-empty-title { font-size: 22px; font-weight: 800; line-height: 1.4; }
.ag-empty p { margin: 8px 0 0; font-size: 16px; line-height: 1.7; color: var(--ink2); }
@media (max-width: 999px) {
  .ag-endcap { align-items: flex-start; text-align: left; padding: 50px 16px 0 58px; }
  .ag-endcap-ring { left: 33px; }
  .ag-empty { margin: 32px 16px 24px 58px; }
}

/* ---- Footer -------------------------------------------------------------------------- */
.ag-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.ag-footer-inner { max-width: 1440px; margin: 0 auto; padding: 24px var(--gutter) 32px; display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: space-between; }
.ag-footer-brand { display: flex; gap: 12px; align-items: flex-start; max-width: 560px; }
.ag-footer-brand .ag-mark { margin-top: 2px; }
.ag-footer-text { display: flex; flex-direction: column; gap: 4px; }
.ag-footer-name { font-size: 20px; font-weight: 800; line-height: 1.4; }
.ag-footer-tag { font-size: 15px; line-height: 1.7; color: var(--ink2); }
.ag-footer-nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; line-height: 1.5; }
.ag-footer-nav a { display: flex; align-items: center; min-height: 44px; color: var(--ink); }
.ag-footer-nav .ag-footer-muted { color: var(--ink2); }

/* ---- Story (zoomed) view ------------------------------------------------------------- */
.ag-shead .ag-wrap { padding: 30px var(--gutter) 12px; }
.ag-shead-pin { position: relative; width: 92px; margin: 0 auto; padding: 4px 0; display: flex; justify-content: center; background: var(--bg); }
.ag-shead-card { position: relative; max-width: 1000px; margin: 14px auto 0; padding: 26px 48px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.ag-shead-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.ag-shead-type { font-size: 15px; font-weight: 700; line-height: 1.6; color: var(--ink2); }
.ag-shead-title { margin: 0; font-weight: 800; font-size: 50px; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; outline: none; }
.ag-hook--story { align-items: center; }
.ag-hook--story .ag-hook-row { justify-content: center; gap: 2px 12px; }
.ag-hook--story .ag-hook-num { font-size: 76px; }
.ag-hook--story .ag-hook-unit { font-size: 26px; }
.ag-hook--story .ag-hook-cap { font-size: 16px; }
.ag-shead-dates { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink2); font-variant-numeric: tabular-nums; }
.ag-shead-dates strong { color: var(--ink); }
.ag-shead-spark { position: relative; width: 760px; max-width: 100%; margin-top: 4px; }
.ag-shead-spark-svg { display: block; }
.ag-shead-spark-labels { position: relative; height: 20px; font-size: 13px; line-height: 20px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.ag-shead-spark-labels span { position: absolute; top: 0; white-space: nowrap; }
.ag-shead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: start; margin-top: 30px; }
.ag-shead-main { justify-self: end; width: 100%; max-width: 600px; display: flex; flex-direction: column; gap: 18px; }
.ag-shead-side { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px; }
.ag-h-sm { margin: 0 0 4px; font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--ink3); }
.ag-lede { margin: 0; font-size: 19px; line-height: 1.75; color: var(--ink); }
.ag-people { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-person { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 22px; border: 1px solid var(--line2); color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.5; }
.ag-person-ini { width: 30px; height: 30px; border-radius: 50%; background: var(--surface2); color: var(--ink2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.ag-person-name { font-weight: 700; }
.ag-person-role { color: var(--ink3); font-size: 13.5px; }
.ag-next { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ag-next.is-dashed { border: 1.5px dashed var(--line2); }
.ag-next-label { font-size: 13.5px; font-weight: 700; line-height: 1.5; color: var(--ink3); }
.ag-next-title { font-size: 20px; font-weight: 800; line-height: 1.45; }
.ag-next-note { font-size: 14px; line-height: 1.6; color: var(--ink2); }
.ag-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.ag-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line2); background: transparent; color: var(--ink); text-decoration: none; font-size: 15.5px; font-weight: 700; cursor: pointer; }
.ag-btn--primary { padding: 0 18px; border: 0; background: var(--ink); color: var(--bg); }
.ag-share { position: absolute; top: 52px; left: 0; width: 300px; max-width: 100%; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 20; }
.ag-share[hidden] { display: none; }
.ag-share-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 15.5px; text-align: left; text-decoration: none; cursor: pointer; }
.ag-share-item:hover { background: var(--surface2); }
.ag-share-ini { width: 28px; height: 28px; border-radius: 6px; background: var(--surface2); color: var(--ink2); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; flex: 0 0 auto; }
.ag-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; line-height: 1.6; }
.ag-facts dt { color: var(--ink3); }
.ag-facts dd { margin: 0; font-weight: 700; }
.ag-ctrl .ag-wrap { padding: 22px var(--gutter) 20px; z-index: 12; }
.ag-ctrl-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; }
.ag-ctrl-l { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.ag-ctrl-r { display: flex; align-items: center; gap: 10px; }
.ag-order { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ag-order button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: var(--ink2); font-size: 15.5px; font-weight: 700; cursor: pointer; }
.ag-order button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.ag-ctrl-note { font-size: 14px; line-height: 1.6; color: var(--ink2); }
.ag-legend-box--story { left: calc(50% + 32px); width: 460px; top: calc(100% - 10px); }
.ag-axis--story .ag-year-sticky, .ag-axis--story .ag-year-bar { top: var(--story-year-top); }
.ag-axis--story .ag-year { scroll-margin-top: var(--story-year-top); }
.ag-snode { position: absolute; border-radius: 50%; background: var(--spine); border: 3px solid var(--spine); box-shadow: 0 0 0 3px var(--bg); z-index: 5; }
.ag-snode.is-spike { border-width: 2.5px; }
.ag-snode.is-start { background: var(--bg); border-width: 4px; }
.ag-snode.is-bg { background: var(--bg); border-color: var(--line2); border-width: 3px; }
.ag-snode.is-unv { background: var(--caution-bg); border-color: var(--caution-line); }
.ag-snode.is-future { background: var(--bg); border: 3px dashed var(--ink3); }
.ag-slabel { position: absolute; display: flex; flex-direction: column; gap: 0; font-size: 13.5px; line-height: 20px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; z-index: 3; align-items: flex-start; }
.ag-slabel.is-row { flex-direction: row; gap: 8px; }
.ag-slabel.is-end { align-items: flex-end; }
.ag-slabel-date { font-weight: 800; }
.ag-slabel-time { color: var(--ink2); }
.ag-dev { position: absolute; width: var(--card-w, 460px); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; z-index: 3; scroll-margin-top: 150px; }
.ag-dev.is-bg { background: var(--surface2); }
.ag-dev.is-future { background: transparent; border: 1.5px dashed var(--line2); }
.ag-dev.is-unv { border: 1.5px dashed var(--caution-line); }
.ag-axis.is-flow .ag-dev, html.no-js .ag-dev { position: relative; width: 100%; max-width: 460px; }
.ag-dev-caution { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--caution-bg); color: var(--caution); font-size: 14px; font-weight: 800; line-height: 1.5; }
.ag-dev-body { padding: 14px 18px 8px; display: flex; flex-direction: column; gap: 8px; }
.ag-dev-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ag-tag { font-size: 13.5px; font-weight: 800; line-height: 1.5; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line2); color: var(--ink); }
.ag-tag--start { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.ag-dev-kind { font-size: 13.5px; font-weight: 700; line-height: 1.5; color: var(--ink2); }
.ag-dev-title { margin: 0; font-weight: 800; font-size: 20px; line-height: 1.4; text-wrap: pretty; }
.ag-dev-sum { margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink2); }
.ag-dev-figs { display: grid; gap: 8px; margin-top: 4px; }
.ag-dev-figs.is-multi { grid-template-columns: 1fr 1fr; }
.ag-dev-fig { margin: 0; min-width: 0; }
.ag-dev-fig figcaption a { color: inherit; font-weight: 700; }
.ag-dev-img { height: 150px; border-radius: 6px; background-color: var(--surface2); background-image: repeating-linear-gradient(135deg, var(--hatch) 0px, var(--hatch) 1px, transparent 1px, transparent 11px); display: flex; align-items: center; justify-content: center; font-size: 13.5px; line-height: 1.5; color: var(--ink3); }
.ag-dev-fig img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }
.ag-dev-fig figcaption { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--ink2); }
.ag-dev-srcs { border-top: 1px solid var(--line); padding: 2px 8px 4px; }
.ag-dev-srcs-title { padding: 6px 10px 0; font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink3); }
.ag-dev-src { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 0 0 10px; }
.ag-dev-src-ini { flex: 0 0 22px; height: 22px; border-radius: 5px; background: var(--surface2); color: var(--ink2); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; line-height: 1; }
.ag-dev-src-name { flex: 1 1 auto; font-size: 15px; font-weight: 700; line-height: 1.5; }
.ag-dev-src-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; font-size: 14.5px; font-weight: 700; line-height: 1.5; color: var(--ink); text-underline-offset: 3px; }
.ag-dev-src-link.is-missing { color: var(--ink3); font-weight: 600; text-decoration: none; }
.ag-more .ag-wrap { padding: 38px var(--gutter) 4px; }
.ag-more-head { display: flex; justify-content: center; margin-bottom: 16px; }
.ag-more-grid { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); }
.ag-more-col--older { display: flex; justify-content: flex-end; }
.ag-more-col--newer { display: flex; justify-content: flex-start; grid-column: 3; }
.ag-tile { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 520px; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.ag-tile:hover { border-color: var(--spine); }
.ag-tile--home { gap: 4px; border: 1.5px dashed var(--line2); background: transparent; }
.ag-tile-dir { font-size: 13.5px; font-weight: 700; line-height: 1.5; color: var(--ink3); }
.ag-tile-row { display: flex; gap: 12px; align-items: flex-start; }
.ag-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-tile-title { font-weight: 800; font-size: 20px; line-height: 1.3; }
.ag-tile-meta { font-size: 14px; line-height: 1.6; color: var(--ink2); }
.ag-endcap--story { padding-top: 50px; }
@media (max-width: 999px) {
  .ag-shead .ag-wrap { padding: 18px 16px 12px 58px; }
  .ag-shead-pin { position: absolute; left: 18px; top: 14px; width: 44px; height: 48px; margin: 0; padding: 2px 0 0; align-items: flex-start; }
  .ag-shead-pin .ag-pin { width: 40px; height: 40px; }
  .ag-shead-card { margin: 0; padding: 16px 16px 18px; border-radius: 14px; align-items: flex-start; text-align: left; gap: 12px; }
  .ag-shead-meta { justify-content: flex-start; gap: 8px; }
  .ag-shead-type { font-size: 14px; }
  .ag-shead-title { font-size: 31px; line-height: 1.22; letter-spacing: 0; }
  .ag-hook--story { align-items: flex-start; }
  .ag-hook--story .ag-hook-row { justify-content: flex-start; gap: 2px 10px; }
  .ag-hook--story .ag-hook-num { font-size: 54px; }
  .ag-hook--story .ag-hook-unit { font-size: 20px; }
  .ag-hook--story .ag-hook-cap { font-size: 14.5px; }
  .ag-shead-dates { font-size: 14.5px; }
  .ag-shead-spark { width: 100%; }
  .ag-shead-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
  .ag-shead-main { max-width: none; gap: 14px; }
  .ag-shead-side { max-width: none; }
  .ag-lede { font-size: 17px; }
  .ag-next-title { font-size: 18px; }
  .ag-ctrl .ag-wrap { padding: 12px 0; }
  .ag-ctrl-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-left: 58px; padding-right: 16px; }
  .ag-ctrl-l { align-items: flex-start; text-align: left; gap: 8px; }
  .ag-order button { padding: 0 14px; font-size: 15px; }
  .ag-legend-box--story { position: static; width: auto; margin: 10px 16px 4px 58px; }
  .ag-dev-img, .ag-dev-fig img { height: 140px; }
  .ag-more .ag-wrap { padding: 26px 0 4px; }
  .ag-more-head { position: relative; justify-content: flex-start; padding: 0 16px 0 58px; margin-bottom: 10px; }
  .ag-more-head .ag-stub { top: 15px; }
  .ag-more-head .ag-pill-title { border: 0; padding: 0; font-size: 21px; line-height: 1.4; }
  .ag-more-grid { display: flex; flex-direction: column-reverse; gap: 10px; margin-left: 58px; padding-right: 16px; }
  .ag-more-col--older, .ag-more-col--newer { display: block; }
  .ag-tile { max-width: none; padding: 16px; }
  .ag-tile-title { font-size: 18px; line-height: 1.35; }
  .ag-tile-meta { font-size: 13.5px; }
  .ag-tile-row .ag-pin { width: 32px; height: 32px; }
}

/* ---- Category page ------------------------------------------------------------------- */
.ag-cathead .ag-wrap { padding: 30px var(--gutter) 18px; }
.ag-cathead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: start; }
.ag-cathead-l { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ag-kicker { font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--ink3); }
.ag-cathead-title { margin: 0; font-weight: 800; font-size: 46px; line-height: 1.2; }
.ag-cathead-r { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 8px; }
.ag-cathead-desc { margin: 0; max-width: 54ch; font-size: 17px; line-height: 1.7; color: var(--ink2); }
.ag-cathead-count { font-size: 15px; font-weight: 700; line-height: 1.6; }
.ag-catnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 22px; }
.ag-catnav-item { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line2); color: var(--ink2); text-decoration: none; font-size: 14.5px; font-weight: 700; background: var(--bg); }
.ag-catnav-item[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 999px) {
  .ag-cathead .ag-wrap { padding: 22px 16px 16px 58px; }
  .ag-cathead-grid { display: flex; flex-direction: column; gap: 4px; }
  .ag-cathead-l { align-items: flex-start; text-align: left; }
  .ag-cathead-l .ag-stub { left: -16.5px; top: 46px; }
  .ag-cathead-title { font-size: 34px; }
  .ag-cathead-r { padding-top: 4px; }
  .ag-cathead-desc { font-size: 16px; }
  .ag-cathead-count { font-size: 14.5px; }
  .ag-catnav { justify-content: flex-start; margin-top: 14px; }
}

/* ---- Text pages (about, search, corrections, tools) ----------------------------------- */
/* On desktop the line hands over to the text instead of running through it. */
.ag-page::before { bottom: auto; height: 22px; }
.ag-page .ag-wrap { padding: 28px var(--gutter) 40px; }
.ag-page-wrap { max-width: 760px; }
.ag-page-kicker { position: relative; display: block; margin-bottom: 6px; }
.ag-page-title { position: relative; margin: 0 0 14px; font-weight: 800; font-size: 40px; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.ag-page-h2 { position: relative; margin: 34px 0 10px; font-weight: 800; font-size: 24px; line-height: 1.35; }
.ag-page .ag-stub, .ag-page-h2 .ag-stub { display: none; }
.ag-page p { margin: 0 0 12px; font-size: 16.5px; line-height: 1.75; color: var(--ink2); }
.ag-page p.ag-lede { color: var(--ink); font-size: 18px; margin-bottom: 18px; }
.ag-page a:not(.ag-btn):not(.ag-result):not(.ag-person-row):not(.ag-tool-card) { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.ag-stat { display: flex; gap: 18px; align-items: flex-start; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin: 6px 0 10px; }
.ag-stat-num { font-weight: 300; font-size: 56px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ag-stat-text { display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.7; color: var(--ink2); }
.ag-stat-text strong { color: var(--ink); font-size: 17px; }
.ag-policy { margin: 0; padding: 0; list-style: none; counter-reset: policy; display: flex; flex-direction: column; gap: 10px; }
.ag-policy li { counter-increment: policy; position: relative; padding: 14px 16px 14px 56px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 15.5px; line-height: 1.7; color: var(--ink2); }
.ag-policy li::before { content: counter(policy); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.ag-policy strong { color: var(--ink); }
.ag-glossary { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15.5px; line-height: 1.7; color: var(--ink2); }
.ag-glossary strong { color: var(--ink); }
.ag-status-explain { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.ag-status-explain > div { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.6; color: var(--ink2); }
.ag-status-explain .ag-chip { flex: 0 0 auto; margin-top: 2px; }
.ag-note { padding: 14px 16px; border-radius: 10px; border: 1px dashed var(--line2); font-size: 15px; line-height: 1.7; color: var(--ink2); }
.ag-back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; }
.ag-back-link[hidden] { display: none; }
@media (max-width: 999px) {
  .ag-page::before { bottom: 0; height: auto; }
  .ag-page .ag-wrap { padding: 20px 16px 32px 58px; }
  .ag-page .ag-stub, .ag-page-h2 .ag-stub { display: block; left: -16.5px; top: 0.7em; }
  .ag-page-title { font-size: 31px; }
  .ag-page-h2 { font-size: 21px; margin-top: 28px; }
  .ag-stat { flex-direction: column; gap: 6px; }
}

/* ---- Tools hub (/tools/) ---------------------------------------------------------------- */
.ag-tools-page .ag-wrap { max-width: 1120px; }
.ag-tool-grid { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ag-tool-grid li { display: flex; }
.ag-tool-card { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 18px 20px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ag-tool-card:hover { border-color: var(--spine); }
.ag-tool-icon { font-size: 28px; line-height: 1.2; }
.ag-tool-title { font-weight: 800; font-size: 19px; line-height: 1.35; }
.ag-tool-desc { flex: 1; font-size: 14.5px; line-height: 1.6; color: var(--ink2); }
.ag-tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ag-tools-page .ag-note { max-width: 760px; }
@media (max-width: 999px) {
  .ag-tool-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
  .ag-tool-card { padding: 16px; }
  .ag-tool-title { font-size: 18px; }
}

/* ---- /admin/: proposals from agents ------------------------------------------------------- */
.ag-admin .ag-wrap { max-width: 1120px; }
.ag-admin-login[hidden], .ag-admin-bar[hidden], .ag-prop-result[hidden] { display: none; }
.ag-admin-login { display: flex; flex-direction: column; gap: 10px; max-width: 520px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ag-admin-login-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ag-admin-login-form .ag-field { flex: 1 1 240px; }
.ag-admin .ag-field-label { display: block; margin-bottom: 4px; font-size: 13.5px; font-weight: 700; color: var(--ink3); }
.ag-admin input[type="text"], .ag-admin input[type="password"], .ag-admin input[type="datetime-local"], .ag-admin textarea, .ag-admin select { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); font-family: inherit; font-size: 15.5px; line-height: 1.5; }
.ag-admin textarea { resize: vertical; min-height: 96px; }
.ag-admin-login-note, .ag-admin-status { margin: 10px 0 0; font-size: 15px; color: var(--ink2); min-height: 1.5em; }
.ag-admin-status.is-error, .ag-admin-login-note.is-error { color: var(--accent-text); font-weight: 700; }
.ag-admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.ag-admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-admin-tab { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; }
.ag-admin-tab.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ag-admin-bar-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ag-admin-who { font-size: 14px; color: var(--ink3); }
.ag-admin-who.is-error { color: var(--accent-text); font-weight: 700; }
.ag-admin-list { display: flex; flex-direction: column; gap: 26px; margin-top: 18px; }
.ag-admin-group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-weight: 800; font-size: 22px; line-height: 1.35; }
.ag-admin-group-title .ag-pin { flex: 0 0 auto; }
.ag-admin-group-meta { font-size: 14px; font-weight: 400; color: var(--ink3); }
.ag-prop { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ag-prop + .ag-prop { margin-top: 12px; }
.ag-prop.is-done { opacity: 0.92; }
.ag-prop-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--ink3); }
.ag-prop-meta strong { color: var(--ink2); }
.ag-prop-note { padding: 10px 14px; border-radius: 10px; background: var(--surface2); font-size: 14.5px; line-height: 1.6; color: var(--ink2); }
.ag-prop-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ag-prop-grid .is-wide { grid-column: 1 / -1; }
.ag-prop-sources { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.ag-prop-sources a { color: var(--ink); font-weight: 700; word-break: break-all; }
.ag-prop-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }
.ag-prop-check input { width: 20px; height: 20px; }
.ag-prop-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ag-prop-img { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.ag-prop-img.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-halo); }
.ag-prop-img img { display: block; width: 100%; height: 170px; object-fit: cover; border-radius: 6px; background: var(--surface2); }
.ag-prop-img-meta { font-size: 13px; line-height: 1.5; color: var(--ink3); word-break: break-all; }
.ag-prop-img.is-failed { color: var(--caution); background: var(--caution-bg); border-color: var(--caution-line); }
.ag-prop-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 4px; border-top: 1px solid var(--line); }
.ag-prop-actions .ag-reject-reason { flex: 1 1 220px; }
.ag-prop-result { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.ag-prop-result.is-ok { border-color: var(--accent); }
.ag-prop-result.is-error { color: var(--accent-text); font-weight: 700; }
.ag-prop-decision { font-size: 14.5px; color: var(--ink2); }
.ag-prop-decision a { color: var(--ink); font-weight: 700; }
.ag-prop-readonly dt { font-size: 13.5px; font-weight: 700; color: var(--ink3); }
.ag-prop-readonly dd { margin: 0 0 8px; font-size: 15.5px; }
@media (max-width: 999px) {
  .ag-prop { padding: 14px; }
  .ag-prop-grid { grid-template-columns: 1fr; }
}

/* Search */
.ag-search--page { display: block; max-width: none; margin: 4px 0 12px; }
.ag-search-summary { font-size: 15px; color: var(--ink2); }
.ag-result-list { display: flex; flex-direction: column; gap: 12px; }
.ag-result { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ag-result:hover { border-color: var(--spine); }
.ag-result-kicker { display: flex; align-items: center; gap: 10px; }
.ag-result-title { font-weight: 800; font-size: 24px; line-height: 1.3; }
.ag-result-match { padding: 10px 14px; border-radius: 8px; background: var(--surface2); font-size: 14.5px; line-height: 1.6; color: var(--ink2); }
.ag-hl { background: var(--accent-halo); color: inherit; padding: 0 2px; border-radius: 3px; }
.ag-people-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ag-person-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.ag-person-row:first-child { border-top: 0; }
.ag-person-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ag-person-meta { font-size: 13.5px; color: var(--ink3); }
.ag-person-arrow { color: var(--ink3); font-size: 20px; }
.ag-search-cta { margin-top: 28px; padding: 18px 20px; border-radius: 12px; border: 1.5px dashed var(--line2); }
.ag-search-cta p { margin: 0 0 6px; font-size: 15.5px; }
.ag-when.is-new { color: var(--accent-text); font-weight: 700; }

/* Corrections form */
.ag-form { display: flex; flex-direction: column; gap: 22px; margin-top: 10px; }
.ag-form-story { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ag-form-story-label { font-size: 13.5px; font-weight: 700; color: var(--ink3); }
.ag-form-story-meta { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; min-height: 24px; }
.ag-select, .ag-form input[type="text"], .ag-form input[type="url"], .ag-form input[type="email"], .ag-form textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.5; }
.ag-form textarea { resize: vertical; }
.ag-form textarea[aria-invalid="true"] { border-color: var(--accent-text); }
.ag-fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.ag-label { display: block; font-size: 17px; font-weight: 800; line-height: 1.4; margin-bottom: 8px; }
.ag-opt { font-weight: 400; color: var(--ink3); }
.ag-radio, .ag-check { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; cursor: pointer; }
.ag-radio input, .ag-check input { width: 20px; height: 20px; accent-color: var(--ink); flex: 0 0 auto; }
.ag-radio:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ag-field { display: flex; flex-direction: column; }
.ag-hint { margin-top: 6px; font-size: 13.5px; color: var(--ink3); }
.ag-btn--wide { width: 100%; justify-content: center; height: 52px; font-size: 17px; }
.ag-form-note { text-align: center; font-size: 14px; color: var(--ink3); }
.ag-form-result { padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ag-form-result[hidden] { display: none; }
.ag-form-result-title { margin: 0; font-weight: 700; color: var(--ink); }
.ag-form-result-text { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 14.5px; line-height: 1.6; color: var(--ink2); }

/* ---- Zoom transition (HANDOFF §7.2) ---------------------------------------------------
   Shared elements: the chosen card -> ag-hero, its pin -> ag-hero-pin, the lifespan glow ->
   ag-glow, the masthead -> ag-masthead. Boxes move on one ease; the fades run on the clock
   with their own keyframe easing so the hand-offs land at the planned percentages. */
.ag-shead-card { view-transition-name: ag-hero; }
.ag-shead-pin { view-transition-name: ag-hero-pin; }
::view-transition { background: var(--bg); }
::view-transition-group(*) { animation-duration: 680ms; animation-timing-function: cubic-bezier(0.55, 0, 0.15, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 680ms; animation-timing-function: linear; mix-blend-mode: normal; }
html.ag-vt-in::view-transition-old(root) { animation-name: ag-page-out-in; transform-origin: var(--ag-o-old, 50% 50%); }
html.ag-vt-in::view-transition-new(root) { animation-name: ag-page-in-in; transform-origin: 50% 15%; }
html.ag-vt-out::view-transition-old(root) { animation-name: ag-page-out-out; transform-origin: 50% 25%; }
html.ag-vt-out::view-transition-new(root) { animation-name: ag-page-in-out; transform-origin: var(--ag-o-new, 50% 50%); }
@keyframes ag-page-out-in { 0% { opacity: 1; transform: scale(1); animation-timing-function: cubic-bezier(0.4, 0, 1, 1); } 40%, 100% { opacity: 0; transform: scale(1.08); } }
@keyframes ag-page-in-in { 0%, 42% { opacity: 0; transform: scale(0.97); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ag-page-out-out { 0% { opacity: 1; transform: scale(1); animation-timing-function: cubic-bezier(0.4, 0, 1, 1); } 40%, 100% { opacity: 0; transform: scale(0.94); } }
@keyframes ag-page-in-out { 0%, 42% { opacity: 0; transform: scale(1.06); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); } 100% { opacity: 1; transform: scale(1); } }
::view-transition-old(ag-hero) { animation: ag-hero-old 680ms linear both; }
::view-transition-new(ag-hero) { animation: ag-hero-new 680ms linear both; }
@keyframes ag-hero-old { 0%, 4% { opacity: 1; } 20%, 100% { opacity: 0; } }
@keyframes ag-hero-new { 0%, 14% { opacity: 0; } 38%, 100% { opacity: 1; } }
::view-transition-old(ag-hero), ::view-transition-new(ag-hero) { height: 100%; object-fit: contain; object-position: 50% 0; mix-blend-mode: normal; }
::view-transition-old(ag-glow), ::view-transition-new(ag-glow) { height: 100%; object-fit: fill; }
::view-transition-image-pair(ag-hero) { isolation: auto; }

/* ---- Reduced motion ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
