:root {
  color-scheme: dark;
  --bg-deep: #07090a;
  --bg: #0b0f10;
  --surface: #111719;
  --surface-raised: #172023;
  --surface-bright: #202a2d;
  --line: #344044;
  --line-soft: #222c2f;
  --text: #f3f5ef;
  --text-secondary: #aeb8b5;
  --text-dim: #74807c;
  --brand: #e43f32;
  --brand-deep: #7e211c;
  --inner: #5be1ed;
  --inner-deep: #143f44;
  --outer: #ffc44f;
  --outer-deep: #4a3713;
  --success: #b8ed69;
  --success-deep: #223815;
  --warning: #ffbf4b;
  --danger: #ff665d;
  --info: #7ea8ff;
  --focus: #ffffff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --topbar-h: 88px;
  --footer-h: 112px;
  --sidebar-w: 220px;
  --motion: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 10%, rgba(228, 63, 50, 0.09), transparent 28%),
    linear-gradient(135deg, var(--bg-deep), var(--bg) 52%, #0d1416);
  color: var(--text);
  font-family: "Barlow", "Avenir Next", sans-serif;
  font-size: 18px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 18px;
  transform: translateY(-150%);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  transition: transform var(--motion);
}

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

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

.app-shell {
  display: grid;
  grid-template:
    "topbar topbar" var(--topbar-h)
    "sidebar workspace" calc(100dvh - var(--topbar-h) - var(--footer-h))
    "sidebar controls" var(--footer-h)
    / var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

.topbar {
  grid-area: topbar;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(170px, 0.6fr) minmax(460px, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 16, 0.96);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.24);
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(228, 63, 50, 0.18), transparent 56%),
    var(--surface);
}

.brand-logo {
  display: block;
  width: min(180px, 100%);
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

.machine-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px 24px;
  border-right: 1px solid var(--line);
}

.machine-identity strong {
  overflow: hidden;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.system-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  padding: 12px 18px;
}

.status-chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-chip.status-ok {
  border-color: rgba(184, 237, 105, 0.26);
}

.status-chip.status-fault {
  border-color: rgba(255, 102, 93, 0.42);
  background: rgba(255, 102, 93, 0.1);
  color: #ffd1cd;
}

.status-chip.status-placement {
  border-color: rgba(91, 225, 237, 0.38);
  background: rgba(91, 225, 237, 0.08);
  color: #bff8fd;
}

.status-sim {
  border-color: rgba(255, 191, 75, 0.42);
  background: rgba(255, 191, 75, 0.08);
  color: #ffd992;
}

.status-symbol {
  display: inline-grid;
  min-width: 28px;
  min-height: 20px;
  place-items: center;
  background: var(--warning);
  color: #181207;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(184, 237, 105, 0.1);
}

.status-fault .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 102, 93, 0.12);
}

.topbar-actions {
  display: flex;
  border-left: 1px solid var(--line);
}

.utility-button {
  display: grid;
  width: 76px;
  align-content: center;
  border-left: 1px solid var(--line-soft);
  background: transparent;
  transition: background var(--motion), color var(--motion);
}

.utility-button:hover,
.utility-button:active {
  background: var(--surface-bright);
}

.utility-value,
.utility-label {
  display: block;
}

.utility-value {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.utility-label {
  color: var(--text-dim);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar {
  grid-area: sidebar;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 40%),
    var(--surface);
}

.sidebar nav {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 60px;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  transition: background var(--motion), color var(--motion), border-color var(--motion);
}

.nav-item::after {
  position: absolute;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  content: "";
}

.nav-item:hover {
  background: var(--surface-bright);
  color: var(--text);
}

.nav-item.active {
  border-left-color: var(--brand);
  background:
    linear-gradient(90deg, rgba(228, 63, 50, 0.18), transparent 70%),
    var(--surface-bright);
  color: var(--text);
}

.nav-item.active::after {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(228, 63, 50, 0.13);
}

.service-nav {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
}

.nav-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
}

.nav-icon svg,
.deck-button svg,
.button-icon svg,
.metric-icon svg,
.inline-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.nav-copy {
  display: grid;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.nav-number {
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer strong {
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.workspace {
  position: relative;
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
}

.view {
  min-height: 100%;
  padding: clamp(22px, 3vw, 44px);
  animation: view-enter 260ms ease-out both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.94;
}

.page-subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 1.14rem;
}

.step-rail {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-segment {
  width: 42px;
  height: 5px;
  background: var(--line);
}

.step-segment.done {
  background: var(--success);
}

.step-segment.current {
  background: var(--brand);
  box-shadow: 0 0 14px rgba(228, 63, 50, 0.36);
}

.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.025), transparent 45%),
    rgba(17, 23, 25, 0.96);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-index {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
}

.panel-body {
  padding: 20px;
}

.ready-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.5fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.ready-hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: 34px;
  background:
    radial-gradient(circle at 70% 48%, rgba(91, 225, 237, 0.08), transparent 20%),
    linear-gradient(125deg, rgba(228, 63, 50, 0.08), transparent 40%),
    var(--surface);
}

.ready-hero::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  background: var(--success);
  content: "";
}

.ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--success);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3.8rem, 8vw, 7.5rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 0.9;
}

.ready-badge .status-dot {
  width: 14px;
  height: 14px;
}

.ready-copy {
  max-width: 520px;
  margin: 22px 0 28px;
  color: var(--text-secondary);
  font-size: 1.14rem;
}

.primary-button,
.secondary-button,
.mode-button,
.action-tile,
.stepper-button {
  transition:
    background var(--motion),
    color var(--motion),
    border-color var(--motion),
    transform 120ms ease-out;
}

.primary-button:active,
.secondary-button:active,
.mode-button:active,
.action-tile:active,
.stepper-button:active {
  transform: translateY(1px);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button {
  background: var(--brand);
  color: white;
  box-shadow: 0 10px 30px rgba(228, 63, 50, 0.23);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.primary-button:hover {
  background: #f05245;
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface-bright);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--text-dim);
  background: #293438;
}

.button-icon {
  display: inline-grid;
  place-items: center;
}

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

.readiness-list {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.readiness-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.readiness-item::before {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(184, 237, 105, 0.45);
  background: var(--success-deep);
  color: var(--success);
  content: "✓";
  font-size: 0.76rem;
  font-weight: 700;
}

.machine-orbit {
  position: absolute;
  right: -20px;
  bottom: -80px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(91, 225, 237, 0.18);
  border-radius: 50%;
}

.machine-orbit::before,
.machine-orbit::after {
  position: absolute;
  inset: 42px;
  border: 1px solid rgba(91, 225, 237, 0.14);
  border-radius: 50%;
  content: "";
}

.machine-orbit::after {
  inset: 98px;
  border-color: rgba(228, 63, 50, 0.18);
}

.summary-stack {
  display: grid;
  gap: 20px;
}

.metric-list {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
}

.metric-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  background: var(--surface);
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--text-secondary);
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.metric-value {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.workflow-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.workflow-node {
  position: relative;
  min-height: 84px;
  padding: 14px 10px;
  border-top: 3px solid var(--line);
  background: var(--surface);
}

.workflow-node.current {
  border-top-color: var(--brand);
  background: rgba(228, 63, 50, 0.08);
}

.workflow-node span,
.workflow-node strong {
  display: block;
}

.workflow-node span {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.workflow-node strong {
  margin-top: 8px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.92rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.4fr);
  gap: 20px;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dimension-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.dimension-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dimension-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 12px;
}

.dimension-value strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dimension-value span {
  color: var(--text-dim);
}

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

.stepper-button {
  min-height: 46px;
  border: 1px solid var(--line);
  background: var(--surface-bright);
  font-size: 1.2rem;
}

.stepper-button:hover {
  border-color: var(--text-dim);
  background: #293438;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.mode-button {
  display: grid;
  min-height: 78px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  text-align: left;
}

.mode-button:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.mode-button.selected {
  border-color: var(--brand);
  background:
    linear-gradient(90deg, rgba(228, 63, 50, 0.12), transparent),
    var(--surface-bright);
  color: var(--text);
}

.mode-button strong,
.mode-button span {
  display: block;
}

.mode-button strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}

.mode-button span {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 0.76rem;
}

.mode-diagram {
  display: flex;
  align-items: center;
  gap: 4px;
}

.weight-dot {
  width: 13px;
  height: 20px;
  border: 2px solid currentColor;
}

.weight-dot.tape {
  width: 19px;
  height: 8px;
  border-radius: 1px;
}

.wheel-stage {
  position: relative;
  display: grid;
  min-height: 430px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(91, 225, 237, 0.05), transparent 36%),
    var(--surface);
}

.balance-3d-stage {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
}

.balance-3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.balance-view-badge {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  display: grid;
  gap: 2px;
  padding: 9px 12px;
  border-left: 3px solid var(--inner);
  background: rgba(7, 10, 11, 0.86);
  pointer-events: none;
}

.balance-view-badge span,
.balance-view-badge strong {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
}

.balance-view-badge span {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.balance-view-badge strong {
  color: var(--inner);
  font-size: 1rem;
}

.calibration-legend {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 6px;
  padding: 9px 11px;
  background: rgba(7, 10, 11, 0.82);
  pointer-events: none;
}

.calibration-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.calibration-legend i {
  display: inline-block;
  width: 18px;
  height: 4px;
}

.legend-scan {
  background: var(--inner);
  box-shadow: 0 0 7px rgba(91, 225, 237, 0.7);
}

.legend-vector {
  background: var(--outer);
}

.legend-focus {
  background: #ff3329;
  box-shadow: 0 0 7px rgba(255, 51, 41, 0.8);
}

.legend-stop {
  background: var(--success);
  box-shadow: 0 0 7px rgba(184, 237, 105, 0.72);
}

.wheel-stage::before,
.wheel-stage::after {
  position: absolute;
  inset: 10% 14%;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
}

.wheel-stage::after {
  inset: 25% 30%;
}

.wheel-visual {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(350px, 74%);
  aspect-ratio: 1;
  place-items: center;
  perspective: 850px;
  transform-style: preserve-3d;
}

.wheel-floor-shadow {
  position: absolute;
  z-index: -2;
  right: 5%;
  bottom: -4%;
  left: 5%;
  height: 24%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  filter: blur(22px);
  transform: rotateX(72deg);
}

.wheel-assembly {
  position: absolute;
  inset: 5%;
  transform: rotateX(5deg) rotateY(-13deg);
  transform-style: preserve-3d;
}

.wheel-depth {
  position: absolute;
  z-index: 0;
  inset: 3%;
  border: 18px solid #060809;
  border-radius: 50%;
  background: #111719;
  box-shadow:
    19px 4px 0 #090c0d,
    25px 7px 22px rgba(0, 0, 0, 0.66);
}

.wheel-rotor {
  position: absolute;
  z-index: 2;
  inset: 0;
  transform: rotate(var(--target-angle));
  transform-origin: 50% 50%;
  transition: transform 720ms cubic-bezier(0.2, 0.75, 0.18, 1);
  will-change: transform;
}

.wheel-face {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(10px 12px 10px rgba(0, 0, 0, 0.42));
}

.tire-shell {
  stroke: #050708;
  stroke-width: 4;
}

.tire-shoulder {
  fill: none;
  stroke: rgba(166, 181, 184, 0.16);
  stroke-width: 2;
  stroke-dasharray: 2 9;
}

.rim-lip {
  stroke: #d4dbdc;
  stroke-width: 3;
}

.rim-channel {
  fill: #182022;
  stroke: #616e71;
  stroke-width: 3;
}

.spoke-set path {
  fill: url(#spokeSurface);
  stroke: #dbe1e2;
  stroke-width: 1.5;
}

.hub-shadow {
  fill: #151b1d;
  stroke: #6c777a;
  stroke-width: 2;
}

.hub-cap {
  fill: url(#rimSurface);
  stroke: #cbd2d3;
  stroke-width: 2;
}

.lug-set circle {
  fill: #151a1c;
  stroke: #9ba6a8;
  stroke-width: 2;
}

.hub-center {
  fill: var(--brand);
  stroke: #f1a39c;
  stroke-width: 2;
}

.tire-highlight,
.rim-highlight {
  fill: none;
  stroke-linecap: round;
}

.tire-highlight {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 8;
}

.rim-highlight {
  stroke: rgba(255, 255, 255, 0.52);
  stroke-width: 4;
}

.reference-notch {
  fill: var(--success);
  filter: drop-shadow(0 0 7px rgba(150, 255, 113, 0.7));
}

.motion-halo {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(91, 225, 237, 0.24);
  border-radius: 50%;
  opacity: 0.35;
}

.halo-one {
  inset: -1%;
}

.halo-two {
  inset: -8%;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
}

.balance-vector {
  position: absolute;
  z-index: 4;
  top: 4%;
  left: 50%;
  display: block;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border: 3px solid #08100c;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 0 5px rgba(150, 255, 113, 0.18);
  transition: opacity 220ms ease;
}

.inner-vector {
  background: var(--inner);
}

.outer-vector {
  top: 96%;
  background: var(--outer);
}

.wheel-visual:not(.spinning) .balance-vector {
  opacity: 1;
}

.wheel-motion-state {
  position: absolute;
  z-index: 6;
  right: -2%;
  bottom: 4%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 12, 0.9);
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.wheel-motion-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(150, 255, 113, 0.6);
}

.wheel-visual.spinning .wheel-rotor {
  animation: wheel-spin-3d 470ms linear infinite;
}

.wheel-visual.spinning .wheel-face {
  filter:
    blur(0.7px)
    drop-shadow(10px 12px 10px rgba(0, 0, 0, 0.42));
}

.wheel-visual.spinning .motion-halo {
  animation: halo-pulse 720ms ease-in-out infinite alternate;
  border-color: rgba(150, 255, 113, 0.42);
}

.wheel-visual.spinning .wheel-motion-state i,
.wheel-visual.indexing .wheel-motion-state i {
  animation: status-blink 420ms steps(1, end) infinite;
}

.wheel-visual.indexing .wheel-rotor {
  animation: wheel-index 900ms cubic-bezier(0.16, 0.72, 0.12, 1) both;
}

@keyframes wheel-spin-3d {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes wheel-index {
  0% {
    transform: rotate(calc(var(--target-angle) - 210deg));
  }
  72% {
    transform: rotate(calc(var(--target-angle) + 7deg));
  }
  100% {
    transform: rotate(var(--target-angle));
  }
}

@keyframes halo-pulse {
  to {
    opacity: 0.8;
    transform: scale(1.035);
  }
}

@keyframes status-blink {
  50% {
    opacity: 0.35;
  }
}

.plane-marker {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 72px;
  min-height: 42px;
  place-items: center;
  padding: 6px 10px;
  border: 1px solid currentColor;
  background: rgba(7, 9, 10, 0.9);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plane-marker.inner {
  top: 28%;
  left: 7%;
  color: var(--inner);
}

.plane-marker.outer {
  right: 7%;
  bottom: 28%;
  color: var(--outer);
}

.measure-callout {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(11, 15, 16, 0.92);
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.measure-callout.top {
  top: 20px;
}

.measure-callout.bottom {
  bottom: 20px;
}

.setup-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--info);
  background: rgba(126, 168, 255, 0.08);
  color: #cbd9ff;
}

.balance-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(380px, 1.2fr) minmax(220px, 0.7fr);
  gap: 14px;
}

.correction-card {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid currentColor;
  background: var(--surface);
}

.correction-card.inner-card {
  color: var(--inner);
  background:
    linear-gradient(180deg, rgba(91, 225, 237, 0.08), transparent 45%),
    var(--surface);
}

.correction-card.outer-card {
  color: var(--outer);
  background:
    linear-gradient(180deg, rgba(255, 196, 79, 0.08), transparent 45%),
    var(--surface);
}

.correction-plane {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.14rem;
}

.correction-plane small {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.correction-value {
  margin: auto 0 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(4.8rem, 8vw, 8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.8;
}

.correction-unit {
  margin-left: 6px;
  color: var(--text-secondary);
  font-size: 1.45rem;
  letter-spacing: 0;
}

.correction-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.correction-meta div {
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.15);
}

.correction-meta span,
.correction-meta strong {
  display: block;
}

.correction-meta span {
  color: var(--text-dim);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.correction-meta strong {
  margin-top: 4px;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.18rem;
}

.position-button {
  width: 100%;
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.center-machine {
  position: relative;
  min-height: 430px;
}

.center-machine .wheel-stage {
  min-height: 430px;
  border: 1px solid var(--line);
}

.axis-line {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.angle-pointer {
  position: absolute;
  z-index: 4;
  top: 7%;
  left: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid var(--success);
  background: var(--success-deep);
  color: var(--success);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  clip-path: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%);
}

.spin-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  align-content: end;
  justify-items: center;
  padding: 0 28px 20px;
  background: linear-gradient(180deg, transparent 56%, rgba(7, 9, 10, 0.7));
  pointer-events: none;
  text-align: center;
}

.spin-overlay[hidden] {
  display: none;
}

.spin-status {
  width: min(430px, 92%);
  padding: 9px 16px;
  border: 1px solid rgba(91, 225, 237, 0.42);
  border-left: 5px solid var(--inner);
  background: linear-gradient(90deg, rgba(20, 80, 88, 0.96), rgba(12, 24, 28, 0.94));
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.spin-rpm {
  margin-top: 6px;
  color: var(--success);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.progress-track {
  width: min(420px, 90%);
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  background: var(--line-soft);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--success);
  transition: width 320ms ease-out;
}

.confidence-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
}

.confidence-track {
  height: 6px;
  overflow: hidden;
  background: var(--line-soft);
}

.confidence-fill {
  width: 94%;
  height: 100%;
  background: var(--success);
}

.weights-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1.35fr) minmax(300px, 0.8fr);
  gap: 20px;
}

.weight-tabs {
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.weight-tab {
  min-height: 52px;
  flex: 1;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
}

.weight-tab:hover {
  background: var(--surface-bright);
  color: var(--text);
}

.weight-tab.active {
  border-bottom-color: var(--brand);
  background: var(--surface-bright);
  color: var(--text);
}

.spoke-stage {
  position: relative;
  display: grid;
  min-height: 440px;
  place-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at center, rgba(228, 63, 50, 0.05), transparent 45%),
    var(--surface);
}

.spoke-stage .wheel-visual {
  width: min(330px, 72%);
}

.spoke-marker {
  position: absolute;
  z-index: 5;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 3px solid var(--text);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 7px rgba(228, 63, 50, 0.2);
}

.spoke-marker.marker-a {
  top: 19%;
  left: 41%;
}

.spoke-marker.marker-b {
  top: 25%;
  left: 62%;
}

.weight-instruction-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.weight-action {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.weight-action + .weight-action {
  margin-top: 10px;
}

.weight-action.done {
  border-color: rgba(184, 237, 105, 0.4);
  background: rgba(184, 237, 105, 0.06);
}

.weight-value-box {
  display: grid;
  min-height: 64px;
  place-items: center;
  border: 1px solid currentColor;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.weight-action.inner-action {
  color: var(--inner);
}

.weight-action.outer-action {
  color: var(--outer);
}

.weight-action-copy {
  color: var(--text);
}

.weight-action-copy strong,
.weight-action-copy span {
  display: block;
}

.weight-action-copy strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
}

.weight-action-copy span {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.check-control {
  margin-top: auto;
  padding-top: 18px;
}

.placement-queue {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 48px minmax(260px, 1fr);
  align-items: center;
  margin-bottom: 16px;
}

.placement-plane {
  display: grid;
  min-height: 76px;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  text-align: left;
}

.placement-plane:hover {
  border-color: var(--line-strong);
  background: var(--surface-bright);
}

.placement-plane.active {
  border-color: var(--brand);
  background:
    linear-gradient(90deg, rgba(228, 63, 50, 0.14), transparent 46%),
    var(--surface-bright);
  color: var(--text);
}

.placement-plane.complete {
  border-color: rgba(150, 255, 113, 0.42);
}

.placement-plane .plane-order {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.placement-plane span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.placement-plane small {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.placement-plane strong {
  color: inherit;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
}

.placement-plane b {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.placement-plane.active b {
  color: var(--brand);
}

.placement-plane.complete b {
  color: var(--success);
}

.queue-connector {
  height: 2px;
  background: var(--line-strong);
}

.queue-connector.complete {
  background: var(--success);
}

.precision-placement-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.45fr) minmax(330px, 0.72fr);
  gap: 18px;
}

.placement-main {
  min-width: 0;
}

.laser-placement-visual {
  border: 1px solid var(--line);
  background: #080b0c;
}

.placement-machine-strip {
  display: flex;
  min-height: 48px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.machine-state-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.machine-state-pill i,
.machine-state-pill svg {
  width: 15px;
  height: 15px;
}

.machine-state-pill.ready {
  border-color: rgba(150, 255, 113, 0.35);
  background: rgba(150, 255, 113, 0.06);
  color: var(--success);
}

.machine-state-pill.laser.ready {
  border-color: rgba(255, 67, 58, 0.46);
  background: rgba(255, 67, 58, 0.08);
  color: #ff5e55;
}

.rim-cutaway-stage {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 55%, rgba(91, 225, 237, 0.08), transparent 52%),
    #080b0c;
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.rim-3d-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 45% 50%, rgba(91, 225, 237, 0.08), transparent 52%),
    #070a0b;
}

.placement-3d-canvas {
  display: block;
  width: 100%;
  height: 520px;
  cursor: grab;
  touch-action: none;
}

.placement-3d-canvas:active {
  cursor: grabbing;
}

.view-orientation {
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-left: 2px solid var(--inner);
  background: rgba(7, 10, 11, 0.78);
  pointer-events: none;
}

.view-orientation span,
.view-orientation small {
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.view-orientation small {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.orientation-arrow {
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-right: 7px;
  background: var(--inner);
  vertical-align: middle;
}

.orientation-arrow::after {
  display: block;
  width: 6px;
  height: 6px;
  transform: translateY(-3px) rotate(45deg);
  border-top: 1px solid var(--inner);
  border-right: 1px solid var(--inner);
  content: "";
}

.render-legend {
  position: absolute;
  bottom: 14px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  max-width: 48%;
  padding: 8px 10px;
  background: rgba(7, 10, 11, 0.82);
  pointer-events: none;
}

.render-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.render-legend i {
  display: inline-block;
  width: 12px;
  height: 3px;
}

.legend-laser {
  background: #ff3127;
  box-shadow: 0 0 6px #ff3127;
}

.legend-weight {
  background: #ffc857;
}

.legend-plane {
  border: 1px solid var(--inner);
  background: rgba(91, 225, 237, 0.18);
}

.rim-cutaway {
  display: block;
  width: 100%;
  height: auto;
  min-height: 410px;
}

.section-tire {
  fill: #101517;
  stroke: #333d40;
  stroke-width: 4;
}

.section-tire.bottom {
  fill: #080b0c;
}

.rim-section {
  stroke: #d7ddde;
  stroke-width: 2;
}

.barrel-wall {
  stroke: #9ba5a7;
  stroke-width: 2;
}

.drop-center {
  fill: none;
  stroke: rgba(210, 219, 221, 0.56);
  stroke-width: 3;
}

.inner-edge-reference {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
  stroke-dasharray: 4 7;
}

.cutaway-label,
.cutaway-note {
  fill: #8f9a9d;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.outer-label {
  text-anchor: start;
}

.cutaway-note {
  font-size: 12px;
}

.active-plane-note {
  fill: #ff5e55;
  text-anchor: middle;
}

.axial-guide {
  stroke: rgba(255, 94, 85, 0.72);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}

.axial-arrow {
  fill: #ff5e55;
  stroke: #ff5e55;
  stroke-width: 1.5;
}

.laser-beam {
  opacity: 0.16;
  transition: opacity 180ms ease;
}

.laser-beam line {
  stroke: #ff3127;
  stroke-width: 4;
  stroke-linecap: round;
}

.laser-beam.active {
  opacity: 1;
}

.laser-beam.active line {
  animation: laser-beam-pulse 640ms ease-in-out infinite alternate;
}

.laser-target-ring {
  fill: none;
  stroke: #ff4a40;
  stroke-width: 3;
  stroke-dasharray: 4 4;
}

.laser-target {
  fill: #ff2015;
}

.laser-emitter path {
  fill: #263033;
  stroke: #778487;
  stroke-width: 2;
}

.laser-emitter circle {
  fill: #ff3127;
}

.weight-ghost {
  opacity: 0;
  transition: opacity 180ms ease;
}

.weight-ghost.active {
  opacity: 0.86;
}

.weight-ghost rect {
  fill: rgba(255, 199, 86, 0.2);
  stroke: #ffc756;
  stroke-width: 2;
  stroke-dasharray: 5 3;
}

.weight-ghost line {
  stroke: rgba(255, 199, 86, 0.7);
}

.laser-target-card {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: var(--target-offset);
  display: grid;
  min-width: 280px;
  gap: 4px;
  padding: 14px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 94, 85, 0.52);
  background: rgba(8, 11, 12, 0.94);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.laser-target-card span,
.laser-target-card small {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.075em;
}

.laser-target-card strong {
  color: #ff695f;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.3rem;
  line-height: 1;
}

.angular-index {
  position: absolute;
  right: 18px;
  bottom: 14px;
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 12, 0.94);
}

.index-dial {
  position: relative;
  width: 70px;
  height: 70px;
  border: 6px solid #2c3538;
  border-radius: 50%;
  background: #111719;
  box-shadow: inset 0 0 0 1px #617073;
}

.index-dial::before {
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  content: "";
}

.index-pointer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 25px;
  transform: translate(-50%, -100%) rotate(var(--index-angle));
  transform-origin: 50% 100%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(150, 255, 113, 0.6);
}

.index-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--text);
}

.index-dial b {
  position: absolute;
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
}

.index-dial b:first-of-type {
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
}

.index-dial b:last-of-type {
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
}

.angular-index > div:last-child {
  display: grid;
}

.angular-index span,
.angular-index small {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.angular-index strong {
  color: var(--success);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.75rem;
}

.precision-instruction-card {
  display: flex;
  min-height: 548px;
  flex-direction: column;
}

.precision-instruction-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 15px;
}

.precision-weight {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 3px 12px;
  padding: 13px 15px;
  border-left: 4px solid var(--brand);
  background: var(--surface);
}

.precision-weight span,
.precision-weight em {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.precision-weight strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3.4rem;
  line-height: 0.9;
}

.precision-weight strong small {
  margin-left: 3px;
  color: var(--text-dim);
  font-size: 1rem;
}

.placement-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.placement-steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.placement-steps li > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid currentColor;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
}

.placement-steps li > div {
  display: grid;
  gap: 3px;
}

.placement-steps strong {
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.14rem;
  line-height: 1.15;
}

.placement-steps small {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.placement-steps li.current {
  border-color: rgba(255, 94, 85, 0.55);
  background: rgba(255, 94, 85, 0.06);
  color: #ff5e55;
}

.placement-steps li.done {
  border-color: rgba(150, 255, 113, 0.32);
  color: var(--success);
}

.placement-mode-control {
  display: grid;
  gap: 6px;
}

.placement-mode-control > span {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.weight-tabs.compact {
  padding: 4px;
}

.weight-tabs.compact .weight-tab {
  min-height: 46px;
  padding: 8px 7px;
  font-size: 1rem;
  line-height: 1.1;
}

.placement-warning {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 199, 86, 0.26);
  background: rgba(255, 199, 86, 0.04);
  color: var(--warning);
}

.placement-warning svg {
  width: 22px;
  height: 22px;
}

.placement-warning p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.4;
}

.precision-action {
  margin-top: auto;
}

.precision-action > button {
  width: 100%;
}

@keyframes laser-beam-pulse {
  to {
    opacity: 0.58;
    stroke-width: 7;
  }
}

.verify-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(300px, 0.8fr);
  gap: 20px;
}

.verify-stage {
  position: relative;
  display: grid;
  min-height: 470px;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  text-align: center;
}

.verify-wheel-shell {
  position: relative;
  width: 100%;
  height: 330px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #182125;
}

.verify-ready-title {
  margin: 18px 0 6px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.75rem;
}

.verify-ready-copy {
  max-width: 480px;
  margin: 0 20px 14px;
  color: var(--text-secondary);
}

.pass-seal {
  position: relative;
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border: 3px solid var(--success);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 237, 105, 0.12), transparent 60%);
  color: var(--success);
}

.pass-seal::before,
.pass-seal::after {
  position: absolute;
  border: 1px solid rgba(184, 237, 105, 0.35);
  border-radius: 50%;
  content: "";
}

.pass-seal::before {
  inset: 9px;
}

.pass-seal::after {
  inset: -15px;
  border-style: dashed;
}

.pass-seal span {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.verify-numbers {
  display: flex;
  gap: 40px;
  margin-top: 26px;
}

.zero-reading {
  display: grid;
  color: var(--text-secondary);
}

.zero-reading strong {
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3rem;
  font-variant-numeric: tabular-nums;
}

.zero-reading.inner-zero strong {
  color: var(--inner);
}

.zero-reading.outer-zero strong {
  color: var(--outer);
}

.certificate {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
}

.certificate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 13px 15px;
  background: var(--surface);
}

.certificate-row span {
  color: var(--text-secondary);
}

.certificate-row strong {
  font-family: "Barlow Condensed", sans-serif;
  font-variant-numeric: tabular-nums;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.report-table th,
.report-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.report-table th {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-table td {
  color: var(--text-secondary);
}

.report-table strong {
  color: var(--text);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(184, 237, 105, 0.35);
  background: var(--success-deep);
  color: var(--success);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
}

.result-badge::before {
  content: "✓";
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.health-panel {
  grid-column: span 7;
}

.protocol-panel {
  grid-column: span 5;
}

.log-panel {
  grid-column: span 8;
}

.fault-panel {
  grid-column: span 4;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.health-card {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.13);
}

.health-bar {
  width: 6px;
  height: 36px;
  background: var(--success);
}

.health-card.warning .health-bar {
  background: var(--warning);
}

.health-copy strong,
.health-copy span {
  display: block;
}

.health-copy span {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.health-value {
  color: var(--success);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
}

.protocol-flow {
  display: grid;
  gap: 8px;
}

.protocol-node {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
}

.protocol-node code {
  color: var(--info);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.protocol-direction {
  color: var(--text-dim);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.event-log {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #07090a;
  color: #bcd0c7;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.log-line {
  display: grid;
  grid-template-columns: 72px 88px 1fr;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid #141b1d;
}

.log-line .log-time {
  color: var(--text-dim);
}

.log-line .log-type {
  color: var(--info);
}

.fault-actions {
  display: grid;
  gap: 10px;
}

.action-tile {
  display: grid;
  min-height: 66px;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}

.action-tile:hover {
  border-color: var(--text-dim);
  background: var(--surface-bright);
}

.action-tile.danger-tile {
  border-color: rgba(255, 102, 93, 0.35);
}

.inline-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
}

.action-tile strong,
.action-tile span {
  display: block;
}

.action-tile span {
  color: var(--text-dim);
  font-size: 0.74rem;
}

.control-deck {
  grid-area: controls;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(228, 63, 50, 0.07), transparent 30%),
    #0a0e0f;
  z-index: 15;
}

.control-instruction {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 16px 28px;
}

.instruction-step {
  margin-bottom: 5px;
  color: var(--brand);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.control-instruction strong {
  overflow: hidden;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hardware-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-left: 1px solid var(--line);
}

.deck-button {
  display: grid;
  min-width: 86px;
  min-height: 70px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deck-button:hover {
  border-color: var(--text-dim);
  background: var(--surface-bright);
  color: var(--text);
}

.deck-confirm {
  border-color: rgba(184, 237, 105, 0.45);
  color: var(--success);
}

.rotary-control {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 5px solid #242d30;
  border-radius: 50%;
  background:
    radial-gradient(circle, #354145 0 28%, #111617 30% 44%, #556266 45% 48%, #171d1f 50%);
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.1),
    0 7px 20px rgba(0, 0, 0, 0.4);
  color: var(--text-secondary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rotary-tick {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 2px;
  height: 8px;
  transform-origin: 1px 50px;
  background: var(--text-dim);
}

.tick-a {
  transform: rotate(-38deg);
}

.tick-b {
  transform: rotate(0);
}

.tick-c {
  transform: rotate(38deg);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: calc(var(--footer-h) + 24px);
  display: flex;
  max-width: 420px;
  min-height: 54px;
  align-items: center;
  padding: 12px 18px;
  transform: translateY(20px);
  border-left: 4px solid var(--success);
  background: #18211c;
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion), transform var(--motion);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-left-color: var(--danger);
  background: #2b1717;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-w: 186px;
  }

  .topbar {
    grid-template-columns: var(--sidebar-w) minmax(150px, 0.5fr) 1fr auto;
  }

  .status-chip.status-sim {
    display: none;
  }

  .balance-workspace {
    grid-template-columns: 1fr 1.3fr 1fr;
  }

  .correction-card {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-h: 72px;
    --footer-h: 98px;
    --sidebar-w: 0px;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    grid-template:
      "topbar" var(--topbar-h)
      "workspace" minmax(calc(100dvh - var(--topbar-h) - var(--footer-h) - 74px), auto)
      "sidebar" 74px
      "controls" var(--footer-h)
      / 1fr;
  }

  .topbar {
    grid-template-columns: minmax(170px, 1fr) auto;
  }

  .machine-identity,
  .system-strip {
    display: none;
  }

  .brand-lockup {
    border-right: 0;
  }

  .topbar-actions {
    border-left: 1px solid var(--line);
  }

  .sidebar {
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(70px, 1fr));
    padding: 4px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-item {
    min-width: 72px;
    min-height: 62px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1px;
    padding: 4px;
    border-top: 3px solid transparent;
    border-left: 0;
    text-align: center;
  }

  .nav-item.active {
    border-top-color: var(--brand);
  }

  .nav-icon {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
  }

  .nav-icon svg {
    width: 19px;
    height: 19px;
  }

  .nav-number {
    display: none;
  }

  .nav-copy {
    font-size: 0.68rem;
  }

  .service-nav {
    margin: 0;
    border-top: 3px solid transparent;
  }

  .sidebar-footer {
    display: none;
  }

  .ready-grid,
  .setup-grid,
  .weights-layout,
  .precision-placement-layout,
  .verify-layout {
    grid-template-columns: 1fr;
  }

  .balance-workspace {
    grid-template-columns: 1fr 1fr;
  }

  .center-machine {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .correction-card {
    min-height: 310px;
  }

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

  .health-panel,
  .protocol-panel,
  .log-panel,
  .fault-panel {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  .view {
    padding: 18px 14px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-title {
    font-size: 2.5rem;
  }

  .ready-hero {
    min-height: 420px;
    padding: 28px 24px;
  }

  .dimension-grid,
  .mode-grid,
  .health-grid {
    grid-template-columns: 1fr;
  }

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

  .workflow-node {
    min-height: 54px;
  }

  .balance-workspace {
    grid-template-columns: 1fr;
  }

  .center-machine,
  .correction-card {
    grid-column: 1;
  }

  .correction-card {
    min-height: 280px;
  }

  .weight-tabs {
    overflow-x: auto;
  }

  .placement-queue {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .queue-connector {
    width: 2px;
    height: 16px;
    margin-left: 30px;
  }

  .placement-3d-canvas,
  .rim-3d-stage {
    height: 420px;
    min-height: 420px;
  }

  .laser-target-card {
    top: 58px;
    left: 50% !important;
  }

  .angular-index {
    right: 10px;
    bottom: 10px;
    grid-template-columns: 62px 1fr;
  }

  .index-dial {
    width: 58px;
    height: 58px;
  }

  .render-legend {
    display: none;
  }

  .weight-tab {
    min-width: 150px;
  }

  .control-deck {
    grid-template-columns: 1fr auto;
  }

  .control-instruction {
    padding: 12px 14px;
  }

  .hardware-controls {
    padding: 8px;
  }

  .rotary-control,
  .deck-button:first-child {
    display: none;
  }

  .deck-button {
    min-width: 78px;
    min-height: 64px;
  }

  .control-instruction strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .system-strip {
    display: none;
  }
}

@media (max-height: 820px) and (min-width: 1000px) {
  .view-balance {
    padding: 12px 20px 10px;
  }

  .view-balance .page-header {
    margin-bottom: 10px;
  }

  .view-balance .page-kicker {
    margin-bottom: 2px;
  }

  .view-balance .page-title {
    font-size: 2.75rem;
  }

  .view-balance .page-subtitle {
    margin-top: 5px;
    font-size: 1rem;
  }

  .view-balance .balance-workspace {
    gap: 12px;
  }

  .view-balance .correction-card,
  .view-balance .center-machine,
  .view-balance .center-machine .wheel-stage {
    min-height: 372px;
  }

  .view-balance .correction-card {
    padding: 20px;
  }

  .view-balance .correction-value {
    font-size: clamp(4.5rem, 7vw, 6.4rem);
  }

  .view-balance .correction-meta {
    margin: 14px 0;
  }

  .view-balance .confidence-bar {
    margin-top: 8px;
    padding: 7px 12px;
  }

  .view-balance .balance-view-badge {
    top: 12px;
    left: 12px;
  }

  .view-balance .calibration-legend {
    right: 10px;
    bottom: 10px;
  }

  .view-balance .spin-overlay {
    padding: 20px 22px;
  }

  .view-weights {
    padding: 12px 20px;
  }

  .view-weights .page-header {
    margin-bottom: 10px;
  }

  .view-weights .page-kicker {
    margin-bottom: 2px;
    font-size: 0.78rem;
  }

  .view-weights .page-title {
    font-size: 2.2rem;
  }

  .view-weights .page-subtitle {
    display: none;
  }

  .view-weights .placement-queue {
    margin-bottom: 8px;
  }

  .view-weights .placement-plane {
    min-height: 56px;
    padding: 7px 10px;
  }

  .view-weights .placement-plane .plane-order {
    width: 34px;
    height: 34px;
  }

  .view-weights .precision-placement-layout {
    gap: 12px;
  }

  .view-weights .placement-machine-strip {
    min-height: 38px;
    padding: 5px 8px;
  }

  .view-weights .machine-state-pill {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 0.76rem;
  }

  .view-weights .rim-3d-stage,
  .view-weights .placement-3d-canvas {
    height: 334px;
    min-height: 334px;
  }

  .view-weights .precision-instruction-card {
    min-height: 373px;
  }

  .view-weights .panel-header {
    min-height: 42px;
    padding: 8px 12px;
  }

  .view-weights .precision-instruction-body {
    gap: 7px;
    padding: 10px;
  }

  .view-weights .precision-weight {
    padding: 8px 10px;
  }

  .view-weights .precision-weight strong {
    font-size: 2.5rem;
  }

  .view-weights .placement-steps {
    gap: 5px;
  }

  .view-weights .placement-steps li {
    min-height: 48px;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    padding: 6px 8px;
  }

  .view-weights .placement-steps li > span {
    width: 28px;
    height: 28px;
  }

  .view-weights .placement-steps strong {
    font-size: 1rem;
  }

  .view-weights .placement-steps small {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  .view-weights .weight-tabs.compact .weight-tab {
    min-height: 40px;
    padding: 5px 6px;
    font-size: 0.9rem;
  }

  .view-weights .placement-warning {
    display: none;
  }

  .view-weights .precision-action button {
    min-height: 46px;
  }

  .view-weights .laser-target-card {
    top: 10px;
    min-width: 250px;
    padding: 10px 12px;
  }

  .view-weights .laser-target-card strong {
    font-size: 1.95rem;
  }

  .view-weights .angular-index {
    right: 10px;
    bottom: 10px;
    grid-template-columns: 58px 1fr;
    padding: 7px 8px;
  }

  .view-weights .index-dial {
    width: 54px;
    height: 54px;
  }
}

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