/* ==========================================================================
 * Feature View Styles: Auth, Pulse Dashboard, 2x2 Gauge Panel, Stage Grid,
 * Spatial Floor Plan / Onboarded Zones, Reports, Events, Audit, History, Admin
 * ========================================================================== */

/* --- Auth Views ----------------------------------------------------------- */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 26px 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--bg);
  padding: 4px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-strong);
}

.auth-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12.5px;
}

.demo-creds {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-muted);
  border: 1px dashed var(--border-strong);
  font-size: 11.5px;
  color: var(--muted);
}

/* --- Zone Pulse Dashboard (.zone-pulse dark canvas) ----------------------- */
.zone-pulse {
  background: var(--zp-bg);
  color: var(--zp-ink);
  border-radius: var(--radius-lg);
  padding: 18px 20px 22px;
  border: 1px solid var(--zp-border);
  margin-bottom: 18px;
}

.zp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--zp-border);
  margin-bottom: 16px;
}

.zp-title-wrap h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
}

.zp-clock {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--zp-accent);
  margin-top: 3px;
}

.zp-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.zp-range-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--zp-border);
  background: var(--zp-surface);
  color: var(--zp-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.zp-range-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.zp-custom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.zp-custom-bar input {
  background: var(--zp-bg);
  color: var(--zp-ink);
  border: 1px solid var(--zp-border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
}

/* KPI Strip */
.zp-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.zp-kpi-card {
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zp-kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--zp-muted);
}

.zp-kpi-val {
  font-size: 25px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.zp-kpi-delta {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zp-kpi-delta.up {
  color: #fbbf24;
}

.zp-kpi-delta.down {
  color: #34d399;
}

.zp-kpi-delta.flat {
  color: var(--zp-muted);
}

/* 2x2 Zone / Gauge Grid */
.zp-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.zp-zone-card {
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.zp-zone-card:hover {
  border-color: var(--zp-accent);
  transform: translateY(-1px);
}

.zp-zone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.zp-zone-name {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}

.zp-zone-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 12.5px;
}

.zp-zone-metric {
  background: var(--zp-surface-2);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
}

/* 2x2 Analog SVG Gauge Panel (.zgp-panel) */
.zgp-panel {
  background: var(--zgp-bg);
  border: 1px solid var(--zgp-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.zgp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.zgp-card {
  background: var(--zgp-card);
  border: 1px solid var(--zgp-border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.zgp-card:hover {
  border-color: var(--zp-accent);
}

.zgp-card-title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--zgp-ink);
  margin-bottom: 6px;
}

.zgp-svg {
  width: 100%;
  max-width: 230px;
  height: auto;
  overflow: visible;
}

.zgp-readout {
  margin-top: -6px;
  text-align: center;
}

.zgp-value {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.zgp-band {
  font-size: 11px;
  color: var(--zgp-muted);
}

/* Pulse Charts & Horizontal Stage Strip */
.zp-chart-card {
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.zp-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.zp-chart-wrap {
  position: relative;
  height: 270px;
}

.zp-stage-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.zp-stage-node {
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 8px;
  padding: 9px 8px;
  color: var(--zp-ink);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.zp-stage-node.active {
  border-color: var(--zp-accent);
  background: var(--zp-surface-2);
}

.zp-stage-detail {
  background: var(--zp-surface-2);
  border: 1px solid var(--zp-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.zp-events-panel {
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 10px;
  padding: 14px 16px;
}

.zp-events-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.zp-events-panel th,
.zp-events-panel td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--zp-border);
  color: var(--zp-ink);
  text-align: left;
}

/* --- Stage Grid & Drill-Down ---------------------------------------------- */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.stage-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.stage-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.param-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* --- Floor-Plan Spatial Views & Boundary/Zone Editors --------------------- */
.fp-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 900 / 560;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0f172a;
  overflow: hidden;
  user-select: none;
}

.fp-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.fp-boundary {
  position: absolute;
  border: 2px solid var(--zone1);
  background: rgba(37, 99, 235, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fp-boundary.edit-mode {
  cursor: move;
  border-style: dashed;
}

.fp-boundary-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
  padding: 2px 7px;
  border-radius: 4px;
}

.fp-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: 3px;
  cursor: nwse-resize;
}

.fp-sensor-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

/* Onboarded Zone Canvas */
.oz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.oz-stage {
  position: relative;
  width: 100%;
  height: 360px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
}

.oz-stage.oz-stage-lg {
  height: 500px;
}

.oz-fit-layer {
  position: absolute;
}

.oz-fit-layer img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.oz-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  white-space: nowrap;
}

.oz-marker.editable {
  cursor: grab;
}

.oz-textbox {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
}

.oz-textbox.editable {
  cursor: move;
  border-style: dashed;
  border-color: var(--zp-accent);
}

/* --- Reports & Charts ----------------------------------------------------- */
.reports-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.chart-box {
  position: relative;
  height: 280px;
}

/* --- Expandable Audit / Event Detail JSON -------------------------------- */
.json-pre {
  margin: 0;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 7px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 280px;
}

/* --- Settings & RBAC Matrix Helpers -------------------------------------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.threshold-band-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--panel);
}

.threshold-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 680px) {
  .threshold-inputs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rbac-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.rbac-row:last-child {
  border-bottom: none;
}

/* --- Phase-1 Clean Motor Shell & Placeholders (Feature 004) --------------- */
.motor-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.motor-type-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.motor-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.motor-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  color: var(--ink);
  font-size: 12.5px;
  text-decoration: none;
}

.motor-chip:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.motor-chip-id {
  font-weight: 700;
}

.motor-chip-status {
  font-size: 11px;
  color: var(--muted);
}

.motor-breadcrumb {
  font-size: 12.5px;
  margin-bottom: 8px;
}

.motor-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.motor-placeholders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.placeholder-card {
  margin-bottom: 0;
}

.placeholder-empty {
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 18px 14px;
  background: var(--panel-muted);
  text-align: center;
}

.placeholder-status {
  font-weight: 700;
  font-size: 13.5px;
}

.motor-topics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  font-size: 12.5px;
}

.nav-template-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 12px 6px;
  cursor: pointer;
}

.nav-template-toggle:hover {
  color: #e2e8f0;
}

/* ==========================================================================
 * Motor Twin View (sample/motor-twin.html integration)
 * ========================================================================== */
.motor-twin {
  --mt-bg: #0d1215;
  --mt-surface: #141b20;
  --mt-surface-2: #1a232a;
  --mt-line: #27333b;
  --mt-fg: #e1e9ec;
  --mt-muted: #8c9ca5;
  --mt-accent: #4fb3c7;
  --mt-ok: #3fb68b;
  --mt-warn: #e8b339;
  --mt-alarm: #e5484d;
  --mt-off: #6b7780;
  --mt-f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --mt-f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mt-f-data: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  background: var(--mt-bg);
  color: var(--mt-fg);
  font-family: var(--mt-f-body);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--mt-line);
  margin-top: 16px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.motor-twin * {
  box-sizing: border-box;
}

.motor-twin .mt-mono {
  font-family: var(--mt-f-data);
}

.motor-twin header.mt-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.motor-twin h1.mt-title {
  font-family: var(--mt-f-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0;
  color: var(--mt-fg);
}

.motor-twin .mt-asset {
  color: var(--mt-muted);
  font-family: var(--mt-f-data);
  font-size: 12px;
  margin-top: 6px;
}

.motor-twin .mt-overall {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.motor-twin .mt-overall .mt-info {
  text-align: right;
  min-width: 0;
}

.motor-twin .mt-overall .mt-src {
  font-family: var(--mt-f-data);
  font-size: 12px;
  color: var(--mt-muted);
}

.motor-twin .mt-overall .mt-detail {
  font-size: 12.5px;
  color: var(--mt-fg);
  min-height: 1.2em;
}

.motor-twin .mt-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--c);
  color: var(--c);
  border-radius: 4px;
  font-family: var(--mt-f-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.motor-twin .mt-bdot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}

.motor-twin .st-ok { --c: var(--mt-ok); }
.motor-twin .st-warn { --c: var(--mt-warn); }
.motor-twin .st-alarm { --c: var(--mt-alarm); }
.motor-twin .st-nodata, .motor-twin .st-stale { --c: var(--mt-off); }

@keyframes mt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.motor-twin .st-alarm .mt-bdot {
  animation: mt-pulse 1s ease-in-out infinite;
}

.motor-twin .mt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (min-width: 1100px) {
  .motor-twin .mt-layout {
    grid-template-columns: minmax(0, 1fr) 370px;
  }
}

.motor-twin .mt-main, .motor-twin .mt-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.motor-twin .mt-stage {
  position: relative;
  border: 1px solid var(--mt-line);
  border-radius: 6px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, #1c2a33 0%, #111a1f 62%, #0d1215 100%);
  aspect-ratio: 16/10;
  min-height: 340px;
  max-width: 100%;
  touch-action: pan-y;
  cursor: grab;
}

.motor-twin .mt-stage:active {
  cursor: grabbing;
}

.motor-twin .mt-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.motor-twin .mt-stage-note {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 11.5px;
  color: var(--mt-muted);
  pointer-events: none;
  max-width: 70%;
}

.motor-twin .mt-runchip {
  position: absolute;
  right: 12px;
  top: 12px;
  font-family: var(--mt-f-data);
  font-size: 12px;
  padding: 4px 9px;
  border: 1px solid var(--mt-line);
  border-radius: 3px;
  background: rgba(13, 18, 21, .8);
  color: var(--mt-fg);
}

.motor-twin .mt-nogl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--mt-muted);
}

.motor-twin .mt-tag {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
}

.motor-twin .mt-tag .mt-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .4);
}

.motor-twin .mt-tag .mt-lead {
  position: absolute;
  left: 0;
  width: 1px;
  background: var(--c);
  opacity: .75;
}

.motor-twin .mt-tag.up .mt-lead {
  bottom: 0;
  height: var(--off);
}

.motor-twin .mt-tag.down .mt-lead {
  top: 0;
  height: var(--off);
}

.motor-twin .mt-tag .mt-chip {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mt-f-data);
  font-size: 11.5px;
  padding: 3px 7px;
  background: rgba(13, 18, 21, .88);
  border: 1px solid var(--c);
  border-radius: 3px;
  display: flex;
  gap: 6px;
  color: var(--mt-fg);
}

.motor-twin .mt-tag.up .mt-chip {
  bottom: var(--off);
}

.motor-twin .mt-tag.down .mt-chip {
  top: var(--off);
}

.motor-twin .mt-tag .mt-chip .n {
  color: var(--mt-muted);
}

.motor-twin .mt-tag .mt-chip b {
  font-weight: 500;
}

.motor-twin .mt-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.motor-twin .mt-cards .mt-card:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 700px) {
  .motor-twin .mt-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .motor-twin .mt-cards .mt-card:last-child {
    grid-column: auto;
  }
}

.motor-twin .mt-card {
  background: var(--mt-surface);
  border: 1px solid var(--mt-line);
  border-top: 3px solid var(--c, var(--mt-off));
  border-radius: 5px;
  padding: 10px 12px 8px;
  min-width: 0;
}

.motor-twin .mt-card-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  min-height: 44px;
}

.motor-twin .mt-card-name {
  font-size: 12px;
  color: var(--mt-muted);
  line-height: 1.25;
}

.motor-twin .mt-pill {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--c);
  color: var(--c);
  border-radius: 3px;
  font-family: var(--mt-f-data);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.motor-twin .mt-reading {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 4px;
}

.motor-twin .mt-val {
  font-family: var(--mt-f-data);
  font-weight: 500;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--mt-fg);
}

.motor-twin .mt-unit {
  font-family: var(--mt-f-data);
  font-size: 12px;
  color: var(--mt-muted);
}

.motor-twin .mt-spark {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 6px;
}

.motor-twin .mt-limits {
  font-family: var(--mt-f-data);
  font-size: 10.5px;
  color: var(--mt-muted);
  margin-top: 4px;
}

.motor-twin .mt-panel {
  background: var(--mt-surface);
  border: 1px solid var(--mt-line);
  border-radius: 6px;
  min-width: 0;
}

.motor-twin .mt-panel > h2,
.motor-twin .mt-panel > details > summary {
  font-family: var(--mt-f-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mt-muted);
  margin: 0;
  padding: 12px 14px;
}

.motor-twin .mt-panel > h2 {
  border-bottom: 1px solid var(--mt-line);
}

.motor-twin .mt-panel > details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.motor-twin .mt-panel > details > summary::-webkit-details-marker {
  display: none;
}

.motor-twin .mt-panel > details > summary::after {
  content: "+";
  font-family: var(--mt-f-data);
}

.motor-twin .mt-panel > details[open] > summary::after {
  content: "\2212";
}

.motor-twin .mt-panel > details[open] > summary {
  border-bottom: 1px solid var(--mt-line);
}

.motor-twin .mt-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.motor-twin .mt-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--mt-line);
}

.motor-twin .mt-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--mt-muted);
  padding: 12px 8px;
  cursor: pointer;
  font-family: var(--mt-f-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.motor-twin .mt-tabs button[aria-selected="true"] {
  color: var(--mt-fg);
  border-bottom-color: var(--mt-accent);
}

.motor-twin .mt-lbl {
  font-size: 12px;
  color: var(--mt-muted);
}

.motor-twin .mt-scs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.motor-twin .mt-sc {
  background: transparent;
  border: 1px solid var(--mt-line);
  color: var(--mt-fg);
  border-radius: 4px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.motor-twin .mt-sc[aria-pressed="true"] {
  border-color: var(--mt-accent);
  color: var(--mt-accent);
  background: rgba(79, 179, 199, .12);
}

.motor-twin .mt-srow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: baseline;
}

.motor-twin .mt-srow input[type=range] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--mt-accent);
  margin: 2px 0 0;
}

.motor-twin .mt-srow output {
  font-family: var(--mt-f-data);
  font-size: 12.5px;
  color: var(--mt-fg);
}

.motor-twin .mt-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--mt-fg);
  cursor: pointer;
}

.motor-twin .mt-check input {
  accent-color: var(--mt-accent);
}

.motor-twin .mt-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.motor-twin input[type=text],
.motor-twin input[type=password],
.motor-twin input[type=number] {
  background: var(--mt-bg);
  border: 1px solid var(--mt-line);
  color: var(--mt-fg);
  border-radius: 4px;
  padding: 7px 9px;
  font-family: var(--mt-f-data);
  font-size: 12.5px;
  width: 100%;
  min-width: 0;
}

.motor-twin .mt-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.motor-twin .mt-btn {
  background: var(--mt-accent);
  color: #04181d;
  border: 1px solid var(--mt-accent);
  border-radius: 4px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.motor-twin .mt-btn.mt-ghost {
  background: transparent;
  color: var(--mt-fg);
  border-color: var(--mt-line);
  font-weight: 500;
}

.motor-twin .mt-status {
  font-family: var(--mt-f-data);
  font-size: 12px;
  padding: 6px 9px;
  border: 1px solid var(--mt-line);
  border-radius: 4px;
  color: var(--mt-muted);
  overflow-wrap: anywhere;
}

.motor-twin .mt-status.good { color: var(--mt-ok); border-color: var(--mt-ok); }
.motor-twin .mt-status.bad { color: var(--mt-alarm); border-color: var(--mt-alarm); }
.motor-twin .mt-status.wait { color: var(--mt-warn); border-color: var(--mt-warn); }

.motor-twin .mt-note {
  font-size: 12px;
  color: var(--mt-muted);
}

.motor-twin pre.mt-code {
  margin: 0;
  padding: 8px 10px;
  background: var(--mt-bg);
  border: 1px solid var(--mt-line);
  border-radius: 4px;
  font-family: var(--mt-f-data);
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre;
  color: var(--mt-fg);
}

.motor-twin .mt-trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 62px);
  gap: 6px;
  align-items: center;
}

.motor-twin .mt-trow.mt-h {
  font-size: 11px;
  color: var(--mt-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.motor-twin .mt-trow span.n {
  font-size: 12.5px;
  color: var(--mt-fg);
}

.motor-twin .mt-trow input {
  padding: 5px 6px;
  text-align: right;
}

.motor-twin #log {
  list-style: none;
  margin: 0;
  padding: 6px 14px 12px;
  display: flex;
  flex-direction: column;
}

.motor-twin #log li {
  display: grid;
  grid-template-columns: auto 10px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--mt-line);
  font-size: 12.5px;
  color: var(--mt-fg);
}

.motor-twin #log li:last-child {
  border-bottom: 0;
}

.motor-twin #log time {
  font-family: var(--mt-f-data);
  font-size: 11.5px;
  color: var(--mt-muted);
}

.motor-twin #log i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  display: block;
}

.motor-twin #log .empty {
  display: block;
  color: var(--mt-muted);
  border: 0;
}


