:root {
  --primary: #326ce5;
  --primary-dark: #2952c3;
  --card: #fff;
  --border: #e1e4e8;
  --text: #24292f;
  --text-muted: #57606a;
  --success: #1a7f37;
  --warning: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.3;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-size: 1.75rem;
  margin-top: 0;
}

h2 {
  font-size: 1.25rem;
  margin-top: 8px;
  margin-bottom: 16px;
  color: var(--text);
}

.intro {
  background: var(--card);
  margin-bottom: 10px;
}

.intro p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.intro code {
  font-size: 0.8125rem;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

section.card {
  background: var(--card);
}

table.features {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--border);
}

/* No top border above subhead row (HTTPRoute, Gateway, Backend TLS, etc.) */
table.features:has(tbody > tr.feature-subhead:first-child) {
  border-top: none;
}

table.features tr.feature-subhead + tr td {
  border-top: 1px solid var(--border);
}

table.features th,
table.features td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

table.features th {
  font-weight: 600;
  color: var(--text-muted);
}

table.features td:first-child,
table.features th:first-child {
  font-weight: 500;
  white-space: nowrap;
}

table.features td:first-child {
  cursor: help;
}

/* Feature names (selectable) slightly larger */
table.features tbody td:first-child {
  font-size: 0.9375rem;
}

.feature-desc-popup {
  position: fixed;
  z-index: 100;
  padding: 8px 12px;
  max-width: 320px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #fff;
  background: rgba(50, 50, 50, 0.92);
  border: 1px solid rgba(80, 80, 80, 0.9);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  white-space: normal;
}

table.features td:nth-child(2),
table.features th:nth-child(2) {
  width: 300px;
  min-width: 0;
  max-width: 300px;
  vertical-align: middle;
  font-size: 0.9375rem;
}

table.features td:nth-child(2) label {
  margin-right: 10px;
}

table.features input[type="radio"],
table.features input[type="checkbox"] {
  margin: 0 3px;
  cursor: pointer;
}

table.features tr.feature-spacer td {
  border: none;
  height: 1.5em;
  padding: 0;
  vertical-align: middle;
}

table.features tr.feature-subhead td,
table.features tr.feature-subhead th {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-top: 14px;
  padding-bottom: 6px;
  padding-left: 12px;
  vertical-align: bottom;
}

table.features tr.feature-subhead:first-child td,
table.features tr.feature-subhead:first-child th {
  padding-top: 0;
}

table.features label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recommend-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
}

.recommend-btn:hover {
  background: var(--primary-dark);
}

.reset-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 12px;
}

.reset-btn:hover {
  background: var(--bg);
  color: var(--text);
}

#results {
  display: none;
  margin-top: 24px;
}

#results.visible {
  display: block;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.results th,
table.results td {
  padding: 12px;
  text-align: left;
  border: 1px solid var(--border);
}

table.results th {
  background: var(--bg);
  font-weight: 600;
}

table.results td a {
  color: var(--primary);
  text-decoration: none;
}

table.results td a:hover {
  text-decoration: underline;
}

.missing {
  color: var(--warning);
  font-size: 0.7rem;
}

.no-results {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

.warning-note {
  background: rgba(154, 103, 0, 0.08);
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  border-radius: 0 4px 4px 0;
}

.warning-note summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.warning-note summary::-webkit-details-marker {
  display: none;
}

.warning-note summary::before {
  content: '▼ ';
  font-size: 0.7em;
  vertical-align: 0.05em;
}

.warning-note[open] summary::before {
  content: '▶ ';
}

#version-row {
  display: none;
  margin-bottom: 16px;
}

#version-row span {
  margin: 0 6px;
  font-weight: 600;
}

#version-select {
  margin-left: 8px;
  padding: 6px 10px;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.intro .intro-source {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 2em;
}

.warning-note p {
  margin: 8px 0 0 0;
}

section.card h3 {
  font-size: 1.125rem;
  margin: 24px 0 12px;
}

section.card h3:first-of-type {
  margin-top: 0;
}

.section-intro {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 0 8px;
  line-height: 1.45;
}

.core-list {
  margin: 0 0 16px 1.25em;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.core-list li {
  margin-bottom: 4px;
}

#http-route-core {
  margin-bottom: 20px;
  border-top: none;
}

#gateway-core {
  margin-bottom: 20px;
  border-top: none;
}

#grpc-route-core {
  margin-bottom: 20px;
  border-top: none;
}

#tls-route-core {
  margin-bottom: 20px;
  border-top: none;
}

#gateway-features {
  border-top: none;
}

#gateway-features thead th {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-top: 0;
  padding-bottom: 6px;
  padding-left: 12px;
  vertical-align: bottom;
}

section.card h3#grpcroute,
section.card h3#tlsroute {
  margin-top: 32px;
}

section.card h3 + p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

section.card .conformance-intro {
  font-size: 0.8125rem;
}

section.card h4 {
  font-size: 1rem;
  margin: 24px 0 12px;
  color: var(--text-muted);
  font-weight: 600;
}

section.card h4:first-of-type {
  margin: 0 0 12px;
}

#wizard-data-status.data-status {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
