:root {
  --bg0: #07080d;
  --bg1: #0e1118;
  --card: rgba(20, 24, 34, 0.72);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f4f6ff;
  --muted: #9aa3b5;
  --accent: #5eead4;
  --accent2: #a78bfa;
  --danger: #fb7185;
  --ok: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(94, 234, 212, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(167, 139, 250, 0.14), transparent 50%), var(--bg0);
  line-height: 1.5;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, black 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  top: 10%;
  left: -80px;
  background: var(--accent);
}

.glow-b {
  bottom: 0;
  right: -60px;
  background: var(--accent2);
}

.topbar,
.shell,
.foot {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
  background: rgba(7, 8, 13, 0.65);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.train-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.72rem;
  cursor: pointer;
  max-width: min(220px, 42vw);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.train-top-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(94, 234, 212, 0.35);
}

.train-top-pill__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.train-top-pill--pulse .train-top-pill__dot {
  background: var(--accent);
  animation: trainDotPulse 1.25s ease-in-out infinite;
}

.train-top-pill--warn .train-top-pill__dot {
  background: #fbbf24;
}

.train-top-pill--err .train-top-pill__dot {
  background: var(--danger);
}

.train-top-pill--ok .train-top-pill__dot {
  background: var(--ok);
}

.train-top-pill__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 28px rgba(94, 234, 212, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
}

.hero {
  margin-bottom: 2rem;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
}

.panel-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.panel-head .muted {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.row-head {
  margin-top: 1.75rem;
}

.muted {
  color: var(--muted);
}

.dropzone {
  display: block;
  margin-top: 1rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(7, 8, 13, 0.35);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: rgba(94, 234, 212, 0.55);
  background: rgba(94, 234, 212, 0.06);
}

.dropzone-inner {
  padding: 2rem 1.25rem;
  text-align: center;
}

.dz-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.dz-title {
  margin: 0 0 0.35rem;
  font-weight: 500;
}

.dz-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-family: var(--mono);
}

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.plate-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 1rem 1rem 0.9rem;
  background: rgba(7, 8, 13, 0.45);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.plate-card:hover {
  transform: translateY(-1px);
}

.plate-card.selected {
  border-color: rgba(94, 234, 212, 0.65);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.25) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
}

.plate-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plate-card-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}

.plate-card-key {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.plate-visual-wrap {
  margin-top: 0.65rem;
  height: 52px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 10px;
}

.plate-visual-wrap.auto {
  justify-content: space-evenly;
}

.plate-visual-image {
  display: block;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.plate-visual-image.wide {
  width: 120px;
  height: 38px;
}

.plate-visual-image.square {
  width: 38px;
  height: 38px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.35rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s, transform 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #2dd4bf);
  color: #041016;
  box-shadow: 0 12px 36px rgba(45, 212, 191, 0.28);
}

.btn.primary:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn.secondary {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn.secondary:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.08);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.btn.ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(4, 16, 22, 0.25);
  border-top-color: #041016;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  min-height: 1.25rem;
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}

.result-card {
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: rgba(7, 8, 13, 0.55);
  display: flex;
  flex-direction: column;
}

.result-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #05060a;
}

.result-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  font-family: var(--mono);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge.warn {
  color: #fcd34d;
}

.badge.ok {
  color: var(--ok);
}

.badge.bad {
  color: var(--danger);
}

.result-body {
  padding: 0.75rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-name {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.btn.mini {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 10px;
}

.foot {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: rgba(20, 24, 34, 0.95);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  z-index: 20;
  max-width: min(90vw, 420px);
  text-align: center;
}

.debug-drawer {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(90vw, 680px);
  max-height: min(70vh, 540px);
  background: rgba(8, 10, 16, 0.96);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 30;
  overflow: hidden;
}

.debug-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--stroke);
}

.debug-content {
  margin: 0;
  padding: 0.8rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #c9d3e9;
  white-space: pre-wrap;
  overflow: auto;
  max-height: min(58vh, 460px);
  font-family: var(--mono);
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 8, 12, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 20px;
  box-sizing: border-box;
}

.editor-modal[hidden] {
  display: none !important;
}

.editor-panel {
  width: min(96vw, 1100px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(8, 10, 16, 0.98);
  box-shadow: var(--shadow);
  padding: 0.55rem 0.7rem 0.65rem;
  min-height: 0;
  box-sizing: border-box;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.5rem;
}

.editor-head strong {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.editor-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.editor-mode-btn.is-active {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(94, 234, 212, 0.12);
  color: var(--text);
}

.editor-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
  flex-shrink: 0;
}

.editor-main-toolbar--blend .editor-zoom-row {
  opacity: 0.38;
  pointer-events: none;
}

.editor-blend-panel {
  flex-shrink: 0;
  padding: 0.3rem 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.editor-blend-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.eb-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.eb-lbl {
  flex-shrink: 0;
}

.eb-num {
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 0.22rem 0.28rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  min-width: 0;
}

.eb-num--overscan {
  width: 4.6rem;
}

.eb-num--feather {
  width: 2.85rem;
}

.eb-num--narrow2 {
  width: 2.35rem;
}

.eb-num--mix {
  width: 2.85rem;
}

.eb-inline-color input[type="color"] {
  width: 1.85rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.editor-blend-actions-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.editor-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.editor-controls select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.editor-canvas-wrap {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #0c0f14 0%, #151a22 100%);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(64vh, calc(100dvh - 7.75rem));
}

#editorCanvas {
  display: block;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
}

.editor-zoom-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
}

.zoom-ctl-hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-zoom-row input[type="range"] {
  width: min(200px, 32vw);
  vertical-align: middle;
}

.zoom-readout {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  min-width: 2.2rem;
  text-align: right;
}

.zoom-x {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

@media (max-height: 780px) {
  .editor-panel {
    padding: 0.42rem 0.55rem 0.5rem;
    gap: 0.35rem;
    max-height: calc(100dvh - 28px);
  }

  .editor-canvas-wrap {
    max-height: min(52vh, calc(100dvh - 7.25rem));
  }

  .editor-controls .btn.mini {
    padding: 0.38rem 0.58rem;
    font-size: 0.74rem;
  }

  .editor-blend-actions-inline {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-height: 660px) {
  .editor-canvas-wrap {
    max-height: min(46vh, calc(100dvh - 6.75rem));
  }

  .editor-zoom-row input[type="range"] {
    width: min(100px, 26vw);
  }

  .editor-mode-row .btn.mini {
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* Auto-train status: floating dock, real metrics from /api/train/status */
.train-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 38;
  width: min(340px, calc(100vw - 2rem));
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color 0.25s ease, box-shadow 0.35s ease;
}

.train-dock--hidden {
  display: none !important;
}

.train-dock--off {
  opacity: 0.92;
  border-color: rgba(255, 255, 255, 0.06);
}

.train-dock--off .train-dock__dot {
  background: var(--muted);
}

.train-dock--flash {
  animation: trainDockFlash 0.85s ease;
}

@keyframes trainDockFlash {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  45% {
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.55), var(--shadow);
  }
}

.train-dock__bar-cap {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.train-dock__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.train-dock__head:hover {
  background: rgba(255, 255, 255, 0.04);
}

.train-dock__dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 10px rgba(154, 163, 181, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.train-dock--pulse .train-dock__dot {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.55);
  animation: trainDotPulse 1.25s ease-in-out infinite;
}

.train-dock--warn .train-dock__dot {
  background: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.train-dock--err .train-dock__dot {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.45);
}

.train-dock--ok .train-dock__dot {
  background: var(--ok);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

@keyframes trainDotPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

.train-dock__title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.train-dock__title {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
}

.train-dock__subtitle {
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-dock__chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.train-dock--open .train-dock__chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.train-dock--training {
  border-color: rgba(94, 234, 212, 0.28);
  animation: trainDockGlow 3s ease-in-out infinite;
}

@keyframes trainDockGlow {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.12), var(--shadow);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.22), 0 20px 50px rgba(94, 234, 212, 0.08);
  }
}

.train-dock__panel {
  padding: 0 0.75rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.train-dock__bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.5rem 0 0.6rem;
  overflow: hidden;
}

.train-dock__bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.35s ease;
}

.train-dock__msg {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
}

.train-dock__metrics {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.train-dock__dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.train-dock__dl dt {
  margin: 0;
  color: var(--muted);
  opacity: 0.9;
}

.train-dock__dl dd {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
}

.train-dock__err {
  margin: 0.45rem 0 0;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.25);
  color: #fecdd3;
  font-size: 0.72rem;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 640px) {
  .train-dock {
    bottom: 3.6rem;
    right: 0.65rem;
    width: min(360px, calc(100vw - 1.2rem));
  }
}
