/* =====================================================================
   tCK ATLAS 鈥?visual system
   A dark instrumentation panel: thin rules, calibrated labels, warm brass
   for measured time, cool cyan for signals.
   ===================================================================== */

:root {
  color-scheme: dark;
  --bg: #040a0f;
  --bg-deep: #020609;
  --surface: #08131a;
  --surface-2: #0b1922;
  --surface-3: #0f202a;
  --ink: #e8f1f2;
  --ink-soft: #c0d2d7;
  --muted: #8298a2;
  --faint: #4f6872;
  --ghost: #31464f;
  --line: rgba(139, 181, 193, 0.13);
  --line-strong: rgba(157, 204, 214, 0.25);
  --line-hot: rgba(241, 182, 99, 0.54);
  --cyan: #7bd7e8;
  --cyan-dim: rgba(123, 215, 232, 0.12);
  --amber: #f1b663;
  --amber-dim: rgba(241, 182, 99, 0.1);
  --orange: #ff9360;
  --violet: #a9a8ff;
  --pink: #ff9ab2;
  --mint: #8cddbf;
  --blue: #87abff;
  --danger: #ff8f86;
  --font-display: "Bahnschrift", "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Aptos", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --shadow-panel: 0 26px 70px -46px rgba(0, 0, 0, 0.95);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 14% -10%, rgba(36, 79, 92, 0.22), transparent 64%),
    radial-gradient(900px 620px at 96% 24%, rgba(113, 72, 28, 0.1), transparent 64%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(122, 169, 183, 0.033) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 169, 183, 0.033) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 88% 78% at 50% 20%, black 10%, transparent 78%);
}

body.has-drawer {
  overflow: hidden;
}

::selection {
  background: rgba(241, 182, 99, 0.28);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6, p, dl, dd, blockquote {
  margin: 0;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* Static shell icons are authored as bare <svg><use> nodes; size them here so
   they never fall back to the SVG default 300 x 150 box. */
.view-tab > svg,
.icon-button > svg,
.search-box > svg,
.sidebar-note__icon > svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.view-tab > svg {
  width: 14px;
  height: 14px;
}

.icon-button > svg {
  width: 17px;
  height: 17px;
}

.search-box > svg {
  width: 14px;
  height: 14px;
}

.sidebar-note__icon > svg {
  width: 13px;
  height: 13px;
}

.site-glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.42;
}

.site-glow--cyan {
  width: 420px;
  height: 420px;
  top: 6%;
  left: 21%;
  background: rgba(53, 130, 150, 0.14);
}

.site-glow--amber {
  width: 380px;
  height: 380px;
  right: 4%;
  bottom: 12%;
  background: rgba(160, 105, 40, 0.09);
}

.site-noise {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
  padding: 0 26px 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 10, 15, 0.9);
  backdrop-filter: blur(22px) saturate(125%);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(123, 215, 232, 0.23) 18%, transparent 48%, rgba(241, 182, 99, 0.15) 82%, transparent);
  pointer-events: none;
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar__right {
  justify-content: flex-end;
  gap: 16px;
}

.menu-button {
  display: none !important;
  margin-right: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, rgba(17, 38, 48, 0.95), rgba(5, 12, 17, 0.9));
  position: relative;
}

.brand__mark::before,
.brand__mark::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-color: var(--amber);
  opacity: 0.8;
}

.brand__mark::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.brand__mark::after {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.brand__mark svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__mark svg path:nth-child(2) {
  stroke-width: 1.9;
}

.brand__copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__copy strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.brand__copy > span {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.brand__copy i {
  color: var(--amber);
  font-style: normal;
  opacity: 0.72;
}

.view-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 23, 0.8);
  border-radius: 3px;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.view-tab .icon {
  width: 14px;
  height: 14px;
}

.view-tab:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.025);
}

.view-tab.is-active {
  color: var(--ink);
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(24, 46, 56, 0.58), rgba(8, 19, 25, 0.6));
  box-shadow: inset 0 -1px 0 rgba(241, 182, 99, 0.74);
}

.view-tab.is-active .icon {
  color: var(--amber);
}

.reference-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.reference-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 9px rgba(140, 221, 191, 0.7);
  animation: status-pulse 3s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.scope-badge {
  height: 27px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  background: rgba(10, 22, 29, 0.7);
  white-space: nowrap;
}

.scope-badge b {
  color: var(--amber);
  font-weight: 400;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.icon-button .icon {
  width: 17px;
  height: 17px;
}

/* ---------------------------------------------------------------------
   Workspace + sidebar
   ------------------------------------------------------------------ */
.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 72px);
  padding: 22px 17px 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 13, 18, 0.74);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 150px;
  background: linear-gradient(180deg, var(--amber), transparent);
  opacity: 0.2;
}

.sidebar__mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 16px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.sidebar-scrim {
  display: none;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: rgba(8, 19, 25, 0.84);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search-box:focus-within {
  border-color: rgba(123, 215, 232, 0.4);
  background: rgba(10, 24, 31, 0.95);
  box-shadow: 0 0 0 1px rgba(123, 215, 232, 0.08);
}

.search-box > .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.search-box input::placeholder {
  color: var(--faint);
  letter-spacing: 0;
}

.search-box kbd {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.index-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 23px 2px 9px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.index-meta span:last-child {
  color: var(--ghost);
}

.param-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-right: -7px;
  padding-right: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(121, 160, 172, 0.22) transparent;
}

.param-nav::-webkit-scrollbar,
.wave-scroll::-webkit-scrollbar {
  height: 8px;
  width: 5px;
}

.param-nav::-webkit-scrollbar-thumb,
.wave-scroll::-webkit-scrollbar-thumb {
  background: rgba(129, 167, 178, 0.2);
  border-radius: 10px;
}

.param-nav::-webkit-scrollbar-track,
.wave-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.nav-group {
  margin-bottom: 17px;
}

.nav-group__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 2px 6px;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.nav-group__head > span {
  color: var(--amber);
  opacity: 0.68;
}

.nav-group__head strong {
  font-weight: 500;
  letter-spacing: 0.06em;
}

.nav-group__head em {
  margin-left: auto;
  color: var(--ghost);
  font-style: normal;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 67px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 37px;
  padding: 6px 2px 6px 8px;
  border-left: 1px solid transparent;
  color: var(--muted);
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-item::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 8px;
  height: 1px;
  background: rgba(139, 181, 193, 0.055);
}

.nav-item:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.022);
  border-left-color: rgba(123, 215, 232, 0.34);
}

.nav-item.is-active {
  color: var(--ink);
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(241, 182, 99, 0.09), rgba(241, 182, 99, 0.01));
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--amber);
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-item__sym {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item__sym sub {
  font-size: 0.68em;
}

.nav-item.is-active .nav-item__sym {
  color: var(--amber);
}

.nav-item__name {
  overflow: hidden;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item__index {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 8px;
}

.nav-item.is-active .nav-item__index {
  color: var(--amber);
  opacity: 0.75;
}

.search-empty {
  padding: 28px 10px;
  text-align: center;
  color: var(--muted);
}

.search-empty__code {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.search-empty p {
  margin: 8px 0 15px;
  font-size: 12px;
}

.search-empty button {
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
}

.sidebar-note {
  flex: 0 0 auto;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.sidebar-note__icon {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.sidebar-note__icon .icon {
  width: 13px;
  height: 13px;
}

.sidebar-note p {
  margin-top: 9px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.8;
}

.sidebar-note > span {
  display: block;
  margin-top: 9px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.main {
  min-width: 0;
  padding: 0 34px 84px;
}

.view[hidden] {
  display: none !important;
}

.view.is-active > .view-page {
  animation: page-rise 0.55s var(--ease) both;
}

@keyframes page-rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-page {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.noscript {
  padding: 30px;
  color: var(--danger);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------------
   Shared typography, buttons and panels
   ------------------------------------------------------------------ */
.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow__signal {
  width: 6px;
  height: 6px;
  border: 1px solid var(--amber);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(241, 182, 99, 0.3);
}

.eyebrow__sep {
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 41px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.055em;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.button .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s var(--ease);
}

.button:hover .icon:last-child {
  transform: translateX(2px);
}

.button--primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #10150f;
  font-weight: 600;
  box-shadow: 0 5px 28px -16px rgba(241, 182, 99, 0.9);
}

.button--primary:hover {
  background: #ffd08b;
  border-color: #ffd08b;
}

.button--ghost {
  border-color: var(--line-strong);
  background: rgba(10, 22, 29, 0.6);
  color: var(--ink-soft);
}

.button--ghost:hover {
  border-color: rgba(157, 204, 214, 0.45);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.button sub {
  font-size: 0.7em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  transition: color 0.2s var(--ease);
}

.text-button:hover {
  color: var(--amber);
}

.text-button .icon {
  width: 13px;
  height: 13px;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(150deg, rgba(14, 29, 38, 0.9), rgba(6, 14, 19, 0.94));
  box-shadow: var(--shadow-panel);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-head--compact {
  margin-bottom: 15px;
}

.section-index {
  display: block;
  margin-bottom: 7px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.panel-head h3,
.section-heading h3,
.section-heading h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.panel-head__note {
  flex: 0 0 auto;
  padding-top: 19px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading > p {
  max-width: 470px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.section-heading__rule {
  flex: 1;
  height: 1px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------------------------------------------------------------------
   Parameter hero
   ------------------------------------------------------------------ */
.param-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: clamp(28px, 4.5vw, 68px);
  padding: 34px 0 42px;
  border-bottom: 1px solid var(--line);
}

.param-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -90px;
  left: 18%;
  right: 0;
  width: auto;
  max-width: 440px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 137, 156, 0.075), transparent 68%);
  pointer-events: none;
}

.param-hero__body {
  min-width: 0;
}

.param-title-line {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 20px;
}

.param-giant {
  max-width: 100%;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(64px, 8.2vw, 114px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.88;
  white-space: nowrap;
  text-shadow: 0 6px 35px rgba(0, 0, 0, 0.55);
}

.param-giant sub {
  position: relative;
  top: -0.04em;
  margin-left: 0.015em;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.345em;
  font-weight: 500;
  letter-spacing: -0.025em;
  vertical-align: baseline;
}

.param-giant--long {
  font-size: clamp(44px, 5.8vw, 82px);
  letter-spacing: -0.07em;
}

.param-index {
  flex: 0 0 auto;
  margin-top: 9px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.param-subline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 19px;
}

.param-subline h2 {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.param-subline > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.param-intro {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.95;
}

.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(123, 215, 232, 0.19);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.075em;
  background: rgba(123, 215, 232, 0.035);
}

.tag-alias {
  margin-left: 3px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.035em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.entry-pager {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid rgba(139, 181, 193, 0.08);
}

.entry-pager__link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 108px;
  padding: 4px 8px 4px 0;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.entry-pager__link:hover {
  color: var(--ink);
}

.entry-pager__link > span {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.entry-pager__link strong {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
}

.entry-pager__link--next {
  margin-left: auto;
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.entry-pager__link.is-disabled {
  opacity: 0.32;
  pointer-events: none;
}

/* specimen plate */
.spec-plate {
  position: relative;
  align-self: stretch;
  min-height: 338px;
  padding: 17px 18px 14px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(160deg, rgba(18, 36, 46, 0.76), rgba(6, 15, 20, 0.93) 58%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(139, 181, 193, 0.04) 31px 32px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 30px 80px -54px #000;
  overflow: hidden;
}

.spec-plate::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 17px;
  height: 17px;
  border-top: 1px solid var(--amber);
  border-right: 1px solid var(--amber);
  opacity: 0.45;
}

.spec-plate::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 17px;
  height: 17px;
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.spec-plate__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
}

.spec-plate__head b {
  color: var(--amber);
  font-weight: 400;
}

.spec-plate__category {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.spec-plate__category span {
  margin-top: 3px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.spec-plate__glyph {
  margin-top: 24px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}

.spec-plate__glyph sub {
  position: relative;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.35em;
  vertical-align: baseline;
  letter-spacing: -0.03em;
}

.spec-plate__facts {
  margin-top: 23px;
  border-top: 1px solid var(--line);
}

.spec-plate__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
}

.spec-plate__facts dt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.spec-plate__facts dd {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: right;
}

.spec-plate__barcode {
  height: 30px;
  margin-top: 18px;
  opacity: 0.25;
  background: repeating-linear-gradient(90deg, var(--ink-soft) 0 1px, transparent 1px 4px, var(--ink-soft) 4px 5px, transparent 5px 8px, var(--ink-soft) 8px 11px, transparent 11px 13px);
  mask-image: linear-gradient(90deg, black 0 72%, transparent);
}

.spec-plate__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

/* ---------------------------------------------------------------------
   Atlas layout
   ------------------------------------------------------------------ */
.atlas-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
  padding-top: 31px;
}

.atlas-main {
  display: flex;
  flex-direction: column;
  gap: 21px;
  min-width: 0;
}

.atlas-rail {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}

/* waveform panel */
.waveform-panel {
  padding: 0;
  overflow: hidden;
}

.wave-head {
  align-items: flex-start;
  margin: 0;
  padding: 21px 22px 18px;
  border-bottom: 1px solid rgba(139, 181, 193, 0.09);
}

.wave-head h3 {
  font-size: 23px;
}

.wave-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 2px;
}

.schematic-chip {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 7px;
  border: 1px solid rgba(255, 147, 96, 0.25);
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.scan-readout {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.scan-readout b {
  color: var(--cyan);
  font-weight: 400;
}

.wave-play {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.wave-play:hover {
  color: var(--ink);
  border-color: rgba(241, 182, 99, 0.45);
}

.wave-play .icon {
  width: 12px;
  height: 12px;
}

.wave-play__icons {
  position: relative;
  width: 12px;
  height: 12px;
}

.wave-play__icons .icon {
  position: absolute;
  inset: 0;
}

.wave-play__icons .icon:last-child {
  display: none;
}

.waveform-panel.is-playing .wave-play {
  border-color: rgba(241, 182, 99, 0.4);
  color: var(--amber);
  background: rgba(241, 182, 99, 0.05);
}

.waveform-panel.is-playing .wave-play__icons .icon:first-child {
  display: none;
}

.waveform-panel.is-playing .wave-play__icons .icon:last-child {
  display: block;
}

.variant-bar {
  display: flex;
  align-items: stretch;
  gap: 15px;
  padding: 11px 22px;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
  background: rgba(4, 11, 15, 0.35);
}

.variant-bar__label {
  display: flex;
  align-items: center;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.variant-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: left;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.variant-tab > span {
  color: var(--ghost);
  font-size: 6.5px;
}

.variant-tab:hover {
  color: var(--ink-soft);
  border-color: var(--line-strong);
}

.variant-tab.is-active {
  border-color: rgba(241, 182, 99, 0.38);
  background: rgba(241, 182, 99, 0.055);
  color: var(--amber);
}

.variant-tab.is-active > span {
  color: var(--amber);
  opacity: 0.6;
}

.wave-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 11px 22px 5px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(20, 53, 64, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(5, 13, 18, 0.7), rgba(4, 10, 15, 0.32));
  scrollbar-color: rgba(121, 160, 172, 0.22) transparent;
}

.trace-svg {
  display: block;
  width: var(--trace-w);
  min-width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-mono);
}

.trace-svg text {
  font-family: var(--font-mono);
}

.cycle-label {
  fill: var(--ghost);
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.cycle-label.is-first {
  fill: var(--faint);
}

.cycle-grid {
  stroke: rgba(139, 181, 193, 0.052);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.time-axis line {
  stroke: rgba(139, 181, 193, 0.23);
  stroke-width: 1;
}

.time-axis path {
  fill: none;
  stroke: rgba(139, 181, 193, 0.32);
  stroke-width: 1;
}

.time-axis text {
  fill: var(--ghost);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.lane-label {
  fill: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.055em;
}

.lane-label--small {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.045em;
}

.lane-label--measure {
  fill: var(--amber);
  font-size: 7.5px;
  letter-spacing: 0.1em;
}

.lane-sub {
  fill: var(--ghost);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.clock-wave {
  fill: none;
  stroke: rgba(199, 241, 246, 0.86);
  stroke-width: 1.5;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 4px rgba(123, 215, 232, 0.2));
}

.clock-edge {
  fill: var(--amber);
  opacity: 0.55;
}

.command-lane {
  stroke: none;
  pointer-events: none;
}

.command-lane-base {
  fill: transparent;
  stroke: rgba(139, 181, 193, 0.17);
  stroke-width: 1;
}

.command-divider {
  stroke: rgba(139, 181, 193, 0.075);
  stroke-width: 1;
}

.command-tag {
  fill: rgba(255, 255, 255, 0.025);
  stroke: rgba(139, 181, 193, 0.3);
  stroke-width: 1;
}

.command-label {
  fill: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.command-sub {
  fill: var(--faint);
  font-size: 6.5px;
  letter-spacing: 0.03em;
}

.command-nop {
  fill: rgba(130, 152, 162, 0.34);
  font-size: 7.2px;
  letter-spacing: 0.08em;
}

.command-mark circle {
  fill: #071117;
  stroke: var(--amber);
  stroke-width: 1;
}

.command-mark text {
  fill: var(--amber);
  font-size: 7.5px;
}

.command--act .command-tag {
  fill: rgba(123, 215, 232, 0.055);
  stroke: rgba(123, 215, 232, 0.38);
}

.command--act .command-label {
  fill: var(--cyan);
}

.command--read .command-tag {
  fill: rgba(135, 171, 255, 0.065);
  stroke: rgba(135, 171, 255, 0.42);
}

.command--read .command-label {
  fill: var(--blue);
}

.command--write .command-tag {
  fill: rgba(255, 154, 178, 0.06);
  stroke: rgba(255, 154, 178, 0.36);
}

.command--write .command-label {
  fill: var(--pink);
}

.command--pre .command-tag {
  fill: rgba(241, 182, 99, 0.055);
  stroke: rgba(241, 182, 99, 0.4);
}

.command--pre .command-label {
  fill: var(--amber);
}

.command--ref .command-tag {
  fill: rgba(140, 221, 191, 0.06);
  stroke: rgba(140, 221, 191, 0.38);
}

.command--ref .command-label {
  fill: var(--mint);
}

.aux-lane {
  fill: rgba(255, 255, 255, 0.012);
  stroke: rgba(139, 181, 193, 0.1);
  stroke-width: 1;
}

.aux-segment rect {
  stroke-width: 1;
}

.aux-segment text {
  font-size: 7.5px;
  letter-spacing: 0.035em;
}

.aux-segment--active rect {
  fill: rgba(123, 215, 232, 0.055);
  stroke: rgba(123, 215, 232, 0.24);
}

.aux-segment--active text {
  fill: rgba(151, 223, 235, 0.78);
}

.aux-segment--read rect {
  fill: rgba(135, 171, 255, 0.06);
  stroke: rgba(135, 171, 255, 0.22);
}

.aux-segment--read text {
  fill: rgba(166, 190, 255, 0.82);
}

.aux-segment--pre rect {
  fill: rgba(241, 182, 99, 0.055);
  stroke: rgba(241, 182, 99, 0.22);
}

.aux-segment--pre text {
  fill: rgba(243, 203, 144, 0.82);
}

.aux-segment--write rect {
  fill: rgba(255, 154, 178, 0.05);
  stroke: rgba(255, 154, 178, 0.2);
}

.aux-segment--write text {
  fill: rgba(255, 177, 195, 0.82);
}

.aux-segment--refresh rect {
  fill: rgba(140, 221, 191, 0.05);
  stroke: rgba(140, 221, 191, 0.22);
}

.aux-segment--refresh text {
  fill: rgba(160, 233, 209, 0.82);
}

.data-lane {
  fill: rgba(255, 255, 255, 0.012);
  stroke: rgba(139, 181, 193, 0.15);
  stroke-width: 1;
}

.data-direction {
  fill: var(--faint);
  font-size: 6.5px;
  letter-spacing: 0.075em;
}

.data-cell rect {
  stroke-width: 1;
}

.data-cell text {
  font-size: 7.4px;
  letter-spacing: 0.01em;
}

.data-cell--read rect {
  fill: rgba(135, 171, 255, 0.09);
  stroke: rgba(135, 171, 255, 0.24);
}

.data-cell--read text {
  fill: rgba(183, 203, 255, 0.9);
}

.data-cell--write rect {
  fill: rgba(255, 154, 178, 0.075);
  stroke: rgba(255, 154, 178, 0.21);
}

.data-cell--write text {
  fill: rgba(255, 190, 205, 0.9);
}

.measure-divider {
  stroke: rgba(139, 181, 193, 0.09);
  stroke-width: 1;
}

.measure {
  --span-color: var(--amber);
  cursor: pointer;
  outline: none;
}

.measure--cyan { --span-color: var(--cyan); }
.measure--amber { --span-color: var(--amber); }
.measure--orange { --span-color: var(--orange); }
.measure--violet { --span-color: var(--violet); }
.measure--muted { --span-color: #7a919a; }

.span-hit {
  fill: transparent;
  transition: fill 0.2s var(--ease);
}

.span-stem,
.span-cap {
  stroke: var(--span-color);
  stroke-width: 1;
  opacity: 0.58;
  transition: opacity 0.2s var(--ease);
}

.span-cap {
  stroke-width: 1.2;
}

.span-pill {
  fill: #09151c;
  stroke: var(--span-color);
  stroke-width: 1;
  opacity: 0.95;
  transition: fill 0.2s var(--ease), stroke-width 0.2s var(--ease);
}

.span-text {
  fill: var(--span-color);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.span-link {
  fill: var(--span-color);
  font-size: 7px;
  opacity: 0.55;
}

.measure:hover .span-hit,
.measure.is-hovered .span-hit {
  fill: color-mix(in srgb, var(--span-color) 4%, transparent);
}

.measure:hover .span-stem,
.measure:hover .span-cap,
.measure.is-hovered .span-stem,
.measure.is-hovered .span-cap {
  opacity: 1;
}

.measure:hover .span-pill,
.measure.is-hovered .span-pill,
.measure:focus .span-pill {
  fill: color-mix(in srgb, var(--span-color) 8%, #09151c);
  stroke-width: 1.5;
}

.measure:focus .span-hit {
  fill: color-mix(in srgb, var(--span-color) 6%, transparent);
}

.measure.is-current .span-stem,
.measure.is-current .span-cap {
  opacity: 0.9;
}

.measure.is-current .span-pill {
  stroke-dasharray: 0;
}

.playhead {
  opacity: 0.4;
  pointer-events: none;
}

.playhead line {
  stroke: var(--amber);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.playhead circle {
  fill: var(--amber);
  filter: drop-shadow(0 0 5px rgba(241, 182, 99, 0.8));
}

.waveform-panel.is-playing .playhead {
  opacity: 1;
}

.waveform-panel.is-flashing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  animation: panel-flash 0.55s var(--ease);
}

@keyframes panel-flash {
  0% { background: rgba(241, 182, 99, 0.1); }
  100% { background: transparent; }
}

.wave-inspect {
  display: grid;
  grid-template-columns: 84px minmax(110px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-height: 48px;
  padding: 11px 22px;
  border-top: 1px solid rgba(139, 181, 193, 0.09);
  background: rgba(4, 11, 15, 0.56);
}

.wave-inspect__key {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.wave-inspect__key--cyan { color: var(--cyan); }
.wave-inspect__key--orange { color: var(--orange); }
.wave-inspect__key--violet { color: var(--violet); }
.wave-inspect__key--muted { color: var(--muted); }

.wave-inspect__main {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.6;
}

.wave-inspect__desc {
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.65;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wave-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 7px;
  padding: 13px 22px 15px;
}

.wave-note {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 24px 8px 11px;
  border: 1px solid rgba(139, 181, 193, 0.1);
  border-left: 1.5px solid var(--note-color, var(--amber));
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.wave-note--amber { --note-color: var(--amber); }
.wave-note--cyan { --note-color: var(--cyan); }
.wave-note--orange { --note-color: var(--orange); }
.wave-note--violet { --note-color: var(--violet); }
.wave-note--muted { --note-color: #718992; }

.wave-note:hover,
.wave-note.is-hovered {
  border-color: rgba(139, 181, 193, 0.22);
  border-left-color: var(--note-color);
  background: rgba(255, 255, 255, 0.035);
}

.wave-note__top {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--note-color);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.wave-note__top i {
  width: 4px;
  height: 4px;
  background: var(--note-color);
  transform: rotate(45deg);
}

.wave-note__top b {
  font-weight: 500;
}

.wave-note__caption {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wave-note__arrow {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--note-color);
  font-size: 9px;
  opacity: 0.5;
}

.wave-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 22px;
  border-top: 1px solid rgba(139, 181, 193, 0.09);
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.025em;
}

.wave-foot > span {
  display: flex;
  align-items: center;
  min-width: 0;
}

.wave-foot > span:last-child {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wave-foot .wave-scroll-hint {
  display: none;
  color: var(--amber);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.waveform-panel.is-scrollable .wave-foot .wave-scroll-hint {
  display: inline-flex;
}

.waveform-panel.is-scroll-end .wave-foot .wave-scroll-hint {
  display: none;
}

.legend-measure {
  width: 12px;
  height: 5px;
  margin-right: 6px;
  border-right: 1px solid var(--amber);
  border-left: 1px solid var(--amber);
  border-top: 1px solid var(--amber);
  opacity: 0.65;
}

/* steps */
.steps-panel {
  padding: 23px;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.step {
  position: relative;
  min-width: 0;
  padding: 19px 22px 19px 0;
  border-right: 1px solid rgba(139, 181, 193, 0.08);
}

.step + .step {
  padding-left: 22px;
}

.step:last-child {
  padding-right: 0;
  border-right: 0;
}

.step__tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.step__tag::after {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(241, 182, 99, 0.26);
}

.step__body h4 {
  margin-top: 14px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.step__body p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.9;
}

.flow-block {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.flow-block__label {
  flex: 0 0 auto;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.flow-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.flow-node {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 33px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  line-height: 1.15;
}

.flow-node b {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
}

.flow-node small {
  margin-top: 3px;
  color: var(--ghost);
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.flow-node.is-key {
  border-color: rgba(241, 182, 99, 0.3);
  background: rgba(241, 182, 99, 0.04);
}

.flow-node.is-key b {
  color: var(--amber);
}

.flow-arrow {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 9px;
}

/* context */
.context-panel {
  position: relative;
  background:
    linear-gradient(145deg, rgba(13, 30, 39, 0.84), rgba(6, 14, 19, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 41px, rgba(139, 181, 193, 0.035) 41px 42px);
}

.context-copy {
  position: relative;
  max-width: 88%;
  margin-left: 16px;
  padding-left: 18px;
  border-left: 1px solid rgba(241, 182, 99, 0.36);
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.context-mark {
  position: absolute;
  right: 4px;
  bottom: -34px;
  color: rgba(241, 182, 99, 0.1);
  font-family: Georgia, serif;
  font-size: 116px;
  line-height: 1;
  pointer-events: none;
}

/* rail */
.facts-panel,
.equation-panel {
  padding: 19px;
}

.fact-list {
  border-top: 1px solid var(--line);
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
}

.fact-row dt {
  flex: 0 0 62px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.fact-row dd {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-align: right;
}

.equation {
  padding: 13px 12px;
  border: 1px solid rgba(241, 182, 99, 0.17);
  background:
    linear-gradient(90deg, rgba(241, 182, 99, 0.045), transparent),
    rgba(3, 10, 14, 0.6);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: -0.01em;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.equation-panel > p {
  margin-top: 13px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.85;
}

.callout {
  position: relative;
  padding: 19px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--callout-color, var(--amber));
  background: rgba(9, 20, 27, 0.72);
}

.callout--warning {
  --callout-color: var(--orange);
}

.callout--memory {
  --callout-color: var(--violet);
  padding-bottom: 16px;
  background:
    linear-gradient(150deg, rgba(31, 30, 55, 0.24), rgba(8, 16, 23, 0.84));
}

.callout__label {
  display: block;
  color: var(--callout-color);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.11em;
}

.callout h3 {
  margin-top: 10px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

.callout p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.callout blockquote {
  margin-top: 15px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0.015em;
}

.callout blockquote::before {
  content: "鈥?;
  margin-right: 1px;
  color: var(--violet);
  opacity: 0.6;
}

.callout blockquote::after {
  content: "鈥?;
  margin-left: 1px;
  color: var(--violet);
  opacity: 0.6;
}

.callout__foot {
  display: block;
  margin-top: 13px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.rail-note {
  padding: 4px 4px 0;
  color: var(--ghost);
}

.rail-note > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.rail-note p {
  margin-top: 6px;
  font-size: 9.5px;
  line-height: 1.8;
}

/* related */
.related-panel {
  padding-top: 5px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 121px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(12, 26, 34, 0.75), rgba(6, 14, 19, 0.7));
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.related-card:hover {
  border-color: rgba(241, 182, 99, 0.34);
  background: linear-gradient(150deg, rgba(24, 37, 36, 0.8), rgba(8, 16, 20, 0.8));
  transform: translateY(-2px);
}

.related-card__meta {
  overflow: hidden;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-card strong {
  margin-top: 15px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.related-card strong sub {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.36em;
  vertical-align: baseline;
}

.related-card__name {
  margin-top: 7px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.5;
}

.related-card__arrow {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: var(--ghost);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.related-card__arrow .icon {
  width: 13px;
  height: 13px;
}

.related-card:hover .related-card__arrow {
  color: var(--amber);
  transform: translateX(2px);
}

/* ---------------------------------------------------------------------
   Sequence page
   ------------------------------------------------------------------ */
.sequence-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(30px, 5vw, 74px);
  align-items: end;
  padding: 42px 0 34px;
}

.sequence-hero h1 {
  margin-top: 22px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(45px, 5.2vw, 78px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.07;
}

.sequence-hero h1 span {
  color: var(--amber);
  font-weight: 300;
}

.sequence-hero__copy > p {
  max-width: 760px;
  margin-top: 21px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

.sequence-index {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(160deg, rgba(16, 33, 43, 0.82), rgba(6, 15, 20, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(139, 181, 193, 0.04) 30px 31px);
}

.sequence-index__eyebrow {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.sequence-index__rows {
  margin-top: 13px;
  border-top: 1px solid var(--line);
}

.sequence-index__rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
}

.sequence-index__rows span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.sequence-index__rows b {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 300;
}

.sequence-index p {
  margin-top: 13px;
  color: var(--ghost);
  font-size: 9.5px;
  line-height: 1.75;
}

.sequence-index__rail {
  display: flex;
  gap: 4px;
  margin-top: 18px;
}

.sequence-index__rail i {
  display: block;
  height: 4px;
  background: rgba(139, 181, 193, 0.15);
}

.sequence-index__rail i:nth-child(1) { width: 26%; background: var(--cyan); opacity: 0.55; }
.sequence-index__rail i:nth-child(2) { width: 20%; background: var(--blue); opacity: 0.45; }
.sequence-index__rail i:nth-child(3) { width: 16%; background: var(--violet); opacity: 0.4; }
.sequence-index__rail i:nth-child(4) { width: 20%; background: var(--amber); opacity: 0.4; }
.sequence-index__rail i:nth-child(5) { width: 10%; background: var(--muted); opacity: 0.25; }
.sequence-index__rail i:nth-child(6) { flex: 1; }

.phase-section {
  margin-top: 34px;
}

.phase-section .section-heading {
  align-items: end;
}

.phase-section .section-heading h2 {
  font-size: 26px;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.phase-card {
  position: relative;
  display: block;
  min-height: 214px;
  padding: 23px 21px 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 29, 38, 0.45), transparent);
  transition: background 0.2s var(--ease);
}

.phase-card:last-child {
  border-right: 0;
}

.phase-card:hover {
  background: linear-gradient(180deg, rgba(241, 182, 99, 0.055), transparent);
}

.phase-card__code {
  display: block;
  color: rgba(241, 182, 99, 0.52);
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 300;
  line-height: 1;
}

.phase-card__time {
  position: absolute;
  top: 24px;
  right: 20px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.phase-card h3 {
  margin-top: 25px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
}

.phase-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.85;
}

.phase-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 17px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  transition: color 0.2s var(--ease);
}

.phase-card__link .icon {
  width: 12px;
  height: 12px;
}

.phase-card:hover .phase-card__link {
  color: var(--amber);
}

.formula-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  margin-top: 31px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 22, 0.48);
}

.formula-item {
  padding: 21px 22px;
  border-right: 1px solid var(--line);
}

.formula-item:last-child {
  border-right: 0;
}

.formula-item > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.formula-item code {
  display: block;
  margin-top: 13px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.formula-item code sub {
  font-size: 0.72em;
}

.formula-item p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.page-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 33px;
  padding: 25px 0 0;
  border-top: 1px solid var(--line);
}

.page-cta h2 {
  margin-top: 7px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}

/* ---------------------------------------------------------------------
   Calculator page
   ------------------------------------------------------------------ */
.calc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 335px;
  gap: clamp(30px, 5vw, 76px);
  align-items: end;
  padding: 42px 0 34px;
}

.calc-hero h1 {
  margin-top: 22px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 82px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.calc-hero h1 span {
  color: var(--amber);
  font-weight: 300;
}

.calc-hero__copy > p {
  max-width: 700px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

.calc-hero__copy sub {
  font-size: 0.72em;
}

.calc-hero__display {
  position: relative;
  padding: 19px 20px 17px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 78% 10%, rgba(241, 182, 99, 0.1), transparent 52%),
    linear-gradient(160deg, rgba(18, 34, 42, 0.9), rgba(5, 13, 18, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.calc-hero__display > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.calc-hero__number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.calc-hero__number strong {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: clamp(42px, 4vw, 55px);
  font-weight: 300;
  letter-spacing: -0.065em;
  line-height: 1;
}

.calc-hero__number em {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
}

.calc-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.calc-hero__meta b {
  color: var(--ink-soft);
  font-weight: 400;
}

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 22px;
  align-items: start;
}

.calc-controls,
.calc-readout {
  padding: 23px;
}

.preset-block {
  padding: 13px;
  border: 1px solid rgba(139, 181, 193, 0.1);
  background: rgba(4, 11, 15, 0.42);
}

.preset-block__head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
}

.preset-block__head > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.11em;
}

.preset-block__head small {
  color: var(--ghost);
  font-size: 8.5px;
  text-align: right;
}

.preset-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.preset-group__name {
  flex: 0 0 28px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.calc-preset {
  height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(139, 181, 193, 0.13);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.calc-preset:hover {
  color: var(--ink-soft);
  border-color: var(--line-strong);
}

.calc-preset.is-active {
  border-color: rgba(241, 182, 99, 0.4);
  background: rgba(241, 182, 99, 0.075);
  color: var(--amber);
}

.calc-fields {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.calc-fields--three {
  grid-template-columns: 1.22fr 1fr 1fr;
}

.calc-fields--four {
  grid-template-columns: 1.1fr 0.95fr 0.95fr 0.95fr;
}

.calc-fields--two {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.calc-field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.calc-field__top b {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-field__top > span {
  overflow: hidden;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-field__control {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid rgba(139, 181, 193, 0.17);
  background: rgba(3, 9, 13, 0.55);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.calc-field__control:focus-within {
  border-color: rgba(123, 215, 232, 0.4);
  box-shadow: 0 0 0 1px rgba(123, 215, 232, 0.06);
}

.calc-field__control input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: -0.02em;
  -moz-appearance: textfield;
}

.calc-field__control input::-webkit-outer-spin-button,
.calc-field__control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.calc-field__unit {
  flex: 0 0 auto;
  padding-right: 10px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  white-space: nowrap;
}

.burst-toggle {
  display: flex;
  height: 42px;
  border: 1px solid rgba(139, 181, 193, 0.17);
  background: rgba(3, 9, 13, 0.55);
}

.burst-option {
  flex: 1;
  min-width: 0;
  padding: 0 7px;
  border: 0;
  border-right: 1px solid rgba(139, 181, 193, 0.12);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.burst-option:last-child {
  border-right: 0;
}

.burst-option.is-active {
  background: rgba(123, 215, 232, 0.09);
  color: var(--cyan);
}

.calc-advanced {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.calc-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  list-style: none;
  cursor: pointer;
}

.calc-advanced summary::-webkit-details-marker {
  display: none;
}

.calc-advanced summary > span:last-child {
  color: var(--ghost);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.calc-hint {
  margin-top: 10px;
  color: var(--ghost);
  font-size: 9px;
  line-height: 1.7;
}

.calc-controls__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 19px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.calc-controls__foot p {
  color: var(--ghost);
  font-size: 9px;
  line-height: 1.7;
}

.calc-controls__foot p span {
  color: var(--amber);
}

.readout-lead {
  padding: 3px 0 18px;
  border-bottom: 1px solid var(--line);
}

.readout-lead > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.readout-lead__number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 9px;
}

.readout-lead__number strong {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 49px;
  font-weight: 300;
  letter-spacing: -0.07em;
  line-height: 1;
}

.readout-lead__number em {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
}

.readout-lead p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.readout-lead p b {
  color: var(--ink-soft);
  font-weight: 400;
}

.calc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.calc-metric {
  position: relative;
  padding: 13px 0 12px;
  border-bottom: 1px solid rgba(139, 181, 193, 0.08);
}

.calc-metric:nth-child(odd) {
  padding-right: 12px;
  border-right: 1px solid rgba(139, 181, 193, 0.08);
}

.calc-metric:nth-child(even) {
  padding-left: 15px;
}

.calc-metric > span {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.calc-metric > span b {
  color: var(--ghost);
  font-weight: 400;
}

.calc-metric strong {
  display: inline-block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.calc-metric > em {
  margin-left: 3px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
}

.calc-metric small {
  display: block;
  margin-top: 3px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6.5px;
}

.latency-ladder {
  margin-top: 17px;
}

.subhead {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.ladder-row {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.ladder-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.ladder-label span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ladder-label b {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 400;
}

.ladder-track {
  height: 6px;
  overflow: hidden;
  background: rgba(139, 181, 193, 0.075);
}

.ladder-fill {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.45s var(--ease);
}

.ladder-fill--cyan { background: var(--cyan); opacity: 0.72; }
.ladder-fill--amber { background: var(--amber); opacity: 0.72; }
.ladder-fill--muted { background: #758d96; opacity: 0.65; }
.ladder-fill--violet { background: var(--violet); opacity: 0.66; }
.ladder-fill--orange { background: var(--orange); opacity: 0.74; }

.refresh-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(140, 221, 191, 0.15);
  background: linear-gradient(145deg, rgba(16, 39, 36, 0.25), rgba(5, 12, 16, 0.55));
}

.refresh-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.refresh-card__head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.refresh-card__head span {
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.refresh-card__head strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 400;
}

.refresh-card__number {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.refresh-card__number strong {
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 300;
  letter-spacing: -0.04em;
}

.refresh-card__number em {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
}

.refresh-meter {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  background: rgba(140, 221, 191, 0.09);
}

.refresh-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), rgba(140, 221, 191, 0.5));
  transition: width 0.45s var(--ease);
}

.refresh-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6px;
}

.refresh-card > p {
  margin-top: 9px;
  color: var(--ghost);
  font-size: 8.5px;
  line-height: 1.7;
}

.refresh-card sub {
  font-size: 0.7em;
}

.readout-formula {
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.readout-formula > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.readout-formula code {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
}

.readout-formula p {
  margin-top: 5px;
  color: var(--ghost);
  font-size: 8.5px;
  line-height: 1.65;
}

.probe-panel {
  margin-top: 22px;
}

.probe-live {
  padding-top: 19px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.probe-live b {
  color: var(--cyan);
  font-weight: 400;
}

.probe-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 45px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.probe-card {
  padding: 15px;
  border: 1px solid rgba(139, 181, 193, 0.12);
  background: rgba(4, 11, 15, 0.45);
}

.probe-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.probe-card__head > span {
  color: var(--amber);
  font-size: 6.5px;
}

.probe-card__head b {
  color: var(--muted);
  font-weight: 400;
}

.probe-input {
  display: flex;
  align-items: center;
  height: 46px;
  margin-top: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.probe-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.04em;
  -moz-appearance: textfield;
}

.probe-input input::-webkit-outer-spin-button,
.probe-input input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.probe-input span {
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.probe-result {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.probe-result span {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.probe-result strong {
  margin-left: auto;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 300;
  letter-spacing: -0.04em;
}

.probe-result em {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
}

.probe-swap {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  justify-self: center;
  border: 1px solid var(--line);
  color: var(--amber);
  transform: rotate(180deg);
}

.probe-swap .icon {
  width: 14px;
  height: 14px;
}

.probe-note {
  margin-top: 12px;
  color: var(--ghost);
  font-size: 9px;
  line-height: 1.7;
}

.calculator-disclaimer {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ghost);
  font-size: 9px;
  line-height: 1.8;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  max-width: min(380px, calc(100vw - 48px));
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--amber);
  background: rgba(7, 17, 23, 0.96);
  box-shadow: 0 18px 50px -24px #000;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1460px) {
  .atlas-grid {
    grid-template-columns: minmax(0, 1fr) 286px;
  }

  .param-hero {
    grid-template-columns: minmax(0, 1fr) 272px;
  }

  .spec-plate__glyph {
    font-size: 33px;
  }
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .main {
    padding-left: 27px;
    padding-right: 27px;
  }

  .atlas-grid {
    grid-template-columns: minmax(0, 1fr) 276px;
    gap: 17px;
  }

  .step-list {
    grid-template-columns: 1fr;
  }

  .step,
  .step + .step {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(139, 181, 193, 0.08);
  }

  .step:last-child {
    border-bottom: 0;
    padding-bottom: 4px;
  }

  .step__body h4 {
    margin-top: 7px;
  }

  .step__body p {
    max-width: 680px;
  }

  .sequence-hero,
  .calc-hero {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 32px;
  }

  .phase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phase-card:nth-child(2) {
    border-right: 0;
  }

  .phase-card:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .calc-layout {
    grid-template-columns: 1fr;
  }

  .calc-readout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    column-gap: 24px;
  }

  .calc-readout > .panel-head {
    grid-column: 1 / -1;
  }

  .calc-readout .readout-lead {
    grid-row: 2 / span 2;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .calc-metrics {
    grid-column: 2;
  }

  .calc-readout .latency-ladder {
    grid-column: 2;
  }

  .refresh-card {
    grid-column: 1 / -1;
  }

  .readout-formula {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr auto 1fr;
  }

  .menu-button {
    display: inline-grid !important;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 90;
    top: 72px;
    left: 0;
    width: 310px;
    max-width: 88vw;
    height: calc(100dvh - 72px);
    padding-top: 18px;
    border-right: 1px solid var(--line-strong);
    background: #061016;
    transform: translateX(-101%);
    transition: transform 0.3s var(--ease);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.45);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar__mobile-head {
    display: flex;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 85;
    inset: 0;
    display: block;
    background: rgba(1, 5, 8, 0.66);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }

  .sidebar-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    padding: 0 28px 72px;
  }

  .atlas-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .atlas-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
  }

  .rail-note {
    grid-column: 1 / -1;
    padding: 0 2px;
  }

  .param-hero {
    grid-template-columns: minmax(0, 1fr) 265px;
    gap: 28px;
  }

  .calc-readout {
    display: block;
  }

  .calc-readout .readout-lead {
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
    height: 64px;
    padding: 0 15px;
  }

  .sidebar {
    top: 64px;
    height: calc(100dvh - 64px);
  }

  .reference-state {
    display: none;
  }

  .scope-badge {
    height: 25px;
  }

  .view-tab {
    padding: 0 9px;
  }

  .brand__copy strong {
    font-size: 10px;
  }

  .main {
    padding: 0 19px 62px;
  }

  .param-hero,
  .sequence-hero,
  .calc-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 28px;
  }

  .param-hero {
    padding-bottom: 30px;
  }

  .param-giant {
    font-size: clamp(58px, 13vw, 90px);
  }

  .param-giant--long {
    font-size: clamp(39px, 8.7vw, 62px);
  }

  .spec-plate {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
    column-gap: 18px;
    padding: 16px;
  }

  .spec-plate__head,
  .spec-plate__category,
  .spec-plate__barcode,
  .spec-plate__foot {
    grid-column: 1 / -1;
  }

  .spec-plate__category {
    margin-top: 15px;
  }

  .spec-plate__glyph {
    margin-top: 12px;
    font-size: 31px;
    align-self: center;
  }

  .spec-plate__facts {
    grid-column: 2;
    grid-row: 3 / span 2;
    margin-top: 12px;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-left: 15px;
    align-self: center;
  }

  .spec-plate__barcode {
    margin-top: 13px;
    height: 22px;
  }

  .spec-plate__foot {
    grid-row: auto;
    margin-top: 8px;
  }

  .sequence-hero {
    align-items: start;
    padding-bottom: 28px;
  }

  .sequence-index {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr);
    column-gap: 22px;
  }

  .sequence-index__eyebrow,
  .sequence-index__rail {
    grid-column: 1 / -1;
  }

  .sequence-index__rows {
    grid-column: 1;
  }

  .sequence-index p {
    grid-column: 2;
    align-self: end;
    margin-top: 13px;
  }

  .sequence-index__rail {
    margin-top: 14px;
  }

  .calc-hero__display {
    width: 100%;
  }

  .calc-fields--four {
    grid-template-columns: 1fr 1fr;
  }

  .calc-fields--four .calc-field:nth-child(2) {
    grid-column: 1;
  }

  .probe-grid {
    grid-template-columns: 1fr;
  }

  .probe-swap {
    transform: rotate(90deg);
  }

  .probe-swap .icon {
    transform: rotate(180deg);
  }

  .formula-band {
    grid-template-columns: 1fr;
  }

  .formula-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .formula-item:last-child {
    border-bottom: 0;
  }

  .page-cta {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .atlas-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 0 12px;
  }

  .topbar__left {
    min-width: auto;
  }

  .topbar__right {
    display: none;
  }

  .brand__copy {
    display: flex;
  }

  .brand__copy > span {
    display: none;
  }

  .brand__copy strong {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .brand {
    gap: 7px;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
  }

  .brand__mark svg {
    width: 27px;
    height: 27px;
  }

  .menu-button {
    margin-right: 8px;
  }

  .view-nav {
    justify-self: end;
    gap: 2px;
    padding: 3px;
  }

  .view-tab {
    height: 31px;
    padding: 0 10px;
  }

  .view-tab span {
    display: none;
  }

  .main {
    padding: 0 14px 56px;
  }

  .panel {
    padding: 17px;
  }

  .eyebrow {
    font-size: 7.5px;
    letter-spacing: 0.09em;
  }

  .param-title-line {
    gap: 12px;
    margin-top: 17px;
  }

  .param-giant {
    font-size: clamp(54px, 18vw, 82px);
    letter-spacing: -0.07em;
  }

  .param-giant--long {
    font-size: clamp(32px, 10.7vw, 50px);
  }

  .param-intro {
    font-size: 13px;
  }

  .param-subline h2 {
    font-size: 20px;
  }

  .param-subline > span {
    font-size: 8px;
  }

  .tag-alias {
    width: 100%;
    margin-left: 0;
  }

  .button {
    flex: 1;
    padding: 0 11px;
    font-size: 8.5px;
  }

  .entry-pager__link {
    min-width: 0;
    flex: 1;
  }

  .spec-plate {
    grid-template-columns: minmax(0, 1fr) 145px;
  }

  .spec-plate__facts {
    padding-left: 12px;
  }

  .spec-plate__facts > div {
    flex-direction: column;
    gap: 1px;
  }

  .spec-plate__facts dd {
    text-align: left;
  }

  .wave-head {
    padding: 16px 16px 14px;
    flex-direction: column;
    gap: 13px;
  }

  .wave-head h3 {
    font-size: 19px;
  }

  .wave-tools {
    width: 100%;
    justify-content: space-between;
  }

  .schematic-chip {
    display: none;
  }

  .variant-bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
  }

  .wave-scroll {
    padding: 8px 10px 3px;
  }

  .trace-svg {
    min-width: 720px;
  }

  .wave-inspect {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 4px 8px;
    padding: 10px 16px;
  }

  .wave-inspect__desc {
    grid-column: 1 / -1;
    padding-left: 70px;
    font-size: 9px;
    white-space: normal;
    line-height: 1.6;
  }

  .wave-notes {
    padding: 11px 16px 13px;
    grid-template-columns: 1fr 1fr;
  }

  .wave-note {
    padding-right: 18px;
  }

  .wave-note__caption {
    font-size: 9px;
  }

  .wave-foot {
    padding: 8px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .wave-foot > span:last-child {
    width: 100%;
    text-align: left;
  }

  .steps-panel,
  .context-panel {
    padding: 17px;
  }

  .panel-head h3,
  .section-heading h3 {
    font-size: 19px;
  }

  .panel-head {
    margin-bottom: 16px;
  }

  .panel-head__note {
    display: none;
  }

  .flow-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .flow-chain {
    width: 100%;
  }

  .flow-node {
    flex: 1;
    min-width: 0;
  }

  .flow-node b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .context-copy {
    max-width: 100%;
    margin-left: 0;
    padding-left: 12px;
    font-size: 12px;
  }

  .context-mark {
    display: none;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-card {
    min-height: 95px;
  }

  .related-card strong {
    margin-top: 9px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading > p {
    font-size: 11px;
  }

  .section-heading__rule {
    display: none;
  }

  .sequence-hero h1,
  .calc-hero h1 {
    font-size: clamp(36px, 11vw, 54px);
    margin-top: 17px;
  }

  .sequence-hero h1 {
    font-size: clamp(34px, 9.7vw, 50px);
  }

  .sequence-hero__copy > p,
  .calc-hero__copy > p {
    margin-top: 15px;
    font-size: 12.5px;
  }

  .sequence-index {
    display: block;
    padding: 16px;
  }

  .sequence-index__rows {
    margin-top: 10px;
  }

  .sequence-index p {
    margin-top: 11px;
  }

  .phase-grid {
    grid-template-columns: 1fr;
  }

  .phase-card {
    min-height: 0;
    padding: 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .phase-card:last-child {
    border-bottom: 0;
  }

  .phase-card__time {
    top: 18px;
  }

  .phase-card h3 {
    margin-top: 14px;
    font-size: 16px;
  }

  .phase-card__link {
    margin-top: 11px;
  }

  .calc-fields--three,
  .calc-fields--four,
  .calc-fields--two {
    grid-template-columns: 1fr 1fr;
  }

  .calc-fields--three .calc-field:first-child {
    grid-column: 1 / -1;
  }

  .calc-fields--four .calc-field--burst {
    grid-column: 1 / -1;
  }

  .preset-group {
    align-items: flex-start;
  }

  .preset-group__name {
    padding-top: 6px;
  }

  .calc-layout {
    gap: 14px;
  }

  .calc-controls,
  .calc-readout {
    padding: 17px;
  }

  .calc-preset {
    height: 25px;
    padding: 0 6px;
    font-size: 7px;
  }

  .calc-controls__foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .readout-lead__number strong {
    font-size: 43px;
  }

  .calc-metric strong {
    font-size: 18px;
  }

  .ladder-row {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .probe-panel {
    padding: 17px;
  }

  .probe-live {
    display: none;
  }

  .probe-grid {
    gap: 9px;
  }

  .probe-card {
    padding: 13px;
  }

  .probe-input {
    height: 41px;
  }

  .probe-input input {
    font-size: 21px;
  }

  .probe-result strong {
    font-size: 19px;
  }

  .formula-item {
    padding: 16px;
  }

  .page-cta h2 {
    font-size: 19px;
  }

  .button.primary-mobile-full,
  .page-cta .button {
    width: 100%;
  }

  .toast {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 430px) {
  .wave-notes {
    grid-template-columns: 1fr;
  }

  .calc-fields--three,
  .calc-fields--four,
  .calc-fields--two {
    grid-template-columns: 1fr;
  }

  .calc-fields--four .calc-field--burst {
    grid-column: auto;
  }

  .calc-metrics {
    grid-template-columns: 1fr;
  }

  .calc-metric:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }

  .calc-metric:nth-child(even) {
    padding-left: 0;
  }

  .spec-plate {
    display: block;
  }

  .spec-plate__facts {
    margin-top: 14px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .spec-plate__facts > div {
    flex-direction: row;
  }

  .spec-plate__facts dd {
    text-align: right;
  }

  .entry-pager__link strong {
    font-size: 9px;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .view-tab {
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------------
   Calculator · ps → tCK rounding panel
   ------------------------------------------------------------------ */
.rounding-panel {
  margin-top: 22px;
}

.rounding-lead {
  max-width: 84ch;
  margin: -6px 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
}

.rounding-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: start;
}

.rounding-rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.round-card.is-active {
  border-color: var(--line-hot);
  background: var(--surface-3);
}

.round-card header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.round-card header span {
  color: var(--action);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.round-card header b {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

.round-card code {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.round-card code i {
  color: var(--amber);
  font-style: normal;
}

.round-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.round-variant {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 10px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
}

.round-variant:first-of-type {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 0;
}

.round-variant > span {
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  transition: color 0.2s var(--ease);
}

.round-variant code {
  padding: 0;
  background: none;
  color: var(--faint);
  font-size: 11.5px;
  transition: color 0.2s var(--ease);
}

.round-variant small {
  grid-column: 2;
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}

.round-variant.is-active > span {
  color: var(--action);
}

.round-variant.is-active code {
  color: var(--ink);
}

.round-variant.is-active small {
  color: var(--muted);
}

.round-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 8px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.round-compare__title {
  margin-right: 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.round-compare__pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.round-compare__pill b {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.round-compare__pill.is-active {
  border-color: var(--line-hot);
  background: var(--surface-3);
  color: var(--action);
}

.round-compare__pill.is-active b {
  color: var(--action);
}

.round-compare p {
  flex-basis: 100%;
  margin: 1px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.7;
}

.rounding-work {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.round-work__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.round-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.round-input > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.round-input__box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px solid var(--line-strong);
}

.round-input__box input {
  width: 108px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 17px;
}

.round-input__box input:focus {
  outline: none;
}

.round-input__box:focus-within {
  border-bottom-color: var(--focus);
}

.round-input__box em {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
}

.round-kind {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.round-kind button {
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.round-kind button:hover {
  color: var(--ink);
}

.round-kind button.is-active {
  border-color: var(--line-hot);
  background: var(--surface-3);
  color: var(--action);
}

.round-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.round-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 12px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
}

.round-step > span {
  color: var(--muted);
  font-size: 11.5px;
}

.round-step code {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.round-step code b {
  color: var(--ink);
  font-weight: 500;
}

.round-step small {
  grid-column: 2;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-align: right;
}

.round-step--target.is-active {
  border-color: var(--line-hot);
  background: var(--surface-3);
}

.round-step--target.is-active > span {
  color: var(--ink);
}

.round-step--target.is-active code b {
  color: var(--amber);
}

.round-ruler {
  position: relative;
  height: 34px;
  margin: 16px 0 2px;
}

.round-ruler::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 1px;
  background: var(--line-strong);
}

.round-ruler__band {
  position: absolute;
  left: 0;
  top: 9px;
  width: 2.5%;
  height: 7px;
  border-radius: 3px;
  background: var(--amber);
  opacity: 0.6;
}

.round-ruler__mark {
  position: absolute;
  top: 4px;
  width: 2px;
  height: 17px;
  background: var(--cyan);
  transform: translateX(-1px);
}

.round-ruler__tick {
  position: absolute;
  bottom: 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.round-ruler__tick--end {
  right: 0;
}

.round-ruler__caption {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ghost);
  font-family: var(--font-mono);
  font-size: 8px;
  white-space: nowrap;
}

.round-gap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

.round-gap b {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.round-gap code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.round-gap code i {
  color: var(--cyan);
  font-style: normal;
}

.round-gap code i + i,
.round-gap code i:last-of-type {
  color: var(--violet);
}
.round-gap span {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
}

.round-result {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.round-result > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.round-result strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}

.round-result strong em {
  margin-left: 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
}

.round-result small {
  margin-left: auto;
  max-width: 50%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: right;
}

.round-preset {
  align-self: flex-start;
}

.rounding-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.round-note {
  padding: 12px 14px;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
}

.round-note b {
  display: block;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
}

.round-note span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.round-note--warn {
  border-left-color: var(--amber);
}

.round-note--warn b {
  color: var(--amber);
}

.rounding-ref {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 10px;
}

@media (max-width: 1080px) {
  .rounding-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rounding-notes {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .round-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .round-step small {
    grid-column: 1;
    text-align: left;
  }

  .round-result small {
    margin-left: 0;
    max-width: none;
    text-align: left;
  }
}
