:root {
  color-scheme: light;
  --site-page: #fbfbf8;
  --site-ink: #172026;
  --site-muted: #65747f;
  --site-line: rgba(23, 32, 38, 0.14);
  --site-accent: #1f8f9f;
  --site-accent-strong: #145e6d;
  --page: #0c1117;
  --surface: rgba(18, 24, 32, 0.88);
  --surface-soft: rgba(28, 36, 48, 0.72);
  --surface-raised: rgba(36, 46, 60, 0.72);
  --line: rgba(194, 210, 232, 0.17);
  --line-strong: rgba(216, 229, 248, 0.32);
  --text: #f4f7fb;
  --muted: #aebbd0;
  --accent: #7dc8ff;
  --accent-strong: #b9e4ff;
  --field: rgba(236, 242, 250, 0.94);
  --field-text: #111821;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--site-page);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fbfbf8 0%, #eef5f2 52%, #f7f6f1 100%);
  color: var(--site-ink);
  font: 14px/1.42 "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--site-ink);
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(23, 32, 38, 0.18);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(23, 32, 38, 0.08);
  background: rgba(251, 251, 248, 0.82);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.site-header__inner {
  width: min(1560px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-brand {
  display: inline-grid;
  gap: 0;
  color: var(--site-ink);
  text-decoration: none;
}

.site-brand__title,
.site-hero h1 span,
.site-footer .site-brand__title {
  font-family: "Ephesis", cursive;
  font-weight: 400;
  letter-spacing: 0;
}

.site-brand__title {
  font-size: clamp(42px, 4.2vw, 66px);
  line-height: 0.78;
  color: #12252a;
}

.site-brand__subtitle {
  color: var(--site-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav-toggle {
  display: none;
  width: 44px;
  height: 40px;
  place-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--site-ink);
  cursor: pointer;
}

.site-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.site-nav a,
.nav-dropdown summary,
.site-button {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--site-ink);
  text-decoration: none;
  font-weight: 700;
}

.site-nav a:hover,
.nav-dropdown summary:hover,
.site-button:hover {
  border-color: rgba(31, 143, 159, 0.42);
  color: var(--site-accent-strong);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(23, 32, 38, 0.16);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.nav-dropdown__menu a {
  width: 100%;
  justify-content: start;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.site-hero,
.app-section,
.guide-section,
.workflow-section {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
}

.site-hero {
  min-height: clamp(360px, 48vh, 560px);
  padding: clamp(68px, 9vw, 118px) 0 clamp(28px, 5vw, 56px);
  display: flex;
  align-items: end;
}

.eyebrow-label {
  margin: 0 0 10px;
  color: var(--site-accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-hero h1 {
  margin: 0;
  color: #10242a;
  font-size: clamp(112px, 16vw, 220px);
  line-height: 0.72;
}

.site-hero__lede {
  max-width: 760px;
  margin: 26px 0 0;
  color: #33464f;
  font: 300 clamp(18px, 2.2vw, 28px)/1.46 "Merriweather", serif;
}

.site-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-button--primary {
  border-color: rgba(20, 94, 109, 0.42);
  background: #163c45;
  color: #f7fbfb;
}

.site-button--primary:hover {
  color: #fff;
  background: #145e6d;
}

.app-section {
  scroll-margin-top: 92px;
  padding: 14px 0 clamp(48px, 7vw, 92px);
}

.section-heading {
  margin: 0 0 18px;
}

.section-heading h2,
.workflow-card h2 {
  margin: 0;
  color: #172026;
  font: 700 clamp(28px, 4vw, 48px)/1.08 "Merriweather", serif;
}

.app-shell {
  height: min(920px, calc(100dvh - 108px));
  min-height: 640px;
  min-width: 0;
  overflow: hidden;
  padding: clamp(10px, 1.7vw, 22px);
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-areas: "controls viewer";
  gap: clamp(10px, 1.4vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, #0c1117 0%, #111822 48%, #0c1117 100%);
  box-shadow: 0 30px 90px rgba(18, 35, 42, 0.28);
}

.viewer {
  grid-area: viewer;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.plot-wrap {
  flex: 0 0 auto;
  position: relative;
  width: 100%;
  min-height: 340px;
  aspect-ratio: 16 / 9;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  box-shadow: var(--shadow);
}

.time-group {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.playback-group {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.viewer-status-row {
  flex: 0 0 auto;
}

.status-bar {
  flex: 0 0 auto;
}

#spectrogramCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

#spectrogramCanvas:active {
  cursor: grabbing;
}

.plot-nav-bar {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: min(280px, calc(100% - 32px));
  transform: translateX(-50%);
}

.plot-nav-bar[hidden] {
  display: none !important;
}

.plot-nav {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(238, 246, 255, 0.28);
  border-radius: 8px;
  background: rgba(240, 246, 255, 0.18);
  color: #eff7ff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.plot-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.empty-state,
.busy-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(16px, 2vw, 20px);
}

.empty-state {
  pointer-events: none;
}

.empty-state[hidden],
.busy-state[hidden] {
  display: none !important;
}

.busy-state {
  z-index: 12;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(3px) saturate(120%);
  -webkit-backdrop-filter: blur(3px) saturate(120%);
}

.busy-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: min(260px, calc(100% - 42px));
  padding: 22px 24px;
  border: 1px solid rgba(238, 246, 255, 0.26);
  border-radius: 8px;
  background: rgba(12, 17, 23, 0.72);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42);
}

.busy-ring {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: busy-spin 800ms linear infinite;
}

.busy-text {
  color: #f2f8ff;
  font-weight: 700;
  letter-spacing: 0;
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.viewer-status-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.status-bar {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #d6e8ff;
}

.inspection-hint {
  min-width: max-content;
  color: rgba(174, 187, 208, 0.74);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
}

.controls {
  grid-area: controls;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
  align-self: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(29, 38, 50, 0.78), rgba(17, 24, 34, 0.82));
  padding: 14px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  scrollbar-width: thin;
  scrollbar-color: rgba(218, 231, 248, 0.32) transparent;
}

.controls-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(218, 231, 248, 0.32) transparent;
}

.controls-scroll::-webkit-scrollbar {
  width: 8px;
}

.controls-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.controls-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(218, 231, 248, 0.28);
}

.controls::-webkit-scrollbar {
  width: 8px;
}

.controls::-webkit-scrollbar-track {
  background: transparent;
}

.controls::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(218, 231, 248, 0.28);
}

.toolbar-toggle {
  display: none;
}

.group {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px 12px 12px;
}

.group legend {
  padding: 0 7px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
}

.file-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.radio-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.radio-row label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.radio-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.radio-row label[aria-disabled="true"] {
  opacity: 0.52;
}

body.plot-spectrum .stft-group legend::after {
  content: " / Spectrum";
  color: var(--muted);
  font-weight: 600;
}

.file-info {
  min-width: 0;
  margin: 0 0 12px;
  padding: 9px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(88px, 0.72fr) minmax(0, 1fr);
  gap: 9px 10px;
  align-items: center;
}

.field-grid label,
.timeline-grid label {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.toggle-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: minmax(126px, max-content) minmax(220px, 1fr) minmax(148px, max-content) minmax(280px, 1.2fr);
  gap: 10px 14px;
  align-items: center;
}

.timeline-grid label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.timeline-grid label span {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.playback-grid {
  display: grid;
  grid-template-columns: minmax(84px, 0.2fr) minmax(360px, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.playback-button {
  min-height: 52px;
  font-weight: 800;
}

.playback-options {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(128px, 0.48fr) minmax(220px, 1fr);
  gap: 8px;
}

.compact-radio,
.expansion-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.expansion-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-radio label,
.expansion-row label {
  min-height: 34px;
  padding: 5px 8px;
}

.carrier-control {
  min-width: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(126px, max-content) minmax(220px, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.carrier-control label {
  min-width: 0;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.carrier-control label span {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mode-label-short {
  display: none;
}

.toolbar-footer {
  align-self: end;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.toolbar-footer #updateView {
  min-height: 42px;
  font-weight: 700;
}

input:not([type="file"]),
select,
button,
.button,
output,
.check {
  width: 100%;
  min-height: 34px;
}

input:not([type="file"]),
select {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  background: var(--field);
  color: var(--field-text);
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

input[readonly] {
  color: rgba(17, 24, 33, 0.76);
  background: rgba(236, 242, 250, 0.72);
  cursor: default;
}

input[type="range"] {
  height: 34px;
  padding: 0;
  accent-color: var(--accent);
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(125, 200, 255, 0.9), rgba(217, 239, 255, 0.48));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: linear-gradient(180deg, #ecf7ff, #81c9ff);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.36);
  appearance: none;
  -webkit-appearance: none;
}

input[type="range"]:disabled::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.14);
}

input[type="range"]:disabled::-webkit-slider-thumb {
  background: #8c929a;
}

#timeSlider::-webkit-slider-runnable-track {
  background: rgba(225, 235, 248, 0.2);
}

#timeSlider:disabled::-webkit-slider-runnable-track {
  background: rgba(225, 235, 248, 0.12);
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(125, 200, 255, 0.9), rgba(217, 239, 255, 0.48));
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: linear-gradient(180deg, #ecf7ff, #81c9ff);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.36);
}

#timeSlider::-moz-range-track {
  background: rgba(225, 235, 248, 0.2);
}

button,
.button {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(247, 250, 255, 0.84);
  color: #0e1721;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 18px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

button:hover,
.button:hover {
  background: rgba(255, 255, 255, 0.96);
}

button:disabled {
  opacity: 0.48;
  cursor: default;
}

.plot-nav {
  width: 100%;
  min-height: 40px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
}

.primary {
  font-weight: 700;
}

.icon-button {
  font-weight: 700;
}

.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.check input {
  position: relative;
  inline-size: 38px;
  block-size: 22px;
  flex: 0 0 auto;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.check input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.32);
  transition: transform 160ms ease, background 160ms ease;
}

.check input:checked {
  border-color: rgba(125, 200, 255, 0.72);
  background: linear-gradient(90deg, rgba(62, 157, 222, 0.9), rgba(125, 200, 255, 0.86));
}

.check input:checked::before {
  transform: translateX(16px);
  background: #fff;
}

.check[aria-disabled="true"] {
  opacity: 0.56;
}

.check input:disabled {
  cursor: default;
}

.time-group,
.playback-group {
  border-color: var(--line-strong);
  background: rgba(23, 31, 42, 0.72);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.playback-group {
  padding-top: 10px;
  padding-bottom: 10px;
}

.time-group output {
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-strong);
}

.guide-section {
  scroll-margin-top: 92px;
  padding: clamp(48px, 7vw, 92px) 0;
}

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

.guide-grid article,
.workflow-card {
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 54px rgba(31, 50, 57, 0.1);
}

.guide-grid article {
  padding: 20px;
}

.guide-grid h3 {
  margin: 0 0 10px;
  color: #172026;
  font: 700 18px/1.25 "Merriweather", serif;
}

.guide-grid p,
.workflow-card p {
  margin: 0;
  color: #435560;
  line-height: 1.62;
}

.workflow-section {
  scroll-margin-top: 92px;
  padding: 0 0 clamp(58px, 8vw, 110px);
}

.workflow-card {
  max-width: 980px;
  padding: clamp(24px, 4vw, 42px);
}

.workflow-card h2 {
  margin-bottom: 14px;
}

.site-footer {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--site-line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--site-muted);
}

.site-footer .site-brand__title {
  color: #12252a;
  font-size: 48px;
  line-height: 0.8;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(278px, 330px) minmax(0, 1fr);
  }

  .timeline-grid {
    grid-template-columns: minmax(126px, max-content) minmax(170px, 1fr);
  }

  .playback-grid {
    grid-template-columns: minmax(76px, 0.18fr) minmax(0, 1fr);
  }

  .timeline-grid #timeSlider {
    grid-column: 2;
  }
}

@media (max-width: 1480px) and (min-width: 841px) {
  .timeline-grid {
    grid-template-columns: minmax(126px, max-content) minmax(180px, 1fr);
  }

  .playback-grid {
    grid-template-columns: minmax(76px, 0.18fr) minmax(0, 1fr);
  }

  .timeline-grid #timeSlider {
    grid-column: 2;
  }
}

@media (max-height: 680px) and (min-width: 841px) {
  .app-shell {
    min-height: 620px;
  }
}

@media (max-width: 1320px) {
  .app-shell {
    height: min(860px, calc(100dvh - 98px));
    min-height: 600px;
    padding: 10px;
    grid-template-columns: 1fr;
    grid-template-areas: "viewer";
    gap: 0;
  }

  .viewer {
    min-height: 0;
  }

  .plot-wrap {
    min-height: min(340px, calc((100vw - 20px) * 0.5625));
  }

  .plot-nav-bar {
    top: 8px;
    width: min(260px, calc(100% - 28px));
  }

  .toolbar-toggle {
    position: fixed;
    left: 14px;
    top: 88px;
    z-index: 70;
    display: inline-grid;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 999px;
    font-size: 24px;
    line-height: 1;
  }

  .controls {
    position: fixed;
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    z-index: 20;
    width: min(84vw, 360px);
    max-height: none;
    background: linear-gradient(180deg, rgba(29, 38, 50, 0.66), rgba(17, 24, 34, 0.58));
    transform: translateX(calc(-100% - 2px));
    transition: transform 180ms ease;
    border-width: 0 1px 0 0;
    border-radius: 0 8px 8px 0;
    padding: 18px 12px 14px;
    overflow: hidden;
  }

  body.controls-open .controls {
    transform: translateX(0);
  }

  body.controls-open .toolbar-toggle {
    left: calc(min(84vw, 360px) + 10px);
    top: 88px;
  }

  .playback-grid {
    grid-template-columns: minmax(76px, 0.18fr) minmax(0, 1fr);
  }

  .playback-options {
    grid-template-columns: minmax(104px, 0.38fr) minmax(220px, 1fr);
  }

  .field-grid,
  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .timeline-grid #timeSlider {
    grid-column: auto;
  }

  .playback-button {
    min-height: 38px;
  }

  .mode-label-long {
    display: none;
  }

  .mode-label-short {
    display: inline;
  }
}

@media (max-width: 920px) {
  .site-header__inner {
    min-height: 72px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 0;
  }

  .site-nav-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 80;
    width: min(280px, calc(100vw - 20px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--site-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 48px rgba(23, 32, 38, 0.16);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
  }

  [data-theme="dark"] body .site-nav {
    background: rgba(15, 20, 31, 0.94);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav a,
  .nav-dropdown summary,
  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .nav-dropdown__menu {
    position: static;
    margin-top: 8px;
    box-shadow: none;
  }

  .site-hero {
    grid-template-columns: 1fr;
    padding-top: 46px;
  }

  .site-hero h1 {
    font-size: clamp(94px, 28vw, 148px);
  }

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

@media (max-width: 680px) {
  .site-hero,
  .app-section,
  .guide-section,
  .workflow-section,
  .site-header__inner,
  .site-footer {
    width: min(100% - 20px, 1560px);
  }

  .site-nav a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .site-hero__lede {
    font-size: 17px;
  }

  .app-shell {
    height: min(760px, calc(100dvh - 92px));
    min-height: 560px;
  }

  .compact-radio,
  .expansion-row {
    grid-template-columns: 1fr 1fr;
  }

  .playback-grid,
  .playback-options,
  .carrier-control {
    grid-template-columns: 1fr;
  }

  .viewer-status-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .inspection-hint {
    min-width: 0;
    text-align: left;
  }

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

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Multi-page site refinements */
.site-main {
  min-height: calc(100dvh - 72px);
}

.site-brand:hover,
.site-brand:focus-visible,
.site-footer__wordmark:hover,
.site-footer__wordmark:focus-visible {
  text-decoration: none;
}

.site-brand:hover .site-brand__title,
.site-brand:focus-visible .site-brand__title {
  transform: scale(1.04);
}

.site-brand__title {
  display: inline-block;
  transition: transform 180ms ease, color 180ms ease;
  transform-origin: left center;
}

.biosonix-wordmark {
  font-family: "Ephesis", cursive;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.site-nav__link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  transform-origin: center;
  transition: color 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  transform: scale(1.06);
  text-decoration: none;
}

.site-nav__link--biosonix .biosonix-wordmark {
  color: currentColor;
  font-size: 1em;
}

.theme-toggle {
  width: auto;
  min-width: 42px;
  min-height: 38px;
  padding: 0 10px;
  grid-auto-flow: column;
  gap: 4px;
  border-color: var(--site-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--site-ink);
  box-shadow: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(31, 143, 159, 0.42);
  color: var(--site-accent-strong);
}

.theme-toggle__moon {
  opacity: 0.46;
}

[data-theme="dark"] .theme-toggle__sun {
  opacity: 0.42;
}

[data-theme="dark"] .theme-toggle__moon {
  opacity: 1;
}

.homepage-apps {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding: 0 0 clamp(48px, 7vw, 92px);
}


.homepage-apps__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.homepage-apps__heading p:not(.eyebrow-label) {
  max-width: 64ch;
  margin: 8px 0 0;
  color: var(--site-muted);
  line-height: 1.55;
}

.homepage-apps__controls {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.icon-button,
.action-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.homepage-apps__nav {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(31, 143, 159, 0.24);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 252, 253, 0.94), rgba(255, 255, 255, 0.9));
  color: var(--site-ink);
  box-shadow: 0 18px 44px rgba(31, 50, 57, 0.12);
  cursor: pointer;
  font: 700 17px/1 "Merriweather Sans", sans-serif;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.homepage-apps__nav:not(:disabled):hover,
.homepage-apps__nav:not(:disabled):focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(225, 250, 252, 0.96), rgba(255, 255, 255, 0.95));
}

.homepage-apps__nav:disabled {
  cursor: default;
  opacity: 0.42;
}

.homepage-apps__viewport {
  overflow: hidden;
}

.homepage-apps__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.homepage-apps__track::-webkit-scrollbar {
  display: none;
}

.surface-card,
.homepage-app-card {
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 54px rgba(31, 50, 57, 0.1);
}

.surface-card {
  padding: 22px;
}

.homepage-app-card {
  flex: 0 0 calc((100% - 16px) / 2);
  min-height: 330px;
  display: grid;
  align-content: start;
  gap: 16px;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
}

.homepage-app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 36%);
}

.homepage-app-card > * {
  position: relative;
}

.homepage-app-card--chalks {
  background: linear-gradient(180deg, rgba(233, 239, 243, 0.96), rgba(255, 255, 255, 0.96));
}

.homepage-app-card--noxtra {
  border-color: rgba(255, 183, 96, 0.18);
  background: radial-gradient(circle at top right, rgba(255, 183, 96, 0.2), transparent 32%), linear-gradient(180deg, rgba(45, 31, 18, 0.96), rgba(16, 12, 9, 0.98));
  color: #f7f1e5;
}

.homepage-app-card--chirps {
  border-color: rgba(41, 173, 245, 0.16);
  background: radial-gradient(circle at top right, rgba(41, 173, 245, 0.14), transparent 34%), linear-gradient(180deg, rgba(14, 19, 30, 0.98), rgba(7, 10, 16, 0.99));
  color: #e8eaf0;
}

.homepage-app-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-grid;
  place-items: center;
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--site-muted);
  font-size: 13px;
  font-weight: 800;
}

.homepage-app-card__accent {
  color: var(--site-muted);
  font-size: 15px;
}

.homepage-app-card__title {
  margin: 0;
}

.homepage-app-card__title--chalks {
  color: #355b75;
  font-family: "Calligraffitti", "Merriweather", serif;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 400;
  line-height: 1;
}

.homepage-app-card__title--noxtra {
  color: #ffb760;
  font-family: "Merriweather", serif;
  font-size: clamp(32px, 4vw, 43px);
  letter-spacing: 0;
}

.homepage-app-card__title--chirps {
  color: #29adf5;
  font-family: "Ephesis", cursive;
  font-size: clamp(42px, 5vw, 56px);
  font-weight: 400;
  line-height: 0.9;
}

.homepage-app-card__summary,
.homepage-app-card__detail {
  margin: 0;
  color: var(--site-muted);
  line-height: 1.58;
}

.homepage-app-card--noxtra .homepage-app-card__summary,
.homepage-app-card--noxtra .homepage-app-card__detail,
.homepage-app-card--noxtra .homepage-app-card__accent {
  color: rgba(247, 241, 229, 0.8);
}

.homepage-app-card--chirps .homepage-app-card__summary,
.homepage-app-card--chirps .homepage-app-card__detail,
.homepage-app-card--chirps .homepage-app-card__accent {
  color: rgba(232, 234, 240, 0.78);
}

.homepage-app-card--noxtra .tag-pill {
  border-color: rgba(255, 183, 96, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f1e5;
}

.homepage-app-card--chirps .tag-pill {
  border-color: rgba(41, 173, 245, 0.16);
  background: rgba(41, 173, 245, 0.08);
  color: #e8eaf0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.homepage-app-card .action-row {
  margin-top: auto;
}

.homepage-app-card--noxtra .site-button--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ffe2b9 0%, #ffbd67 38%, #ff8e47 100%);
  color: #241507;
}

.homepage-app-card--chirps .site-button--primary {
  border-color: transparent;
  background: #29adf5;
  color: #071019;
}
.feature-band,
.page-hero {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
}

.feature-band {
  padding: clamp(36px, 6vw, 86px) 0 clamp(60px, 8vw, 112px);
}

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

.feature-grid article {
  min-height: 184px;
  padding: 22px;
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 54px rgba(31, 50, 57, 0.1);
}

.feature-grid h3,
.guide-grid h2 {
  margin: 0 0 10px;
  color: #172026;
  font: 700 19px/1.25 "Merriweather", serif;
}

.feature-grid p {
  margin: 0;
  color: #435560;
  line-height: 1.62;
}

.meta-line,
.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-hero {
  padding: clamp(70px, 10vw, 130px) 0 clamp(24px, 5vw, 56px);
}

.page-hero--compact {
  max-width: 980px;
  margin-left: max(16px, calc((100% - min(1560px, calc(100% - 32px))) / 2));
}

.page-hero h1 {
  margin: 0;
  color: #172026;
  font: 700 clamp(44px, 7vw, 84px)/1.02 "Merriweather", serif;
}

.page-hero p:not(.eyebrow-label) {
  max-width: 780px;
  margin: 18px 0 0;
  color: #435560;
  font: 300 clamp(17px, 2vw, 24px)/1.5 "Merriweather", serif;
}

.guide-section--page {
  padding-top: 24px;
}

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

.guide-section--page .guide-grid article {
  min-height: 188px;
}

.site-footer {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  border-top: 1px solid var(--site-line);
  background: rgba(248, 249, 245, 0.86);
  color: var(--site-muted);
}

.site-footer__inner {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 54px) 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer__wordmark {
  color: #12252a;
  font-size: clamp(46px, 5vw, 72px);
  line-height: 0.78;
  text-decoration: none;
}

.site-footer__tagline {
  max-width: 390px;
  margin: 0;
  color: var(--site-muted);
  line-height: 1.55;
}

.site-footer__nav a {
  color: var(--site-muted);
  text-decoration: none;
  font-weight: 700;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
  color: var(--site-accent-strong);
}

.site-footer__external {
  max-width: 420px;
}

.site-footer__privacy-link,
.site-footer__coffee {
  color: var(--site-muted);
  text-decoration: none;
  font-weight: 700;
}

.site-footer__privacy-link:hover,
.site-footer__privacy-link:focus-visible,
.site-footer__coffee:hover,
.site-footer__coffee:focus-visible {
  color: var(--site-accent-strong);
}

.site-footer__coffee {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.site-footer__biosonix {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  color: var(--site-muted);
  text-decoration: none;
  font-weight: 700;
  transform-origin: left center;
  transition: color 180ms ease, transform 180ms ease;
}

.site-footer__biosonix:hover,
.site-footer__biosonix:focus-visible {
  color: var(--site-accent-strong);
  transform: scale(1.08);
}

.site-footer__biosonix .biosonix-wordmark {
  font-size: 1em;
}

.site-footer__bar {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 22px;
  border-top: 1px solid var(--site-line);
}

.site-footer__bar p {
  margin: 0;
  color: var(--site-muted);
  font-size: 12px;
}

.privacy-section {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 clamp(60px, 8vw, 112px);
  display: grid;
  gap: 14px;
}

.privacy-card {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 54px rgba(31, 50, 57, 0.1);
}

.privacy-card h2 {
  margin: 0 0 10px;
  color: #172026;
  font: 700 22px/1.2 "Merriweather", serif;
}

.privacy-card p {
  margin: 0;
  color: #435560;
  line-height: 1.62;
}

.spectra-app-page {
  overflow: hidden;
  background: var(--site-page);
}

.app-page-main {
  height: calc(100dvh - 72px);
  overflow: hidden;
  background: var(--page);
}

.app-page-main .app-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

[data-theme="dark"] body {
  --site-page: #05080f;
  --site-ink: #e8edf4;
  --site-muted: #aab6c8;
  --site-line: rgba(125, 200, 255, 0.16);
  --site-accent: #7dc8ff;
  --site-accent-strong: #b9e4ff;
  background: linear-gradient(180deg, #05080f 0%, #0b111a 55%, #05080f 100%);
  color: var(--site-ink);
}

[data-theme="dark"] body .site-header {
  background: rgba(5, 8, 13, 0.86);
  border-bottom-color: var(--site-line);
}

[data-theme="dark"] body .site-brand__title,
[data-theme="dark"] body .site-hero h1,
[data-theme="dark"] body .site-hero h1 span,
[data-theme="dark"] body .section-heading h2,
[data-theme="dark"] body .page-hero h1,
[data-theme="dark"] body .feature-grid h3,
[data-theme="dark"] body .guide-grid h2,
[data-theme="dark"] body .guide-grid h3,
[data-theme="dark"] body .site-footer__wordmark {
  color: var(--site-ink);
}

[data-theme="dark"] body .site-hero__lede,
[data-theme="dark"] body .page-hero p:not(.eyebrow-label),
[data-theme="dark"] body .feature-grid p,
[data-theme="dark"] body .guide-grid p,
[data-theme="dark"] body .site-footer__tagline {
  color: var(--site-muted);
}

[data-theme="dark"] body .site-nav__link,
[data-theme="dark"] body .nav-dropdown summary,
[data-theme="dark"] body .site-button,
[data-theme="dark"] body .site-nav-toggle,
[data-theme="dark"] body .theme-toggle {
  border-color: var(--site-line);
  background: rgba(240, 246, 255, 0.06);
  color: var(--site-ink);
}

[data-theme="dark"] body .site-nav {
  border-color: var(--site-line);
}

[data-theme="dark"] body .site-button--primary {
  border-color: rgba(125, 200, 255, 0.36);
  background: #0d4f66;
  color: #f4fbff;
}

[data-theme="dark"] body .feature-grid article,
[data-theme="dark"] body .guide-grid article {
  border-color: var(--site-line);
  background: rgba(15, 20, 31, 0.74);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] body .nav-dropdown__menu {
  border-color: var(--site-line);
  background: rgba(15, 20, 31, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] body .homepage-apps__nav {
  border-color: rgba(125, 200, 255, 0.28);
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.96), rgba(12, 18, 28, 0.96));
  color: #f4fbff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] body .homepage-apps__nav:not(:disabled):hover,
[data-theme="dark"] body .homepage-apps__nav:not(:disabled):focus-visible {
  background: linear-gradient(180deg, rgba(32, 53, 73, 0.98), rgba(14, 24, 38, 0.98));
  color: #ffffff;
}

[data-theme="dark"] body .privacy-card h2 {
  color: var(--site-ink);
}

[data-theme="dark"] body .privacy-card p {
  color: var(--site-muted);
}

[data-theme="dark"] body .privacy-card {
  border-color: var(--site-line);
  background: rgba(15, 20, 31, 0.74);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] body .site-footer {
  border-top-color: var(--site-line);
  background: #05080f;
}

[data-theme="dark"] body .site-footer__bar {
  border-top-color: var(--site-line);
}

@media (max-width: 920px) {
  .feature-grid,
  .guide-section--page .guide-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .app-page-main {
    height: calc(100dvh - 98px);
  }
}

@media (max-width: 680px) {
  .feature-band,
  .privacy-section,
  .page-hero {
    width: min(100% - 20px, 1560px);
  }

  .page-hero--compact {
    margin-left: auto;
  }

  .theme-toggle {
    min-width: 38px;
    min-height: 34px;
    padding: 0 8px;
  }
}
