:root {
  color-scheme: dark;
  --bg: #171715;
  --surface: #22221e;
  --surface-raised: #292923;
  --line: #424139;
  --text: #f1eee2;
  --muted: #bbb7a8;
  --ember: #ff9b5b;
  --ember-dark: #5c3021;
  --green: #a9d8a7;
  --yellow: #f0cc76;
  --red: #ff9c8d;
  --focus: #ffe1a6;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 9% 0%, rgba(143, 67, 35, 0.24), transparent 38rem),
    radial-gradient(ellipse at 92% 26rem, rgba(76, 93, 58, 0.09), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button, input { font: inherit; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(23, 23, 21, 0.92);
  backdrop-filter: blur(14px);
}

.skip-link { position: absolute; z-index: 5; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); border-radius: 7px; background: var(--focus); color: #24180f; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.12em; }
.fire-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(255, 155, 91, 0.35); border-radius: 50%; background: rgba(255, 155, 91, 0.08); color: var(--ember); font-size: 1.2rem; }
.topbar-label { color: var(--muted); font-size: 0.9rem; }
.topbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.control-label { color: var(--muted); font-size: 0.75rem; }
.header-select { min-height: 36px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-raised); color: var(--text); }
.header-select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.hero-banner { margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.hero-banner img { display: block; width: 100%; height: auto; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.hero-links .button-secondary { text-decoration: none; }
.intro { padding: clamp(42px, 7vw, 82px) 0 30px; }
.eyebrow { margin: 0 0 10px; color: var(--ember); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.3rem, 6vw, 4.6rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.04em; }
.lede { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.65; }
.language-note { margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(150deg, rgba(255,255,255,0.035), transparent 65%), var(--surface); box-shadow: var(--shadow); }
.how-it-works { margin-bottom: 16px; padding: 22px 24px; }
.how-it-works .section-heading { margin-bottom: 18px; }
.how-it-works .section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.steps-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps-list li { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.step-number { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--ember-dark); color: var(--ember); font-weight: 800; }
.steps-list h3 { margin: 2px 0 6px; font-size: 0.9rem; line-height: 1.35; }
.steps-list p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; overflow-wrap: anywhere; }
.loader { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; padding: 26px; border-color: #55463a; }
.loader h2 { margin-bottom: 6px; font-size: 1.2rem; }
.loader-copy > p:last-child { margin: 0; color: var(--muted); font-size: 0.9rem; }
code { color: #f5d8bd; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.loader-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.file-button, .button-secondary, .button-primary { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-weight: 700; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease; }
.button-primary { border-color: var(--ember); background: var(--ember); color: #28170e; }
.file-button { background: var(--surface-raised); }
.button-secondary { background: var(--surface-raised); }
.button-primary:hover { transform: translateY(-1px); background: #ffb27c; }
.file-button:hover { transform: translateY(-1px); border-color: var(--ember); }
.button-secondary:hover { transform: translateY(-1px); border-color: var(--ember); }
.button-primary:disabled, .button-secondary:disabled { cursor: wait; opacity: 0.6; }
#package-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
#package-file:focus-visible ~ .file-button { outline: 3px solid var(--yellow); outline-offset: 3px; }
.file-button:focus-within, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.status { grid-column: 1 / -1; min-height: 1.4em; margin: 8px 0 0; color: var(--muted); font-size: 0.88rem; }
.status[data-kind="success"] { color: var(--green); }
.status[data-kind="error"] { color: var(--red); }
.empty-state { margin: 22px 0 68px; padding: clamp(38px, 7vw, 72px) 24px; border: 1px dashed #5c5749; border-radius: 14px; text-align: center; }
.empty-icon { display: inline-grid; width: 42px; height: 42px; place-items: center; margin-bottom: 18px; border-radius: 50%; background: var(--ember-dark); color: var(--ember); font-size: 1.6rem; }
.empty-state h2 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 500; }
.empty-state p { max-width: 560px; margin: 0 auto; color: var(--muted); line-height: 1.6; }
.example-notice { margin: 24px 0 14px; padding: 12px 16px; border-left: 3px solid var(--yellow); background: rgba(240, 204, 118, 0.08); color: #f6dda0; font-size: 0.9rem; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; margin-top: 24px; }
.change-card, .route-card, .detail-card { padding: 24px; }
.change-card { border-top: 2px solid #9a6441; }
.route-card { border-top: 2px solid var(--ember); background: radial-gradient(ellipse at 100% 0%, rgba(255, 155, 91, 0.08), transparent 24rem), var(--surface); }
.change-card h2, .route-card h2, .detail-card h2 { margin-bottom: 14px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.project-name { margin: -5px 0 22px; color: var(--muted); overflow-wrap: anywhere; }
.identity-list { display: grid; gap: 13px; margin: 0; }
.identity-list > div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; }
dt { color: var(--muted); font-size: 0.83rem; }
dd { margin: 0; overflow-wrap: anywhere; font-size: 0.88rem; font-weight: 650; }
.sha { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; }
.path-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 0; padding: 0; list-style: none; }
.path-item { max-width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: #191916; color: #ddd8c9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.73rem; overflow-wrap: anywhere; }
.route-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.route-title { text-transform: uppercase; letter-spacing: 0.06em; }
.route-targeted_review { color: var(--yellow); }
.route-deep_review { color: var(--red); }
.route-covered_by_evidence { color: var(--green); }
.route-glyph { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--ember); font-weight: 800; }
.route-description { max-width: 620px; color: var(--muted); line-height: 1.55; }
.route-card h3 { margin: 20px 0 8px; font-size: 0.88rem; }
.reason-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.reason-item { padding: 6px 9px; border-radius: 5px; background: #353329; color: #e7d9b9; font-size: 0.75rem; }
.capacity { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.capacity > div { display: grid; gap: 5px; }
.capacity span { color: var(--muted); font-size: 0.73rem; }
.capacity strong { font-size: 1.05rem; }
.capacity > div:last-child strong { color: var(--ember); }
.schedule-state { margin: 13px 0 0; color: var(--muted); font-size: 0.79rem; }
.package-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; padding: 13px 16px; border: 1px solid #4d4639; border-radius: 10px; background: rgba(34, 34, 30, 0.82); }
.package-nav span { margin-right: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; }
.package-nav a { min-height: 38px; display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid #4a483e; border-radius: 99px; background: #292923; color: var(--text); text-decoration: none; font-size: 0.78rem; transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease; }
.package-nav a:hover { border-color: var(--ember); background: #34291f; color: #ffbd8e; }
.package-nav a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.detail-card { scroll-margin-top: 18px; }
.sast-card { border-top: 2px solid #b8793b; }
.sast-finding { border-left: 3px solid var(--ember); }
.severity-pill { flex: 0 0 auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; }
.severity-pill.severity-critical, .severity-pill.severity-high { border-color: rgba(214, 95, 80, 0.65); color: #ff9386; }
.severity-pill.severity-medium { border-color: rgba(224, 169, 76, 0.65); color: #f0cc76; }
.state-pill.sast-available { color: var(--green); }
.state-pill.sast-no_findings { color: var(--muted); }
.state-pill.sast-partial, .state-pill.sast-unavailable, .state-pill.sast-legacy { color: var(--yellow); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; }
.count { min-width: 28px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); text-align: center; font-size: 0.75rem; }
.stack-list { display: grid; gap: 9px; }
.item-card { padding: 13px; border: 1px solid #3d3b33; border-radius: 9px; background: #1b1b18; }
.item-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-title { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.state-pill, .candidate-pill { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #62604f; border-radius: 99px; color: var(--yellow); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.state-supported, .state-pass { border-color: #4a7250; color: var(--green); }
.state-fail, .state-contradicted { border-color: #8b4a3f; color: var(--red); }
.coverage-complete { border-color: #8a7545; color: var(--yellow); }
.coverage-partial { border-color: #8b4a3f; color: var(--red); }
.coverage-unknown { border-color: #8a7545; color: var(--yellow); }
.candidate-pill { border-color: #886244; color: #ffbd8e; }
.item-text { margin: 9px 0 0; color: #e0dccf; font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }
.item-meta { margin: 8px 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.45; overflow-wrap: anywhere; }
.task-minutes { color: var(--ember); font-size: 0.8rem; font-weight: 750; }
.subtle { margin: -5px 0 14px; color: var(--muted); font-size: 0.83rem; line-height: 1.5; }
.mapper-card { grid-column: 1 / -1; border-top: 2px solid #bc8050; }
.mapper-subheading { margin: 20px 0 10px; font-size: 0.88rem; }
.coverage-detail { margin: 0; padding: 10px 12px; border-left: 2px solid #8a7545; background: #20201c; }
.empty-list { margin: 0; padding: 12px; color: var(--muted); font-size: 0.84rem; }
.package-footer { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin: 16px 0 52px; padding: 16px 2px; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.package-footer p { margin: 0; overflow-wrap: anywhere; }
.package-footer code { overflow-wrap: anywhere; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px clamp(20px, 5vw, 72px); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; }
.site-footer span:first-child { color: var(--ember); font-weight: 800; letter-spacing: 0.1em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar-tools { flex-wrap: wrap; }
  .loader { grid-template-columns: 1fr; }
  .loader-actions { margin-top: 9px; }
  .steps-list, .overview-grid, .detail-grid { grid-template-columns: 1fr; }
  .package-footer { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding-top: 10px; padding-bottom: 10px; }
  .topbar-tools { justify-content: flex-start; gap: 6px; }
  .topbar-label { flex-basis: 100%; margin-bottom: 3px; }
  .control-label { margin-left: 2px; }
  .topbar-label { font-size: 0.78rem; }
  .shell { width: min(100% - 28px, 1120px); }
  .loader, .change-card, .route-card, .detail-card { padding: 18px; }
  .loader-actions { align-items: stretch; }
  .file-button, .button-secondary, .button-primary { flex: 1 1 100%; }
  .capacity { gap: 5px; }
  .capacity strong { font-size: 0.92rem; }
  .site-footer { flex-direction: column; }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: #fffdf9;
  --surface-raised: #f0ece5;
  --line: #d5cec2;
  --text: #25231f;
  --muted: #625d53;
  --ember: #914316;
  --ember-dark: #f5e4d9;
  --green: #24613b;
  --yellow: #715300;
  --red: #a2342a;
  --focus: #1254a3;
  --shadow: 0 18px 48px rgba(50, 39, 25, 0.09);
}

html[data-theme="light"] .topbar { background: rgba(255, 253, 249, 0.94); }
html[data-theme="light"] .panel { background: linear-gradient(150deg, rgba(71, 49, 27, 0.025), transparent 65%), var(--surface); }
html[data-theme="light"] .loader { border-color: #c6ad99; }
html[data-theme="light"] code { color: #713c1d; }
html[data-theme="light"] .button-primary { background: #914316; border-color: #914316; color: #fffdf9; }
html[data-theme="light"] .button-primary:hover { background: #78360f; }
html[data-theme="light"] .file-button { border-color: #d5cec2; background: #f0ece5; color: #25231f; }
html[data-theme="light"] .steps-list li { border-color: #ded8ce; }
html[data-theme="light"] .empty-state { border-color: #aaa08e; }
html[data-theme="light"] .example-notice { background: #fff4d2; color: #573e00; }
html[data-theme="light"] .path-item { background: #f4f1eb; color: #39352e; }
html[data-theme="light"] .reason-item { background: #eee8da; color: #4b3c18; }
html[data-theme="light"] .package-nav { border-color: #d1c7b7; background: rgba(255, 253, 249, 0.9); }
html[data-theme="light"] .package-nav a { border-color: #d5cec2; background: #f2eee7; }
html[data-theme="light"] .package-nav a:hover { background: #f9e8dc; color: #713c1d; }
html[data-theme="light"] .item-card { border-color: #ded8ce; background: #fbfaf7; }
html[data-theme="light"] .item-text { color: #37342f; }
html[data-theme="light"] .state-pill, html[data-theme="light"] .candidate-pill { border-color: #aaa18f; }
html[data-theme="light"] .state-supported, html[data-theme="light"] .state-pass { border-color: #8ab398; }
html[data-theme="light"] .state-fail, html[data-theme="light"] .state-contradicted { border-color: #d49a91; }
html[data-theme="light"] .candidate-pill { border-color: #c39a7a; color: #713c1d; }
html[data-theme="light"] .coverage-complete, html[data-theme="light"] .coverage-unknown { border-color: #c5aa62; }
html[data-theme="light"] .coverage-partial { border-color: #d49a91; }
html[data-theme="light"] .coverage-detail { border-color: #bd9d50; background: #f5f0e2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
