:root {
  color-scheme: dark;
  --bg: #0b0e0f;
  --surface: #111617;
  --surface-raised: #171d1e;
  --surface-soft: #1d2425;
  --ink: #ecece4;
  --muted: #adb6b2;
  --dim: #7f8b87;
  --line: #303a3a;
  --line-bright: #586762;
  --acid: #9db8ad;
  --acid-soft: #849f95;
  --orange: #b58b5b;
  --warning: #d0aa72;
  --danger: #dc817c;
  --success: #91baa5;
  --focus: #dec28c;
  --sans: Arial, Helvetica, sans-serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --max-width: 1760px;
  --gutter: clamp(1rem, 3vw, 3.5rem);
  --border: 1px solid var(--line);
  --chrome-primary-height: 4.5rem;
  --quick-nav-height: 3.35rem;
  --chrome-height: calc(var(--chrome-primary-height) + var(--quick-nav-height));
}

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

html {
  min-width: 0;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--chrome-height) + 0.75rem);
}

body {
  position: relative;
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 78% -12%, rgba(157, 184, 173, 0.09), transparent 34rem),
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(157, 184, 173, 0.035) 1px) 0 0 / min(10vw, 9rem) 100%,
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: 200;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(236, 236, 228, 0.012) 3px 4px);
  content: "";
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  max-width: 100%;
  font: inherit;
}

button,
select,
input[type="range"],
input[type="checkbox"],
.file-button {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
}

p:last-child,
h1:last-child,
h2:last-child,
h3:last-child {
  margin-bottom: 0;
}

::selection {
  background: var(--acid);
  color: var(--bg);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--acid);
  color: var(--bg);
  font-family: var(--mono);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

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

.site-chrome {
  position: sticky;
  z-index: 100;
  top: 0;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 15, 0.88);
  backdrop-filter: blur(18px) saturate(0.8);
}

.chrome-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: var(--chrome-primary-height);
  padding: 0 var(--gutter);
}

.site-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.9rem;
  color: var(--ink);
  text-decoration: none;
}

.site-brand-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-bright);
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 0.25rem rgba(157, 184, 173, 0.04);
}

.site-brand-mark img {
  width: 1.85rem;
  height: 1.85rem;
  filter: grayscale(1) contrast(0.9) brightness(1.3);
}

.site-brand-copy {
  display: grid;
  line-height: 1;
}

.site-brand-copy strong {
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.site-brand-copy small {
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.site-chrome-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
}

.version-chip,
.status-chip,
.panel-status {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border: var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-chip[data-state="ready"],
.status-chip[data-state="connected"],
.status-chip[data-state="success"] {
  color: var(--success);
}

.status-chip[data-state="error"] {
  color: var(--danger);
}

.status-dot {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, currentColor 13%, transparent);
}

.site-nav {
  display: flex;
  width: 100%;
  height: var(--quick-nav-height);
  min-width: 0;
  align-items: stretch;
  padding: 0 var(--gutter);
  overflow-x: auto;
  overflow-y: hidden;
  border-top: var(--border);
  background: rgba(17, 22, 23, 0.9);
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-color: var(--line-bright) var(--bg);
  scrollbar-width: thin;
}

.site-nav::-webkit-scrollbar {
  height: 0.2rem;
}

.site-nav::-webkit-scrollbar-track {
  background: var(--bg);
}

.site-nav::-webkit-scrollbar-thumb {
  background: var(--line-bright);
}

.site-nav-label,
.site-nav-item {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav-label {
  position: sticky;
  z-index: 2;
  left: 0;
  padding: 0 1rem 0 0;
  border-right: var(--border);
  background: var(--surface);
  color: var(--acid);
}

.site-nav-item {
  position: relative;
  gap: 0.55rem;
  padding: 0.2rem clamp(0.85rem, 1.55vw, 1.45rem);
  border-right: var(--border);
  color: var(--muted);
  scroll-snap-align: start;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.site-nav-item::before {
  color: var(--dim);
  content: attr(data-index);
  font-size: 0.57rem;
}

.site-nav-item::after {
  position: absolute;
  right: 0.75rem;
  bottom: 0;
  left: 0.75rem;
  height: 1px;
  background: var(--acid);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-nav-item:hover,
.site-nav-item:focus-visible,
.site-nav-item[aria-current="location"] {
  background: var(--surface-soft);
  color: var(--ink);
}

.site-nav-item:focus-visible {
  outline-offset: -3px;
}

.site-nav-item:hover::after,
.site-nav-item:focus-visible::after,
.site-nav-item[aria-current="location"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.shell {
  --pointer-x: 50vw;
  --pointer-y: 35vh;
  --scroll-progress: 0;
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
}

.shell::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background: radial-gradient(28rem circle at var(--pointer-x) var(--pointer-y), rgba(157, 184, 173, 0.075), transparent 72%);
  content: "";
  pointer-events: none;
}

.shell::after {
  position: fixed;
  z-index: 110;
  top: var(--chrome-height);
  left: 0;
  width: calc(var(--scroll-progress) * 100%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acid));
  box-shadow: 0 0 0.7rem rgba(157, 184, 173, 0.28);
  content: "";
  pointer-events: none;
}

.shell > * {
  position: relative;
  z-index: 1;
}

.operations-hero {
  position: relative;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(1.5rem, 3vw, 3rem);
  overflow: clip;
  border-right: var(--border);
  border-left: var(--border);
}

.stage-index {
  display: grid;
  grid-template-columns: 0.5fr 1fr 1fr;
  min-width: 0;
  padding: 0.65rem 0;
  border-bottom: var(--border);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-index span:nth-child(2) {
  text-align: center;
}

.stage-index span:last-child {
  text-align: right;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  min-width: 0;
  border-bottom: var(--border);
}

.hero-copy {
  position: relative;
  min-width: 0;
  min-height: clamp(24rem, 39vw, 38rem);
  padding: clamp(2rem, 4vw, 4.5rem) clamp(1.5rem, 4vw, 4rem) 2rem 0;
  overflow: hidden;
  border-right: var(--border);
}

.hero-copy::before {
  position: absolute;
  right: clamp(-15rem, -9vw, -7rem);
  bottom: -17rem;
  width: clamp(28rem, 42vw, 47rem);
  aspect-ratio: 1;
  border: 1px solid rgba(157, 184, 173, 0.16);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 2.6rem, rgba(157, 184, 173, 0.045) 2.65rem 2.72rem);
  content: "";
  opacity: 0.72;
  pointer-events: none;
  transform: translate3d(var(--pointer-shift-x, 0), var(--pointer-shift-y, 0), 0);
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-overline {
  margin-bottom: 1rem;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-overline::before {
  content: "[ ";
}

.eyebrow::after,
.section-overline::after {
  content: " ]";
}

.hero-copy h1 {
  max-width: 8.6ch;
  margin-bottom: 1.4rem;
  color: var(--ink);
  font-size: clamp(4rem, 8vw, 8.3rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.78;
  text-transform: uppercase;
}

.hero-copy h1 em {
  color: var(--acid-soft);
  font-style: normal;
}

.hero-lede {
  max-width: 38rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
}

.signal-map {
  position: absolute;
  right: clamp(1.5rem, 4vw, 4rem);
  bottom: 2.2rem;
  left: 0;
  height: 4.4rem;
}

.signal-map::before {
  position: absolute;
  top: 50%;
  right: 1.8rem;
  left: 1.8rem;
  border-top: 1px dashed var(--line-bright);
  content: "";
}

.signal-node {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 3.55rem;
  height: 3.55rem;
  place-items: center;
  border: 1px solid var(--line-bright);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 800;
  transform: translateY(-50%) rotate(45deg);
}

.signal-node::before {
  position: absolute;
  inset: 0.32rem;
  border: 1px solid var(--line);
  content: "";
}

.signal-node {
  text-indent: -0.1em;
}

.signal-node::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  content: attr(class);
  opacity: 0;
}

.signal-node {
  line-height: 1;
}

.signal-node.node-host {
  left: 0.45rem;
}

.signal-node.node-bridge {
  left: 50%;
  border-color: var(--acid);
  color: var(--acid);
  transform: translate(-50%, -50%) rotate(45deg);
}

.signal-node.node-pad {
  right: 0.45rem;
}

.signal-node > * {
  transform: rotate(-45deg);
}

.signal-pulse {
  position: absolute;
  z-index: 3;
  top: calc(50% - 0.28rem);
  left: 12%;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0.8rem rgba(157, 184, 173, 0.42);
  animation: signal-travel 4.8s linear infinite;
}

@keyframes signal-travel {
  0% { left: 12%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 88%; opacity: 0; }
}

.connection-surface {
  position: relative;
  min-width: 0;
  align-self: stretch;
  padding: clamp(1.4rem, 3vw, 3rem);
  overflow: hidden;
  border-left: 1px solid rgba(157, 184, 173, 0.22);
  background:
    linear-gradient(145deg, rgba(157, 184, 173, 0.09), transparent 48%),
    var(--surface-raised);
  color: var(--ink);
}

.connection-surface::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(157, 184, 173, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 184, 173, 0.045) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  content: "";
  mask-image: linear-gradient(135deg, #000, transparent 72%);
  opacity: 0.5;
  pointer-events: none;
}

.connection-surface::after {
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: -45%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(236, 236, 228, 0.06), transparent);
  content: "";
  pointer-events: none;
  transform: skewX(-14deg);
  animation: surface-scan 11s ease-in-out infinite;
}

.connection-surface > * {
  position: relative;
  z-index: 1;
}

@keyframes surface-scan {
  0%, 20% { left: -45%; opacity: 0; }
  34% { opacity: 1; }
  60%, 100% { left: 125%; opacity: 0; }
}

.panel-marker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(2.2rem, 5vw, 5rem);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line-bright);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.connection-surface-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.connection-surface .section-overline {
  color: var(--acid);
}

.connection-surface h2 {
  margin-bottom: 1rem;
  font-size: clamp(2.3rem, 4vw, 4.25rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.9;
  text-transform: uppercase;
}

.connection-surface .panel-status {
  flex: 0 0 auto;
  border-color: var(--line-bright);
  color: var(--muted);
}

.connection-copy {
  max-width: 37rem;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.connection-surface-actions,
.action-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button {
  display: inline-flex;
  min-width: 0;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1rem;
  border: 1px solid var(--line-bright);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

.button.primary {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--bg);
}

.button.quiet {
  background: var(--surface);
}

.button.danger {
  border-color: var(--danger);
  color: #ffaaa7;
}

.button.danger:hover:not(:disabled) {
  background: var(--danger);
  color: var(--bg);
}

.button:disabled {
  opacity: 0.48;
}

.connection-surface .button.primary {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--bg);
}

.connection-surface .button.primary:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.connection-surface .button.quiet {
  border-color: var(--line-bright);
  background: rgba(11, 14, 15, 0.32);
  color: var(--ink);
}

.connection-surface .button.quiet:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.notice {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 0.5rem 0.8rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid currentColor;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.notice strong {
  flex: 0 0 auto;
  color: inherit;
}

.notice.warning {
  background: var(--warning);
  color: #241203;
}

.notice.info {
  border-color: var(--line-bright);
  background: var(--surface-raised);
  color: var(--ink);
}

.notice.info span {
  color: var(--muted);
}

.device-list {
  display: grid;
  min-width: 0;
  gap: 0.6rem;
  margin-top: 1rem;
}

.empty-state,
.device-card {
  display: flex;
  min-width: 0;
  min-height: 4.2rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem;
  border: var(--border);
  background: rgba(11, 14, 15, 0.38);
}

.empty-glyph {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-bright);
  color: var(--acid);
  font-size: 1.2rem;
}

.empty-state > div,
.device-card > div {
  min-width: 0;
}

.empty-title,
.device-name {
  margin-bottom: 0.1rem;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.empty-copy,
.device-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.device-card[data-active="true"] {
  border-color: var(--acid-soft);
  background: var(--surface-soft);
}

.device-card[data-active="true"] .device-name {
  color: var(--ink);
}

.device-card[data-active="true"] .device-meta {
  color: var(--muted);
}

.device-card .action-row {
  flex: 0 0 auto;
}

.device-card .button {
  min-height: 2.5rem;
}

.live-console {
  min-width: 0;
  background: var(--surface);
}

.console-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: var(--border);
}

.console-heading > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.9rem;
}

.console-number,
.card-kicker,
.feature-glyph {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  place-items: center;
  background: var(--acid);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
}

.console-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.diagnostic-action {
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange) 16%, var(--surface));
  color: var(--ink);
}

.console-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-width: 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  border-right: var(--border);
}

.metric-card {
  min-width: 0;
  padding: 1rem;
  border-right: var(--border);
}

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

.metric-label {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  margin-bottom: 0.3rem;
  color: var(--acid);
  font-size: clamp(1.55rem, 2.6vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.metric-note {
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.diagnostic-cluster {
  min-width: 0;
  padding: 0.8rem;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  border-top: var(--border);
  border-left: var(--border);
}

.diagnostic-card {
  display: grid;
  min-width: 0;
  min-height: 4.4rem;
  align-content: space-between;
  padding: 0.6rem;
  border-right: var(--border);
  border-bottom: var(--border);
}

.diagnostic-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.59rem;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.diagnostic-card strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.log-preview {
  min-height: 2.4rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-left: 0.22rem solid var(--orange);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.system-rail {
  display: flex;
  width: min(100%, var(--max-width));
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  border: var(--border);
  border-top: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.system-rail b {
  margin-right: 0.6rem;
  color: var(--acid);
}

.system-rail-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
}

.system-rail-live i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.7rem rgba(145, 186, 165, 0.3);
}

.tab-panel {
  position: relative;
  width: min(100%, var(--max-width));
  min-width: 0;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 8rem) var(--gutter);
  overflow: clip;
  border-right: var(--border);
  border-bottom: var(--border);
  border-left: var(--border);
  background: linear-gradient(155deg, rgba(157, 184, 173, 0.022), transparent 42%);
  transition: box-shadow 220ms ease;
}

.tab-panel:target {
  box-shadow: inset 0 2px 0 rgba(157, 184, 173, 0.5);
}

.tab-panel:nth-of-type(even) {
  background:
    linear-gradient(155deg, rgba(181, 139, 91, 0.022), transparent 42%),
    rgba(17, 22, 23, 0.38);
}

.content-section::before {
  position: absolute;
  top: clamp(1.3rem, 3vw, 2.5rem);
  right: var(--gutter);
  color: rgba(157, 184, 173, 0.06);
  content: attr(data-section-index);
  font-family: var(--mono);
  font-size: clamp(5rem, 13vw, 13rem);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.8;
  pointer-events: none;
}

.content-section > * {
  position: relative;
  z-index: 1;
}

.section-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 4rem);
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3rem, 7vw, 7.2rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.82;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.panel-status {
  flex: 0 1 auto;
  color: var(--acid);
  text-align: right;
  overflow-wrap: anywhere;
}

.workflow-grid,
.settings-grid,
.feature-grid,
.backup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  border-top: var(--border);
  border-left: var(--border);
}

.workflow-card,
.settings-card,
.feature-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 22rem;
  flex-direction: column;
  padding: clamp(1.2rem, 2.5vw, 2.4rem);
  border-right: var(--border);
  border-bottom: var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.workflow-card::before,
.settings-card::before,
.feature-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-top: 1px solid var(--acid-soft);
  border-right: 1px solid var(--acid-soft);
  content: "";
  opacity: 0.42;
  transform: translate(1.25rem, -1.25rem) rotate(45deg);
}

.workflow-card-accent {
  border-color: color-mix(in srgb, var(--orange) 58%, var(--line));
  background:
    linear-gradient(145deg, rgba(181, 139, 91, 0.11), transparent 54%),
    var(--surface-raised);
  color: var(--ink);
}

.workflow-index {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: auto;
  padding-bottom: 3rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.workflow-index i {
  height: 1px;
  flex: 1;
  background: currentColor;
}

.workflow-card-accent .workflow-index,
.workflow-card.workflow-card-accent p {
  color: var(--muted);
}

.workflow-card h3,
.feature-card h3,
.settings-card h3 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.7rem, 2.7vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.workflow-card p,
.feature-card p,
.settings-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.text-action,
.text-link {
  display: inline-flex;
  width: fit-content;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.3rem;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
}

.workflow-card-accent .text-action {
  color: var(--orange);
}

.text-action:hover,
.text-link:hover {
  border-bottom-width: 0.25rem;
}

.callout {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 1.2rem;
  margin-top: 1.25rem;
  padding: clamp(1.2rem, 2.5vw, 2rem);
  border: var(--border);
  background: var(--surface-raised);
}

.callout-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  place-items: center;
  background: var(--acid);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 900;
}

.callout h3 {
  margin-bottom: 0.3rem;
  font-size: 1.15rem;
}

.callout p {
  margin: 0;
  color: var(--muted);
}

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

.settings-card {
  min-height: 27rem;
  gap: 1.25rem;
}

.card-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-heading > div {
  min-width: 0;
}

.card-heading h3 {
  margin-bottom: 0.35rem;
}

.card-heading p {
  margin-bottom: 0;
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 0.65rem 1rem;
  padding-top: 1rem;
  border-top: var(--border);
}

.field-label {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.field-value {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 900;
}

.field input[type="range"],
.field select {
  grid-column: 1 / -1;
  width: 100%;
}

input[type="range"] {
  min-height: 2.75rem;
  accent-color: var(--acid);
}

select {
  min-height: 2.8rem;
  padding: 0.6rem 2.2rem 0.6rem 0.75rem;
  border: 1px solid var(--line-bright);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
}

.switch-field {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 0.9rem;
  min-height: 3.1rem;
  padding-top: 0.65rem;
  border-top: var(--border);
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-ui {
  position: relative;
  width: 3.1rem;
  height: 1.65rem;
  border: 1px solid var(--line-bright);
  background: var(--bg);
}

.switch-ui::after {
  position: absolute;
  top: 0.23rem;
  left: 0.24rem;
  width: 1.05rem;
  height: 1.05rem;
  background: var(--muted);
  content: "";
  transition: transform 150ms ease, background-color 150ms ease;
}

.switch-field input:checked + .switch-ui::after {
  background: var(--acid);
  transform: translateX(1.52rem);
}

.switch-field input:focus-visible + .switch-ui {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.action-bar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding: 1.2rem;
  border: var(--border);
  background: var(--surface-raised);
}

.action-bar .eyebrow {
  margin-bottom: 0.25rem;
}

.action-bar p {
  margin-bottom: 0;
}

.unavailable-field {
  border-color: color-mix(in srgb, var(--orange) 46%, var(--line));
  background: linear-gradient(90deg, rgba(181, 139, 91, 0.055), transparent 72%);
}

.unavailable-field .field-label {
  color: var(--muted);
}

.unavailable-field input,
.unavailable-field .switch-ui {
  filter: saturate(0.35);
  opacity: 0.62;
}

.field-hint {
  grid-column: 1 / -1;
  color: #c4a171;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.45;
}

.switch-field .field-hint {
  grid-column: 2;
}

.notice.warning.usb-reconnect-notice {
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange) 11%, var(--surface-raised));
  color: var(--ink);
}

.usb-reconnect-notice > div {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
}

.usb-reconnect-notice span {
  color: var(--muted);
}

.usb-reconnect-notice .button {
  flex: 0 0 auto;
  border-color: var(--orange);
}

#factory-reset-config-button {
  border-style: double;
  border-width: 3px;
}

.controller-lab-console {
  position: relative;
  min-width: 0;
  margin-bottom: 1.25rem;
  overflow: hidden;
  border: var(--border);
  background:
    linear-gradient(rgba(157, 184, 173, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 184, 173, 0.025) 1px, transparent 1px),
    var(--surface);
  background-size: 2.4rem 2.4rem;
}

.controller-lab-console::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(157, 184, 173, 0.09);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translate(45%, -52%);
}

.controller-lab-heading {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.2rem, 2.5vw, 2.25rem);
  border-bottom: var(--border);
}

.controller-lab-heading > div:first-child {
  min-width: 0;
}

.controller-lab-heading .section-overline {
  margin-bottom: 0.75rem;
}

.controller-lab-heading h3 {
  margin: 0;
  font-size: clamp(2.7rem, 5.5vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.82;
  text-transform: uppercase;
}

.controller-stream-state {
  display: grid;
  grid-template-columns: auto minmax(9rem, 1fr) minmax(12rem, 1fr);
  min-width: min(100%, 27rem);
  align-items: center;
  border: var(--border);
  background: rgba(11, 14, 15, 0.72);
}

.controller-stream-state > span:not(.controller-stream-dot) {
  display: grid;
  min-height: 3.7rem;
  align-content: center;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  border-left: var(--border);
}

.controller-stream-state small,
.controller-health-strip span,
.controller-module-label span,
.controller-button-panel > p,
.controller-analysis-table caption,
.controller-analysis-table th,
.controller-sensor-grid dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.controller-stream-state span[id] {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 800;
}

.controller-stream-state b {
  justify-self: end;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.controller-stream-dot {
  width: 0.58rem;
  height: 0.58rem;
  margin: 0.9rem;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 0.28rem rgba(127, 139, 135, 0.09);
}

.controller-lab-console[data-state="live"] .controller-stream-dot {
  background: var(--success);
  box-shadow: 0 0 0.8rem rgba(145, 186, 165, 0.42);
  animation: controller-live-pulse 1.8s ease-in-out infinite;
}

@keyframes controller-live-pulse {
  50% { opacity: 0.5; transform: scale(0.78); }
}

.controller-health-strip {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  border-bottom: var(--border);
}

.controller-health-strip > div {
  display: grid;
  min-width: 10rem;
  flex: 1 1 10rem;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-right: var(--border);
}

.controller-health-strip span[id] {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.77rem;
  font-weight: 800;
}

.controller-health-strip > p {
  display: flex;
  min-width: 20rem;
  flex: 1.5 1 22rem;
  align-items: center;
  margin: 0;
  padding: 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.controller-lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  min-width: 0;
}

.controller-live-inputs,
.controller-sensor-panel,
.controller-analysis-panel {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.75rem);
}

.controller-live-inputs {
  border-right: var(--border);
}

.controller-data-column {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
}

.controller-sensor-panel {
  border-bottom: var(--border);
}

.controller-subheading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.controller-subheading > span {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  background: var(--acid);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 900;
}

.controller-subheading > div {
  min-width: 0;
}

.controller-subheading h4 {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.controller-subheading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.controller-stick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  border-top: var(--border);
  border-left: var(--border);
}

.controller-stick-module {
  min-width: 0;
  padding: 1rem;
  border-right: var(--border);
  border-bottom: var(--border);
  background: rgba(11, 14, 15, 0.58);
}

.controller-module-label {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.controller-module-label span[id] {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 800;
}

.controller-stick-pad {
  position: relative;
  width: min(100%, 15rem);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(157, 184, 173, 0.06), transparent 58%),
    var(--bg);
}

.controller-stick-ring {
  position: absolute;
  inset: 18%;
  border: 1px dashed var(--line-bright);
  border-radius: 50%;
}

.controller-stick-axis {
  position: absolute;
  background: var(--line);
}

.controller-stick-axis.axis-x {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.controller-stick-axis.axis-y {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.controller-stick-point {
  --stick-left: 50%;
  --stick-top: 50%;
  position: absolute;
  z-index: 2;
  top: var(--stick-top);
  left: var(--stick-left);
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 0.32rem rgba(157, 184, 173, 0.13), 0 0 1rem rgba(157, 184, 173, 0.32);
  transform: translate(-50%, -50%);
  transition: top 70ms linear, left 70ms linear;
}

.controller-trigger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  margin-top: 0.8rem;
  border-top: var(--border);
  border-left: var(--border);
}

.controller-trigger-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-right: var(--border);
  border-bottom: var(--border);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
}

.controller-trigger-grid progress {
  width: 100%;
  height: 0.45rem;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--line);
  accent-color: var(--acid);
}

.controller-trigger-grid progress::-webkit-progress-bar {
  background: var(--line);
}

.controller-trigger-grid progress::-webkit-progress-value {
  background: var(--acid);
}

.controller-trigger-grid progress::-moz-progress-bar {
  background: var(--acid);
}

.controller-trigger-grid span[id] {
  min-width: 3.2rem;
  color: var(--acid);
  text-align: right;
}

.controller-button-panel {
  margin-top: 0.8rem;
  padding: 1rem;
  border: var(--border);
  background: rgba(11, 14, 15, 0.48);
}

.controller-button-panel > p {
  margin-bottom: 0.75rem;
}

.controller-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.6rem, 1fr));
  min-width: 0;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.controller-input-key {
  display: flex;
  min-width: 0;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem;
  border: var(--border);
  background: var(--surface-raised);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background-color 80ms linear, border-color 80ms linear, color 80ms linear, box-shadow 80ms linear;
}

.controller-input-key small {
  color: inherit;
  font-size: 0.5rem;
}

.controller-input-key[data-active="true"] {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--bg);
  box-shadow: 0 0 0.9rem rgba(157, 184, 173, 0.22);
}

.controller-sensor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
  border-top: var(--border);
  border-left: var(--border);
}

.controller-sensor-grid > div {
  display: grid;
  min-width: 0;
  gap: 0.55rem;
  padding: 0.9rem;
  border-right: var(--border);
  border-bottom: var(--border);
  background: rgba(11, 14, 15, 0.5);
}

.controller-sensor-grid dd {
  min-width: 0;
  margin: 0;
}

.controller-sensor-grid span[id] {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.controller-analysis-panel {
  background: linear-gradient(145deg, rgba(157, 184, 173, 0.055), transparent 48%);
}

.controller-analysis-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: var(--border);
  background: rgba(11, 14, 15, 0.56);
}

.controller-analysis-table caption {
  padding: 0 0 0.65rem;
  text-align: left;
}

.controller-analysis-table th,
.controller-analysis-table td {
  min-width: 0;
  padding: 0.7rem 0.55rem;
  border-right: var(--border);
  border-bottom: var(--border);
  text-align: left;
  overflow-wrap: anywhere;
}

.controller-analysis-table th:last-child,
.controller-analysis-table td:last-child {
  border-right: 0;
}

.controller-analysis-table tbody tr:last-child > * {
  border-bottom: 0;
}

.controller-analysis-table tbody th {
  color: var(--muted);
}

.controller-analysis-table span[id] {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
}

.controller-analysis-footnote {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.controller-lab-console + .feature-grid {
  margin-top: 1.25rem;
}

.feature-card {
  min-height: 24rem;
}

.feature-glyph {
  margin-bottom: auto;
}

.feature-card h3 {
  margin-top: 3rem;
}

.feature-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.protocol-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  min-width: 0;
  align-items: stretch;
  border: var(--border);
}

.protocol-map article {
  min-width: 0;
  min-height: 18rem;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  background: var(--surface);
}

.protocol-map article span {
  display: block;
  margin-bottom: 5rem;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.protocol-map article strong {
  display: block;
  margin-bottom: 0.7rem;
  font-size: clamp(1.7rem, 3vw, 3.3rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.protocol-map article p {
  color: var(--muted);
}

.protocol-map > i {
  display: grid;
  width: 3rem;
  place-items: center;
  border-right: var(--border);
  border-left: var(--border);
  background: var(--surface-soft);
  color: var(--acid);
  font-family: var(--mono);
  font-style: normal;
  font-weight: 900;
}

.diagnostic-callout .text-link {
  margin-top: 0.8rem;
}

.firmware-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  min-width: 0;
  align-items: stretch;
  border: var(--border);
  background: var(--surface);
}

.firmware-current,
.firmware-inspect {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  border-right: var(--border);
}

.firmware-current strong {
  margin: 0.5rem 0;
  color: var(--acid);
  font-size: clamp(3rem, 6vw, 6rem);
  letter-spacing: -0.07em;
  line-height: 0.9;
  overflow-wrap: anywhere;
}

.firmware-current > span:last-child,
.firmware-inspect p {
  color: var(--muted);
  font-size: 0.82rem;
}

.firmware-inspect p {
  margin: 0.8rem 0 0;
}

.firmware-release-link {
  align-self: stretch;
  border: 0;
  background: var(--surface-raised);
}

.verification-result {
  grid-column: 1 / -1;
  padding: 1rem;
  border-top: var(--border);
  color: var(--ink);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.file-button:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.log-view {
  min-width: 0;
  min-height: 24rem;
  max-height: 60vh;
  padding: 1rem;
  overflow: auto;
  border: var(--border);
  background: #050706;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.65;
}

.log-line {
  min-width: 0;
  padding: 0.25rem 0;
  border-bottom: 1px solid #242a25;
  overflow-wrap: anywhere;
}

.log-error {
  color: #ffaaa7;
}

.log-info {
  color: #aab8c2;
}

@media (hover: hover) {
  .workflow-card:hover,
  .settings-card:hover,
  .feature-card:hover {
    z-index: 2;
    border-color: var(--line-bright);
    background-color: var(--surface-raised);
    box-shadow: 0 1.2rem 2.5rem rgba(0, 0, 0, 0.2);
    transform: translateY(-0.25rem);
  }
}

@keyframes section-reveal {
  from {
    transform: translateY(2.25rem);
  }

  to {
    transform: translateY(0);
  }
}

@supports (animation-timeline: view()) {
  .content-section > * {
    animation: section-reveal linear both;
    animation-range: entry 0 entry 34%;
    animation-timeline: view();
  }
}

.footer {
  display: flex;
  width: min(100%, var(--max-width));
  min-width: 0;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 2.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.confirm-dialog {
  width: min(38rem, calc(100vw - 2rem));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line-bright);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.dialog-card {
  min-width: 0;
  padding: clamp(1.3rem, 4vw, 3rem);
}

.dialog-card h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
  overflow-wrap: anywhere;
}

.dialog-card > p:not(.eyebrow) {
  color: var(--muted);
  overflow-wrap: anywhere;
}

#confirm-message {
  max-height: min(50vh, 28rem);
  overflow-y: auto;
  white-space: pre-line;
}

#controller-lab-body {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  margin: 1rem 0;
}

#controller-lab-body .log-line {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

@media (max-width: 1180px) {
  .operations-grid {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.9fr);
  }

  .hero-copy h1 {
    font-size: clamp(3.7rem, 8.6vw, 6.6rem);
  }

  .console-body {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    border-right: 0;
    border-bottom: var(--border);
  }

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

  .firmware-inspect {
    border-right: 0;
  }

  .firmware-release-link,
  .verification-result {
    grid-column: 1 / -1;
    min-height: 4rem;
    border-top: var(--border);
  }
}

@media (max-width: 820px) {
  body {
    background: var(--bg);
  }

  .chrome-primary {
    min-height: 4rem;
  }

  .site-brand-copy small {
    display: none;
  }

  .version-chip {
    display: none;
  }

  .operations-hero {
    display: flex;
    flex-direction: column;
    border-right: 0;
    border-left: 0;
  }

  .stage-index {
    order: 0;
    grid-template-columns: 1fr 1fr;
  }

  .stage-index span:nth-child(2) {
    display: none;
  }

  .operations-grid {
    display: contents;
  }

  .hero-copy {
    order: 3;
    min-height: 21rem;
    padding: 2.5rem 0 1rem;
    border-top: var(--border);
    border-right: 0;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: clamp(3.5rem, 16.5vw, 6.2rem);
  }

  .hero-lede {
    max-width: 31rem;
  }

  .signal-map {
    display: none;
  }

  .connection-surface {
    order: 1;
    margin: 0 calc(var(--gutter) * -1);
    padding: 1.5rem var(--gutter);
  }

  .live-console {
    order: 2;
  }

  .panel-marker {
    margin-bottom: 2rem;
  }

  .console-heading {
    align-items: flex-start;
    padding: 1rem 0;
  }

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

  .metric-card {
    padding: 0.75rem;
  }

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

  .system-rail {
    align-items: flex-start;
    flex-direction: column;
    border-right: 0;
    border-left: 0;
  }

  .tab-panel {
    border-right: 0;
    border-left: 0;
  }

  .section-heading {
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: clamp(2.9rem, 13vw, 5.8rem);
  }

  .panel-status {
    text-align: left;
  }

  .workflow-grid,
  .feature-grid,
  .backup-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .workflow-card,
  .feature-card,
  .settings-card {
    min-height: 20rem;
  }

  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .action-bar .action-row,
  .action-bar .button {
    width: 100%;
  }

  .protocol-map {
    grid-template-columns: 1fr;
  }

  .protocol-map article {
    min-height: 14rem;
  }

  .protocol-map article span {
    margin-bottom: 3rem;
  }

  .protocol-map > i {
    width: auto;
    min-height: 3rem;
    border: 0;
    border-top: var(--border);
    border-bottom: var(--border);
    transform: none;
  }

  .protocol-map > i::first-letter {
    transform: rotate(90deg);
  }

  .firmware-panel {
    grid-template-columns: 1fr;
  }

  .firmware-current,
  .firmware-inspect {
    border-right: 0;
    border-bottom: var(--border);
  }

  .firmware-release-link,
  .verification-result {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 0.85rem;
  }

  .site-brand-mark {
    width: 2.35rem;
    height: 2.35rem;
  }

  .site-brand-copy strong {
    font-size: 1.08rem;
  }

  .status-chip {
    max-width: 9.7rem;
    font-size: 0.6rem;
  }

  .hero-copy {
    min-height: 18rem;
    padding-top: 2rem;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 16vw, 4.5rem);
  }

  .connection-surface .panel-status {
    align-self: flex-start;
  }

  .connection-surface-heading,
  .console-heading {
    align-items: flex-start;
  }

  .notice {
    flex-direction: column;
  }

  .device-card {
    align-items: stretch;
    flex-direction: column;
  }

  .device-card .action-row,
  .device-card .button {
    width: 100%;
  }

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

  .metric-card {
    padding: 0.6rem;
    border-right: var(--border);
    border-bottom: 0;
  }

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

  .metric-label,
  .metric-note {
    font-size: 0.58rem;
  }

  .metric-value {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }

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

  .section-heading h2 {
    font-size: clamp(2.6rem, 15vw, 4.4rem);
  }

  .workflow-card,
  .feature-card,
  .settings-card {
    min-height: 0;
  }

  .workflow-index,
  .feature-glyph {
    margin-bottom: 2.5rem;
  }

  .workflow-card h3,
  .feature-card h3,
  .settings-card h3 {
    font-size: 2rem;
  }

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

  .callout {
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
  }

  #controller-lab-body .log-line {
    align-items: stretch;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .shell::before,
  .shell::after,
  body::before,
  .connection-surface::after {
    display: none;
  }

  .content-section > * {
    animation: none !important;
    transform: none;
  }
}

@media (forced-colors: active) {
  .status-dot,
  .system-rail-live i,
  .signal-pulse,
  .switch-ui::after,
  .controller-stream-dot,
  .controller-stick-point {
    forced-color-adjust: none;
  }

  .button.primary,
  .console-number,
  .card-kicker,
  .feature-glyph,
  .callout-icon {
    border: 2px solid CanvasText;
  }

  .controller-input-key[data-active="true"] {
    border: 2px solid Highlight;
  }
}
