:root {
  --bg: #faf9f5;
  --bg-alt: #f3efe6;
  --bg-card: #ffffff;
  --ink: #2a2520;
  --ink-soft: #6b5e52;
  --ink-mute: #9a8d80;
  --accent: #c85a3a;
  --accent-soft: #e8b9a8;
  --accent-deep: #9c4329;
  --line: #e6dfd2;
  --line-soft: #efe9dc;
  --serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --sans: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --serif-sc: 'Noto Serif SC', 'Source Han Serif SC', serif;
  --max: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-deep); }

code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  background: var(--line-soft);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--accent-deep);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: saturate(120%) blur(8px);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  font-size: 0.92rem;
}
.nav-links a { color: var(--ink-soft); transition: color 0.12s ease; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 500; }

.nav-divider {
  width: 1px;
  height: 14px;
  background: var(--line);
  margin: 0 0.2rem;
}

/* Nav dropdowns */
.nav-group { position: relative; }
.nav-group-trigger {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.12s ease;
}
.nav-group-trigger:hover { color: var(--accent); }
.nav-group-trigger.active {
  color: var(--accent);
  font-weight: 500;
}
.nav-group-trigger .caret {
  font-size: 0.7em;
  opacity: 0.65;
  transition: transform 0.15s ease;
  line-height: 1;
}
.nav-group:hover .caret,
.nav-group:focus-within .caret { transform: rotate(180deg); }

.nav-group-menu {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 180px;
  padding: 0.4rem 0;
  margin: 0;
  list-style: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 20;
}
.nav-group:hover .nav-group-menu,
.nav-group:focus-within .nav-group-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.nav-group-menu::before {
  content: '';
  position: absolute;
  top: -1rem;
  left: 0;
  right: 0;
  height: 1rem;
}
.nav-group-menu::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  transform: translateX(-50%) rotate(45deg);
}
.nav-group-menu li { margin: 0; }
.nav-group-menu li a {
  display: block;
  padding: 0.55rem 1.1rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.92rem;
}
.nav-group-menu li a:hover { background: var(--bg-alt); color: var(--accent); }
.nav-group-menu li a.active { color: var(--accent); font-weight: 500; }
.nav-links .github-link {
  color: var(--accent);
  font-weight: 500;
}
.nav-links .lang-toggle {
  border: 1px solid var(--line);
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.nav-links .lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 7rem 2rem 5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 1.2rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin: 0 0 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.hero-subtitle {
  font-family: var(--serif-sc);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1.5rem;
}
.hero-tagline {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 2rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto 2.2rem;
}
@media (max-width: 860px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); max-width: 520px; }
}
@media (max-width: 460px) {
  .hero-stats { grid-template-columns: 1fr; }
}
.hero-stat {
  text-decoration: none;
  color: inherit;
  padding: 1.3rem 1.2rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
  min-width: 0;
}
.hero-stat:hover { border-color: var(--accent); transform: translateY(-2px); }
.hero-stat .stat-num {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--accent-deep);
  line-height: 1;
}
.hero-stat .stat-num-alt { color: #8a6e1d; }
.hero-stat .stat-lbl {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
  margin-top: 0.35rem;
}
.hero-stat .stat-sub {
  font-size: 0.78rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* Buttons */
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-tertiary {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--ink-mute);
}
.hero-tertiary a {
  color: var(--ink-soft);
  text-decoration: none;
}
.hero-tertiary a:hover {
  color: var(--accent);
}
.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-deep);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding: 5rem 2rem;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.container {
  max-width: var(--max);
  margin: 0 auto;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 1.8rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 720px;
  margin-bottom: 2.5rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}
.card h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-weight: 500;
}
.card p {
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}
.card-meta {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(200, 90, 58, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-top: 0.5rem;
}
.card-action {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-action:hover {
  text-decoration: none;
}
.card-action:hover .card-cta {
  color: var(--accent-deep);
}
.card-cta {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.6rem;
  margin-bottom: 0;
}
.card-disabled {
  opacity: 0.55;
  background: var(--bg-alt);
  border-style: dashed;
}
.card-disabled:hover {
  transform: none;
  border-color: var(--line);
}
.card-tag {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.card-related a {
  font-size: 0.92rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: inline-block;
}
.card-current {
  border: 2px solid var(--accent);
}
.here-pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: 3px;
  margin-top: 0.5rem;
}

/* Two column */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}
.two-col h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1rem;
}
.two-col p {
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}

.problem-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}
.problem-list li {
  margin-bottom: 0.7rem;
  line-height: 1.6;
}

/* Status list */
.status-list {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
.status-list li {
  padding: 0.7rem 0 0.7rem 2rem;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  color: var(--ink-soft);
}
.status-list li:before {
  position: absolute;
  left: 0;
  top: 0.7rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.status-list li.done:before {
  content: "✓";
  color: var(--accent);
}
.status-list li.done {
  color: var(--ink);
}
.status-list li.todo:before {
  content: "○";
  color: var(--ink-mute);
}

/* Mapping table */
.table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
}
.mapping-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.94rem;
}
.mapping-table th {
  background: var(--bg-alt);
  font-family: var(--serif);
  font-weight: 500;
  text-align: left;
  padding: 0.9rem 1.2rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.mapping-table td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  vertical-align: top;
}
.mapping-table tr:last-child td {
  border-bottom: none;
}
.mapping-table tr:hover {
  background: var(--bg-alt);
}

/* CTA section */
.section-cta {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-top: 1px solid var(--line);
  text-align: center;
}
.section-cta .two-col {
  text-align: left;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 2.5rem 2rem;
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-meta p {
  margin: 0.2rem 0;
  color: rgba(250, 249, 245, 0.7);
}
.footer-meta strong {
  color: #fff;
}
.footer-meta a {
  color: var(--accent-soft);
}
.footer-links {
  display: flex;
  gap: 1.6rem;
}
.footer-links a {
  color: var(--accent-soft);
}
.footer-links a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 720px) {
  .nav-links {
    gap: 0.9rem;
    font-size: 0.85rem;
  }
  .nav-links a:not(.github-link):not(.lang-toggle) {
    display: none;
  }
  .hero {
    padding: 4rem 1.5rem 3rem;
  }
  .section {
    padding: 3rem 1.5rem;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Phase 1+2 — Gallery / View / Editor styles
   ============================================================ */

.container-wide {
  max-width: 1380px;
  margin: 0 auto;
}

/* Active nav state */
.nav-links a.active {
  color: var(--accent);
  font-weight: 500;
}

/* Page hero (smaller than landing hero, used on subpages) */
.page-hero {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--line);
  padding: 4rem 2rem 3rem;
}
.page-hero .container {
  max-width: var(--max);
  margin: 0 auto;
}
.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  margin: 0.4rem 0 0.8rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-subtitle {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 0 1rem;
}
.page-hero .eyebrow a {
  color: var(--accent);
  font-weight: 500;
}

.doc-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.ads-pill, .status-pill, .meta-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.ads-pill { background: var(--accent); color: #fff; }
.ads-pill-l0, .ads-pill-l1 { background: #6b8e6b; }
.ads-pill-l2 { background: #8a8243; }
.ads-pill-l3 { background: #c85a3a; }
.ads-pill-l4 { background: #9c4329; }
.ads-pill-l5 { background: #5e2814; }

.status-pill { border: 1px solid var(--line); color: var(--ink-soft); background: var(--bg-card); }
.status-vendor_confirmed { color: #2d6a3a; border-color: #b6d8be; background: #ebf5ed; }
.status-community_reviewed { color: #6b5e2c; border-color: #d8cfa1; background: #f8f3df; }
.status-draft { color: #6b5e52; }

.meta-pill { background: var(--line-soft); color: var(--ink-soft); }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: end;
  gap: 1.2rem;
  margin-bottom: 2rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.filter-group label {
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-group select, .filter-group input {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.92rem;
  background: var(--bg);
  color: var(--ink);
}
.filter-group select:focus, .filter-group input:focus {
  outline: none;
  border-color: var(--accent);
}
.filter-search { flex: 1 1 280px; }
.filter-search input { width: 100%; }
.filter-meta {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--ink-soft);
  align-self: end;
  padding-bottom: 0.5rem;
}

/* Gallery grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}
.doc-card {
  display: block;
  padding: 1.4rem 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}
.doc-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 90, 58, 0.08);
}
.doc-card-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.doc-card-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 0.3rem;
  color: var(--ink);
  font-weight: 500;
}
.doc-card-function {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.doc-card-stats {
  display: flex;
  gap: 0.8rem;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}
.stat-item { color: var(--ink-soft); }
.stat-permitted::before { content: '●'; color: #6b8e6b; margin-right: 0.3rem; }
.stat-not-permitted::before { content: '●'; color: #c85a3a; margin-right: 0.3rem; }
.doc-card-meta {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin: 0;
}

.empty-cta {
  text-align: center;
  padding: 3rem;
  color: var(--ink-soft);
}
.contribute-cta {
  margin-top: 4rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: 6px;
  text-align: center;
}
.contribute-cta h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 0.6rem;
}
.contribute-cta p {
  margin: 0;
  color: var(--ink-soft);
}

.loading, .error {
  padding: 2rem;
  color: var(--ink-soft);
  text-align: center;
}
.error { color: #c85a3a; }

/* View tabs */
.view-tabs-section { padding-top: 2rem; }

.view-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.view-tab {
  padding: 0.7rem 1.4rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-tab:hover { color: var(--accent); }
.view-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.view-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
}
.btn-link {
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--sans);
}
.btn-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.view-intro {
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.2rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
}

/* ODC table */
.cat-block { margin-bottom: 2.5rem; }
.cat-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.5rem;
  margin: 0 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cat-ratio {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.odc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.92rem;
}
.odc-table th {
  background: var(--bg-alt);
  font-family: var(--serif);
  font-weight: 500;
  text-align: left;
  padding: 0.7rem 1rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.odc-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  vertical-align: top;
}
.odc-table tr:last-child td { border-bottom: none; }
.odc-table tr.req-permitted td.req-cell { color: #2d6a3a; font-weight: 500; }
.odc-table tr.req-not_permitted td.req-cell { color: #c85a3a; font-weight: 500; }

.el-name { color: var(--ink); font-weight: 500; }
.el-section { font-size: 0.78rem; color: var(--ink-mute); margin-top: 0.2rem; }
.param-range { font-family: 'SF Mono', monospace; font-size: 0.85rem; color: var(--accent-deep); margin-top: 0.3rem; }
.exit-cell { font-size: 0.85rem; color: var(--ink-mute); }

.json-details { margin-top: 2rem; }
.json-details summary {
  cursor: pointer;
  padding: 0.6rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.json-dump {
  margin-top: 0.5rem;
  padding: 1rem;
  background: #1a1714;
  color: #f3efe6;
  font-family: 'SF Mono', monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  border-radius: 3px;
  max-height: 600px;
  overflow-y: auto;
}

.assoc-list { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.assoc-list li { margin-bottom: 0.5rem; }

/* Tester view */
.test-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-box {
  padding: 1.2rem 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stat-box strong {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--ink);
  font-weight: 500;
}
.stat-box span {
  font-size: 0.85rem;
  color: var(--ink-mute);
}
.sampling-cell { font-family: 'SF Mono', monospace; font-size: 0.85rem; color: var(--accent-deep); }
.discrete-list {
  columns: 2;
  column-gap: 2rem;
  color: var(--ink-soft);
}
.discrete-list li { margin-bottom: 0.4rem; break-inside: avoid; }

/* Regulator view */
.compliance-overall {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}
.compliance-clean { color: #2d6a3a; font-weight: 500; }
.compliance-gap-label { color: #c85a3a; font-weight: 500; margin-bottom: 0.6rem; }
.gap-list { margin: 0; padding-left: 1.2rem; }
.gap-list li { color: var(--ink-soft); margin-bottom: 0.4rem; }
.gap-name { color: var(--ink); }
.gap-section { color: var(--ink-mute); font-size: 0.85rem; }

/* Consumer view */
.consumer-summary {
  font-size: 1.1rem;
  padding: 1.5rem;
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  border-radius: 3px;
  margin-bottom: 2rem;
  color: var(--ink);
}
.consumer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.consumer-card {
  padding: 1.6rem 1.8rem;
  background: var(--bg-card);
  border-radius: 6px;
  border-top: 4px solid;
}
.consumer-card h3 { font-family: var(--serif); margin: 0 0 1rem; font-weight: 500; font-size: 1.2rem; }
.consumer-card ul { list-style: none; padding: 0; margin: 0; color: var(--ink-soft); }
.consumer-card li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line-soft); }
.consumer-card li.more { color: var(--ink-mute); border-bottom: none; padding-top: 0.6rem; font-style: italic; }
.consumer-card-green { border-color: #6b8e6b; }
.consumer-card-green h3 { color: #2d6a3a; }
.consumer-card-amber { border-color: #c8a13a; }
.consumer-card-amber h3 { color: #8a6e1d; }
.consumer-card-red { border-color: #c85a3a; }
.consumer-card-red h3 { color: #c85a3a; }

.consumer-exits {
  padding: 1.6rem 1.8rem;
  background: #fef4e8;
  border-left: 4px solid #c85a3a;
  border-radius: 3px;
  color: var(--ink);
}
.consumer-exits h3 {
  font-family: var(--serif);
  margin: 0 0 0.8rem;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--accent-deep);
}
.consumer-exits ul { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.consumer-exits li { margin-bottom: 0.4rem; }

/* Coverage strip (national-standard coverage dashboard) */
.coverage-strip {
  margin: 1.4rem 0 2rem;
  padding: 1rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}
.coverage-strip-head { font-size: 0.95rem; color: var(--ink); margin-bottom: 0.5rem; }
.coverage-bar {
  display: flex;
  height: 24px;
  border-radius: 3px;
  overflow: hidden;
  font-size: 0.72rem;
  font-family: var(--sans);
}
.coverage-bar .seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0 0.4rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.coverage-bar .seg-manual { background: #2d6a3a; }
.coverage-bar .seg-inferred { background: #8a6e1d; }
.coverage-bar .seg-gap { background: #8a8580; color: #fff; }
.coverage-bar .seg-structural { background: #c9b9ad; color: #3a2e24; }
.coverage-strip-note { font-size: 0.82rem; color: var(--ink-mute); margin: 0.6rem 0 0; font-style: italic; }

/* Coverage tags per item */
.coverage-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 6px;
  margin-left: 0.5rem;
  border-radius: 3px;
  font-family: var(--sans);
  letter-spacing: 0.03em;
  vertical-align: 1px;
}
.tag-gap { background: #e6e2de; color: #6b645e; }
.tag-structural { background: #f0e8df; color: #6a5640; }
.tag-manual { background: #d4e6d4; color: #2d6a3a; }
.tag-official { background: #c8dbe6; color: #27526b; }
.tag-inferred { background: #f0e1c4; color: #8a6e1d; }
.consumer-item.coverage-gap .item-name { color: var(--ink-mute); }
.consumer-item.coverage-gap { opacity: 0.72; }
.consumer-item.coverage-structural { opacity: 0.55; font-size: 0.9rem; }
.consumer-item.coverage-structural .item-meta { display: none; }

/* Consumer view — new grouped layout */
.consumer-bucket {
  margin: 1.8rem 0;
  padding: 1.4rem 1.6rem 1rem;
  background: var(--bg-card);
  border-radius: 6px;
  border-left: 4px solid var(--line);
}
.consumer-bucket-green { border-left-color: #6b8e6b; }
.consumer-bucket-amber { border-left-color: #c8a13a; }
.consumer-bucket-red { border-left-color: #c85a3a; }

.bucket-heading {
  font-family: var(--serif);
  margin: 0 0 0.25rem;
  font-weight: 500;
  font-size: 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}
.consumer-bucket-green .bucket-heading { color: #2d6a3a; }
.consumer-bucket-amber .bucket-heading { color: #8a6e1d; }
.consumer-bucket-red .bucket-heading { color: #c85a3a; }
.bucket-count { font-size: 0.95rem; color: var(--ink-mute); font-family: var(--sans); font-weight: 400; }
.bucket-hint { color: var(--ink-mute); font-size: 0.9rem; margin: 0 0 1rem; }
.empty-note { color: var(--ink-mute); font-style: italic; margin: 0.5rem 0; }

.consumer-group {
  border-top: 1px solid var(--line-soft);
  padding: 0.6rem 0;
}
.consumer-group:first-of-type { border-top: none; }
.group-summary {
  cursor: pointer;
  font-weight: 500;
  padding: 0.3rem 0;
  user-select: none;
  list-style: none;
  color: var(--ink);
}
.group-summary::-webkit-details-marker { display: none; }
.group-summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--ink-mute);
  font-size: 0.85em;
}
details[open] > .group-summary::before { transform: rotate(90deg); }
.group-count { color: var(--ink-mute); font-size: 0.9rem; font-weight: 400; }

.consumer-item-list {
  list-style: none;
  padding: 0 0 0.4rem 1.4rem;
  margin: 0.4rem 0 0;
}
.consumer-item {
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line-soft);
  color: var(--ink-soft);
}
.consumer-item:last-child { border-bottom: none; }
.item-head { font-size: 0.98rem; color: var(--ink); }
.item-name { font-weight: 500; }
.item-range { color: var(--accent-deep); font-weight: 500; }
.item-desc { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.2rem; }
.item-exit {
  font-size: 0.85rem;
  color: #c85a3a;
  margin-top: 0.2rem;
  font-weight: 500;
}
.item-meta {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 0.3rem;
  font-family: var(--sans);
}
.item-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-alt);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.8em;
}
.item-section { color: var(--ink-mute); }

.consumer-sources {
  margin-top: 2.5rem;
  padding: 1.4rem 1.6rem;
  background: var(--bg-alt);
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}
.consumer-sources h3 {
  font-family: var(--serif);
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 500;
}
.source-status { color: var(--ink-soft); margin: 0 0 1rem; line-height: 1.6; }
.source-list-intro { margin: 0 0 0.4rem; font-weight: 500; color: var(--ink); }
.source-list {
  padding-left: 1.2rem;
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}
.source-list a { word-break: break-all; }
.source-notes {
  font-size: 0.88rem;
  color: var(--ink-mute);
  font-style: italic;
  border-top: 1px dashed var(--line-soft);
  padding-top: 0.8rem;
  margin: 0.8rem 0 0;
  line-height: 1.6;
}

.doc-card-coverage {
  margin: 0.6rem 0 0.8rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-alt);
  border-radius: 4px;
}
.cov-label { font-size: 0.85rem; color: var(--ink); margin-bottom: 0.35rem; }
.cov-label strong { color: var(--accent-deep); font-weight: 600; }
.cov-label .cov-sub { color: var(--ink-mute); font-size: 0.82rem; }
.cov-bar { display: flex; height: 6px; border-radius: 2px; overflow: hidden; }
.cov-bar .seg { display: block; }
.cov-bar .seg-manual { background: #2d6a3a; }
.cov-bar .seg-inferred { background: #8a6e1d; }
.cov-bar .seg-gap { background: #8a8580; }
.cov-bar .seg-structural { background: #c9b9ad; }

.card-phase-tag {
  margin-left: 0.5rem;
  font-size: 0.72rem;
  padding: 1px 8px;
  background: #faefe5;
  color: var(--accent-deep);
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* Matrix view */
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: 1px;
  margin: 0 0.1rem 0 0.3rem;
}
.legend-dot.req-permitted { background: #6b8e6b; }
.legend-dot.req-not_permitted { background: #c85a3a; }
.legend-dot.req-gap { background: #b8b2ad; }
.legend-dot.req-structural { background: #d0c0ad; }

.matrix-filters {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg-alt);
  border-radius: 6px;
}
.matrix-filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  color: var(--ink-soft);
  gap: 0.25rem;
}
.matrix-filters select,
.matrix-filters input {
  padding: 0.35rem 0.6rem;
  font-size: 0.92rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-card);
  min-width: 200px;
  font-family: inherit;
}
.matrix-count {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-left: auto;
}
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg-card);
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 800px;
}
.matrix-table th, .matrix-table td {
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  padding: 0.55rem 0.7rem;
  vertical-align: top;
}
.matrix-table th {
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  font-weight: 500;
  text-align: left;
  z-index: 2;
}
.matrix-th-elem { min-width: 240px; }
.matrix-th-doc { min-width: 160px; max-width: 200px; }
.matrix-th-doc a { text-decoration: none; color: inherit; display: block; }
.matrix-th-doc .th-vendor { font-weight: 500; color: var(--accent-deep); font-size: 0.88rem; }
.matrix-th-doc .th-model { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.matrix-th-doc .th-lvl { font-size: 0.72rem; color: var(--ink-mute); margin-top: 0.2rem; }
.matrix-cat-row td {
  background: #faf4ec;
  font-family: var(--serif);
  font-weight: 500;
  padding: 0.6rem 1rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}
.matrix-elem { background: var(--bg-card); }
.elem-name { font-weight: 500; color: var(--ink); }
.elem-meta { font-size: 0.7rem; color: var(--ink-mute); margin-top: 0.2rem; }
.elem-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.matrix-cell {
  position: relative;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: default;
}
.matrix-cell .cell-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: 1px;
}
.matrix-cell.req-permitted { background: rgba(107, 142, 107, 0.1); }
.matrix-cell.req-permitted .cell-dot { background: #6b8e6b; }
.matrix-cell.req-not_permitted { background: rgba(200, 90, 58, 0.1); }
.matrix-cell.req-not_permitted .cell-dot { background: #c85a3a; }
.matrix-cell.req-gap { background: rgba(184, 178, 173, 0.12); color: var(--ink-mute); }
.matrix-cell.req-gap .cell-dot { background: #b8b2ad; }
.matrix-cell.req-structural { background: rgba(208, 192, 173, 0.15); color: var(--ink-mute); font-style: italic; }
.matrix-cell.req-structural .cell-dot { background: #d0c0ad; }
.matrix-cell .cell-text { color: var(--ink); }
.matrix-cell .cell-lbl { color: var(--ink-soft); font-size: 0.82rem; }

.btn-workbench {
  color: var(--accent) !important;
  font-weight: 500;
}
.btn-workbench:hover { text-decoration: underline; }

/* Editor workbench banner */
.editor-workbench-banner {
  background: #faefe5;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.editor-workbench-banner .wb-dot { color: var(--accent); font-size: 0.8em; }
.editor-workbench-banner .wb-msg { flex: 1; }
.editor-workbench-banner .wb-back {
  color: var(--accent);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Vendor Workbench */
.workbench-phase-banner {
  margin-top: 1.4rem;
  padding: 0.8rem 1.2rem;
  background: #faefe5;
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 0.92rem;
  color: var(--ink);
}
.workbench-phase-banner a { color: var(--accent); margin-left: 0.5rem; }
.workbench-vendor-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
  padding: 1.2rem 1.4rem;
  background: var(--bg-alt);
  border-radius: 6px;
}
.workbench-label { font-weight: 500; color: var(--ink); }
.workbench-select {
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-card);
  min-width: 280px;
}
.workbench-hint { color: var(--ink-mute); font-size: 0.85rem; }
.workbench-empty {
  padding: 3rem 1.4rem;
  text-align: center;
  color: var(--ink-mute);
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.workbench-summary { margin-bottom: 1.2rem; }
.workbench-vendor-name { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin: 0 0 0.6rem; }
.workbench-pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.workbench-pill {
  padding: 3px 11px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: var(--sans);
}
.workbench-action-bar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.workbench-action-bar .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
.workbench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
}
.workbench-table thead { background: var(--bg-alt); }
.workbench-table th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
}
.workbench-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.fn-name-cell { min-width: 220px; }
.fn-name { font-weight: 500; color: var(--ink); margin-bottom: 0.2rem; }
.fn-notes { font-size: 0.82rem; color: var(--ink-mute); line-height: 1.5; }
.fn-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-family: var(--sans);
}
.fn-published {
  color: #2d6a3a;
  font-size: 0.82rem;
  font-family: var(--sans);
  margin-left: 0.4rem;
}
.fn-actions { white-space: nowrap; }
.btn-mini {
  font-size: 0.8rem;
  padding: 3px 10px;
  margin-right: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-card);
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.btn-mini.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-mini.btn-accent:hover { background: var(--accent); color: #fff; }
.btn-mini.btn-danger:hover { border-color: #c85a3a; color: #c85a3a; }
.text-mute { color: var(--ink-mute); }

/* Editor */
.editor-section { padding: 2.5rem 1.5rem; }

.editor-meta-panel, .editor-help {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 1.5rem;
  padding: 0;
}
.editor-meta-panel summary, .editor-help summary {
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 500;
}
.editor-meta-panel[open] summary, .editor-help[open] summary {
  border-bottom: 1px solid var(--line);
}
.editor-meta-panel .meta-grid {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.meta-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.meta-grid input, .meta-grid select, .meta-grid textarea {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--bg);
}
.meta-grid input:focus, .meta-grid select:focus, .meta-grid textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.meta-full { grid-column: 1 / -1; }
.editor-help { padding-bottom: 1rem; }
.editor-help ol { padding-left: 1.5rem; padding-right: 1.5rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.editor-help li { margin-bottom: 0.4rem; }

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1.2rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  align-items: center;
}
.toolbar-spacer { flex: 1; }

.editor-body {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 1.2rem;
  min-height: 600px;
}
.editor-body > div {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.2rem;
  overflow: auto;
  max-height: 80vh;
}
.editor-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 0.8rem;
  font-size: 1.05rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.el-count {
  background: var(--accent);
  color: #fff;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-family: var(--sans);
}

/* Catalog tree */
.tree-search {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}
.tree-cat-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 1rem 0 0.4rem;
  color: var(--accent-deep);
}
.tree-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.6rem;
  border-left: 1px solid var(--line-soft);
}
.tree-item { padding: 0; }
.tree-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.tree-label:hover { background: var(--bg-alt); }
.tree-label.is-selected { color: #2d6a3a; font-weight: 500; }
.tree-label.is-leaf .tree-name { color: var(--ink); }
.tree-marker {
  width: 16px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-mute);
}
.tree-label.is-selected .tree-marker { color: #2d6a3a; }
.tree-section { font-size: 0.75rem; color: var(--ink-mute); margin-left: auto; }

/* Selected list */
.selected-list { display: flex; flex-direction: column; gap: 0.6rem; }
.empty-hint { color: var(--ink-mute); font-style: italic; padding: 1rem 0; text-align: center; }
.sel-cat-title {
  font-family: var(--serif);
  font-size: 0.92rem;
  margin: 0.8rem 0 0.4rem;
  color: var(--accent-deep);
}
.sel-item {
  padding: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  border-left: 4px solid var(--line);
}
.sel-item.req-permitted { border-left-color: #6b8e6b; }
.sel-item.req-not_permitted { border-left-color: #c85a3a; }
.sel-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sel-item-name { font-weight: 500; color: var(--ink); flex: 1; }
.sel-item-section { font-size: 0.78rem; color: var(--ink-mute); }
.sel-item-remove {
  background: none;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.3rem;
}
.sel-item-remove:hover { color: var(--accent); }
.sel-item-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.req-radio {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex: 1;
  justify-content: center;
}
.req-radio input { margin: 0; }
.req-radio-permitted.active { background: #ebf5ed; border-color: #6b8e6b; color: #2d6a3a; font-weight: 500; }
.req-radio-not_permitted.active { background: #fdedea; border-color: #c85a3a; color: #c85a3a; font-weight: 500; }

.sel-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-mute);
}
.sel-field input, .sel-field select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--ink);
}

/* JSON preview */
.json-preview {
  margin: 0;
  padding: 0;
  background: #1a1714;
  color: #f3efe6;
  font-family: 'SF Mono', monospace;
  font-size: 0.78rem;
  overflow: auto;
  border-radius: 4px;
  padding: 1rem;
  white-space: pre-wrap;
  max-height: 70vh;
}

@media (max-width: 1100px) {
  .editor-body {
    grid-template-columns: 1fr;
  }
  .test-summary, .compliance-overall {
    flex-wrap: wrap;
  }
}

/* Compare page */
.compare-picker { padding: 2rem; background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px; }
.compare-picker h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 1rem; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.picker-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.picker-card:hover { border-color: var(--accent-soft); }
.picker-card.active { border-color: var(--accent); background: rgba(200, 90, 58, 0.04); }
.picker-card input { margin-top: 0.3rem; accent-color: var(--accent); }
.picker-card-info { flex: 1; }
.picker-title { font-weight: 500; color: var(--ink); margin-bottom: 0.2rem; }
.picker-sub { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.5rem; }
.picker-pills { display: flex; gap: 0.4rem; }

.compare-actions { display: flex; justify-content: center; }

.compare-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.compare-doc-header h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}
.compare-doc-header p { margin: 0 0 0.5rem; color: var(--ink-soft); font-size: 0.88rem; }

.compare-table th { font-size: 0.85rem; }
.compare-row-disagree {
  background: rgba(200, 161, 58, 0.08);
}
.compare-row-disagree .compare-req { color: #8a6e1d; font-weight: 500; }
.compare-row-agree.compare-row-permitted { background: rgba(107, 142, 107, 0.05); }
.compare-row-agree.compare-row-not_permitted { background: rgba(200, 90, 58, 0.05); }
.compare-cell-missing { color: var(--ink-mute); font-style: italic; }
.compare-cell.req-permitted .compare-req { color: #2d6a3a; font-weight: 500; }
.compare-cell.req-not_permitted .compare-req { color: #c85a3a; font-weight: 500; }
