:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --general: #3867d6;
  --agentic: #148f77;
  --physical: #c0392b;
  --decision: #b54708;
  --proposed: #6941c6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 999; background: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.hero { color: white; background: #111827; border-bottom: 1px solid rgba(255,255,255,.08); }
.hero__home { display: block; color: inherit; text-decoration: none; }
.hero__home:hover { background: rgba(255,255,255,.02); }
.hero__home:focus-visible { outline: 3px solid #f79009; outline-offset: -3px; }
.hero__inner { max-width: 1480px; margin: auto; padding: 30px 36px 26px; }
.hero__eyebrow { display: flex; align-items: center; gap: 8px; color: #98a2b3; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.release-dot { width: 7px; height: 7px; border-radius: 50%; background: #f79009; box-shadow: 0 0 0 4px rgba(247,144,9,.12); }
.hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-top: 14px; }
.hero h1 { margin: 0; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.035em; font-weight: 680; }
.hero p { margin: 8px 0 0; color: #b9c0cc; font-size: 13px; }

.domain-nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.domain-nav__inner { max-width: 1480px; margin: auto; padding: 11px 36px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.domain-pill { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid var(--line); background: white; color: #344054; border-radius: 999px; padding: 7px 13px; font-size: 12px; font-weight: 650; text-decoration: none; }
.domain-pill:hover { border-color: #98a2b3; }
.domain-pill.active { background: var(--ink); border-color: var(--ink); color: white; }
.domain-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.domain-icon { width: 17px; text-align: center; font-size: 13px; line-height: 1; }
.domain-pill--general { color: var(--general); }
.domain-pill--agentic { color: var(--agentic); }
.domain-pill--physical { color: var(--physical); }
.domain-pill--decision { color: var(--decision); }
.report-pill { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; margin-left: auto; padding: 7px 12px; border-radius: 999px; background: #173458; color: white; text-decoration: none; font-size: 12px; font-weight: 750; }
.report-pill:hover { background: #102b4d; }
.report-pill:focus-visible { outline: 3px solid rgba(23,52,88,.24); outline-offset: 2px; }
.report-pill b { padding: 2px 7px; border-radius: 999px; background: #c7352c; color: white; font-size: 9px; letter-spacing: .04em; }

main { max-width: 1480px; margin: auto; padding: 28px 36px 48px; }
.overview, .explorer { margin-bottom: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-kicker { margin: 0 0 5px; color: #98a2b3; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.text-link { color: #475467; font-size: 12px; text-decoration: none; border-bottom: 1px solid #98a2b3; }
.text-link:hover { color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 132px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--ink)); }
.stat-card span { color: #475467; font-size: 12px; font-weight: 650; }
.stat-level-icon { margin-right: 6px; color: var(--accent, var(--ink)); font-style: normal; }
.stat-card strong { margin-top: auto; font-size: 28px; letter-spacing: -.04em; }
.stat-card small { margin-top: 4px; color: #98a2b3; font-size: 10px; }
.stat-card--dark { --accent: var(--ink); }
.stat-card--l2 { --accent: var(--general); }
.stat-card--l3 { --accent: var(--agentic); }
.stat-card--l4 { --accent: var(--physical); }

.explorer__heading { margin-top: 8px; }
.result-summary { margin: 0; color: #667085; font-size: 12px; }
.result-summary strong { color: var(--ink); font-size: 16px; }
.filter-shell { display: grid; grid-template-columns: minmax(250px, 1.8fr) repeat(4, minmax(125px, .7fr)) auto; gap: 9px; align-items: end; margin-bottom: 12px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-shell label { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: #667085; font-size: 10px; font-weight: 700; }
.filter-shell select, .search-box { height: 38px; border: 1px solid #d0d5dd; border-radius: 8px; background: white; color: #344054; }
.filter-shell select { width: 100%; padding: 0 30px 0 10px; font-size: 12px; outline: none; }
.filter-shell select:focus, .search-box:focus-within { border-color: #475467; box-shadow: 0 0 0 3px rgba(71,84,103,.1); }
.search-box { align-self: end; position: relative; display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; padding: 0 10px; }
.search-box > span:not(.sr-only) { color: #667085; font-size: 20px; line-height: 1; transform: rotate(-15deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 13px; }
.search-box kbd { padding: 2px 6px; border: 1px solid #d0d5dd; border-radius: 4px; background: #f9fafb; color: #98a2b3; font-size: 10px; }
.clear-button { height: 38px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 8px; background: #f9fafb; color: #475467; font-size: 11px; font-weight: 650; }
.clear-button:hover { background: #f2f4f7; }

.explorer-layout { display: grid; grid-template-columns: 312px minmax(0, 1fr); gap: 12px; align-items: start; }
.taxonomy-panel { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.taxonomy-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.taxonomy-panel__head div { display: flex; flex-direction: column; gap: 2px; }
.taxonomy-panel__head div span { color: #98a2b3; font-size: 9px; letter-spacing: .14em; font-weight: 800; }
.taxonomy-panel__head strong { font-size: 12px; }
.node-count { color: #667085; background: #f2f4f7; border-radius: 999px; padding: 3px 7px; font-size: 9px; }
.taxonomy-tree { max-height: calc(100vh - 146px); overflow: auto; padding: 8px; }
.tree-domain { margin-bottom: 4px; }
.tree-domain summary { list-style: none; display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; }
.tree-domain summary::-webkit-details-marker { display: none; }
.tree-domain summary::before { content: "›"; color: #98a2b3; font-size: 15px; transform: rotate(0); transition: transform .15s; }
.tree-domain[open] summary::before { transform: rotate(90deg); }
.tree-domain summary:hover { background: #f9fafb; }
.tree-domain-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px; background: color-mix(in srgb, var(--domain-color) 10%, white); font-size: 12px; }
.tree-count { margin-left: auto; color: #98a2b3; font-size: 9px; }
.tree-children { padding-left: 18px; }
.tree-node { display: flex; align-items: flex-start; gap: 6px; width: 100%; padding: 6px 7px; border: 0; border-radius: 6px; background: transparent; color: #475467; text-align: left; font-size: 10px; line-height: 1.35; }
.tree-node:hover, .tree-node.active { background: #f2f4f7; color: var(--ink); }
.tree-node code { flex: 0 0 auto; color: #98a2b3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.tree-node span { flex: 1; }
.tree-node b { color: #98a2b3; font-size: 9px; font-weight: 600; }

.results { min-width: 0; }
.active-filter { margin-bottom: 10px; padding: 9px 12px; border-radius: 8px; background: #eef4ff; color: #3538cd; font-size: 11px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.risk-card { display: flex; flex-direction: column; min-height: 220px; padding: 14px; border: 1px solid var(--line); border-top: 3px solid var(--card-accent, var(--ink)); border-radius: 10px; background: white; box-shadow: 0 1px 2px rgba(16,24,40,.04); cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.risk-card--retired { background: #fafafa; border-style: dashed; }
.risk-card:hover { transform: translateY(-2px); border-color: #c4c9d2; box-shadow: 0 8px 20px rgba(16,24,40,.08); }
.risk-card:focus-visible { outline: 3px solid rgba(56,103,214,.25); outline-offset: 2px; }
.risk-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.risk-card__identity, .dialog-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.risk-id { color: #475467; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 750; letter-spacing: .03em; }
.risk-id--domain { padding: 4px 7px; border-radius: 6px; background: var(--card-accent); color: white; }
.domain-badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 999px; background: color-mix(in srgb, var(--card-accent) 10%, white); color: var(--card-accent); font-size: 8px; font-weight: 750; letter-spacing: .02em; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--locked { color: #b42318; background: #fef3f2; }
.status--proposed { color: #5925dc; background: #f4f3ff; }
.status--decision { color: #b54708; background: #fffaeb; }
.status--merged { color: #475467; background: #f2f4f7; }
.risk-card h3 { margin: 12px 0 7px; font-size: 14px; line-height: 1.35; letter-spacing: -.012em; }
.merged-note { margin: -2px 0 8px; color: #667085; font-size: 10px; font-weight: 700; }
.risk-card__definition { display: -webkit-box; overflow: hidden; margin: 0; color: #667085; font-size: 11px; line-height: 1.55; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.risk-card__definition span { color: #475467; }
.risk-card__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.breadcrumb { display: -webkit-box; overflow: hidden; color: #667085; font-size: 9px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.metric { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; color: #98a2b3; font-size: 8px; }
.metric strong { color: #344054; font-size: 13px; }
.empty-state { grid-column: 1 / -1; padding: 70px 24px; border: 1px dashed #d0d5dd; border-radius: 12px; background: white; text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; }
.empty-state span { color: #667085; font-size: 12px; }
.loading-card { height: 220px; border-radius: 10px; background: linear-gradient(90deg,#f2f4f7 25%,#fafafa 38%,#f2f4f7 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.pagination { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 18px; }
.pagination button { min-width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #475467; font-size: 11px; }
.pagination button:hover:not(:disabled), .pagination button.active { background: var(--ink); border-color: var(--ink); color: white; }
.pagination button:disabled { cursor: not-allowed; opacity: .45; }

.card-dialog { width: min(720px, calc(100vw - 28px)); max-height: min(820px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(16,24,40,.28); }
.card-dialog::backdrop { background: rgba(16,24,40,.58); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; color: #475467; font-size: 22px; line-height: 1; }
.dialog-body { padding: 28px; }
.dialog-identity { padding-right: 44px; }
.dialog-body h2 { margin: 12px 45px 5px 0; font-size: 23px; line-height: 1.25; letter-spacing: -.03em; }
.dialog-path { margin: 13px 0; padding: 9px 11px; border-radius: 8px; background: #f2f4f7; color: #475467; font-size: 10px; }
.dialog-section { margin-top: 22px; }
.dialog-section h3 { margin: 0 0 7px; color: #344054; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.dialog-section p { margin: 0; color: #475467; font-size: 13px; line-height: 1.68; }
.dialog-section .definition-ko { margin-top: 8px; color: #667085; }
.dialog-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.dialog-metrics div { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.dialog-metrics span { display: block; color: #98a2b3; font-size: 9px; }
.dialog-metrics strong { display: block; margin-top: 4px; font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.axis-tag { padding: 5px 8px; border-radius: 6px; background: #eef4ff; color: #3538cd; font-size: 10px; font-weight: 700; }
.reference-list { list-style: none; margin: 0; padding: 0; }
.reference-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.reference-list a { color: #175cd3; text-decoration: none; font-size: 12px; font-weight: 650; }
.reference-list small { display: block; margin-top: 3px; color: #98a2b3; }
.reference-list .reference-justification { margin: 0 0 7px; padding: 8px 10px; border-left: 2px solid #d0d5dd; border-radius: 0 5px 5px 0; background: #f9fafb; color: #475467; font-size: 12px; line-height: 1.55; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 36px; background: #111827; color: #98a2b3; font-size: 11px; }
footer div { display: flex; flex-direction: column; gap: 3px; }
footer strong { color: white; }
footer p { margin: 0; }

@media (max-width: 1180px) {
  .filter-shell { grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(130px, 1fr)); }
  .clear-button { align-self: end; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .hero__inner, .domain-nav__inner, main { padding-left: 18px; padding-right: 18px; }
  .hero__row { align-items: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-shell { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .explorer-layout { grid-template-columns: 1fr; }
  .taxonomy-panel { position: static; max-height: none; }
  .taxonomy-tree { max-height: 360px; }
  footer { padding: 22px 18px; align-items: flex-start; flex-direction: column; }
  .report-pill { margin-left: 6px; }
}
@media (max-width: 560px) {
  .hero__inner { padding-top: 24px; padding-bottom: 22px; }
  .hero h1 { font-size: 25px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .stat-grid, .cards-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 112px; }
  .filter-shell { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .dialog-body { padding: 22px 18px; }
  .dialog-metrics { grid-template-columns: repeat(2, 1fr); }
}

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