/* =========================================================================
   Laser Selector - design system
   White paper, thin rules, blue ink for anything that emits and orange for
   anything that receives. Light, not moody - it mirrors the mini-program.
   ========================================================================= */

:root {
  /* substrate ------------------------------------------------------------ */
  /* White paper, a whisper of blue in the recesses, blue and orange ink.    */
  --bg:            #ffffff;
  --bg-2:          #f5f8fc;
  --surface:       #ffffff;
  --surface-2:     #f1f5f9;
  --surface-3:     rgba(15, 23, 42, 0.06);
  --line:          rgba(15, 23, 42, 0.10);
  --line-strong:   rgba(15, 23, 42, 0.20);

  /* ink ------------------------------------------------------------------ */
  --ink:           #0b1526;
  --ink-2:         #33415a;
  --ink-3:         #56657c;
  --ink-4:         #6b7c93;

  /* signal --------------------------------------------------------------- */
  --emit:          #0369a1;   /* blue   - anything that emits, 5.93:1 on white */
  --emit-2:        #0ea5e9;
  --emit-deep:     #075985;
  --recv:          #ea580c;   /* orange - anything that receives */
  --hot:           #ea580c;
  --warn:          #b45309;
  --ok:            #047857;

  --grad-emit:  linear-gradient(120deg, #0369a1 0%, #1d4ed8 58%, #1e40af 100%);
  --grad-hot:   linear-gradient(120deg, #c2410c 0%, #9a3412 100%);
  --grad-brand: linear-gradient(120deg, #f97316 0%, #0ea5e9 58%, #2563eb 100%);

  /* diagrams -------------------------------------------------------------- */
  /* The mini-program's light theme picks #64748b for whatever it writes on the
   * canvas and a near-white for axes. On a white card that axis colour is
   * invisible, so the axis token is a shade darker; the ink token is identical. */
  --diagram-axis:  #cbd5e1;
  --diagram-line:  #64748b;

  /* geometry ------------------------------------------------------------- */
  --r-sm: 4px;
  --r:    8px;
  --r-lg: 14px;
  --pad:  clamp(1rem, 3vw, 2rem);
  --maxw: 1220px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo,
          Consolas, "Liberation Mono", monospace;

  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 10px 28px -14px rgba(15,23,42,.18);
  --shadow-lg: 0 22px 54px -26px rgba(15,23,42,.28);
}

*, *::before, *::after { box-sizing: border-box; }

/* The client code shows and hides things with the `hidden` attribute. The
 * browser's own [hidden] rule lives in the user-agent sheet, which every author
 * rule outranks - so one `display` on the same element silently defeats it.
 * That is exactly how the catalogue filter once stopped filtering: the count
 * changed and not one card left the grid. This has to win outright. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 500px at 12% -8%, rgba(2, 132, 199, .10), transparent 62%),
    radial-gradient(900px 420px at 92% 4%,  rgba(249, 115, 22, .10), transparent 60%),
    linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px) 0 0 / 56px 100%;
  mask-image: linear-gradient(to bottom, #000 0, #000 55vh, transparent 100vh);
}

body > * { position: relative; z-index: 1; }

h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -0.018em;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.02rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--emit); text-decoration: none; transition: color .16s ease; }
a:hover { color: var(--emit-deep); }

img, svg { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

code, kbd, samp, .mono {
  font-family: var(--mono);
  font-size: .875em;
  font-feature-settings: "zero" 1;
}

code {
  background: rgba(2, 132, 199, .08);
  border: 1px solid rgba(2, 132, 199, .16);
  color: #075985;
  padding: .1em .4em;
  border-radius: var(--r-sm);
}

pre {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; color: #334155; }

::selection { background: rgba(2, 132, 199, .22); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--emit);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* -------------------------------------------------------------------------
   Primitives
   ---------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.wrap-wide { max-width: 1500px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--emit);
  color: #fff;
  padding: .7rem 1.1rem;
  font-weight: 650;
  border-radius: 0 0 var(--r) 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--emit);
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--emit);
  opacity: .6;
}

.lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-3); max-width: 62ch; }

.muted { color: var(--ink-4); }
.small { font-size: .84rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tight { padding: clamp(2rem, 4vw, 3rem) 0; }

.section-head { margin-bottom: clamp(1.6rem, 3vw, 2.6rem); max-width: 74ch; }
.section-head .lede { margin-top: .5rem; }

/* buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.25rem;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: .93rem;
  font-weight: 560;
  cursor: pointer;
  transition: transform .14s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(15,23,42,.26); background: #e2e8f0; color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-emit);
  border-color: transparent;
  color: #fff;
  font-weight: 680;
  box-shadow: 0 8px 26px -12px rgba(2, 132, 199, .75);
}
.btn-primary:hover { color: #fff; box-shadow: 0 12px 34px -12px rgba(2, 132, 199, .95); }

.btn-hot {
  background: var(--grad-hot);
  border-color: transparent;
  color: #fff;
  font-weight: 660;
  box-shadow: 0 8px 26px -14px rgba(234, 88, 12, .8);
}
.btn-hot:hover { color: #fff; }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-sm { padding: .48rem .85rem; font-size: .84rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }

/* badges ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .26rem .55rem;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
  background: rgba(15,23,42,.04);
  white-space: nowrap;
}
.badge-emit { color: #0369a1; border-color: rgba(2,132,199,.34); background: rgba(2,132,199,.09); }
.badge-recv { color: #c2410c; border-color: rgba(234,88,12,.34); background: rgba(234,88,12,.09); }
.badge-hot  { color: #c2410c; border-color: rgba(234,88,12,.34);  background: rgba(234,88,12,.09); }
.badge-warn { color: #b45309; border-color: rgba(180,83,9,.34); background: rgba(180,83,9,.09); }
.badge-ok   { color: #047857; border-color: rgba(5,150,105,.34); background: rgba(5,150,105,.09); }

/* cards ----------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, rgba(2,132,199,.035), rgba(2,132,199,0)) , var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.card-hover:hover {
  border-color: rgba(2, 132, 199, .36);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* panels / callouts ----------------------------------------------------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.note {
  border-left: 3px solid var(--emit);
  background: rgba(2, 132, 199, .055);
  padding: .9rem 1.1rem;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: .92rem;
  color: var(--ink-2);
}
.note-warn { border-left-color: var(--warn); background: rgba(180, 83, 9, .06); }
.note-hot  { border-left-color: var(--hot);  background: rgba(234, 88, 12, .06); }
.note > :last-child { margin-bottom: 0; }

/* Enquiry form feedback: #rfq-status ships hidden and is filled by app.js. */
#rfq-status { color: var(--ok); font-weight: 600; }
#rfq-status.is-error { color: var(--recv); }

.formula {
  font-family: var(--mono);
  font-size: .95rem;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-left: 3px solid var(--emit);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 1rem 1.2rem;
  color: #075985;
  overflow-x: auto;
  margin: 1.4rem 0;
}

/* -------------------------------------------------------------------------
   Header / navigation
   ---------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.6rem);
  min-height: 64px;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 680; letter-spacing: -.02em; }
.brand:hover { color: var(--emit); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-text { font-size: 1.02rem; }
.brand-text small { display: block; font-size: .62rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }

.nav { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.nav a {
  color: var(--ink-2);
  font-size: .9rem;
  font-weight: 520;
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--emit); }

.header-actions { display: flex; align-items: center; gap: .5rem; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  font-size: .8rem;
  font-family: var(--mono);
}
.lang-switch a, .lang-switch span {
  padding: .38rem .62rem;
  color: var(--ink-4);
  letter-spacing: .04em;
}
.lang-switch a:hover { background: var(--surface-2); color: var(--ink-2); }
.lang-switch [aria-current="true"] { background: var(--surface-2); color: var(--emit); }

.nav-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  width: 38px; height: 34px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .nav {
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: .5rem var(--pad) 1rem;
    gap: 0;
    margin-left: 0;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .7rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header-actions .btn { display: none; }
}

/* -------------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem 2.5rem;
}
.footer-grid h4 {
  font-size: .74rem;
  font-family: var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: .9rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-grid a { color: var(--ink-3); font-size: .89rem; }
.footer-grid a:hover { color: var(--emit); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.6rem;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--ink-4);
}

/* -------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: .5rem; }
.hero h1 .thin { display: block; font-weight: 320; color: var(--ink-3); font-size: .52em; letter-spacing: -.01em; margin-top: .35em; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.2rem;
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.hero-stats div { min-width: 92px; }
.hero-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.02em;
}
.hero-stats span { font-size: .76rem; color: var(--ink-4); letter-spacing: .04em; }

/* beam illustration ------------------------------------------------------ */
.beam-figure {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: radial-gradient(120% 120% at 80% 0%, rgba(2,132,199,.10), transparent 55%), #f8fafc;
  padding: 1.2rem;
  overflow: hidden;
}
.beam-figure svg { width: 100%; height: auto; }
.beam-caption {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.pulse-dot { animation: pulse-run 3.6s linear infinite; }
@keyframes pulse-run {
  0%   { transform: translateX(0); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateX(440px); opacity: 0; }
}
.glow-soft { filter: drop-shadow(0 0 7px rgba(2,132,199,.55)); }

/* -------------------------------------------------------------------------
   Selector wizard
   ---------------------------------------------------------------------- */
.selector {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 1.8rem);
  align-items: start;
}
@media (max-width: 1040px) { .selector { grid-template-columns: 1fr; } }

.selector-main {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.steps-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: .85rem clamp(1rem, 2vw, 1.4rem);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.steps-bar::-webkit-scrollbar { display: none; }
.step-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--ink-4);
  white-space: nowrap;
  padding: .25rem 0;
}
.step-chip i {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: .68rem;
  font-style: normal;
  flex: none;
}
.step-chip[data-state="active"] { color: var(--emit); }
.step-chip[data-state="active"] i { border-color: var(--emit); background: rgba(2,132,199,.14); color: var(--emit); }
.step-chip[data-state="done"] { color: var(--ink-2); }
.step-chip[data-state="done"] i { border-color: rgba(5,150,105,.5); color: var(--ok); background: rgba(5,150,105,.1); }
.step-sep { flex: none; width: 18px; height: 1px; background: var(--line); margin: 0 .55rem; }

.step-body { padding: clamp(1.2rem, 2.6vw, 2rem); }
.step-panel > h3 { margin-bottom: .3rem; }
.step-panel > .hint { color: var(--ink-4); font-size: .88rem; margin-bottom: 1.4rem; }

.choices { display: grid; gap: .7rem; }
.choices-2 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.choices-3 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.choices-4 { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  color: var(--ink-2);
  text-align: left;
  font: inherit;
}
.choice:hover { border-color: rgba(2,132,199,.45); background: #e0f2fe; transform: translateY(-2px); }
.choice[aria-pressed="true"] {
  border-color: var(--emit);
  background: linear-gradient(180deg, rgba(2,132,199,.14), rgba(2,132,199,.04));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(2,132,199,.28);
}
.choice[aria-pressed="true"]::after {
  content: "";
  position: absolute; top: .6rem; right: .6rem;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emit);
  box-shadow: 0 0 10px 2px rgba(2,132,199,.8);
}
.choice b { font-weight: 600; font-size: .95rem; color: inherit; }
.choice small { font-size: .76rem; color: var(--ink-4); line-height: 1.45; }
.choice .mono { color: var(--ink-3); }

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.2rem, 2.6vw, 2rem);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.step-nav .spacer { flex: 1; }

/* live summary rail ----------------------------------------------------- */
.selector-rail {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(2,132,199,.05), transparent 40%), var(--surface);
  padding: clamp(1.1rem, 2.2vw, 1.4rem);
  position: sticky;
  top: 84px;
}
.selector-rail h4 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 1rem;
}
.rail-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .55rem; }
.rail-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .86rem;
  padding-bottom: .55rem;
  border-bottom: 1px dashed var(--line);
}
.rail-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.rail-list .k { color: var(--ink-4); }
.rail-list .v { color: var(--ink); font-family: var(--mono); font-size: .82rem; text-align: right; }
.rail-list .v.empty { color: var(--ink-4); font-style: italic; font-family: var(--font); }

.rail-estimate {
  border: 1px solid rgba(2,132,199,.24);
  background: rgba(2,132,199,.05);
  border-radius: var(--r);
  padding: .9rem 1rem;
  margin-bottom: 1rem;
}
.rail-estimate .big {
  font-family: var(--mono);
  font-size: 1.35rem;
  color: var(--emit);
  letter-spacing: -.02em;
}
.rail-estimate .lbl { font-size: .74rem; color: var(--ink-4); }

/* -------------------------------------------------------------------------
   Results
   ---------------------------------------------------------------------- */
.result-stack { display: grid; gap: 1.1rem; }

.result-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.result-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.result-card[data-rank="primary"] { border-color: rgba(2,132,199,.42); box-shadow: 0 0 0 1px rgba(2,132,199,.12), var(--shadow); }

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem 1rem;
  padding: .9rem clamp(1rem, 2vw, 1.4rem);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.result-rank {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .28rem .6rem;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
}
[data-rank="primary"] .result-rank { color: #0369a1; border-color: rgba(2,132,199,.4); background: rgba(2,132,199,.1); }
[data-rank="budget"] .result-rank { color: #b45309; border-color: rgba(180,83,9,.35); background: rgba(180,83,9,.08); }

.result-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: clamp(1.1rem, 2.4vw, 1.5rem);
}
@media (max-width: 780px) { .result-body { grid-template-columns: 1fr; } }

.result-body h3 { margin-bottom: .15rem; }
.result-sub { font-family: var(--mono); font-size: .84rem; color: var(--emit); margin-bottom: .9rem; }

.kv { list-style: none; margin: 0; padding: 0; display: grid; gap: .38rem; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; font-size: .86rem; }
.kv .k { color: var(--ink-4); }
.kv .v { color: var(--ink); font-family: var(--mono); font-size: .82rem; text-align: right; }

.why { border-left: 2px solid rgba(2,132,199,.4); padding-left: .9rem; }
.why h5 {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 .5rem;
}
.why ul { margin: 0; padding-left: 1.05rem; display: grid; gap: .3rem; font-size: .85rem; }
.why li::marker { color: var(--emit); }

.result-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  padding: .85rem clamp(1rem, 2vw, 1.4rem);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.result-foot .spacer { flex: 1; }

.score-bar { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; }
.score-bar span { display: block; height: 100%; background: var(--grad-emit); }

/* -------------------------------------------------------------------------
   Catalogue
   ---------------------------------------------------------------------- */
.catalog {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: start;
}
@media (max-width: 900px) { .catalog { grid-template-columns: 1fr; } }

.filters {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 1.1rem;
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  /* The facet list runs to roughly 1300 px, which is taller than a laptop
   * viewport. Pinned at top: 84px a panel that tall has its lower half stuck
   * below the fold for good - the 450 nm option and the clear button were
   * simply unreachable. So the list scrolls inside the panel and the button
   * stays on its foot. */
  max-height: calc(100vh - 108px);
}
.filters-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: -.25rem; padding: .25rem; }
.filters-foot { flex: none; border-top: 1px solid var(--line); padding-top: .9rem; }

/* Below 900 px the rail sits above the grid, so a 1300 px list would push the
 * first product more than a screen down. It folds away instead. Only app.js
 * wires the toggle up, so with scripting off the panel simply stays open. */
.facet-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .6rem .8rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 560;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  cursor: pointer;
}
@media (max-width: 900px) {
  .filters { position: static; max-height: none; }
  .filters-scroll { overflow: visible; }
  .facet-toggle { display: flex; }
  .filters[data-collapsed="true"] .filters-scroll,
  .filters[data-collapsed="true"] .filters-foot { display: none; }
}

.filters h4 {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 1.3rem 0 .6rem;
}
.filters h4:first-child { margin-top: 0; }

.filter-list { display: grid; gap: .1rem; }
.filter-list label {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .86rem;
  color: var(--ink-2);
  padding: .34rem .4rem;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.filter-list label:hover { background: var(--surface-2); }
.filter-list input { accent-color: #0284c7; width: 15px; height: 15px; flex: none; }
.filter-list .count { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--ink-4); }
/* An option that cannot narrow the list any further stays in place and reads as
 * unavailable, rather than vanishing and reflowing the list under the pointer. */
.filter-list label.is-empty { opacity: .42; cursor: default; }
.filter-list label.is-empty:hover { background: none; }
.filter-list input:disabled { cursor: default; }

.search-box { position: relative; margin-bottom: 1rem; }
.search-box input {
  width: 100%;
  padding: .7rem .9rem .7rem 2.2rem;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
}
.search-box input::placeholder { color: var(--ink-4); }
.search-box svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-4); }
.search-box kbd {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: .68rem; color: var(--ink-4);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
  padding: .05rem .34rem; pointer-events: none;
}
@media (max-width: 700px) { .search-box kbd { display: none; } }

/* Search, the hit count and the sort order sit in one band that sticks under
 * the header, so all three stay reachable however far down the grid you are. */
.catalog-bar {
  position: sticky;
  top: 84px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem 1rem;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px) saturate(140%);
}
.catalog-bar .search-box { flex: 1 1 220px; max-width: 460px; margin-bottom: 0; }
.catalog-bar .count { font-family: var(--mono); font-size: .84rem; color: var(--ink-3); white-space: nowrap; }
.catalog-bar .count b { color: var(--emit); }
.catalog-bar select {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  padding: .42rem .7rem;
  font: inherit;
  font-size: .84rem;
}


.active-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
/* Inside the bar the tray becomes a full-width second row, so *why* a search
 * came back short is on screen without hunting back up the rail. It goes away
 * entirely when nothing is on. */
.catalog-bar .active-filters { flex: 1 1 100%; margin-bottom: 0; max-height: 6rem; overflow: auto; }
/* Room for the key hint so long placeholders do not run underneath it. */
.catalog-bar .search-box input { padding-right: 2.4rem; }

.product-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 1.05rem 1.1rem 1.15rem;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--grad-emit);
  opacity: .55;
}
.product-card:hover { border-color: rgba(2,132,199,.4); transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card .model { font-family: var(--mono); font-size: .95rem; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.product-card .tagline { font-size: .84rem; color: var(--ink-3); line-height: 1.5; min-height: 2.6em; }
.product-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: auto;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.product-card .kvline { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .76rem; color: var(--ink-3); }
.product-card .kvline .k { color: var(--ink-4); }

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-3);
  grid-column: 1 / -1;
}

/* -------------------------------------------------------------------------
   Product detail
   ---------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  color: var(--ink-4);
  margin-bottom: 1.4rem;
}
.breadcrumbs a { color: var(--ink-4); }
.breadcrumbs a:hover { color: var(--emit); }
.breadcrumbs span[aria-current] { color: var(--ink-2); }

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding-bottom: clamp(1.5rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 880px) { .product-hero { grid-template-columns: 1fr; } }

.product-hero h1 {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  letter-spacing: -.02em;
  word-break: break-word;
}
.product-hero .tagline { font-size: 1.06rem; color: var(--emit); font-family: var(--mono); margin-bottom: 1rem; }

.keyfigures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .8rem;
  margin: 1.6rem 0;
}
.keyfigure {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: .75rem .85rem;
}
.keyfigure b {
  display: block;
  font-family: var(--mono);
  font-size: 1.12rem;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -.02em;
}
.keyfigure span { font-size: .72rem; color: var(--ink-4); letter-spacing: .03em; }

.spec-table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.spec-table caption { text-align: left; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); padding-bottom: .7rem; }
.spec-table th, .spec-table td { padding: .62rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--ink-4); width: 46%; }
.spec-table td { color: var(--ink); font-family: var(--mono); font-size: .84rem; }
.spec-table tr:hover td, .spec-table tr:hover th { background: rgba(2,132,199,.05); }
.table-scroll { overflow-x: auto; }

/* The source matrix compares up to four datasheets side by side, so it is a
 * wide table that scrolls sideways inside its panel rather than compressing
 * every cell into a wrapped paragraph. */
.spec-table.spec-matrix { min-width: 44rem; font-size: .82rem; }
.spec-table.spec-matrix th { width: auto; }
.spec-table.spec-matrix thead th { color: var(--ink); font-weight: 600; font-size: .8rem;
                                    border-bottom-color: var(--line-strong); white-space: nowrap; }
.spec-table.spec-matrix tbody th { width: 12.5rem; font-family: var(--mono); font-size: .75rem;
                                   letter-spacing: .02em; color: var(--ink-3); }
.spec-table.spec-matrix td { font-size: .79rem; }

.callout-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.callout-list li {
  display: flex;
  gap: .6rem;
  font-size: .9rem;
  color: var(--ink-2);
}
.callout-list li::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  margin-top: .55em;
  border-radius: 50%;
  background: var(--emit);
  box-shadow: 0 0 8px 1px rgba(2,132,199,.6);
}

.sticky-aside { position: sticky; top: 84px; display: grid; gap: 1rem; }

/* The package photograph is a thumbnail beside its own caption: at this size it
 * only has to identify the package, not sell it. The width is fixed and the
 * height is left entirely to the file's own ratio, so no box can stretch the
 * shot the way the earlier square plate did. */
.pkg-photo { display: flex; align-items: center; gap: .85rem; margin: 0; }
.pkg-photo img {
  flex: none; width: 112px; height: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
}
.pkg-photo figcaption { display: grid; gap: .2rem; font-size: .78rem; color: var(--ink-3); }
.pkg-photo figcaption b {
  font-family: var(--mono); font-size: .82rem; color: var(--ink); font-weight: 500;
  letter-spacing: .02em;
}

.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.source-list li { border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .85rem; background: var(--surface-2); }
.source-list .vendor { font-size: .74rem; color: var(--ink-4); letter-spacing: .04em; }
.source-list .m { font-family: var(--mono); font-size: .87rem; color: var(--ink); }

/* -------------------------------------------------------------------------
   Knowledge base
   ---------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 940px) { .article-layout { grid-template-columns: 1fr; } }

.prose { max-width: 74ch; font-size: 1.005rem; line-height: 1.78; }
.prose > h2 {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.28rem, 2.2vw, 1.6rem);
}
.prose > h3 { margin-top: 1.9rem; font-size: 1.13rem; color: var(--ink); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: .4rem; margin: 0 0 1.2rem; }
.prose li::marker { color: var(--emit); }
.prose strong { color: var(--ink); font-weight: 640; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-3);
}
.prose table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 1.4rem 0; }
.prose th, .prose td { padding: .55rem .75rem; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 560; }
.prose td { color: var(--ink-2); }
.prose td.num, .prose th.num { font-family: var(--mono); font-size: .84rem; }

.toc {
  position: sticky;
  top: 84px;
  border-left: 1px solid var(--line);
  padding-left: 1.1rem;
  font-size: .85rem;
}
.toc h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); margin-bottom: .8rem; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.toc a { color: var(--ink-3); display: block; line-height: 1.45; }
.toc a:hover { color: var(--emit); }
.toc li.lvl-3 { padding-left: .9rem; font-size: .93em; }

.article-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 1.2rem 1.25rem;
  transition: border-color .18s ease, transform .18s ease;
}
.article-card:hover { border-color: rgba(2,132,199,.4); transform: translateY(-2px); }
.article-card h3 { font-size: 1.06rem; margin: 0; }
.article-card p { font-size: .875rem; color: var(--ink-3); margin: 0; }
.article-card .meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .74rem; color: var(--ink-4); font-family: var(--mono); margin-top: auto; padding-top: .7rem; }
.article-card .topic { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--emit); }

/* -------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------- */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: grid; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .8rem; color: var(--ink-3); font-weight: 550; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .68rem .85rem;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  transition: border-color .15s ease;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--emit); outline: none; box-shadow: 0 0 0 3px rgba(2,132,199,.14); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }

.cta-band {
  border: 1px solid rgba(2,132,199,.28);
  border-radius: var(--r-lg);
  background: radial-gradient(120% 160% at 8% 0%, rgba(2,132,199,.12), transparent 60%), var(--surface);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
}
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* utility --------------------------------------------------------------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.divider { height: 1px; background: var(--line); margin: 2rem 0; border: 0; }

/* ==========================================================================
   Layer 2 (calculators), the specification database, and lead capture
   Added for the five-layer build: Selector / Calculators / Knowledge /
   Database / Supplier.  Appended so nothing above this line changes.
   ========================================================================== */

:root {
  --accent: var(--emit);
  --muted: var(--ink-3);
  --wa: #25d366;
  --wa-dark: #128c3f;
}

.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;
}

/* ------------------------------------------------------------ breadcrumbs */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  font-size: .8rem; font-family: var(--mono); color: var(--ink-4);
  margin-bottom: .9rem;
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--emit); }
.crumb-sep { color: var(--ink-4); opacity: .6; }

/* --------------------------------------------------------------- WhatsApp */
.btn-wa {
  background: var(--wa); border-color: var(--wa); color: #04321a; font-weight: 620;
}
.btn-wa:hover { background: #1fbe5b; border-color: #1fbe5b; color: #04321a; }

.panel-wa { border-color: rgba(37, 211, 102, .35); background: rgba(37, 211, 102, .06); }
.panel-wa h3 { color: var(--ink); }

.wa-float {
  position: fixed; right: clamp(.8rem, 2vw, 1.4rem); bottom: clamp(.8rem, 2vw, 1.4rem);
  z-index: 60; display: inline-flex; align-items: center; gap: .5rem;
  padding: .62rem .95rem .62rem .72rem;
  background: var(--wa); color: #04321a; border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(37, 211, 102, .45), 0 2px 8px rgba(15, 23, 42, .16);
  font-size: .85rem; font-weight: 620; transition: transform .16s ease, background .16s ease;
}
.wa-float:hover { background: #1fbe5b; color: #04321a; transform: translateY(-2px); }
.wa-float svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 640px) {
  .wa-float-label { display: none; }
  .wa-float { padding: .7rem; }
}
footer.site-footer { padding-bottom: 5rem; }

/* ------------------------------------------------------ calculator hub */
.hub-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  margin: 1.2rem 0 .9rem;
}
.hub-toolbar .search-box { flex: 1 1 320px; max-width: 520px; }
.hub-toolbar .count { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }
.hub-toolbar .count b { color: var(--emit); font-family: var(--mono); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .34rem .68rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: .8rem; font-family: inherit; cursor: pointer; text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { border-color: var(--emit); color: var(--emit); background: rgba(2, 132, 199, .08); }
.chip-n { color: var(--ink-4); font-family: var(--mono); font-size: .72rem; }
.chip.is-active .chip-n { color: var(--emit); }

.row-head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.row-head .muted { font-family: var(--mono); }

.calc-card {
  display: flex; flex-direction: column; gap: .45rem;
  padding: 1rem 1.05rem; min-height: 152px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.calc-card:hover {
  border-color: rgba(2, 132, 199, .5); background: var(--surface-2);
  transform: translateY(-2px); color: var(--ink);
}
.calc-card-title { font-weight: 620; color: var(--ink); letter-spacing: -.01em; }
.calc-card-desc { font-size: .84rem; color: var(--ink-3); line-height: 1.5; flex: 1; }
.calc-card-formula {
  font-family: var(--mono); font-size: .74rem; color: var(--emit);
  background: rgba(2, 132, 199, .07); border-radius: var(--r-sm);
  padding: .28rem .45rem; align-self: flex-start; word-break: break-word;
}

/* ------------------------------------------------- single calculator page */
.calc-layout {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 1.8rem); align-items: start;
}
@media (max-width: 1040px) { .calc-layout { grid-template-columns: 1fr; } }

.calc-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(1rem, 2.2vw, 1.5rem);
}
.calc-formula-display {
  font-family: var(--mono); font-size: .95rem; color: var(--emit);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: .7rem .9rem; margin-bottom: 1.2rem;
  overflow-x: auto; white-space: nowrap;
}
.calc-h {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-4); font-family: var(--mono); font-weight: 600;
  margin: 1.3rem 0 .6rem;
}
.calc-h:first-child { margin-top: 0; }

.calc-targets { display: flex; flex-wrap: wrap; gap: .4rem; }
.calc-target {
  padding: .42rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-family: inherit; font-size: .84rem; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.calc-target:hover { border-color: var(--line-strong); color: var(--ink); }
.calc-target.is-active {
  border-color: var(--emit); background: rgba(2, 132, 199, .12);
  color: var(--emit); font-weight: 600;
}

.calc-inputs { display: grid; gap: .85rem; }
.calc-field { display: grid; gap: .3rem; }
.calc-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.calc-field-head label { font-size: .88rem; color: var(--ink-2); }
.calc-unit { font-family: var(--mono); font-size: .76rem; color: var(--ink-4); }
.calc-number {
  width: 100%; padding: .55rem .7rem; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-family: var(--mono); font-size: .92rem;
}
.calc-number:focus { outline: none; border-color: var(--emit); }
.calc-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px;
  background: transparent; cursor: pointer;
}
.calc-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: var(--surface-3); border: 1px solid var(--line);
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -6px;
  border-radius: 50%; background: var(--emit); border: 2px solid var(--bg);
}
.calc-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
.calc-slider::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--bg); background: var(--emit); border-radius: 50%; }

.calc-result-box {
  margin-top: 1.3rem; padding: 1rem 1.1rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--emit); border-radius: var(--r);
}
.calc-result-label {
  display: block; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4);
}
.calc-result { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.calc-value {
  font-family: var(--mono); font-size: clamp(1.6rem, 4.4vw, 2.3rem);
  font-weight: 600; color: var(--emit); letter-spacing: -.02em; line-height: 1.15;
}
.calc-value-bad { font-size: 1rem; color: var(--warn); }
.calc-result-unit { font-family: var(--mono); font-size: .95rem; color: var(--ink-3); }

.calc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* Catalogue linkage: load a real part into the inputs, and read the result
 * back out as a shortlist of parts. Blue is the emit half of the palette, so
 * the picker and the part links take it; a shortfall switches the comparison
 * line to the receive / warning orange. */
.calc-parts {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-2); padding: .85rem 1rem; margin-bottom: 1.2rem;
}
.calc-parts .calc-h { margin-top: 0; }
.calc-parts-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.calc-parts-row select {
  flex: 1 1 16rem; min-width: 0; padding: .5rem .6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-family: var(--mono); font-size: .86rem;
}
.calc-parts-said {
  margin: .6rem 0 0; font-family: var(--mono); font-size: .8rem; color: var(--emit);
}

.calc-reco { margin-top: 1.4rem; }
.calc-reco-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.calc-reco-hit {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
  padding: .6rem .75rem; border: 1px solid var(--line);
  border-left: 3px solid var(--emit); border-radius: var(--r); background: var(--bg-2);
}
.calc-reco-model {
  font-family: var(--mono); font-size: .9rem; font-weight: 600; color: var(--emit);
}
.calc-reco-why { margin-left: auto; font-family: var(--mono); font-size: .78rem; color: var(--ink-3); }
.calc-reco-meta { flex-basis: 100%; font-size: .76rem; color: var(--ink-4); }
.calc-reco.is-short .calc-reco-hit { border-left-color: var(--recv); }
.calc-reco.is-short .calc-reco-why { color: var(--recv); }
.calc-reco .btn { margin-top: .7rem; }

.calc-chart-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.calc-chart-head label { font-size: .84rem; color: var(--ink-3); }
.calc-chart-head select {
  padding: .38rem .6rem; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--ink); font-family: inherit; font-size: .84rem;
}
.calc-chart { width: 100%; height: 220px; display: block; margin-top: .5rem; }

.calc-side { display: grid; gap: 1rem; }
.side-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1rem 1.1rem;
}
.side-card-cta { border-color: rgba(2, 132, 199, .3); }
.side-card .btn + .btn { margin-top: .4rem; }

.var-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.var-table th, .var-table td { text-align: left; padding: .38rem .3rem; border-bottom: 1px solid var(--line); }
.var-table thead th {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 600;
}
.var-table tbody th { font-weight: 500; color: var(--ink-2); }
.var-table tbody td { color: var(--ink-3); font-family: var(--mono); }
.var-table tbody tr:last-child th, .var-table tbody tr:last-child td { border-bottom: 0; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; padding: .5rem 0; font-size: .86rem; color: var(--ink-2); }
.link-list a:hover { color: var(--emit); }

/* --------------------------------------------------------- database table */
.db-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: .9rem;
}
.db-toolbar .search-box { flex: 1 1 320px; max-width: 520px; }
.db-toolbar .count { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }
.db-toolbar .count b { color: var(--emit); font-family: var(--mono); }

.db-facets { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1rem; }
.db-facet { display: grid; gap: .25rem; }
.db-facet span {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4);
}
.db-facet select {
  padding: .42rem .6rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--ink); font-family: inherit; font-size: .84rem;
  min-width: 10rem;
}

.db-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 940px; }
.db-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-2); text-align: left; padding: .55rem .5rem;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-4); white-space: nowrap;
}
.db-table thead th[data-sort] { cursor: pointer; user-select: none; }
.db-table thead th[data-sort]:hover { color: var(--ink-2); }
.db-table thead th.is-sorted { color: var(--emit); }
.db-table thead th.is-sorted[aria-sort="ascending"]::after { content: " \2191"; }
.db-table thead th.is-sorted[aria-sort="descending"]::after { content: " \2193"; }
.db-table tbody tr { border-bottom: 1px solid var(--line); }
.db-table tbody tr:hover { background: var(--surface); }
.db-table tbody th { text-align: left; font-weight: 600; padding: .5rem .5rem; white-space: nowrap; }
.db-table tbody td { padding: .5rem .5rem; color: var(--ink-2); }
.db-table tbody td.num { font-family: var(--mono); color: var(--ink-3); white-space: nowrap; }
.db-pick { width: 2.4rem; text-align: center; }
.db-pick input { accent-color: var(--emit); }

.db-tray {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .8rem; margin-top: 1rem; padding: .8rem 1rem;
  background: var(--surface-2); border: 1px solid var(--emit);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.db-tray-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; min-width: 0; }
.db-tray-main b { color: var(--emit); font-family: var(--mono); }
.db-tray-list {
  font-family: var(--mono); font-size: .78rem; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch;
}
.db-tray-actions { display: flex; flex-wrap: wrap; gap: .45rem; }

/* ------------------------------------------------------------ home layers */
.layer-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}
.layer-card { display: flex; flex-direction: column; }
.layer-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.layer-num {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700; line-height: 1;
  background: var(--grad-emit); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.layer-tag {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4);
  border: 1px solid var(--line); border-radius: 999px; padding: .16rem .5rem;
}
.layer-card p { flex: 1; font-size: .86rem; color: var(--ink-3); }
.layer-cta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }

.cta-band-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ----------------------------------------------------- header breathing */
@media (max-width: 1150px) {
  .nav a { padding: .45rem .5rem; font-size: .85rem; }
  .header-inner { gap: .7rem; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header-actions .btn { display: none; }
  .nav {
    position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: .5rem var(--pad) 1rem; gap: 0; margin-left: 0; display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .7rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; font-size: .95rem; }
}

/* The article TOC emits lvl-1..lvl-3; only lvl-3 had a rule. */
.toc li.lvl-2 { padding-left: .45rem; }


/* The floating WhatsApp button hides while the database tray is up. */
body.tray-open .wa-float { opacity: 0; pointer-events: none; transition: opacity .15s ease; }


/* ==========================================================================
   Live diagram
   The mini-program never charted a generic curve: every calculator draws its
   own physical schematic on a 300rpx canvas (pages/calculator/calculator.wxss
   -> .chart-box). Those routines are ported verbatim by tools/gen_diagrams.py;
   this is the frame they are drawn in, sized to the same proportions.
   ========================================================================== */

.calc-diagram-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: .6rem .6rem .35rem;
  margin-bottom: 1.2rem;
}
.calc-diagram {
  /* The mini-program's canvas box (300rpx inside the page padding) is 335 x 130
   * on a 375pt phone; this reserves the same 2.58:1 aspect so the page does not
   * jump, and calculator.js confirms the height once the width is known. */
  width: 100%; max-width: 720px; aspect-ratio: 520 / 202; height: auto;
  margin-inline: auto; display: block; border-radius: var(--r-sm);
}
.calc-diagram-caption {
  max-width: 720px; margin: .4rem auto 0; padding-top: .45rem;
  border-top: 1px solid var(--line);
  font-size: .74rem; color: var(--ink-4); text-align: center;
}
/* ==========================================================================
   905 nm rangefinder teardown
   The interactive half of the 905 nm application page: a photograph of the
   real module, four draggable parts and a readout panel. Light surfaces only -
   the parts carry the site's reading of the two accents, blue for anything on
   the transmit path and orange for anything that receives, and the drive
   electronics stay ink-grey because they do neither.
   ========================================================================== */

.rf-how { margin-top: 1.3rem; max-width: 74ch; }
.rf-how > b {
  display: block; margin-bottom: .5rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4);
}
.rf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.rf-steps li { display: flex; gap: .6rem; align-items: baseline; font-size: .92rem; color: var(--ink-3); }
.rf-step-n {
  flex: 0 0 auto; width: 1.35rem; height: 1.35rem; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .7rem;
  color: var(--emit); background: rgba(2, 132, 199, .09);
  border: 1px solid rgba(2, 132, 199, .24);
}

/* -- the bill of materials ------------------------------------------------ */
.rf-bom {
  list-style: none; margin: 0 0 1.3rem; padding: 0;
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.rf-part {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: .25rem;
  width: 100%; padding: .85rem 1rem 1rem 1.15rem;
  font: inherit; text-align: left; cursor: grab;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.rf-part::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--line-strong);
}
.rf-part:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rf-part:active { cursor: grabbing; }
.rf-part-emit::before { background: var(--grad-emit); }
.rf-part-recv::before { background: var(--grad-hot); }
.rf-part-path::before { background: linear-gradient(180deg, #94a3b8 0%, #475569 100%); }
.rf-part-emit.is-active { border-color: rgba(3, 105, 161, .5); box-shadow: 0 0 0 3px rgba(2, 132, 199, .10); }
.rf-part-recv.is-active { border-color: rgba(234, 88, 12, .5); box-shadow: 0 0 0 3px rgba(234, 88, 12, .10); }
.rf-part-path.is-active { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(15, 23, 42, .07); }
.rf-part-code { font-family: var(--mono); font-size: .67rem; letter-spacing: .12em; color: var(--ink-4); }
.rf-part-name { font-weight: 600; color: var(--ink); }
.rf-part-sub { font-size: .81rem; color: var(--ink-3); line-height: 1.4; }

/* -- the stage and its readout -------------------------------------------- */
.rf-layout {
  display: grid; gap: 1.2rem; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
}
.rf-stage-wrap { min-width: 0; }
.rf-viewswitch { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .7rem; }
.rf-switch {
  font: inherit; font-size: .85rem; padding: .4rem .9rem;
  border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.rf-switch:hover { color: var(--ink); border-color: var(--line-strong); }
.rf-switch.is-active { color: #fff; background: var(--grad-emit); border-color: transparent; }
.rf-switch-gap { flex: 1 1 auto; }

.rf-stage {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rf-stage.is-dragover { border-color: var(--emit); box-shadow: 0 0 0 4px rgba(2, 132, 199, .12); }
.rf-photo { display: block; width: 100%; height: auto; }
.rf-leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rf-leaders path { fill: none; stroke: var(--line-strong); stroke-width: 1.6; stroke-dasharray: 6 5; }
.rf-leaders circle { fill: var(--recv); stroke: none; }
.rf-markers { position: absolute; inset: 0; }

.rf-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: .15rem; align-items: center;
  max-width: 74%; padding: .9rem 1.3rem; text-align: center;
  border: 1.5px dashed rgba(2, 132, 199, .36); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .88);
  color: var(--ink-3); font-size: .84rem;
}
.rf-hint b { color: var(--emit); font-size: .95rem; }
.rf-caption { margin: .5rem 0 0; max-width: 68ch; }

/* -- markers and the exploded view ---------------------------------------- */
/* The marker button *is* the dot, so it lands exactly on the coordinate. Its
   label hangs off above or below instead of beside it: the receive window and
   the detector behind it sit close enough together that two labels side by side
   would touch. */
.rf-marker {
  position: absolute; transform: translate(-50%, -50%);
  width: .8rem; height: .8rem; padding: 0;
  color: var(--emit); background: currentColor;
  border: 2px solid #fff; border-radius: 99px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .4);
  transition: transform .15s ease;
}
.rf-marker-recv { color: var(--recv); }
.rf-marker-path { color: #475569; }
.rf-marker:hover, .rf-marker:focus-visible { transform: translate(-50%, -50%) scale(1.3); }
.rf-marker.is-active { box-shadow: 0 0 0 3px rgba(255, 255, 255, .92), 0 1px 6px rgba(15, 23, 42, .5); }
.rf-marker::after {
  content: ""; position: absolute; inset: -.45rem;
  border-radius: 99px; border: 1.5px solid currentColor;
  animation: rf-pulse 2.2s ease-out infinite;
}
@keyframes rf-pulse {
  0%   { transform: scale(.7); opacity: .65; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rf-marker::after { animation: none; opacity: .4; }
}
.rf-marker-name {
  position: absolute; left: 50%; transform: translateX(-50%);
  padding: .16rem .5rem; white-space: nowrap;
  font-family: var(--font); font-size: .73rem; font-weight: 600; line-height: 1.35;
  color: var(--ink); background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line-strong); border-radius: 99px;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .12);
}
.rf-marker-up .rf-marker-name { bottom: calc(100% + .38rem); }
.rf-marker-down .rf-marker-name { top: calc(100% + .38rem); }
.rf-marker.is-active .rf-marker-name { color: #fff; background: var(--ink); border-color: var(--ink); }

.rf-exploded {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: .1rem;
  max-width: 42%; padding: .5rem .7rem;
  font: inherit; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
  border-left-width: 3px;
}
.rf-exploded-emit { border-left-color: var(--emit); }
.rf-exploded-recv { border-left-color: var(--recv); }
.rf-exploded-path { border-left-color: #64748b; }
.rf-exploded.is-active { border-color: var(--line-strong); box-shadow: 0 6px 20px rgba(15, 23, 42, .16); }
.rf-exploded-short { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); }
.rf-exploded-name { font-size: .84rem; font-weight: 600; color: var(--ink); }

/* -- the readout panel ---------------------------------------------------- */
.rf-detail { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; }
.rf-detail-empty { display: flex; flex-direction: column; gap: .35rem; color: var(--ink-3); }
.rf-detail-empty b { font-size: 1.02rem; color: var(--ink); }
.rf-detail-empty p { margin: 0; }
.rf-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: space-between; }
.rf-detail-actions { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }

.rf-code { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--ink-4); }
.rf-title { margin: .55rem 0 .2rem; font-size: 1.3rem; }
.rf-subtitle { margin: 0 0 .6rem; font-family: var(--mono); font-size: .74rem; color: var(--ink-4); }
.rf-desc { margin: 0 0 1rem; font-size: .92rem; color: var(--ink-2); }
.rf-block { margin-top: 1.1rem; }
.rf-block > h3 {
  margin: 0 0 .55rem; font-family: var(--mono); font-size: .71rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); font-weight: 500;
}
.rf-block > p { margin: 0; font-size: .91rem; color: var(--ink-2); }
.rf-note {
  margin-top: 1.1rem; padding: .85rem 1rem;
  border-left: 3px solid var(--recv); border-radius: 0 var(--r) var(--r) 0;
  background: rgba(234, 88, 12, .055);
}
.rf-note b { display: block; margin-bottom: .3rem; font-size: .89rem; color: var(--ink); }
.rf-note p { margin: 0; font-size: .89rem; color: var(--ink-2); }

.rf-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.rf-mini li { display: grid; gap: .15rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.rf-mini-model { font-family: var(--mono); font-size: .84rem; font-weight: 600; color: var(--emit-deep); }
.rf-mini-figs { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
.rf-mini-why { font-size: .81rem; color: var(--ink-3); line-height: 1.45; }

.rf-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem);
  z-index: 80; max-width: min(90vw, 30rem);
  padding: .6rem 1.1rem; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: .86rem;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.rf-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* -- the parts a parameter maps to --------------------------------------- */
.rf-group { margin-bottom: 2.2rem; }
.rf-group:last-child { margin-bottom: 0; }
.rf-group-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: end;
  justify-content: space-between; margin-bottom: 1rem;
}
.rf-group-head h3 { margin: 0; font-size: 1.1rem; }
.rf-group-head .lede { margin: .35rem 0 0; font-size: .95rem; }
.rf-pick-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }

.badge-path { color: var(--ink-2); border-color: var(--line-strong); background: rgba(15, 23, 42, .06); }

@media (max-width: 1000px) {
  .rf-layout { grid-template-columns: minmax(0, 1fr); }
  .rf-detail { position: static; max-height: none; }
}
@media (max-width: 560px) {
  .rf-exploded { max-width: 56%; font-size: .78rem; }
  .rf-marker-name { display: none; }
}
/* -- the teardown hub and the module relationship nav --------------------- */
/* Every module page carries the same two things: a pill row back to the hub
   and across to the sibling module, and the hub itself repeats each module as
   a card, so the section is navigable from either end. */
.rf-siblings { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.rf-sibling {
  padding: .42rem .9rem; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: .84rem; color: var(--ink-2); text-decoration: none;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.rf-sibling:hover { border-color: var(--emit); color: var(--emit-deep); text-decoration: none; }
.rf-sibling.is-current {
  border-color: rgba(3, 105, 161, .45); background: rgba(2, 132, 199, .09);
  color: var(--emit-deep); font-weight: 600;
}

.rf-hub-card { display: flex; flex-direction: column; gap: .6rem; }
.rf-hub-photo {
  display: block; overflow: hidden; margin-bottom: .2rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2);
}
.rf-hub-photo img { display: block; width: 100%; height: 190px; object-fit: cover; }
.rf-hub-title { margin: 0; font-size: 1.28rem; }
.rf-hub-title a { color: inherit; text-decoration: none; }
.rf-hub-title a:hover { color: var(--emit-deep); text-decoration: none; }
.rf-hub-parts { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 0; }
.rf-hub-card > p { margin: 0; }

@media (max-width: 560px) {
  .rf-hub-photo img { height: 150px; }
}
