/* Machine Integration page — live console + bidirectional flow + OPC
   Builds on tokens.css / site.css / knowledge.css. Cyan = telemetry (collect),
   amber = command (write-back). Two-way by design. */

:root {
  --mi-collect: var(--kt-cyan-500);   /* machine → MES (telemetry, signal) */
  --mi-command: #F2A93B;              /* MES → machine (commands, write-back) */
}

/* ════════ 01 · TWO-WAY FLOW DIAGRAM ═════════════════════════ */
.kt-mi-flow {
  max-width: 940px;
  margin: 0 auto;
}
.kt-mi-node {
  background: #fff;
  border: 1px solid var(--kt-gray-300);
  border-radius: var(--kt-radius-md);
  padding: 22px 26px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.kt-mi-node.is-mes {
  background: var(--kt-navy-900);
  border-color: var(--kt-navy-900);
  box-shadow: var(--kt-shadow-cyan);
}
.kt-mi-node-badge {
  font-family: var(--kt-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--kt-cyan-700);
  background: var(--kt-cyan-50);
  border: 1px solid rgba(0,184,212,0.25);
  border-radius: var(--kt-radius-sm);
  padding: 5px 9px;
  white-space: nowrap;
}
.kt-mi-node.is-mes .kt-mi-node-badge {
  background: rgba(0,184,212,0.15);
  color: var(--kt-cyan-300);
  border-color: rgba(0,184,212,0.3);
}
.kt-mi-node-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--kt-navy-900);
}
.kt-mi-node.is-mes .kt-mi-node-name { color: #fff; }
.kt-mi-node-desc { font-size: 13px; color: var(--kt-gray-600); margin-top: 2px; line-height: 1.45; }
.kt-mi-node.is-mes .kt-mi-node-desc { color: var(--kt-gray-300); }
.kt-mi-node-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* the two-direction link: command DOWN (amber) + collect UP (cyan) */
.kt-mi-link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 14px 26px;
}
.kt-mi-dir {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--kt-radius-md);
  border: 1px solid var(--kt-gray-200);
  background: #fff;
}
.kt-mi-dir.cmd  { border-color: rgba(242,169,59,0.4);  background: rgba(242,169,59,0.05); }
.kt-mi-dir.coll { border-color: rgba(0,184,212,0.35); background: var(--kt-cyan-50); }
.kt-mi-dir-pipe {
  position: relative;
  width: 3px;
  flex-shrink: 0;
  border-radius: 3px;
}
.kt-mi-dir.cmd .kt-mi-dir-pipe {
  background-image: repeating-linear-gradient(180deg, var(--mi-command) 0 7px, transparent 7px 14px);
  background-size: 3px 14px;
  animation: kt-mi-down calc(1.3s / var(--mi-speed, 1)) linear infinite;
}
.kt-mi-dir.coll .kt-mi-dir-pipe {
  background-image: repeating-linear-gradient(180deg, var(--mi-collect) 0 7px, transparent 7px 14px);
  background-size: 3px 14px;
  animation: kt-mi-up calc(1.3s / var(--mi-speed, 1)) linear infinite;
}
@keyframes kt-mi-down { from { background-position: 0 0; } to { background-position: 0 14px; } }
@keyframes kt-mi-up   { from { background-position: 0 14px; } to { background-position: 0 0; } }
.kt-mi-dir-pipe::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.kt-mi-dir.cmd .kt-mi-dir-pipe::after  { bottom: -3px; border-top: 8px solid var(--mi-command); }
.kt-mi-dir.coll .kt-mi-dir-pipe::after { top: -3px; border-bottom: 8px solid var(--mi-collect); }
.kt-mi-dir-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--kt-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.kt-mi-dir.cmd  .kt-mi-dir-head { color: #B9791A; }
.kt-mi-dir.coll .kt-mi-dir-head { color: var(--kt-cyan-700); }
.kt-mi-dir-arrow { font-size: 13px; }
.kt-mi-dir-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.kt-mi-dir-list li {
  font-size: 13px;
  line-height: 1.4;
  color: var(--kt-gray-700);
  padding-left: 16px;
  position: relative;
}
.kt-mi-dir-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 6px; height: 6px;
  border-radius: 1px;
}
.kt-mi-dir.cmd  .kt-mi-dir-list li::before { background: var(--mi-command); }
.kt-mi-dir.coll .kt-mi-dir-list li::before { background: var(--mi-collect); }
@media (max-width: 720px) {
  .kt-mi-link { grid-template-columns: 1fr; gap: 12px; padding: 12px 8px; }
  .kt-mi-node { grid-template-columns: auto 1fr; padding: 18px; }
  .kt-mi-node-tags { display: none; }
}

/* ════════ 02 · LIVE CONSOLE ═════════════════════════════════ */
.kt-mi-stage {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1040px) { .kt-mi-stage { grid-template-columns: 1fr; } }

.kt-mi-console {
  background: var(--kt-navy-900);
  border-radius: var(--kt-radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.kt-mi-console::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,184,212,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,184,212,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.kt-mi-console > * { position: relative; }
.kt-mi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.kt-mi-head-l { display: flex; align-items: center; gap: 10px; }
.kt-mi-head-title {
  font-family: var(--kt-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #fff;
  font-weight: 600;
}
.kt-mi-head-sub {
  font-family: var(--kt-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--kt-navy-200);
}
.kt-mi-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--kt-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mi-collect);
}
.kt-mi-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mi-collect);
  box-shadow: 0 0 0 0 rgba(0,184,212,0.6);
  animation: kt-mi-pulse 1.8s infinite;
}
.is-paused .kt-mi-live-dot { animation: none; background: var(--kt-gray-500); box-shadow: none; }
.is-paused .kt-mi-live { color: var(--kt-gray-500); }
@keyframes kt-mi-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,184,212,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(0,184,212,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,184,212,0); }
}

.kt-mi-body {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) { .kt-mi-body { grid-template-columns: 1fr; } }

.kt-mi-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.kt-mi-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  padding: 14px;
}
.kt-mi-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.kt-mi-panel-label {
  font-family: var(--kt-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--kt-navy-200);
  text-transform: uppercase;
}
.kt-mi-panel-val {
  font-family: var(--kt-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--mi-collect);
  font-variant-numeric: tabular-nums;
}

/* chart */
.kt-mi-chart-wrap { position: relative; }
.kt-mi-chart { display: block; width: 100%; height: 150px; }
.kt-mi-chart-set {
  position: absolute;
  right: 0;
  font-family: var(--kt-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--mi-command);
  background: rgba(242,169,59,0.12);
  border: 1px solid rgba(242,169,59,0.35);
  padding: 1px 5px;
  border-radius: 3px;
  transform: translateY(-50%);
  pointer-events: none;
  transition: top 0.5s ease;
}

/* metric tiles */
.kt-mi-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kt-mi-metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  padding: 12px 14px;
}
.kt-mi-metric-k {
  font-family: var(--kt-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--kt-navy-200);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.kt-mi-metric-v {
  font-family: var(--kt-font-mono);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kt-mi-metric-v small { font-size: 11px; color: var(--kt-navy-200); font-weight: 500; margin-left: 3px; }
.kt-mi-metric.is-cmd .kt-mi-metric-v { color: var(--mi-command); }
.kt-mi-metric.is-coll .kt-mi-metric-v { color: var(--mi-collect); }

/* OPC tag stream */
.kt-mi-stream {
  height: 176px;
  overflow: hidden;
  font-family: var(--kt-font-mono);
  font-size: 11px;
  line-height: 1.7;
  position: relative;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 100%);
}
.kt-mi-stream-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  white-space: nowrap;
  align-items: baseline;
}
.kt-mi-stream-t { color: var(--kt-navy-300); }
.kt-mi-stream-op {
  font-weight: 700;
  letter-spacing: 0.04em;
}
.kt-mi-stream-op.rd { color: var(--mi-collect); }
.kt-mi-stream-op.wr { color: var(--mi-command); }
.kt-mi-stream-op.sub { color: var(--kt-cyan-300); }
.kt-mi-stream-node { color: var(--kt-gray-400); overflow: hidden; text-overflow: ellipsis; }
.kt-mi-stream-v { color: #fff; text-align: right; }
.kt-mi-stream-row.is-new { animation: kt-mi-rowin 0.4s ease; }
@keyframes kt-mi-rowin {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* spine: MES ⇅ MACHINE */
.kt-mi-spine {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  padding: 12px 14px;
}
.kt-mi-spine-end { text-align: center; }
.kt-mi-spine-end b {
  display: block;
  font-family: var(--kt-font-sans);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.kt-mi-spine-end span {
  font-family: var(--kt-font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--kt-navy-200);
}
.kt-mi-spine-arrows { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.kt-mi-spine-arrow {
  font-family: var(--kt-font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
}
.kt-mi-spine-arrow.cmd  { color: var(--mi-command); background: rgba(242,169,59,0.12); }
.kt-mi-spine-arrow.coll { color: var(--mi-collect); background: rgba(0,184,212,0.12); }

/* write-back controls */
.kt-mi-controls { display: flex; flex-direction: column; gap: 12px; }
.kt-mi-ctrl-row { display: flex; flex-direction: column; gap: 7px; }
.kt-mi-ctrl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.kt-mi-ctrl-label {
  font-family: var(--kt-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--kt-navy-200);
  text-transform: uppercase;
}
.kt-mi-ctrl-read {
  font-family: var(--kt-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--mi-command);
  font-variant-numeric: tabular-nums;
}
.kt-mi-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.14);
  outline: none;
}
.kt-mi-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--mi-command);
  cursor: pointer;
  border: 2px solid var(--kt-navy-900);
  box-shadow: 0 0 0 1px var(--mi-command);
}
.kt-mi-range::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--mi-command);
  cursor: pointer;
  border: 2px solid var(--kt-navy-900);
}
.kt-mi-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kt-mi-btn {
  font-family: var(--kt-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 9px 10px;
  border-radius: 5px;
  border: 1px solid rgba(242,169,59,0.4);
  background: rgba(242,169,59,0.1);
  color: var(--mi-command);
  transition: background var(--kt-transition-base), transform var(--kt-transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.kt-mi-btn:hover { background: rgba(242,169,59,0.2); }
.kt-mi-btn:active { transform: translateY(1px); }
.kt-mi-btn.full { grid-column: 1 / -1; }
.kt-mi-btn.is-stop { border-color: rgba(231,76,60,0.45); background: rgba(231,76,60,0.1); color: #FF6B5B; }
.kt-mi-btn.is-stop:hover { background: rgba(231,76,60,0.2); }
.kt-mi-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.kt-mi-btn.flash { animation: kt-mi-flash 0.5s ease; }
@keyframes kt-mi-flash {
  0% { background: var(--mi-command); color: var(--kt-navy-900); }
  100% { background: rgba(242,169,59,0.1); color: var(--mi-command); }
}

.kt-mi-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kt-mi-foot span {
  font-family: var(--kt-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--kt-navy-300);
}

/* explanation rail beside the console */
.kt-mi-explain { display: flex; flex-direction: column; gap: 16px; }
.kt-mi-xcard {
  border: 1px solid var(--kt-gray-200);
  border-radius: var(--kt-radius-md);
  background: #fff;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.kt-mi-xcard::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
}
.kt-mi-xcard.coll::before { background: var(--mi-collect); }
.kt-mi-xcard.cmd::before  { background: var(--mi-command); }
.kt-mi-xcard-tag {
  font-family: var(--kt-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.kt-mi-xcard.coll .kt-mi-xcard-tag { color: var(--kt-cyan-700); }
.kt-mi-xcard.cmd  .kt-mi-xcard-tag { color: #B9791A; }
.kt-mi-xcard h3 {
  font-family: var(--kt-font-sans);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--kt-navy-900);
  margin: 0 0 8px;
}
.kt-mi-xcard p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--kt-gray-700);
  margin: 0;
  text-wrap: pretty;
}
.kt-mi-xcard p + p { margin-top: 10px; }
.kt-mi-xcard code {
  font-family: var(--kt-font-mono);
  font-size: 12px;
  color: var(--kt-cyan-700);
  background: var(--kt-cyan-50);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ════════ 04 · OPC EXPLAINER DIAGRAM ════════════════════════ */
.kt-opc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 900px) { .kt-opc { grid-template-columns: 1fr; } }
.kt-opc-diagram {
  background: var(--kt-navy-900);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--kt-radius-md);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.kt-opc-diagram::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,184,212,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,184,212,0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.kt-opc-diagram > * { position: relative; }
.kt-opc-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
}
.kt-opc-box {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
}
.kt-opc-box.server { border-color: rgba(0,184,212,0.3); }
.kt-opc-box.client { border-color: rgba(242,169,59,0.3); }
.kt-opc-box-h {
  font-family: var(--kt-font-sans);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}
.kt-opc-box-s {
  font-family: var(--kt-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--kt-navy-200);
  margin-bottom: 14px;
}
.kt-opc-nodes { display: flex; flex-direction: column; gap: 6px; }
.kt-opc-node {
  font-family: var(--kt-font-mono);
  font-size: 10px;
  color: var(--kt-gray-300);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.kt-opc-node b { color: var(--mi-collect); font-weight: 600; }
.kt-opc-mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 96px;
}
.kt-opc-svc {
  font-family: var(--kt-font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 6px 6px;
  border-radius: 4px;
  position: relative;
}
.kt-opc-svc.up   { color: var(--mi-collect); background: rgba(0,184,212,0.1); border: 1px solid rgba(0,184,212,0.25); }
.kt-opc-svc.down { color: var(--mi-command); background: rgba(242,169,59,0.1); border: 1px solid rgba(242,169,59,0.25); }
.kt-opc-diagram-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kt-opc-chip {
  font-family: var(--kt-font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--kt-navy-200);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--kt-radius-full);
  padding: 4px 10px;
}
.kt-opc-copy h3 {
  font-family: var(--kt-font-sans);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--kt-navy-900);
  margin: 0 0 14px;
}
.kt-opc-copy p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--kt-gray-700);
  margin: 0 0 14px;
  text-wrap: pretty;
}
.kt-opc-copy p:last-child { margin-bottom: 0; }
.kt-opc-copy strong { color: var(--kt-navy-900); }
.kt-opc-copy code {
  font-family: var(--kt-font-mono);
  font-size: 13px;
  color: var(--kt-cyan-700);
  background: var(--kt-cyan-50);
  padding: 1px 6px;
  border-radius: 3px;
}

/* compare table accents (extends knowledge.css .kt-compare) */
.kt-compare td.is-coll { background: var(--kt-cyan-50); }
.kt-compare thead th.is-coll { background: var(--kt-cyan-600); }
.kt-compare td.is-cmd { background: rgba(242,169,59,0.08); }
.kt-compare thead th.is-cmd { background: #B9791A; }
.kt-compare td.is-coll strong, .kt-compare td.is-cmd strong { color: var(--kt-navy-900); }

/* ════════ TWEAKS PANEL (vanilla) ════════════════════════════ */
.kt-tw {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 268px;
  background: var(--kt-navy-900);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--kt-radius-md);
  box-shadow: var(--kt-shadow-xl);
  z-index: var(--kt-z-modal);
  font-family: var(--kt-font-sans);
  display: none;
  overflow: hidden;
}
.kt-tw.is-open { display: block; }
.kt-tw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.kt-tw-title {
  font-family: var(--kt-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--kt-cyan-300);
  text-transform: uppercase;
}
.kt-tw-close {
  color: var(--kt-gray-400);
  font-size: 18px;
  line-height: 1;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.kt-tw-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.kt-tw-body { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.kt-tw-row { display: flex; flex-direction: column; gap: 9px; }
.kt-tw-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--kt-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--kt-navy-200);
  text-transform: uppercase;
}
.kt-tw-label b { color: var(--kt-cyan-300); font-weight: 600; }
.kt-tw-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.16);
  outline: none;
}
.kt-tw-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--kt-cyan-500);
  cursor: pointer;
}
.kt-tw-range::-moz-range-thumb {
  width: 13px; height: 13px; border: none;
  border-radius: 50%; background: var(--kt-cyan-500); cursor: pointer;
}
.kt-tw-seg {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}
.kt-tw-seg button {
  font-family: var(--kt-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--kt-navy-200);
  padding: 7px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  text-transform: uppercase;
}
.kt-tw-seg button.is-on {
  color: var(--kt-navy-900);
  background: var(--kt-cyan-500);
  border-color: var(--kt-cyan-500);
  font-weight: 700;
}
.kt-tw-swatches { display: flex; gap: 8px; }
.kt-tw-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  position: relative;
}
.kt-tw-swatch.is-on { border-color: #fff; }
.kt-tw-swatch::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--sw);
}
