:root {
  --navy: #003087;
  --blue: #0070e0;
  --ink: #06182f;
  --muted: #50617a;
  --line: #d7e4f4;
  --wash: #eef5ff;
  --panel: #ffffff;
  --green: #0b7a53;
  --gold: #9a6700;
  --draft: #a33a3a;
  --shadow: 0 24px 70px rgba(0, 48, 135, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f5f8fc;
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
main { min-height: calc(100vh - 108px); }

.bn-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand, .top-nav, .user-pill { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 900; color: var(--navy); }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  font-size: 12px;
}
.top-nav a {
  font-size: 13px;
  font-weight: 800;
  color: #30415d;
  padding: 8px 10px;
  border-radius: 999px;
}
.top-nav a:hover { background: var(--wash); color: var(--navy); }
.user-pill { font-size: 12px; font-weight: 800; color: #4d5e78; }
.user-pill a {
  color: white;
  background: var(--navy);
  border-radius: 999px;
  padding: 10px 14px;
}
.subbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  color: #45617f;
  font-size: 12px;
  font-weight: 800;
  background: #fbfdff;
}
.subbar span:first-child { color: var(--navy); text-transform: uppercase; letter-spacing: .08em; }

.hero, .detail-hero {
  max-width: 1220px;
  margin: 0 auto;
  padding: 76px 24px 52px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
  gap: 28px;
  align-items: center;
}
.hero.compact { display: block; max-width: 980px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 950;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  color: var(--navy);
  font-size: clamp(42px, 6vw, 78px);
  line-height: .94;
  letter-spacing: 0;
  margin-bottom: 22px;
}
h2 {
  color: var(--navy);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.02;
  margin-bottom: 12px;
}
h3 { color: var(--navy); margin-bottom: 8px; }
.lead {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
  max-width: 800px;
  font-weight: 600;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 950;
  border: 1px solid transparent;
}
.btn.primary { background: var(--navy); color: white; box-shadow: 0 10px 24px rgba(0,48,135,.18); }
.btn.secondary { background: white; color: var(--navy); border-color: var(--line); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.back-link { color: var(--blue); font-size: 13px; font-weight: 900; }

.hero-panel, .cert-panel, .info-panel, .mini-card, .lang-card, .compare-card, .cascade-card, .level-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
}
.hero-panel, .cert-panel { padding: 28px; }
.panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--blue);
  font-weight: 950;
  margin-bottom: 10px;
}
.big-stat { font-size: 72px; line-height: .9; color: var(--navy); font-weight: 950; }
.muted, .registry, .claim { color: var(--muted); }
.metric-grid, .card-metrics, .stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 20px;
}
.metric-grid div, .card-metrics div, .stats-strip div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #f8fbff;
}
.metric-grid strong, .card-metrics strong, .stats-strip strong { display: block; color: var(--navy); font-size: 28px; }
.metric-grid span, .card-metrics span, .stats-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }

.section, .band { max-width: 1220px; margin: 0 auto; padding: 46px 24px; }
.band { max-width: none; background: white; border-block: 1px solid var(--line); }
.band > * { max-width: 1220px; margin-inline: auto; }
.section-head { margin-bottom: 26px; max-width: 820px; }
.section-head p { color: var(--muted); line-height: 1.65; font-weight: 600; }
.section-head.split {
  max-width: none;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}
.legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.use-grid, .catalog-grid, .level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.mini-card, .lang-card, .level-card { padding: 22px; }
.mini-card p, .lang-card p, .level-card p { color: var(--muted); line-height: 1.55; font-weight: 600; }
.catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.iso {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--wash);
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 8px;
  font-weight: 950;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  border: 1px solid;
}
.badge.green, .cert-panel.green, .level-card.green { color: var(--green); background: #f0fbf6; border-color: #bfe8d5; }
.badge.blue, .cert-panel.blue, .level-card.blue { color: var(--blue); background: #eef7ff; border-color: #bddcff; }
.badge.gold, .cert-panel.gold, .level-card.gold { color: var(--gold); background: #fff8e8; border-color: #f1d28b; }
.badge.draft, .cert-panel.draft, .level-card.draft { color: var(--draft); background: #fff3f3; border-color: #f0c3c3; }
.draft-card { border-color: #f0c3c3; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.cert-panel dl, .source-list { display: grid; gap: 10px; margin: 20px 0 0; }
.cert-panel div, .source-list div { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(0,0,0,.08); padding-top: 10px; }
dt { color: var(--muted); font-size: 12px; font-weight: 850; }
dd { margin: 0; color: var(--ink); font-weight: 900; text-align: right; }
.stats-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }

.select-form select, .compare-form select, .compare-form input {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  padding: 0 14px;
  font-weight: 850;
}
.cascade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.cascade-card { padding: 20px; box-shadow: none; }
.kv {
  display: grid;
  grid-template-columns: minmax(170px, .9fr) minmax(0, 1.1fr);
  gap: 12px;
  border-top: 1px solid #e8eef6;
  padding: 10px 0;
  align-items: start;
}
.kv span { color: var(--muted); font-size: 12px; font-weight: 850; }
.kv strong { overflow-wrap: anywhere; }
.cell-form { color: #082651; font-weight: 850; }
.cell-na { color: #7c8799; font-style: italic; }
.cell-unresolved { color: var(--draft); font-style: italic; background: #fff3f3; }

.matrix-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}
.matrix, .compact-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.matrix th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--navy);
  color: white;
  font-size: 11px;
  text-align: left;
  padding: 12px;
  white-space: nowrap;
}
.matrix td {
  border-top: 1px solid #e8eef6;
  border-right: 1px solid #eef3fa;
  padding: 10px 12px;
  min-width: 150px;
  font-size: 13px;
  vertical-align: top;
}
.matrix td:first-child { position: sticky; left: 0; background: #f9fcff; font-weight: 950; color: var(--navy); }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.info-panel { padding: 26px; box-shadow: none; }
.notes { color: var(--muted); line-height: 1.6; font-weight: 600; }
.compare-form {
  display: grid;
  grid-template-columns: minmax(240px, .6fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 24px;
}
.compare-form label { display: grid; gap: 7px; color: var(--muted); font-weight: 900; font-size: 12px; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.compare-card { padding: 20px; overflow: hidden; }
.compact-table th, .compact-table td { text-align: left; padding: 10px; border-top: 1px solid #e8eef6; vertical-align: top; }
.compact-table th { color: var(--navy); font-size: 12px; }
.sample { display: inline-flex; padding: 6px 9px; border-radius: 8px; margin-right: 8px; border: 1px solid var(--line); background: #f8fbff; }

@media (max-width: 980px) {
  .hero, .detail-hero, .two-col, .compare-grid, .cascade-grid { grid-template-columns: 1fr; }
  .catalog-grid, .use-grid, .level-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .section-head.split { display: block; }
  .legend { justify-content: flex-start; margin-top: 12px; }
}
@media (max-width: 720px) {
  .bn-header { height: auto; padding: 14px; align-items: flex-start; flex-direction: column; }
  .top-nav { flex-wrap: wrap; }
  .user-pill { width: 100%; justify-content: space-between; }
  .hero, .detail-hero { padding-top: 40px; }
  h1 { font-size: 42px; }
  .catalog-grid, .use-grid, .level-grid, .stats-strip, .metric-grid, .card-metrics { grid-template-columns: 1fr; }
  .compare-form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* --- tier lock states (UCM per-tier access) --- */
.locked-card { opacity: .62; filter: grayscale(.35); }
.locked-card:hover { opacity: .85; }
.lock { font-size: .8em; opacity: .8; }
.locked-card .card-actions .btn { pointer-events: auto; }
.panel-title { text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; opacity: .7; }

/* --- plain-terms on-ramp on the public welcome hero --- */
.plain-terms {
  margin-top: 1rem;
  padding: .9rem 1.1rem;
  border-left: 3px solid var(--accent, #003087);
  background: rgba(0, 48, 135, .05);
  border-radius: 6px;
  font-size: .96rem;
  line-height: 1.55;
}
.plain-terms strong { color: var(--accent, #003087); }
.plain-terms em { font-style: italic; opacity: .9; }
