/* Open Payments Reform Lab: uses the Intellica site tokens (/kit/tokens.css) so it matches every other page. No inline styles (the CSP allows only style-src 'self'). */
.lab-hero { padding: 3rem 0 1rem; }
.lab-hero .eyebrow, .lab .eyebrow, .lab .kicker { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-ink); margin: 0 0 .5rem; }
.lab-hero .eyebrow a { color: inherit; }
.lab-hero h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; color: var(--text-hi); margin: .4rem 0 1rem; }
.lab-hero p { color: var(--text); max-width: 52rem; }
.lab-hero .lead { font-size: var(--text-lg); color: var(--text-hi); }
.lab-hero .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }

.lab.layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.75rem; align-items: start; padding-block: 1rem 4rem; }
.lab .sidebar { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.lab .sidebar h3 { margin: 0 0 .6rem; font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.lab .sidebar a { display: block; padding: .3rem .45rem; border-radius: 6px; font-size: var(--text-xs); color: var(--text); text-decoration: none; }
.lab .sidebar a:hover { background: var(--card-hi); color: var(--text-hi); }
.lab .sidebar b { color: var(--accent-ink); margin-right: .5rem; font-family: var(--font-mono); }
.lab .content { min-width: 0; }

.lab section { scroll-margin-top: 5rem; }
.lab a { color: var(--accent-ink); }
.lab .overview { padding: .5rem 0 .25rem; }
.lab .overview h2 { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; margin: .25rem 0 .5rem; color: var(--text-hi); }
.lab .overview p { color: var(--text); max-width: 56rem; }

.lab .intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1.25rem 0; }
.lab .metric, .lab .card, .lab .panel, .lab .arc-section { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.lab .arc-section { border-top: 3px solid var(--accent); }
.lab .metric { padding: 1rem; }
.lab .metric b { display: block; font-size: var(--text-md); line-height: 1.3; color: var(--text-hi); }
.lab .metric span { font-size: var(--text-xs); color: var(--muted); }
.lab .card, .lab .panel { padding: 1.1rem; }
.lab .card h3, .lab .panel h3 { margin: 0 0 .5rem; font-size: var(--text-md); color: var(--text-hi); }
.lab .card p, .lab .panel p { color: var(--text); }
.lab .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.lab .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.lab .tag, .lab .pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--card-hi); border: 1px solid var(--line-hi); color: var(--text); font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.lab .tag.fact, .lab .pill.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.lab .tag.proposal, .lab .pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.lab .tag.open { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.lab .note, .lab .callout { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin: 1rem 0; color: var(--text); }
.lab .note.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--card)); }
.lab .note.danger { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--card)); }

.lab .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin: .9rem 0; }
.lab table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.lab th, .lab td { padding: .6rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.lab th { background: var(--card-hi); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.lab tr:last-child td { border-bottom: 0; }

.lab .flowsteps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; margin: 1rem 0; }
.lab .flowstep { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; }
.lab .flowstep b { display: block; font-size: var(--text-sm); color: var(--text-hi); }
.lab .flowstep span { font-size: var(--text-xs); color: var(--muted); }

.lab .arc-section { padding: 1.4rem; margin: 1.25rem 0; }
.lab .section-head { display: flex; gap: .9rem; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: .9rem; margin-bottom: 1rem; }
.lab .section-head .num { display: grid; place-items: center; min-width: 2.7rem; height: 2.7rem; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent-ink); font-family: var(--font-mono); font-weight: 700; }
.lab .section-head h2 { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; margin: 0; color: var(--text-hi); }
.lab .section-head p { margin: .25rem 0 0; color: var(--muted); font-size: var(--text-xs); }
.lab .section-body { color: var(--text); }
.lab .section-body h3 { font-size: var(--text-md); margin: 1.25rem 0 .4rem; color: var(--text-hi); }
.lab .section-body h3:first-child { margin-top: 0; }
.lab .section-body ul, .lab .section-body ol { padding-left: 1.4rem; }
.lab .section-body li { margin: .3rem 0; }

.lab .diagram { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin: 1rem 0; }
.lab .diagram svg { width: 100%; min-width: 680px; height: auto; }
.lab .diagram text { font: 700 14px var(--font-sans); fill: var(--text-hi); text-anchor: middle; }
.lab .diagram .sub[x="28"], .lab .diagram .sub[x="30"], .lab .diagram .sub[x="42"] { text-anchor: start; }
.lab .diagram .sub { font: 11px var(--font-sans); fill: var(--muted); font-weight: 500; }
.lab .diagram .core { fill: color-mix(in srgb, var(--accent) 16%, var(--card)); stroke: var(--accent); stroke-width: 2; }
.lab .diagram .module { fill: var(--card-hi); stroke: var(--line-hi); stroke-width: 1.5; }
.lab .diagram .external { fill: var(--card); stroke: var(--muted); stroke-width: 1.5; }
.lab .diagram .data { fill: color-mix(in srgb, var(--warn) 12%, var(--card)); stroke: var(--warn); stroke-width: 1.5; }
.lab .diagram .zone { fill: transparent; stroke: var(--line-hi); stroke-dasharray: 6 4; }
.lab .diagram .line { stroke: var(--muted); stroke-width: 2; fill: none; }
.lab .diagram .lifeline { stroke: var(--line-hi); stroke-dasharray: 4 5; stroke-width: 1.4; }
.lab .diagram .msg { stroke: var(--accent); stroke-width: 1.8; fill: none; }
.lab .diagram .msg text { font-size: 10px; fill: var(--accent-ink); font-weight: 600; }

.lab pre { background: var(--surface); color: var(--text-hi); border: 1px solid var(--line); padding: .9rem; border-radius: 8px; overflow: auto; font-size: var(--text-xs); line-height: 1.5; }
.lab code { font-family: var(--font-mono); }
.lab dl dt { font-weight: 700; margin-top: .6rem; color: var(--text-hi); }
.lab dl dd { margin: 0 0 .5rem .9rem; color: var(--text); }
.lab .sources li { margin: .5rem 0; font-size: var(--text-xs); }
.lab .small { font-size: var(--text-xs); color: var(--muted); }
.lab .anchor { display: inline-block; margin-left: .5rem; font-size: var(--text-xs); }
.lab .arcnav { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .75rem 0; }
.lab .arcnav a { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; font-size: var(--text-xs); text-decoration: none; color: var(--text); }
.lab .arcnav a:hover { border-color: var(--accent); }
.lab .arcnav a b { color: var(--accent-ink); margin-right: .5rem; font-family: var(--font-mono); }
.lab .divider { height: 1px; background: var(--line); margin: 1.25rem 0; }
.lab-end { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.25rem; color: var(--muted); font-size: var(--text-xs); }

@media (max-width: 1050px) { .lab.layout { grid-template-columns: 14rem minmax(0, 1fr); } .lab .grid.three { grid-template-columns: repeat(2, 1fr); } .lab .flowsteps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .lab.layout { display: block; }
  .lab .sidebar { position: relative; top: auto; max-height: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; margin-bottom: 1rem; }
  .lab .sidebar h3 { grid-column: 1 / -1; }
  .lab .intro-grid, .lab .grid, .lab .grid.three { grid-template-columns: 1fr; }
  .lab .arcnav, .lab .flowsteps { grid-template-columns: repeat(2, 1fr); }
  .lab .arc-section { padding: 1rem; }
  .lab .section-head h2 { font-size: var(--text-lg); }
}
@media print { .lab .sidebar, .lab-hero .actions { display: none; } .lab.layout { display: block; } .lab .arc-section { break-inside: avoid; } }
