/* =========================================================================
   Minister of Defense — V8 Web Playtest · visual system
   Dark "operations room" theme. Class names are shared with index.html and
   sim_engine.js; keep them stable when editing.
   ========================================================================= */
:root {
  --bg-0: #070b11;
  --bg-1: #0d141e;
  --bg-2: #121b28;
  --bg-3: #1a2636;
  --bg-hover: #1f2d40;
  --border: #223247;
  --border-soft: rgba(255, 255, 255, 0.06);
  --border-bright: #34506f;
  --text-0: #e9f1fb;
  --text-1: #a9bbd2;
  --text-2: #6f849e;
  --accent-amber: #f2a93b;
  --accent-amber-soft: rgba(242, 169, 59, 0.14);
  --accent-cyan: #3cc8e4;
  --accent-cyan-soft: rgba(60, 200, 228, 0.12);
  --accent-green: #3ddc84;
  --accent-red: #f0604d;
  --accent-purple: #a77bdb;
  --arm-color: #e0812f;
  --arm-fill: rgba(224, 129, 47, 0.22);
  --aze-color: #3a9be0;
  --aze-fill: rgba(58, 155, 224, 0.22);
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 118px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(60, 200, 228, 0.06), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(242, 169, 59, 0.05), transparent 60%),
    var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

::selection { background: rgba(60, 200, 228, 0.3); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2a3c55 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #26374e; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #34506f; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

code, .code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(60, 200, 228, 0.09);
  color: #8fdcef;
  border: 1px solid rgba(60, 200, 228, 0.16);
  padding: 0 4px;
  border-radius: 3px;
  white-space: nowrap;
}

small { font-size: 10.5px; color: var(--text-2); font-weight: 500; }

/* ------------------------------------------------------------------ */
/* Sticky app chrome: header + nav                                     */
/* ------------------------------------------------------------------ */
.app-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(9, 14, 21, 0.86);
  border-bottom: 1px solid var(--border);
}

.top-header {
  padding: 10px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #f2a93b 0%, #b8681a 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 4px 14px rgba(242, 169, 59, 0.25);
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-badge {
  background: var(--accent-amber-soft);
  border: 1px solid rgba(242, 169, 59, 0.45);
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.6px;
  vertical-align: middle;
  margin-left: 8px;
}

.brand-title { font-size: 16px; font-weight: 750; letter-spacing: 0.4px; color: #fff; }
.brand-subtitle { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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

.ctrl-pill {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 4px 3px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}
.ctrl-pill label { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.ctrl-pill select { border-radius: 16px; border-color: transparent; background-color: var(--bg-0); }

select, button, input { font-family: var(--font-sans); }

select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236f849e' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--text-0);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 5px 26px 5px 9px;
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover { border-color: #4a6a8f; }
select:focus, input:focus, .btn:focus-visible, .radio-pill:focus-visible {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(60, 200, 228, 0.18);
}

input[type="text"] {
  background: var(--bg-0);
  border: 1px solid var(--border-bright);
  color: var(--text-0);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 12px;
}

/* Navigation */
.nav-tabs {
  padding: 0 14px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  color: var(--text-1);
  border: none;
  padding: 9px 14px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  border-radius: 8px 8px 0 0;
}
.nav-tab::after {
  content: "";
  position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 2px;
  background: var(--accent-amber);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.03); }
.nav-tab.active { color: #fff; }
.nav-tab.active::after { transform: scaleX(1); }

.tab-num {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.nav-tab.active .tab-num { background: var(--accent-amber); color: #1a1004; border-color: transparent; }
.tab-sub { font-size: 10.5px; color: var(--text-2); font-weight: 500; font-family: var(--font-mono); }

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */
.tab-view { display: none; padding: 16px 20px 28px; flex: 1; }
.tab-view.active { display: block; animation: fadeUp 0.28s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.wargame-grid {
  display: grid;
  grid-template-columns: 360px minmax(520px, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.wargame-grid > * { min-width: 0; }

/* Long side columns scroll independently so the map stays in view */
.col-sticky {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow-y: auto;
  padding-right: 2px;
}

@media (max-width: 1400px) {
  .wargame-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .wargame-grid > :nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .wargame-grid { grid-template-columns: 1fr; }
  .col-sticky { position: static; max-height: none; }
  .brand-subtitle { display: none; }
}

/* Panels */
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 40%), var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.panel-header {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-0);
  background: rgba(255, 255, 255, 0.015);
}
.panel-header > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header > span:first-child::before {
  content: "";
  width: 3px; height: 13px; border-radius: 2px;
  background: var(--accent-amber);
  flex: none;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--accent-cyan);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  flex: none;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-body { padding: 14px; }

/* Buttons */
.btn {
  background: var(--bg-3);
  color: var(--text-0);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: #4a6a8f; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, #f2a93b 0%, #c97a1c 100%);
  border-color: rgba(255, 210, 140, 0.5);
  color: #1b1105;
  box-shadow: 0 4px 14px rgba(242, 169, 59, 0.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffbb55 0%, #d98a28 100%); border-color: #ffd28c; }

.btn-cyan { background: var(--accent-cyan-soft); border-color: rgba(60, 200, 228, 0.5); color: var(--accent-cyan); }
.btn-cyan:hover { background: rgba(60, 200, 228, 0.22); color: #fff; border-color: var(--accent-cyan); }

.btn-danger { background: rgba(240, 96, 77, 0.14); border-color: var(--accent-red); color: #ff8f80; }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.preset-grid .btn { white-space: normal; text-align: center; line-height: 1.3; padding: 7px 8px; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan), transparent);
  opacity: 0.6;
}
.kpi-label { font-size: 10.5px; color: var(--text-2); letter-spacing: 0.2px; }
.kpi-val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-0);
  margin-top: 3px;
  line-height: 1.25;
  transition: color 0.2s;
}
.kpi-sub { font-size: 10.5px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }

/* Controls */
.control-group {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.control-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.control-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-weight: 650;
  font-size: 12.5px;
  margin-bottom: 7px;
  color: var(--text-0);
}
.control-title > span:last-child:not(:first-child) {
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.control-desc { font-size: 11.5px; color: var(--text-2); margin-bottom: 7px; }

.radio-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.radio-pill {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 6px 5px;
  font-size: 11.5px;
  text-align: center;
  cursor: pointer;
  color: var(--text-1);
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.radio-pill small { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 10px; }
.radio-pill:hover { border-color: #4a6a8f; color: var(--text-0); }
.radio-pill.selected {
  background: linear-gradient(180deg, rgba(242, 169, 59, 0.2), rgba(242, 169, 59, 0.08));
  border-color: var(--accent-amber);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(242, 169, 59, 0.25) inset;
}
.radio-pill.selected small { color: #f6c983; }

/* ------------------------------------------------------------------ */
/* Hex map                                                             */
/* ------------------------------------------------------------------ */
.hex-map-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hex-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.legend-items { display: flex; gap: 14px; font-size: 11px; color: var(--text-1); flex-wrap: wrap; align-items: center; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend-line { display: inline-block; width: 18px; height: 0; border-top: 3px solid; margin-right: 5px; vertical-align: 2px; border-radius: 2px; }

.map-stage {
  position: relative;
  background:
    radial-gradient(ellipse at 55% 45%, rgba(30, 50, 75, 0.55) 0%, rgba(7, 11, 17, 0) 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 40px),
    #080d14;
}

#nk-hex-svg { width: 100%; height: auto; min-height: 380px; max-height: 560px; display: block; }

.hex-group { cursor: pointer; }
.hex-poly { stroke-width: 1.4; transition: filter 0.15s ease, stroke-width 0.15s ease; }
.hex-group:hover .hex-poly { filter: brightness(1.35); stroke-width: 2.2; }
.hex-poly.selected { stroke: #ffd28c !important; stroke-width: 2.8; }

.hex-label {
  font-size: 11px;
  font-weight: 650;
  fill: #eef4fc;
  paint-order: stroke;
  stroke: rgba(5, 9, 14, 0.85);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}
.hex-sub { font-size: 8.5px; fill: #8ea3be; font-family: var(--font-mono); pointer-events: none; }

.map-tip {
  position: absolute;
  pointer-events: none;
  min-width: 200px;
  max-width: 260px;
  background: rgba(10, 16, 24, 0.96);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--text-1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
  z-index: 5;
}
.map-tip.show { opacity: 1; transform: none; }
.map-tip .tip-title { color: #fff; font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.map-tip .tip-row { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 11px; }

.map-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(255, 255, 255, 0.015);
}
.map-footer .stats { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-1); }

/* 5-phase strip */
.strip-phases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0; }
.phase-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  position: relative;
}
.phase-box:not(:last-child)::after {
  content: "›"; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  color: var(--text-2); font-size: 13px; z-index: 1;
}
.phase-box.active-phase { border-color: rgba(242, 169, 59, 0.7); background: var(--accent-amber-soft); }
.phase-code { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--accent-cyan); letter-spacing: 0.8px; }
.phase-name { font-size: 11.5px; font-weight: 650; margin: 3px 0; line-height: 1.3; }
.phase-stat { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-1); }

/* Progress */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aze-color) 0%, var(--accent-amber) 100%);
  border-radius: 8px;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 7px 9px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: middle; }
.data-table th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2px;
  background: rgba(255, 255, 255, 0.02);
  position: sticky; top: 0; z-index: 1;
  white-space: nowrap;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }

.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .bar { height: 6px; border-radius: 6px; background: currentColor; opacity: 0.85; }
.bar-cell .bar-bg { width: 70px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); display: flex; justify-content: flex-end; overflow: hidden; }

/* Event feed */
.event-feed { max-height: 300px; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.event-item {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-cyan);
  padding: 7px 10px;
  border-radius: 4px 6px 6px 4px;
  line-height: 1.45;
  animation: fadeUp 0.25s ease both;
}
.event-item.warn { border-left-color: var(--accent-amber); }
.event-item.crit { border-left-color: var(--accent-red); background: rgba(240, 96, 77, 0.07); }
.event-item.good { border-left-color: var(--accent-green); }
.event-time { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); margin-bottom: 1px; }

/* Badges */
.badge-pass, .badge-warn, .badge-fail, .badge-info {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-pass { background: rgba(61, 220, 132, 0.12); border: 1px solid rgba(61, 220, 132, 0.6); color: #6ef0a5; }
.badge-warn { background: rgba(242, 169, 59, 0.12); border: 1px solid rgba(242, 169, 59, 0.6); color: var(--accent-amber); }
.badge-fail { background: rgba(240, 96, 77, 0.12); border: 1px solid rgba(240, 96, 77, 0.6); color: #ff8f80; }
.badge-info { background: var(--accent-cyan-soft); border: 1px solid rgba(60, 200, 228, 0.5); color: var(--accent-cyan); }

/* Charts */
.chart-box { width: 100%; display: block; }
.chart-box text { font-family: var(--font-mono); font-size: 10px; fill: var(--text-2); }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-1); margin-bottom: 6px; flex-wrap: wrap; }

/* Squad canvas */
#squad-battle-canvas {
  width: 100%;
  height: 360px;
  background: #081019;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
}

/* Validation cards */
.val-card { cursor: default; }
.val-card .kpi-val { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.val-card .val-name { font-size: 11.5px; color: var(--text-0); font-weight: 600; margin-top: 2px; line-height: 1.3; min-height: 30px; }

.selfcheck-box { margin-top: 14px; display: none; }
.selfcheck-box.show { display: block; animation: fadeUp 0.25s ease both; }

/* Toast */
.toast-host { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: rgba(13, 20, 30, 0.97);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12px;
  color: var(--text-0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.2s ease both;
  max-width: 360px;
}
.toast.good { border-left-color: var(--accent-green); }
.toast.warn { border-left-color: var(--accent-amber); }

/* TO&E editor */
.toe-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: border-color 0.12s, background 0.12s;
}
.toe-item:hover { border-color: #4a6a8f; background: var(--bg-hover); }
.toe-item.active { border-color: var(--accent-cyan); background: var(--accent-cyan-soft); }
.lvl-chip {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 700;
  flex: none;
}

/* --- fit & finish --- */
select { padding-right: 26px !important; }
.preset-grid .btn { flex-direction: column; gap: 1px; }
.preset-grid .btn small { font-weight: 500; }
.panel-body { overflow-x: auto; }
.data-table code { white-space: normal; word-break: break-all; }
.bar-cell .bar-bg { width: 48px; }
