@font-face {
  font-family: "OCR-A";
  src: url("/assets/FONT_OCRA.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Terminus";
  src: url("/assets/FONT_Terminus.otf") format("opentype");
  font-display: swap;
}

:root {
  --blue: #2f31e8;
  --blue-bright: #5557ff;
  --yellow: #caff16;
  --cyan: #58e8f2;
  --magenta: #e95cff;
  --coral: #ff5b52;
  --paper: #d9dce2;
  --black: #050507;
  --ink: #0b0b0e;
  --panel: #111116;
  --panel-raised: #1b1b21;
  --white: #fff;
  --muted: #9ba6b8;
  --muted-strong: #c4ccda;
  --danger: #ff5b52;
  --success: #16e66f;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.26);
  --line-blue: rgba(47, 49, 232, 0.82);
  --header-height: 80px;
  --footer-height: 42px;
  --font-tech: "OCR-A", ui-monospace, monospace;
  --font-mono: "Terminus", "Cascadia Mono", ui-monospace, monospace;
  --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--black);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(88, 232, 242, 0.045) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px) 0 0 / 64px 64px,
    var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: geometricPrecision;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--white);
  cursor: pointer;
  font-family: var(--font-tech);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover:not(:disabled) {
  border-color: var(--yellow);
  background: rgba(202, 255, 22, 0.09);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

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

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--yellow);
  color: #000;
  font-family: var(--font-tech);
}

.app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: 202px minmax(280px, 1fr) minmax(190px, auto) auto;
  height: var(--header-height);
  border-bottom: 1px solid var(--line-strong);
  background: #000;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
}

.app-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--yellow) 0 18%,
    var(--cyan) 18% 48%,
    var(--blue) 48% 82%,
    var(--coral) 82% 100%);
  pointer-events: none;
}

.brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
  background: var(--blue);
}

.brand-panel::after {
  content: "SC/01";
  position: absolute;
  right: 8px;
  bottom: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 9px;
}

.brand-panel img {
  width: 142px;
  max-width: 100%;
  max-height: 44px;
}

.product-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 10px 26px;
  border-right: 1px solid var(--line);
}

.product-heading .eyebrow,
.panel-code {
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.product-heading strong {
  overflow: hidden;
  font-family: var(--font-tech);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.055em;
  line-height: 1.08;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-heading__subtitle {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-telemetry {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  gap: 2px 9px;
  min-width: 190px;
  padding: 0 22px;
  border-right: 1px solid var(--line);
  color: var(--muted-strong);
  font-family: var(--font-tech);
  font-size: 11px;
}

.status-dot {
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #606773;
  box-shadow: 0 0 0 3px rgba(96, 103, 115, 0.13);
}

.status-dot.is-online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(99, 230, 155, 0.13), 0 0 12px rgba(99, 230, 155, 0.5);
}

.header-telemetry__port {
  grid-column: 2;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.header-actions {
  display: flex;
  min-width: 164px;
  align-items: stretch;
}

.header-mode,
.header-home {
  display: flex;
  min-width: 82px;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  font-family: var(--font-tech);
  font-size: 11px;
  text-decoration: none;
}

.header-mode[aria-pressed="false"] {
  background: var(--yellow);
  color: #000;
}

.header-home:hover,
.header-mode:hover {
  background: var(--blue);
  color: var(--white);
}

.header-actions .language-picker {
  flex: 0 0 52px;
  margin-inline-start: 0;
}

.header-actions .language-picker__button {
  width: 52px;
  min-height: 100%;
  border: 0;
  border-radius: 0;
}

.browser-gate {
  position: fixed;
  inset: var(--header-height) 0 auto;
  z-index: 45;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--danger);
  background: #2b0e0b;
}

.browser-gate div {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.browser-gate p {
  margin: 0 0 0 auto;
  color: #ffc1b8;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - var(--footer-height));
  padding-top: var(--header-height);
}

.device-rail {
  position: sticky;
  top: var(--header-height);
  display: flex;
  height: calc(100vh - var(--header-height));
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line-strong);
  background: rgba(4, 7, 12, 0.93);
  scrollbar-width: thin;
}

.rail-card {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.connection-card {
  background:
    linear-gradient(140deg, rgba(47, 49, 232, 0.36), transparent 62%),
    rgba(10, 14, 23, 0.92);
}

.panel-heading,
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h1,
.panel-heading h2,
.section-intro h2,
.card-heading h3,
.confirm-dialog h2 {
  margin: 4px 0 0;
  font-family: var(--font-tech);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.15;
  text-transform: uppercase;
}

.panel-heading h1 {
  font-size: 18px;
}

.panel-heading h2 {
  font-size: 14px;
}

.panel-heading--compact {
  align-items: center;
}

.state-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.state-badge[data-state="online"],
.state-badge[data-state="pass"] {
  border-color: rgba(99, 230, 155, 0.62);
  color: var(--success);
}

.state-badge[data-state="busy"],
.state-badge[data-state="pending"] {
  border-color: rgba(202, 255, 22, 0.65);
  color: var(--yellow);
}

.state-badge[data-state="fail"] {
  border-color: rgba(255, 114, 95, 0.7);
  color: var(--danger);
}

.primary-action {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, 0.8);
  background: var(--yellow);
  color: #000;
}

.primary-action span {
  padding: 0 16px;
}

.primary-action strong {
  align-self: stretch;
  display: flex;
  min-width: 54px;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(0, 0, 0, 0.26);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
}

.primary-action:hover:not(:disabled) {
  border-color: var(--yellow);
  background: var(--blue);
  color: var(--white);
}

.primary-action:hover:not(:disabled) strong {
  border-left-color: rgba(255, 255, 255, 0.25);
}

.connect-action {
  width: 100%;
  margin-top: 19px;
}

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

.icon-action {
  width: 34px;
  min-height: 34px;
  font-size: 18px;
}

.identity-grid,
.live-grid {
  display: grid;
  margin: 18px 0 0;
}

.identity-grid {
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.identity-grid div {
  min-width: 0;
  padding: 10px;
  background: rgba(5, 8, 13, 0.92);
}

.identity-grid dt,
.live-grid dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.identity-grid dd,
.live-grid dd {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
}

.live-card {
  flex: 1 0 auto;
}

.live-level {
  margin-top: 18px;
  padding: 16px;
  border-left: 3px solid var(--yellow);
  background: rgba(47, 49, 232, 0.22);
}

.live-level span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.live-level strong {
  display: block;
  margin-top: 3px;
  color: var(--yellow);
  font-family: var(--font-tech);
  font-size: 22px;
  font-weight: 400;
}

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

.live-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.live-flags span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: #6d7582;
  font-family: var(--font-mono);
  font-size: 9px;
}

.live-flags span.is-active {
  border-color: var(--yellow);
  color: var(--yellow);
}

.workspace {
  min-width: 0;
}

.workspace-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  display: flex;
  min-height: 52px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(5, 7, 11, 0.96);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
}

.workspace-tabs button {
  min-width: 145px;
  min-height: 51px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.workspace-tabs button[aria-selected="true"] {
  background: var(--blue);
  color: var(--white);
}

.workspace-tabs button[aria-selected="true"]::before {
  content: "[>] ";
  color: var(--yellow);
}

.workspace-scroll {
  min-height: calc(100vh - var(--header-height) - 52px);
}

.workspace-panel {
  display: none;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 3.2vw, 48px);
}

.workspace-panel.is-active {
  display: block;
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(300px, 0.6fr);
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.section-intro h2 {
  font-size: clamp(25px, 3vw, 39px);
}

.section-intro p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.utility-card {
  min-width: 0;
  padding: 20px;
  border: 0;
  border-top: 8px solid var(--blue);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 36%),
    rgba(10, 14, 22, 0.87);
  box-shadow: inset 0 0 0 1px var(--line);
}

.levels-card,
.fan-test-card,
.trace-card {
  border-top-color: var(--cyan);
}

.config-grid > .utility-card,
.fanlog-card,
.production-card {
  border-top-color: var(--magenta);
}

.config-stack .utility-card:first-child,
.firmware-card {
  border-top-color: var(--yellow);
}

.config-stack .utility-card:last-child {
  border-top-color: var(--coral);
}

.card-heading {
  align-items: center;
  margin-bottom: 17px;
}

.card-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-index {
  color: var(--yellow);
  font-family: var(--font-tech);
  font-size: 11px;
}

.card-heading h3 {
  margin: 0;
  font-size: 15px;
}

.card-heading output {
  color: var(--yellow);
  font-family: var(--font-tech);
  font-size: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row button {
  padding: 0 12px;
}

.danger-action {
  border-color: rgba(255, 114, 95, 0.48);
  color: #ff9a8c;
}

.danger-action:hover:not(:disabled) {
  border-color: var(--danger);
  background: rgba(255, 114, 95, 0.12);
  color: #ffc0b7;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
}

.table-wrap--tall {
  max-height: 460px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 90px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  background: #1b1b21;
  color: var(--muted-strong);
  font-family: var(--font-tech);
  font-size: 10px;
  font-weight: 400;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted-strong);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:not(.empty-row):hover td {
  background: rgba(47, 49, 232, 0.13);
}

.data-table tr.is-selected td {
  background: rgba(202, 255, 22, 0.06);
}

.data-table input[type="number"],
.data-table select,
.field-grid input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #06090e;
  color: var(--white);
  font-family: var(--font-mono);
}

.data-table input[type="number"],
.field-grid input {
  padding: 5px 8px;
}

.data-table select {
  min-width: 108px;
  padding: 4px 28px 4px 8px;
}

.data-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--yellow);
}

.levels-table th:nth-child(3) {
  min-width: 130px;
}

.levels-table th:nth-child(4) {
  min-width: 118px;
}

.levels-table th:nth-child(6) {
  min-width: 170px;
}

.select-column {
  min-width: 44px !important;
  width: 44px;
}

.order-controls {
  display: flex;
  gap: 5px;
}

.order-controls button {
  width: 29px;
  min-height: 29px;
  padding: 0;
  font-family: var(--font-mono);
}

.empty-row td {
  height: 68px;
  color: var(--muted);
  text-align: center;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(400px, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.config-stack {
  display: grid;
  align-content: start;
  gap: 18px;
}

.range-control {
  display: block;
  padding: 12px 4px 5px;
}

.range-control input {
  width: 100%;
  accent-color: var(--yellow);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.input-suffix {
  position: relative;
  display: block;
}

.input-suffix input {
  padding-right: 36px;
}

.input-suffix em {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: var(--yellow);
  font-style: normal;
}

.apply-dock {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(3, 5, 8, 0.94);
  backdrop-filter: blur(12px);
}

.apply-dock__file-actions,
.apply-dock__danger {
  display: flex;
  gap: 8px;
}

.apply-dock__file-actions {
  margin-right: auto;
}

.apply-dock button:not(.primary-action) {
  padding: 0 13px;
}

.apply-action {
  min-width: 260px;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.75fr) minmax(520px, 1.25fr);
  gap: 18px;
}

.fan-test-card canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 310px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: #05080d;
}

.firmware-card {
  max-width: 980px;
}

.firmware-release {
  padding: 18px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(47, 49, 232, 0.2), transparent 58%),
    #060a11;
}

.firmware-release[data-state="available"] {
  border-color: rgba(202, 255, 22, 0.72);
  box-shadow: inset 4px 0 0 var(--yellow);
}

.firmware-release[data-state="current"] {
  border-color: rgba(99, 230, 155, 0.5);
  box-shadow: inset 4px 0 0 var(--success);
}

.firmware-release[data-state="error"],
.firmware-release[data-state="unavailable"] {
  border-color: rgba(255, 114, 95, 0.48);
}

.firmware-release .card-heading {
  margin-bottom: 10px;
}

.firmware-release__intro,
.firmware-release__status {
  margin: 0;
  color: var(--muted);
}

.firmware-release__versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.firmware-release__versions div {
  min-width: 0;
  padding: 13px;
  background: rgba(2, 5, 9, 0.92);
}

.firmware-release__versions dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.firmware-release__versions dd {
  margin: 5px 0 0;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.firmware-release__status {
  min-height: 21px;
  margin-top: 13px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 12px;
}

.firmware-release__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.firmware-release__actions > button {
  min-height: 44px;
  padding: 0 16px;
}

.firmware-release__actions .primary-action {
  width: min(100%, 340px);
  padding: 0;
}

.firmware-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.firmware-divider::before,
.firmware-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.drop-zone {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(90deg, rgba(88, 232, 242, 0.09) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    rgba(3, 6, 11, 0.62);
  cursor: pointer;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--yellow);
  background-color: rgba(202, 255, 22, 0.04);
}

.drop-zone[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

.drop-zone[aria-disabled="true"]:hover {
  border-color: var(--line-strong);
  background-color: transparent;
}

.drop-zone__icon {
  color: var(--yellow);
  font-family: var(--font-tech);
  font-size: 38px;
}

.drop-zone strong {
  font-family: var(--font-tech);
  font-size: 16px;
  font-weight: 400;
  text-transform: uppercase;
}

.drop-zone p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.firmware-package {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--line);
}

.firmware-package div {
  min-width: 0;
  padding: 13px;
  background: #070b12;
}

.firmware-package span,
.firmware-package strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firmware-package span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.firmware-package strong {
  margin-top: 5px;
  color: var(--white);
  font-size: 12px;
  font-weight: 400;
}

.firmware-progress {
  margin-top: 18px;
}

.firmware-progress div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 12px;
}

.firmware-progress progress {
  width: 100%;
  height: 13px;
  border: 0;
  border-radius: 0;
  background: #020304;
}

.firmware-progress progress::-webkit-progress-bar {
  background: #020304;
}

.firmware-progress progress::-webkit-progress-value {
  background: var(--yellow);
}

.bootloader-notice {
  margin-top: 16px;
  padding: 16px;
  border-left: 3px solid var(--yellow);
  background: rgba(202, 255, 22, 0.07);
}

.bootloader-notice strong {
  font-family: var(--font-tech);
  font-weight: 400;
  text-transform: uppercase;
}

.bootloader-notice p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.bootloader-notice button {
  padding: 0 14px;
}

.firmware-update-action {
  width: min(100%, 420px);
  margin: 18px 0 0 auto;
}

.production-card {
  max-width: 1100px;
}

.production-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.production-actions .primary-action {
  min-width: 280px;
  margin-right: auto;
  padding: 0;
}

.result-pass {
  color: var(--success);
}

.result-fail {
  color: var(--danger);
}

.result-pending {
  color: var(--yellow);
}

.trace-list {
  display: grid;
  max-height: min(620px, calc(100vh - 310px));
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: auto;
  background: var(--line);
  list-style: none;
  counter-reset: trace;
}

.trace-list li {
  display: grid;
  grid-template-columns: 86px 34px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 12px;
  background: #05080d;
  font-family: var(--font-mono);
  font-size: 12px;
}

.trace-list time {
  color: var(--muted);
}

.trace-direction {
  color: var(--success);
}

.trace-direction.is-rx {
  color: var(--yellow);
}

.trace-hex {
  overflow-wrap: anywhere;
  color: var(--muted-strong);
}

.trace-empty {
  display: block !important;
  padding: 28px !important;
  color: var(--muted);
  text-align: center;
}

.confirm-dialog {
  width: min(520px, calc(100% - 30px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #0b1019;
  color: var(--white);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 24px;
}

.confirm-dialog h2 {
  font-size: 21px;
}

.confirm-dialog p {
  margin: 14px 0 22px;
  color: var(--muted);
}

.confirm-dialog .button-row {
  justify-content: flex-end;
}

.confirm-dialog button {
  min-width: 110px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 58px;
  z-index: 80;
  display: grid;
  width: min(390px, calc(100% - 36px));
  gap: 8px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--yellow);
  background: rgba(8, 12, 18, 0.97);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
  color: var(--muted-strong);
}

.toast.is-error {
  border-left-color: var(--danger);
}

.toast.is-success {
  border-left-color: var(--success);
}

footer {
  position: relative;
  z-index: 25;
  display: flex;
  min-height: var(--footer-height);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  background: #000;
  color: #737b88;
  font-family: var(--font-mono);
  font-size: 10px;
}

footer b {
  color: var(--yellow);
  font-weight: 400;
}

body[data-mode="simple"] [data-advanced],
body[data-mode="simple"] [data-capability="production"] {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 176px 1fr auto;
  }

  .brand-panel {
    padding: 0 22px;
  }

  .header-telemetry {
    display: none;
  }

  .app-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .device-rail .rail-card {
    padding: 18px;
  }

  .config-grid,
  .diagnostics-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  :root {
    --header-height: 122px;
  }

  .app-header {
    grid-template-columns: 130px minmax(0, 1fr);
    grid-template-rows: 80px 42px;
    height: var(--header-height);
  }

  .brand-panel {
    grid-column: 1;
    grid-row: 1;
    padding: 0 14px;
  }

  .product-heading {
    grid-column: 2;
    grid-row: 1;
    padding: 9px 15px;
    border-right: 0;
  }

  .product-heading strong {
    font-size: 17px;
  }

  .product-heading__subtitle {
    font-size: 10px;
  }

  .header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    border-top: 1px solid var(--line);
  }

  .header-mode,
  .header-home {
    min-width: 0;
    flex: 1 1 auto;
  }

  .app-shell {
    display: block;
  }

  .device-rail {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .connection-card,
  .live-card {
    min-height: 230px;
  }

  .identity-card {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workspace-tabs {
    top: var(--header-height);
  }

  .workspace-panel {
    padding: 24px 15px;
  }

  .section-intro {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .apply-dock {
    flex-wrap: wrap;
  }

  .apply-dock__file-actions {
    order: 1;
    width: 100%;
  }

  .apply-dock__danger {
    margin-right: auto;
  }

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

@media (max-width: 560px) {
  .product-heading .eyebrow,
  .product-heading__subtitle {
    display: none;
  }

  .product-heading strong {
    white-space: normal;
  }

  .device-rail {
    display: block;
  }

  .connection-card,
  .live-card {
    min-height: 0;
  }

  .workspace-tabs button {
    min-width: 126px;
  }

  .card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-heading .button-row {
    width: 100%;
  }

  .card-heading .button-row button {
    flex: 1 1 auto;
  }

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

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

  .apply-dock__danger,
  .apply-action {
    width: 100%;
  }

  .apply-dock__danger button {
    width: 100%;
  }

  .apply-action {
    min-width: 0;
  }

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

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

  .firmware-release__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .firmware-release__actions > button,
  .firmware-release__actions .primary-action {
    width: 100%;
  }

  .production-actions .primary-action {
    min-width: 100%;
  }

  .trace-list li {
    grid-template-columns: 68px 30px minmax(0, 1fr);
    gap: 7px;
    font-size: 10px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
