:root {
  --bg: #0a0e14;
  --bg-panel: #121820;
  --bg-panel-hover: #181f2a;
  --text: #e6edf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-dim: #2563b8;
  --link-on-dark: #8ec5ff;
  --link-on-dark-hover: #b8daff;
  --brand-blue: #3d8bfd;
  --pass: #3ddc84;
  --border: #243044;
  --radius: 10px;
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
}

.wrap {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.mono { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 0.92em; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.brand-name {
  color: var(--brand-blue);
}

.brand-text.brand-name {
  color: var(--brand-blue);
}

.brand-icon {
  color: var(--text);
  filter: drop-shadow(0 0 12px rgba(61, 139, 253, 0.25));
}

.footer-bird {
  color: var(--muted);
  opacity: 0.55;
  margin: 0 auto 0.65rem;
  display: block;
}

.hero-mark {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hero-wordmark {
  display: block;
  width: min(280px, 100%);
  height: auto;
  opacity: 0.95;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.nav a:hover { color: var(--accent); }

.nav-dropdown { position: relative; cursor: default; color: var(--muted); font-weight: 600; }
.nav-dropdown:hover { color: var(--accent); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 0.35rem 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
/* Invisible bridge — margin-top would leave a dead zone outside the hover target. */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.5rem;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg-panel-hover); }

main { flex: 1; padding: 2rem 0 3rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

.tagline {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.copy { margin: 0; color: var(--muted); font-size: 0.85rem; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mark { order: -1; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 1rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 1rem; }
h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }

.lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }

.hero-actions { margin-top: 1.5rem; }

.about { margin-bottom: 3rem; max-width: 65ch; }
.about p { color: var(--muted); }

.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;
}

.serial-lookup {
  margin-bottom: 3rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 36rem;
}

.serial-lookup .lead {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.lookup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.lookup-input {
  flex: 1 1 10rem;
  min-width: 9rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.lookup-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lookup-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: rgba(255, 120, 120, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffb4b4;
}

.lookup-hint {
  margin: 1rem 0 0;
  font-size: 0.92rem;
}

.product-grid-section { margin-bottom: 3rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
}

.card h3 { margin: 0 0 0.25rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .sku { color: var(--muted); margin: 0 0 0.75rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

.badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--border);
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); }

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  margin-top: 0.75rem;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.shop-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

.shop-note { margin-bottom: 2rem; }
.shop-note p { color: var(--muted); }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.cert-panel { border-color: rgba(61, 220, 132, 0.35); }
.cert-sn { font-size: 1.1rem; margin-bottom: 1rem; }
.pass { color: var(--pass); font-weight: 700; }

.cert-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0 0 1.25rem;
}
.cert-meta dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }
.cert-meta dd { margin: 0.15rem 0 0; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* SI units in table headers — must stay lowercase (mV ≠ MV). */
.data-table th .si-unit {
  text-transform: none;
  letter-spacing: normal;
}

.data-table tr.muted-row td {
  color: var(--muted);
}

.dc-step-table {
  max-width: 32rem;
}

/* Δ (mV): fixed sign + right-aligned amount — mV suffix columns line up (not full-cell right align). */
.data-table th.col-mv,
.data-table td.col-mv {
  width: 6.25rem;
  white-space: nowrap;
}

.mv-cell {
  display: inline-grid;
  grid-template-columns: 1ch 4.5ch auto;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}

.mv-sign {
  text-align: center;
}

.mv-amt {
  text-align: right;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.compact-list { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.compact-list li { margin-bottom: 0.35rem; }

.muted { color: var(--muted); font-size: 0.92rem; }
.notice { color: #f0ad4e; font-size: 0.92rem; }
.warn-panel { border-color: #856404; }

.product-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.product-header .lead { margin-bottom: 1rem; }

@media (max-width: 640px) {
  .product-header { grid-template-columns: 1fr; }
  .product-header-mark { justify-self: center; }
}

.product-photo-strip {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.product-photo-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.65rem;
  align-items: flex-end;
  width: 100%;
}

.product-photo-cell {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.product-photo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  line-height: 0;
  border-radius: 4px;
}

.product-photo-link img {
  display: block;
  width: 100%;
  height: 480px;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
}

.product-photo-link:hover img {
  border-color: var(--link-on-dark);
}

.product-photo-cell figcaption {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.product-photo-hint {
  margin: 0.65rem 0 0;
  text-align: center;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .product-photo-row {
    gap: 0.5rem;
  }
  .product-photo-link img {
    height: 280px;
  }
  .product-photo-cell figcaption {
    font-size: 0.68rem;
  }
}

.turul-bird-mark {
  color: var(--accent);
  opacity: 0.9;
  display: block;
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(61, 139, 253, 0.18));
}

.cert-panel { position: relative; overflow: visible; }

.cert-watermark {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  width: 140px;
  height: auto;
  display: block;
  color: var(--pass);
  opacity: 0.08;
  pointer-events: none;
}

.fn-header {
  cursor: help;
  border-bottom: 1px dotted var(--border);
}

.data-table sup {
  font-size: 0.65em;
  margin-left: 0.1em;
  color: var(--accent);
}

.table-footnotes {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.table-footnotes li { margin-bottom: 0.35rem; }
.table-footnotes a { color: var(--accent); }

.guide-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.guide-bird {
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0.75;
}

.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chart-tab {
  background: var(--bg-panel-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  min-width: 4.5rem;
}
.chart-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chart-tab:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.chart-wrap {
  position: relative;
  height: 360px;
  width: 100%;
}

.chart-subhead {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.chart-subhead:first-of-type {
  margin-top: 0;
}

.cert-subhead {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.muted-panel { opacity: 0.85; }

.product-page a:not(.btn) {
  color: var(--link-on-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.product-page a:not(.btn):hover {
  color: var(--link-on-dark-hover);
}

.guide-page { scroll-margin-top: 1rem; }

.guide-page a:not(.btn):not(.guide-image-link) {
  color: var(--link-on-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.guide-page a:not(.btn):not(.guide-image-link):hover {
  color: var(--link-on-dark-hover);
}

.guide-breadcrumb {
  margin-bottom: 1.25rem;
}

.guide-breadcrumb a {
  color: var(--link-on-dark);
  text-decoration: none;
}

.guide-breadcrumb a:hover {
  color: var(--link-on-dark-hover);
  text-decoration: underline;
}

.guide-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

/* User's Guide */
.users-guide { scroll-margin-top: 1rem; }

.guide-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 52rem;
}

.guide-toc {
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-panel-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.guide-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .guide-toc ol { columns: 1; }
}

.guide-toc a { color: var(--link-on-dark); text-decoration: none; }
.guide-toc a:hover { color: var(--link-on-dark-hover); text-decoration: underline; }

.guide-section {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}

.guide-section:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.guide-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.guide-section h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
}

.guide-figure {
  margin: 1rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-panel);
  border-radius: 6px;
  padding: 0.5rem;
}

.guide-figure img {
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
  display: block;
  margin-inline: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.guide-image-link {
  display: block;
  width: max-content;
  max-width: min(100%, 420px);
  margin-inline: auto;
  cursor: zoom-in;
  line-height: 0;
  border-radius: 4px;
}

.guide-image-link:hover img {
  border-color: var(--link-on-dark);
}

.guide-figure--medium img {
  max-width: min(100%, 360px);
}

.guide-figure--medium .guide-image-link {
  max-width: min(100%, 360px);
}

.guide-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.guide-figure .guide-enlarge-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.guide-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 8, 12, 0.92);
  backdrop-filter: blur(4px);
}

.guide-lightbox[hidden] {
  display: none;
}

.guide-lightbox-img {
  max-width: min(96vw, 1600px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}

.guide-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-panel-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.guide-lightbox-close:hover {
  border-color: var(--link-on-dark);
  color: var(--link-on-dark);
}

body.guide-lightbox-open {
  overflow: hidden;
}

.guide-table { margin: 1rem 0; }

.guide-note {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-panel-hover);
  color: var(--muted);
  font-size: 0.92rem;
}

.guide-shipping-default {
  border-left-color: #c9a227;
  background: #faf6e8;
}

.guide-shipping-default p:last-child {
  margin-bottom: 0;
}

.guide-placeholder {
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-style: italic;
}

.muted-inline { color: var(--muted); font-size: 0.85em; font-weight: 400; }
.small { font-size: 0.88rem; }

/* Marketplace listing drafts (local preview — /draft/marketplace/…) */
.marketplace-draft-banner {
  margin: 0 0 1.25rem;
  padding: 0.65rem 1rem;
  border: 1px solid #c9a227;
  border-radius: var(--radius);
  background: rgba(201, 162, 39, 0.12);
  color: #e8d48a;
  font-size: 0.92rem;
}

.marketplace-platform-links {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.marketplace-platform-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--platform-color, var(--accent));
  border-radius: var(--radius);
  background: var(--bg-panel);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.marketplace-platform-card:hover {
  background: var(--bg-panel-hover);
  border-color: var(--platform-color, var(--accent));
}

.marketplace-platform-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.marketplace-platform-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.marketplace-draft-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.marketplace-draft-nav a {
  color: var(--link-on-dark);
}

.marketplace-draft-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  pointer-events: none;
}

.marketplace-platform-badge {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  background: var(--platform-color, var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.marketplace-fields .marketplace-field {
  margin: 1.75rem 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.marketplace-fields .marketplace-field:first-of-type {
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
}

.marketplace-field-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.marketplace-field-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.marketplace-char-count {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.marketplace-char-count--over {
  color: #f87171;
  font-weight: 600;
}

.marketplace-field-hint {
  margin: 0 0 0.5rem;
}

.marketplace-copy-box {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0d1117;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
}

.marketplace-copy-box:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.marketplace-html-preview {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.marketplace-html-render {
  margin-top: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #222;
}

.marketplace-images ol {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.marketplace-images li {
  margin-bottom: 0.35rem;
}

