/* ============================================================
   Sapphire.Space — design system
   Concept: "metrology instrument" — dark measurement surface,
   monospaced numerics, one signal accent, green reserved for
   coring geometry only.
   ============================================================ */

:root {
  /* type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);

  /* spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --font-body: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 4px;
  --radius-lg: 8px;
  --rail: 268px;
  --header-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* dark is the primary theme (instrument screen) */
:root,
[data-theme='dark'] {
  --bg: #0c0e11;
  --surface: #14171b;
  --surface-2: #191d22;
  --surface-3: #21262c;
  --border: #262c33;
  --border-strong: #38414a;
  --text: #eef1f4;
  --text-muted: #98a2ad;
  --text-faint: #84909c; /* rail headings, card labels (+15 % on 28 Sep) */
  --accent: #4d94ff;
  --accent-quiet: rgba(77, 148, 255, 0.13);
  --accent-hover: #6ba6ff;
  --core: #35d07f; /* coring geometry only */
  --text-dim: #b7bfc8; /* long reading text: softer than --text on the dark ground */
  --uv: #b58cff;
  --uv-quiet: rgba(181, 140, 255, 0.14);
  --core-quiet: rgba(53, 208, 127, 0.14);
  --warn: #e0a33e;
  --alert: #e1614f;
  --grid-line: rgba(255, 255, 255, 0.035);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* The alternative theme is a high-contrast reading mode, not a soft "day"
   theme: pure white ground, near-black text, visible borders everywhere and
   accents darkened until every pairing clears WCAG AA for body text. Nothing
   here may leak into the dark theme above. */
[data-theme='light'] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #eceff2;
  --border: #7a838d;
  --border-strong: #12161a;
  --text: #000000;
  --text-muted: #1e252c;
  --text-faint: #4a535c;
  --accent: #0b47a6;
  --accent-quiet: rgba(11, 71, 166, 0.1);
  --accent-hover: #06306f;
  --core: #0a6b3d;
  --text-dim: #1e252c;
  --uv: #5b2a9e;
  --uv-quiet: rgba(91, 42, 158, 0.1);
  --core-quiet: rgba(10, 107, 61, 0.12);
  --warn: #7a4a04;
  --alert: #96271a;
  --grid-line: rgba(0, 0, 0, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* --- high-contrast reinforcement (light theme only) --- */
[data-theme='light'] .panel,
[data-theme='light'] .card,
[data-theme='light'] .table-wrap,
[data-theme='light'] .modal,
[data-theme='light'] .rail {
  border-color: var(--border-strong);
}
[data-theme='light'] .masthead,
[data-theme='light'] .foot {
  border-color: var(--border-strong);
}
[data-theme='light'] .btn--primary {
  background: #06306f;
  border-color: #06306f;
  color: #ffffff;
}
[data-theme='light'] .btn--ghost,
[data-theme='light'] .icon-btn {
  border-color: var(--border-strong);
  color: var(--text);
}
[data-theme='light'] .tag {
  border-color: currentColor;
  font-weight: 600;
}
[data-theme='light'] a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-theme='light'] :focus-visible {
  outline: 3px solid #06306f;
  outline-offset: 2px;
}
[data-theme='light'] input,
[data-theme='light'] select,
[data-theme='light'] textarea {
  border-color: var(--border-strong);
  color: var(--text);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- primitives ---------- */

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.tag--ok {
  color: var(--core);
  border-color: var(--core-quiet);
  background: var(--core-quiet);
}
.tag--warn {
  color: var(--warn);
  border-color: rgba(224, 163, 62, 0.25);
  background: rgba(224, 163, 62, 0.1);
}
.tag--info {
  color: var(--accent);
  border-color: var(--accent-quiet);
  background: var(--accent-quiet);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--text-faint);
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border);
}
.btn--block {
  width: 100%;
}
.btn--sm {
  min-height: 30px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}
.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.icon-btn[aria-pressed='true'] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-quiet);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.panel__head h2,
.panel__head h3 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- header ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-6);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: var(--text-base);
}
.logo svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.logo span {
  color: var(--text-faint);
  font-weight: 500;
}

.masthead nav {
  display: flex;
  gap: var(--space-5);
  margin-left: var(--space-4);
}
.masthead nav a {
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  color: var(--text);
}

.masthead__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.search {
  position: relative;
  width: 260px;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 var(--space-3) 0 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
}
.search input::placeholder {
  color: var(--text-faint);
}
.search svg {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 15px;
  height: 15px;
  color: var(--text-faint);
}

/* ---------- catalogue layout ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  align-items: start;
}

.rail {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-5) var(--space-5) var(--space-10);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}

.rail__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.fgroup {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}
.fgroup > h3 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
}
.check:hover {
  color: var(--text);
}
.check input {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface-2);
  flex: none;
  position: relative;
}
.check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.check .count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.range input {
  width: 100%;
  height: 32px;
  padding: 0 var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.range span {
  color: var(--text-faint);
  font-size: var(--text-xs);
}

.main {
  min-width: 0;
  padding: var(--space-6) var(--space-8) var(--space-16);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.toolbar h1 {
  font-size: var(--text-xl);
}
.toolbar__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.toolbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.select {
  height: 32px;
  padding: 0 var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: var(--text-xs);
}

.chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  min-height: 26px;
}
.chips:empty {
  min-height: 0;
  margin-bottom: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-2) 3px var(--space-3);
  background: var(--accent-quiet);
  border: 1px solid var(--accent-quiet);
  color: var(--accent);
  border-radius: 999px;
  font-size: var(--text-xs);
}
.chip button {
  background: none;
  border: 0;
  color: inherit;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.chip button:hover {
  opacity: 1;
}

/* ---------- crystal cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: var(--space-5);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card__view {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0e1116;
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card__view img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card__id {
  position: absolute;
  top: var(--space-2);
  left: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #9aa6b3;
}
.card__fav {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.card__status {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
}
.card__uv {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
}
.card__status .tag,
.card__uv .tag {
  backdrop-filter: blur(6px);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
}

.card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.card__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.card__title h3 {
  font-size: var(--text-base);
}
.card__title .price {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
}
.specs div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.specs dt,
.specs .k {
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.specs dd,
.specs .v {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yieldbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.yieldbar__top {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.yieldbar__top b {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
}
.meter {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--core);
  border-radius: 2px;
}

.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-1);
}
.card__foot .seller {
  font-size: var(--text-xs);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__foot .btn {
  flex: 0 0 auto;
}
/* Only the vendor name may be shortened; the flag and the rating stay whole,
   so a longer translation never leaves a clipped "4." behind. */
.card__foot .seller__rate { flex: 0 0 auto; white-space: nowrap; }
/* drawn country marks — see js/flags.js for why these are not emoji */
.flag {
  width: 1.05em;
  height: 0.735em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.08em;
  border-radius: 1px;
}
.card__foot .seller__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* list (table) view */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
table.data th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
table.data td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tbody tr:hover {
  background: var(--surface-2);
}
table.data td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
}
.pager button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.pager button[aria-current='true'] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.empty {
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  color: var(--text);
}

/* ---------- detail page ---------- */

.crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-faint);
  padding: var(--space-4) var(--space-8) 0;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 0.85fr);
  gap: var(--space-6);
  padding: var(--space-4) var(--space-8) var(--space-16);
  align-items: start;
}

.stage {
  position: sticky;
  top: calc(var(--header-h) + var(--space-4));
  height: calc(100vh - var(--header-h) - var(--space-10));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #0e1116;
  overflow: hidden;
  min-height: 560px;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.stage__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}
.stage__tools {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 3;
}
.stage__tools .icon-btn {
  background: rgba(20, 24, 29, 0.8);
  border-color: #2b333c;
  color: #b7c1cc;
  backdrop-filter: blur(6px);
}
.stage__tools .icon-btn:hover {
  color: #fff;
}
.stage__hud {
  position: absolute;
  right: var(--space-3);
  top: var(--space-3);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #7c8794;
  text-align: right;
}
.stage__legend {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  z-index: 3;
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  background: rgba(20, 24, 29, 0.86);
  border: 1px solid #2b333c;
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  font-size: var(--text-xs);
  color: #b7c1cc;
}
.swatch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.swatch i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.layers {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 3;
  width: 190px;
  padding: var(--space-3);
  background: rgba(20, 24, 29, 0.9);
  border: 1px solid #2b333c;
  color: #b7c1cc;
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.layers h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7c8794;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 3px 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
}
.switch:hover {
  color: var(--text);
}
.layers .switch {
  color: #b7c1cc;
}
.layers .switch:hover {
  color: #fff;
}
.layers .switch input {
  background: #262d35;
  border-color: #3a434d;
}
.switch input {
  appearance: none;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  position: relative;
  flex: none;
  transition: background 0.15s;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.15s var(--ease), background 0.15s;
}
.switch input:checked {
  background: var(--accent-quiet);
  border-color: var(--accent);
}
.switch input:checked::after {
  transform: translateX(12px);
  background: var(--accent);
}

.aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.idblock {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.idblock h1 {
  font-size: var(--text-xl);
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
}
.idblock .sub {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

dl.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0;
}
dl.kv dt,
dl.kv dd {
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
  margin: 0;
  font-size: var(--text-sm);
}
dl.kv dt {
  color: var(--text-muted);
  white-space: nowrap;
}
dl.kv dd {
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
dl.kv dt:nth-last-of-type(1),
dl.kv dd:nth-last-of-type(1) {
  border-bottom: 0;
}

.planbar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.plan {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}
.plan:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.plan[aria-pressed='true'] {
  color: var(--core);
  border-color: var(--core);
  background: var(--core-quiet);
}
.plan--add {
  border-style: dashed;
}

.calc {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.calc__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.calc__row input {
  height: 32px;
  padding: 0 var(--space-2);
  text-align: right;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.calc__row input:focus {
  border-color: var(--accent);
}
.calc__out {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.calc__out b {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--core);
  font-weight: 600;
}
.calc__note {
  font-size: var(--text-xs);
  color: var(--text-faint);
  line-height: 1.5;
}

.cores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.cores span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  border-radius: 3px;
  background: var(--core-quiet);
  color: var(--core);
}
.cores span.more {
  background: transparent;
  color: var(--text-muted);
}

.actions {
  display: grid;
  gap: var(--space-2);
}
.actions .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.hint {
  font-size: var(--text-xs);
  color: var(--text-faint);
  line-height: 1.5;
}

.defects {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}
.defect {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 60px;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.defect b {
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 500;
}
.defect .meter i {
  background: var(--accent);
}

/* ---------- modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(4, 6, 8, 0.66);
  backdrop-filter: blur(3px);
}
.overlay[hidden] {
  display: none;
}
.modal {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal__body {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-4);
}
.field {
  display: grid;
  gap: var(--space-2);
}
.field label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.radio-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.radio-row label {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
}
.radio-row input {
  display: none;
}
.radio-row input:checked + span {
  color: var(--accent);
}
.radio-row label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-quiet);
  color: var(--accent);
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--core);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast svg {
  width: 16px;
  height: 16px;
  color: var(--core);
}

/* ---------- admin ---------- */

.admin {
  padding: var(--space-6) var(--space-8) var(--space-16);
  max-width: 1180px;
  margin: 0 auto; /* aligns the console with the prose pages */
}
.admin__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-6);
  align-items: start;
}
.admin__grid > *,
.admin__grid > * > * {
  min-width: 0;
}
.admin__col { display: grid; gap: 1.5rem; min-width: 0; }
.admin__col .table-wrap { overflow-x: auto; }
.dropzone {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  padding: var(--space-10);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-5);
}
.form-grid .span-2 {
  grid-column: span 2;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--border);
  padding: var(--space-8);
  display: grid;
  gap: var(--space-4);
  color: var(--text-faint);
  font-size: var(--text-xs);
}
.foot__row {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  align-items: center;
}
.foot nav {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.foot nav a {
  color: var(--text-muted);
}
/* language line — quiet grey, pipe-separated */
.foot__langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-faint);
}
.foot__langs a {
  color: var(--text-faint);
}
.foot__langs a:hover {
  color: var(--text-muted);
}
.foot__langs b {
  color: var(--text-muted);
  font-weight: 600;
}
.foot__langs span {
  color: var(--border-strong);
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    position: relative;
    top: 0;
    height: 60vh;
    min-height: 420px;
  }
  .admin__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  :root { --header-h: 104px; }
  :root {
    --rail: 0px;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: fixed;
    inset: var(--header-h) auto 0 0;
    width: 300px;
    background: var(--surface);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
  }
  .rail.open {
    transform: none;
  }
  .masthead {
    gap: var(--space-3);
    padding: 0 var(--space-4);
  }
  .masthead {
    flex-wrap: wrap;
    height: auto;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
    row-gap: var(--space-3);
  }
  .masthead nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: var(--space-4);
    scrollbar-width: none;
  }
  .masthead nav::-webkit-scrollbar { display: none; }
  .masthead nav a { white-space: nowrap; }
  .masthead__right {
    flex: 1;
    min-width: 0;
  }
  .search {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .logo span {
    display: none;
  }
  [data-list] {
    display: none;
  }
  .main,
  .detail,
  .admin,
  .prose {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .prose h1 { font-size: 1.75rem; }
  .crumbs {
    padding-left: var(--space-4);
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
}

@media (min-width: 901px) {
  .rail-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* --- measured (.svcm) records ---------------------------------------- */
.tag--data {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.card__measured {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font: 500 0.6875rem/1.4 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  backdrop-filter: blur(4px);
}
.levelctl {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.35rem;
}
.levelctl label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.levelctl input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}


/* ---- language switcher ---- */
.select--lang {
  padding: 0.34rem 1.6rem 0.34rem 0.6rem;
  font-size: var(--text-xs);
  max-width: 8.5rem;
}
@media (max-width: 720px) {
  .select--lang { max-width: 5.2rem; }
}

/* ---- vendor sign-in + become-a-vendor page ---- */
.signin { max-width: 640px; }
.signin__body { display: grid; gap: 0.9rem; padding: 1.25rem; }
.signin__row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

.prose {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-16);
  display: grid;
  gap: 1.5rem;
}
.prose .lead { color: var(--text); max-width: 62ch; }
.conditions {
  margin: 0;
  padding: 1.25rem 1.25rem 1.5rem 2.4rem;
  display: grid;
  gap: 0.7rem;
  color: var(--text-dim);
  line-height: 1.55;
}
/* A list that continues a paragraph should read as part of it, not as a
   separate block: collapse the double padding on both joins. */
.prose__body:has(+ .conditions) { padding-bottom: 0.35rem; }
.prose__body + .conditions { padding-top: 0.2rem; }
.conditions:has(+ .prose__body) { padding-bottom: 0.35rem; }
.conditions + .prose__body { padding-top: 0.35rem; }
.hint--tight {
  margin-top: 0.45rem;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--text-faint);
}
.conditions li::marker { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.conditions b { color: var(--text); font-weight: 600; }
.prose .form-grid { padding: 1.25rem; }
.check.span-2 { grid-column: 1 / -1; }

/* ---- prose pages: About, Support, Disclaimer ---- */
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.12; margin: 0; letter-spacing: -0.02em; }
.prose__body { padding: 1.25rem; display: grid; gap: 0.9rem; color: var(--text-dim); line-height: 1.65; }
.prose__body p { margin: 0; max-width: 74ch; }
.prose__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.35rem !important; }

/* ---- FAQ accordion ---- */
.faq { display: grid; }
.faq__item { border-top: 1px solid var(--line); }
.faq__item:first-child { border-top: 0; }
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}
.faq__q:hover { color: var(--accent); }
.faq__q i {
  flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.18s ease;
  opacity: 0.6;
}
.faq__item.is-open .faq__q i { transform: rotate(-135deg) translate(-2px, -2px); }
.faq__a {
  display: none;
  padding: 0 1.25rem 1.15rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 74ch;
}
.faq__item.is-open .faq__a { display: block; }
.admin__col table.data th,
.admin__col table.data td { padding: var(--space-3); }

/* ---- boule comparison sheet ---- */
.cmp { width: min(1040px, 100%); display: grid; }
.cmp__scroll { overflow: auto; max-height: 68vh; }
.cmp__table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.cmp__table th,
.cmp__table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.cmp__rowhead {
  position: sticky;
  left: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
  z-index: 1;
}
.cmp__col {
  min-width: 150px;
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.cmp__col b { display: block; font-variant-numeric: tabular-nums; }
.cmp__sub { color: var(--text-muted); font-size: var(--text-xs); }
.cmp__thumb { display: block; margin-bottom: var(--space-2); }
.cmp__thumb img { height: 96px; width: auto; max-width: 100%; border-radius: var(--radius); display: block; margin: 0 auto; }
.cmp__table td.is-best { color: var(--text); font-weight: 600; }
.cmp__best {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.cmp__note { padding: var(--space-4); border-top: 1px solid var(--border); margin: 0; }
[data-list].has-pins { color: var(--accent); position: relative; }
[data-list].has-pins::after {
  content: attr(data-count);
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
@media (max-width: 700px) {
  .cmp__col { min-width: 122px; }
  .cmp__table th, .cmp__table td { padding: var(--space-2); font-size: var(--text-xs); }
  .cmp__rowhead {
    width: 82px;
    max-width: 82px;
    white-space: normal;
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.3;
  }
  .cmp__scroll { max-height: 72vh; }
}

/* Short pages (vendor console sign-in, prose pages) should still park the
   footer on the bottom edge instead of leaving a dead band under it. */
body:has(> main.prose),
body:has(> main.admin) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body:has(> main.prose) > main,
body:has(> main.admin) > main { flex: 1 0 auto; }
body:has(> main.prose) > .foot,
body:has(> main.admin) > .foot { margin-top: auto; }

.foot__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

/* ---- continuous article page (About): reads as one column, no panels ---- */
.prose--article {
  max-width: 780px;
  display: block;
}
.article {
  color: var(--text-dim);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.15rem);
  line-height: 1.7;
}
.article > h1 {
  margin: 0 0 0.9rem;
  color: var(--text);
}
.article > .lead {
  /* opening paragraph: slightly larger, sets the reading voice */
  margin: 0 0 1.9rem;
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: none;
}
.article > h2 {
  /* between the title and the body: no rules, no uppercase, no boxes */
  margin: 2.4rem 0 0.7rem;
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}
.article > h2:first-of-type {
  margin-top: 2rem;
}
.article > p {
  margin: 0 0 1.05rem;
  max-width: 68ch;
}
.article > ul {
  margin: 0 0 1.05rem;
  padding-left: 1.35rem;
  max-width: 68ch;
  display: grid;
  gap: 0.45rem;
}
.article > ul li::marker {
  color: var(--text-faint);
}
.article > p:last-child,
.article > ul:last-child {
  margin-bottom: 0;
}
.article a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: from-font;
}
.article > .prose__cta {
  margin-top: 1.4rem !important;
  max-width: none;
}
@media (max-width: 640px) {
  .article > h2 {
    margin-top: 1.9rem;
  }
}

/* ---- UV-performance tag + (i) hint ---- */
.tag--uv {
  color: var(--uv);
  border-color: color-mix(in srgb, var(--uv) 40%, transparent);
  background: var(--uv-quiet);
}
.card__uv .tag--uv {
  background: color-mix(in srgb, var(--bg) 62%, transparent);
}
.hint-i {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  margin-left: 0.15rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 600 0.62rem/1 var(--font-body);
  font-style: normal;
  cursor: help;
}
.hint-i:focus-visible {
  outline: 2px solid var(--uv);
  outline-offset: 2px;
}
.hint-i::after {
  content: attr(data-tip);
  position: absolute;
  left: -0.6rem;
  bottom: calc(100% + 0.5rem);
  width: max-content;
  max-width: 15rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  font: 400 var(--text-xs) / 1.45 var(--font-body);
  white-space: normal;
  text-align: left;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
  pointer-events: none;
  z-index: 20;
}
.hint-i:hover::after,
.hint-i:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: none;
}
/* in the right-hand record panel the bubble opens leftwards */
.panel__head .hint-i::after {
  left: auto;
  right: -0.6rem;
}
.tagrow {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
dl.kv dd.kv__text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  white-space: normal;
}
dl.kv dd.kv__docs a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
dl.kv dd.kv__docs a + a {
  display: block;
  margin-top: 0.25rem;
}

/* ---- catalogue: coring plan on hover ---- */
.card__view img.card__plan {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.card:hover .card__view img.card__plan,
.card__view:focus-visible img.card__plan {
  opacity: 1;
}
@media (hover: none) {
  .card__view img.card__plan { display: none; }
}
/* form-factor hint inside a card: opens leftwards, stays within the card */
.specs .hint-i::after {
  left: auto;
  right: -0.6rem;
  max-width: 12.5rem;
}
.card__pending {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.toolbar__count { margin-top: 0.35rem; }

/* ---- catalogue: request when nothing fits ---- */
.needs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.needs p {
  font-size: var(--text-base);
  color: var(--text);
}

/* ---- crystal page: availability + enquiry at the top ---- */
.buybox {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.buybox__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}
.buybox__note {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.buybox__actions {
  display: flex;
  gap: var(--space-2);
}
.buybox__actions .btn { flex: 1 1 0; }
.buybox__actions .btn--primary { flex-grow: 1.6; }
.hint--pad {
  padding: 0 var(--space-4);
  margin-top: var(--space-3);
}
.stage__pending {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mbar { display: none; }
@media (max-width: 900px) {
  .mbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
  }
  .mbar .tagrow { align-items: center; gap: var(--space-2); font-size: var(--text-xs); }
  .mbar .btn { margin-left: auto; }
  body:has(.mbar) .foot { padding-bottom: 5.5rem; }
}

/* ---- card title: method left, mass right, same type ---- */
.card__title .card__mass {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
}
.card__price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.card__price b {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* spam trap: invisible to people, filled in by bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.buybox__price { font-size: var(--text-sm); }

/* home intro: one step larger, two lines */
.toolbar__lead {
  font-size: var(--text-base);
  line-height: 1.55;
  max-width: 62rem;
}

/* Secondary buttons must read as buttons on the dark ground: a raised fill
   and a clearly visible edge (the old surface-2 fill was 3 % off the panel). */
:root .btn:not(.btn--primary),
[data-theme='dark'] .btn:not(.btn--primary) {
  background: #252c34;
  border-color: #56616d;
  color: #e6eaee;
}
:root .btn:not(.btn--primary):hover,
[data-theme='dark'] .btn:not(.btn--primary):hover {
  background: #2f3842;
  border-color: #7a8692;
}
[data-theme='light'] .btn:not(.btn--primary) {
  background: #eef1f4;
  border-color: #12161a;
  color: #12161a;
}
[data-theme='light'] .btn:not(.btn--primary):hover { background: #dde2e7; }
/* coring-plan chips are buttons too */
:root .plan:not([aria-pressed='true']),
[data-theme='dark'] .plan:not([aria-pressed='true']) {
  background: #252c34;
  border-color: #56616d;
  color: #d5dbe1;
}
:root .plan:not([aria-pressed='true']):hover,
[data-theme='dark'] .plan:not([aria-pressed='true']):hover {
  background: #2f3842;
  border-color: #7a8692;
  color: #fff;
}
[data-theme='light'] .plan:not([aria-pressed='true']) {
  background: #eef1f4;
  border-color: #12161a;
  color: #12161a;
}
