:root {
  color-scheme: light;
  --night: #0B1120; --dark: #0F172A; --light: #F8FAFC;
  --canvas: #F4F7FB; --paper: #FFF; --line: #E2E8F0; --muted: #475569;
  --blue: #0284C7; --hover: #0369A1; --emerald: #10B981;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --shadow: 0 1px 2px #0f172a08, 0 7px 22px #0f172a08;
  --grid: linear-gradient(#94a3b811 1px, transparent 1px), linear-gradient(90deg, #94a3b811 1px, transparent 1px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--dark); background: var(--canvas); font: 500 1rem/1.55 var(--sans); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:is(a, button, summary):focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.mono, .code, .regulation, .metric strong, .project-stat strong, .eyebrow { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { width: min(1184px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Navigation */
.topbar { height: 56px; position: sticky; top: 0; z-index: 5; color: var(--light); background: var(--grid), #0B1120F5; background-size: 24px 24px; backdrop-filter: blur(14px); border-bottom: 1px solid #cbd5e128; }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: .82rem; font-weight: 800; line-height: 1.15; min-width: 0; }
.brand img { width: 60px; height: 26px; object-fit: contain; flex: none; }
.brand > span { border-left: 1px solid #cbd5e135; padding-left: 12px; }
.live, .badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border-radius: 100px; padding: 4px 9px; font-size: .69rem; font-weight: 800; line-height: 1.35; }
.live, .featured .badge.active { background: #10b98119; border: 1px solid #10b98142; color: #a7f3d0; }
.live { font-variant-numeric: tabular-nums; }
.dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 3px #10b98122; }
.switch { position: relative; margin-left: auto; flex: none; }
.switch summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid #cbd5e135; border-radius: 7px; font-size: .75rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.switch summary::-webkit-details-marker { display: none; }
.switch summary:hover { background: #ffffff10; }
.switch summary svg { width: 14px; height: 14px; }
.switch[open] summary svg { transform: rotate(180deg); }
.switch ul { position: absolute; right: 0; top: 100%; width: min(365px, calc(100vw - 32px)); max-height: calc(100dvh - 68px); overflow: auto; margin: 8px 0 0; padding: 6px; list-style: none; background: var(--night); border: 1px solid #475569; border-radius: 10px; box-shadow: 0 12px 32px #0004; }
.switch li a { display: flex; gap: 10px; align-items: baseline; padding: 7px 9px; border-radius: 5px; font-size: .77rem; }
.switch li a:is(:hover, [aria-current='page']) { background: #ffffff14; }
.switch li .mono { color: #7dd3fc; }

/* Portal heading and indicators */
.hero { color: var(--light); background: radial-gradient(ellipse at 83% 0%, #0284c731, transparent 55%), var(--grid), var(--night); background-size: auto, 24px 24px, 24px 24px, auto; border-bottom: 1px solid #0284c760; }
.portal-hero { padding: 38px 0 56px; }
.eyebrow { color: var(--hover); font-size: .72rem; font-weight: 600; letter-spacing: .105em; text-transform: uppercase; }
.hero .eyebrow { color: #7dd3fc; }
.eyebrow > span { display: inline-block; width: 20px; height: 1px; background: currentColor; margin: 0 5px; vertical-align: middle; }
.hero h1 { font-size: clamp(2rem, 4.25vw, 3.65rem); line-height: 1.07; letter-spacing: -.066em; font-weight: 800; margin: 9px 0 13px; overflow-wrap: anywhere; }
.portal-hero h1 + p { color: #cbd5e1; max-width: 68ch; font-size: .96rem; }
.workspace { padding-bottom: 56px; }
.metrics { display: grid; gap: 12px; margin: -24px 0 32px; position: relative; }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.metric { padding: 13px 16px; display: flex; flex-direction: column; gap: 4px; }
.metric > span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.metric strong { font-weight: 600; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.07em; line-height: 1.13; margin-top: auto; }
.metric strong small { font: inherit; font-size: .58em; letter-spacing: normal; }
.metric small { color: var(--muted); font-size: .69rem; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row progress { appearance: none; min-width: 0; flex: 1; height: 5px; border: 0; border-radius: 20px; overflow: hidden; background: var(--line); color: var(--blue); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--blue); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 15px; }
.section-heading h2 { font-size: clamp(1.33rem, 3vw, 1.9rem); letter-spacing: -.045em; line-height: 1.2; margin-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #e9eff6; border-radius: 100px; }
.filters button { color: var(--muted); cursor: pointer; background: transparent; border: 1px solid transparent; border-radius: 100px; padding: 4px 10px; font-size: .73rem; font-weight: 800; }
.filters button:hover { color: var(--hover); }
.filters button[aria-pressed='true'] { background: var(--paper); color: var(--hover); border-color: var(--line); box-shadow: var(--shadow); }

/* Scheme cards and featured KPBU */
.schemes, .panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.scheme-card { display: flex; flex-direction: column; align-items: flex-start; padding: 17px; min-height: 174px; transition: transform .18s, border-color .18s, box-shadow .18s; }
.scheme-card:is(:hover, :focus-within) { transform: translateY(-3px); border-color: #0284c780; box-shadow: 0 9px 24px #0f172a16; }
.card-top { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 12px; }
.icon-tile { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 8px; background: #eaf5fc; color: var(--hover); border: 1px solid #0284c724; }
.icon-tile svg { width: 20px; height: 20px; }
.code { color: var(--muted); font-size: .68rem; white-space: nowrap; letter-spacing: .04em; }
.badge { color: #334155; background: #eef2f7; }
.card-top .badge { margin-left: auto; }
.scheme-card h3 { font-size: 1rem; line-height: 1.34; letter-spacing: -.027em; font-weight: 800; overflow-wrap: anywhere; }
.regulation { display: inline-block; color: #334155; background: #f1f5f9; border-radius: 5px; padding: 3px 6px; font-size: .67rem; overflow-wrap: anywhere; margin: 8px 0 11px; }
.card-link, .button { display: inline-flex; gap: 7px; align-items: center; font-weight: 800; font-size: .77rem; }
.card-link { margin-top: auto; color: var(--hover); }
:is(.card-link, .button, .back) svg { flex: none; width: 15px; height: 15px; transition: transform .18s; }
.scheme-card:is(:hover, :focus-within) :is(.card-link, .button) svg { transform: translateX(3px); }
.featured { grid-column: span 2; padding: 19px; color: var(--light); border-color: var(--blue); background: radial-gradient(ellipse at right top, #0284c735, transparent 64%), var(--grid), var(--dark); background-size: auto, 24px 24px, 24px 24px, auto; }
.featured:is(:hover, :focus-within) { border-color: #38bdf8; }
.featured .code { color: #bae6fd; }
.featured .icon-tile, .scheme-intro .icon-tile { background: #0284c72b; border-color: #38bdf840; color: #7dd3fc; }
.featured-body { width: 100%; display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.featured h3 { font-size: clamp(1.95rem, 4vw, 2.9rem); line-height: 1; letter-spacing: -.06em; }
.featured-subtitle { color: #dbeafe; font-size: .87rem; margin-top: 4px; }
.featured .regulation, .scheme-intro .regulation { color: #dbeafe; background: #ffffff13; margin-bottom: 7px; }
.project-stat { align-self: center; flex: none; padding-left: 14px; border-left: 1px solid #94a3b853; color: #bae6fd; font-size: .77rem; }
.project-stat strong { display: block; color: var(--light); font-size: clamp(1.4rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -.065em; }
.feature-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.feature-list span { color: #e0f2fe; border: 1px solid #94a3b84d; border-radius: 100px; padding: 2px 8px; font-size: .67rem; }
.button { border-radius: 7px; padding: 8px 11px; }
.primary { background: var(--blue); border: 1px solid var(--blue); color: var(--night); }
.primary:hover { background: var(--hover); color: white; }

/* Scheme detail */
.scheme-hero { padding: 20px 0 48px; }
.breadcrumb { display: flex; gap: 8px; align-items: baseline; color: #cbd5e1; font-size: .73rem; margin-bottom: 17px; }
.breadcrumb a { color: #7dd3fc; }
.breadcrumb a:hover { text-decoration: underline; }
.scheme-intro { display: flex; align-items: start; gap: 13px; }
.scheme-intro .icon-tile { width: 48px; height: 48px; }
.scheme-intro .icon-tile svg { width: 25px; height: 25px; }
.scheme-intro h1 { margin: 4px 0 2px; font-size: clamp(1.55rem, 3.65vw, 2.75rem); }
.scheme-intro .badge { background: #ffffff15; color: #e2e8f0; }
.step-label { margin-top: 12px; }
.stepper { display: flex; flex-wrap: wrap; gap: 5px 12px; list-style: none; padding: 0; margin: 7px 0 0; }
.stepper li { display: flex; gap: 6px; align-items: center; color: #e2e8f0; font-size: .78rem; font-weight: 700; }
.stepper li + li::before { content: '→' / ''; color: #7dd3fc; margin-right: 4px; }
.step-index { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #7dd3fc55; color: #bae6fd; border-radius: 50%; font-size: .64rem; }
.panel { padding: 15px; display: flex; flex-direction: column; }
.panel h2 { font-size: .96rem; margin-bottom: 11px; }
.panel-slot { display: grid; flex: 1; place-items: center; align-content: center; gap: 8px; min-height: 120px; background: var(--canvas); border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); font-size: .78rem; }

/* Wrapper: let the iframe own the remaining viewport */
.topbar-compact { height: 48px; background: var(--night); }
.topbar-compact .wrap { width: calc(100% - 32px); }
.back { display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 800; color: #e0f2fe; }
.back:hover { color: #7dd3fc; }
.wrapper-crumb { color: #cbd5e1; border-left: 1px solid #cbd5e135; padding-left: 15px; font-size: .73rem; }
.wrapper-crumb span { margin-inline: 3px; }
.embed-main, .embed-main iframe { display: block; width: 100%; height: calc(100vh - 48px); height: calc(100dvh - 48px); border: 0; }
.embed-main { position: relative; }
.embed-main noscript p { position: absolute; inset: 16px auto auto 16px; }

@media (max-width: 950px) {
  .schemes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .brand { gap: 7px; font-size: .72rem; }
  .brand > span { padding-left: 7px; }
  .brand img { width: 44px; }
  .topbar-inner { gap: 8px; }
  .portal-hero { padding-top: 29px; padding-bottom: 46px; }
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .metric { padding-inline: 10px; }
  .wrapper-crumb { padding-left: 8px; }
}
@media (max-width: 490px) {
  .schemes { grid-template-columns: minmax(0, 1fr); }
  .featured { grid-column: auto; }
  .live { padding: 3px 5px; font-size: .59rem; }
  .live .dot { width: 5px; height: 5px; }
  .switch summary { padding-inline: 5px; font-size: .69rem; }
  .wrapper-crumb { font-size: .64rem; }
  .back { font-size: .66rem; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .scheme-card:is(:hover, :focus-within) { transform: none; }
}
