/* ── Reset & base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f1a;
  --surface:   #1a1a2e;
  --surface2:  #16213e;
  --border:    #2a2a4a;
  --text:      #e0e0e0;
  --muted:     #555;
  --muted2:    #888;
  --accent:    #5c85e0;
  --accent2:   #7de05c;
  --danger:    #e05c5c;
  --warn:      #e0b55c;
  --radius:    10px;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Nav ─────────────────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}

.tabs { display: flex; gap: 4px; flex: 1; }

.nav-restart-btn { margin-left: auto; font-size: 12px; }

.tab {
  background: none;
  border: none;
  color: var(--muted2);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.tab:hover  { color: var(--text); background: var(--border); }
.tab.active { color: var(--text); background: var(--border); }

/* ── Main ────────────────────────────────────────────────────────────── */
main { padding: 28px 28px; max-width: 1400px; }

.tab-content        { display: none; }
.tab-content.active { display: block; }

h2 { font-size: 16px; color: var(--text); margin-bottom: 18px; }
h3 { font-size: 13px; color: var(--muted2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.muted  { color: var(--muted2); font-size: 13px; }
.muted2 { color: var(--muted); font-size: 12px; }

.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-header h2 { margin-bottom: 0; }

.subsection { margin-bottom: 32px; }

/* ── Button ──────────────────────────────────────────────────────────── */
.btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--border); }

/* ── Card grid ───────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card[data-span="2"] { grid-column: span 2; }
.card[data-span="3"] { grid-column: span 3; }
.card[data-span="4"] { grid-column: span 4; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  transition: border-color 0.15s, opacity 0.15s;
}
.card.loading { color: var(--muted); font-size: 13px; }
.card-label   { font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.card-value   { font-size: 22px; font-weight: bold; color: var(--text); }
.card-sub     { font-size: 12px; color: var(--muted2); margin-top: 4px; }
.card-value.ok   { color: var(--accent2); }
.card-value.warn { color: var(--warn); }
.card-value.bad  { color: var(--danger); }

/* ── Card edit mode ───────────────────────────────────────────────────── */
.card-controls {
  display: none;
  position: absolute;
  top: 7px; right: 7px;
  align-items: center;
  gap: 3px;
}
.card-grid.edit-mode .card-controls { display: flex; }
.card-grid.edit-mode .card { border-style: dashed; }

.card-drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  user-select: none;
}
.card-drag-handle:hover { color: var(--text); background: var(--border); }

.card-span-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted2);
  font-family: var(--font-mono);
  font-size: 10px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
}
.card-span-btn:hover { color: var(--text); border-color: var(--accent); }

.card-span-label {
  color: var(--muted);
  font-size: 10px;
  min-width: 14px;
  text-align: center;
}

.card.dragging   { opacity: 0.35; cursor: grabbing; }
.card.drag-over  { border-color: var(--accent) !important; border-style: solid !important; }

/* ── Docs ────────────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

#docs-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 72px;
}

.sidebar-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }

#docs-list { list-style: none; }
#docs-list li { list-style: none; }
#docs-list ul { list-style: none; padding-left: 0; }
#docs-list li a {
  display: block;
  color: var(--muted2);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#docs-list li a:hover  { color: var(--text); background: var(--border); }
#docs-list li a.active { color: var(--text); background: var(--border); }

.tree-dir {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted2);
  font-size: 12px;
  padding: 5px 8px 3px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.tree-dir:hover { color: var(--text); background: var(--border); }
.tree-dir-name { font-weight: bold; letter-spacing: 0.3px; }
.tree-arrow { font-size: 9px; color: var(--muted); flex-shrink: 0; width: 10px; }
#docs-list ul { border-left: 1px solid var(--border); margin-left: 18px; }

#docs-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-height: 300px;
}

/* Markdown content styles */
#docs-content h1 { font-size: 22px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
#docs-content h2 { font-size: 17px; margin: 24px 0 10px; }
#docs-content h3 { font-size: 14px; color: var(--text); text-transform: none; letter-spacing: 0; margin: 18px 0 8px; }
#docs-content p  { margin-bottom: 12px; color: var(--muted2); }
#docs-content a  { color: var(--accent); }
#docs-content code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
}
#docs-content pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 14px;
}
#docs-content pre code { background: none; border: none; padding: 0; }
#docs-content ul, #docs-content ol { padding-left: 20px; margin-bottom: 12px; color: var(--muted2); }
#docs-content li { margin-bottom: 4px; }
#docs-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--muted2);
  margin-bottom: 12px;
}
#docs-content table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
#docs-content th, #docs-content td { padding: 8px 12px; border: 1px solid var(--border); font-size: 13px; }
#docs-content th { background: var(--surface2); color: var(--muted2); text-align: left; }

/* ── Proxmox ─────────────────────────────────────────────────────────── */
.proxmox-node-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

.proxmox-node-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.proxmox-status-icon { font-size: 15px; font-weight: bold; }
.proxmox-status-icon.ok  { color: var(--accent2); }
.proxmox-status-icon.bad { color: var(--danger); }

.proxmox-node-name { color: var(--text); }

/* ── Storage ─────────────────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.chart-card h3 { margin-bottom: 14px; }
.chart-card svg { width: 100%; height: auto; display: block; }

/* ── Table ───────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  color: var(--muted2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}
.badge.ok      { background: #1a3a1a; color: var(--accent2); }
.badge.warn    { background: #3a2a0a; color: var(--warn); }
.badge.bad     { background: #3a1a1a; color: var(--danger); }
.badge.neutral { background: var(--border); color: var(--muted2); }

/* Station tags — ISS/CSS at a glance in the Stations tab */
.station-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.station-tag.station-ISS { background: #16243d; color: var(--accent);  border-color: #24406b; }
.station-tag.station-CSS { background: #3a1a1a; color: var(--danger);  border-color: #6b2424; }

.encode-progress {
  display: inline-block;
  width: 80px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 5px;
}
.encode-progress-bar {
  height: 100%;
  background: var(--accent2);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card[data-span="4"] { grid-column: span 3; }
}
@media (max-width: 800px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card[data-span="3"], .card[data-span="4"] { grid-column: span 2; }
  .chart-grid    { grid-template-columns: 1fr; }
  .docs-layout   { grid-template-columns: 1fr; }
  #docs-sidebar  { position: static; }
}
@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
  .card[data-span] { grid-column: span 1; }
}

/* ── Mobile / phone ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* entire nav scrolls as one row */
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 0 12px;
  }
  nav::-webkit-scrollbar { display: none; }

  /* don't let tabs shrink — they define the scroll width */
  .tabs { flex-shrink: 0; gap: 4px; }

  /* bigger tap targets */
  .tab {
    padding: 8px 16px;
    white-space: nowrap;
    min-height: 36px;
  }
  .btn {
    padding: 7px 14px;
    min-height: 36px;
    white-space: nowrap;
  }
  .nav-restart-btn { flex-shrink: 0; }

  main { padding: 14px 12px; }

  .docs-layout { gap: 14px; }
  #docs-content { padding: 16px; }
}

/* ── Kanban ──────────────────────────────────────────────────────────── */
/* main is capped at 1400px for readability, which leaves 1344px of content --
   narrower than a 5-column board (1506px), so the board scrolled sideways even
   on a wide screen. The kanban tab opts out of that cap; every other tab keeps
   it. The class is toggled in switchTab(). */
body.tab-wide main { max-width: none; }

.kanban-board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
}

.kb-column {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  /* 290px by preference, but allowed to shrink to 248px so five columns still
     fit a 1440px laptop rather than forcing a horizontal scroll. Past that
     limit the board scrolls, which is the right behaviour for many columns. */
  flex: 0 1 290px;
  min-width: 248px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 190px);
}

.kb-column-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--border);
}

.kb-column-title {
  flex: 1;
  min-width: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 5px;
}
.kb-column-title:hover { border-color: var(--border); }
.kb-column-title:focus { border-color: var(--accent); outline: none; background: var(--surface); }

.kb-count {
  font-size: 11px;
  color: var(--muted2);
  background: var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.kb-col-del { padding: 2px 6px; font-size: 11px; color: var(--muted); }
.kb-col-del:hover { color: var(--danger); }

/* Min-height keeps an empty column a valid drop target */
.kb-cards {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 60px;
  flex: 1;
}
.kb-cards.kb-over {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  outline: 1px dashed var(--accent);
  outline-offset: -4px;
}

.kb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 10px;
  cursor: grab;
}
.kb-card:hover { border-color: var(--accent); }
.kb-card.dragging { opacity: 0.35; cursor: grabbing; }

.kb-card-title { font-size: 13px; color: var(--text); word-break: break-word; }
.kb-card-meta  { font-size: 11px; color: var(--muted2); margin-top: 5px; }

.kb-card-thumb {
  display: block;
  width: 100%;
  max-height: 110px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 8px;
  border: 1px solid var(--border);
}

.kb-add {
  margin: 0 8px 8px;
  font-size: 12px;
  color: var(--muted2);
  border-style: dashed;
}
.kb-add:hover { color: var(--text); }

/* ── Card editor modal ───────────────────────────────────────────────── */
.kb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}

.kb-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 16px 18px 14px;
}

.kb-modal-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }

.kb-modal-title {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: bold;
  padding: 8px 10px;
}
.kb-modal-title:focus { border-color: var(--accent); outline: none; }

.kb-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.kb-modal-details {
  width: 100%;
  min-height: 90px;   /* the checklist shares the modal now */
  resize: vertical;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 11px;
  margin-bottom: 16px;
}
.kb-modal-details:focus { border-color: var(--accent); outline: none; }

.kb-label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kb-label-count { font-size: 11px; color: var(--muted2); }

.kb-checklist { margin-bottom: 16px; }

.kb-task {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.kb-task:hover { background: var(--surface2); }
.kb-task.done .kb-task-text { color: var(--muted2); text-decoration: line-through; }

.kb-task-box  { accent-color: var(--accent); cursor: pointer; flex: none; }
.kb-task-text { flex: 1; cursor: pointer; }

.kb-task-del {
  flex: none;
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  visibility: hidden;
}
.kb-task:hover .kb-task-del { visibility: visible; }
.kb-task-del:hover { color: var(--text); }

.kb-task-add {
  width: 100%;
  margin-top: 4px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 4px 3px;
}
.kb-task-add:focus { outline: none; border-top-color: var(--accent); }

.kb-image-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  min-height: 20px;
}

.kb-thumb-wrap { position: relative; }

.kb-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: zoom-in;
  display: block;
}
.kb-thumb:hover { border-color: var(--accent); }

.kb-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted2);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.kb-thumb-del:hover { color: var(--danger); border-color: var(--danger); }

.kb-modal-foot { display: flex; align-items: center; gap: 10px; }
.kb-delete-btn { margin-left: auto; color: var(--danger); border-color: var(--danger); }
.kb-delete-btn:hover { background: #3a1a1a; }

/* ── VM traffic sources ───────────────────────────────────────────────── */
/* Chart palette: the 6 categorical slots validated against this surface
   (#1a1a2e) for lightness band, chroma, CVD separation and contrast.
   Assigned in fixed rank order and never cycled -- the tail folds into
   --vmt-other, a neutral that is deliberately not one of the hues. */
.vmt-section {
  --vmt-1: #3987e5;
  --vmt-2: #d95926;
  --vmt-3: #199e70;
  --vmt-4: #c98500;
  --vmt-5: #d55181;
  --vmt-6: #008300;
  --vmt-other: #55556e;
  --vmt-grid: #2a2a4a;
}

.vmt-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vmt-filters .vmt-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.vmt-filters label {
  font-size: 11px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.vmt-btn.active {
  background: var(--border);
  border-color: var(--accent);
  color: var(--text);
}
.vmt-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
}
.vmt-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted2);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

/* Per-guest tiles double as the guest selector. */
.vmt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.vmt-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  transition: border-color 0.15s, background 0.15s;
}
.vmt-tile:hover    { border-color: var(--muted2); }
.vmt-tile.active   { border-color: var(--accent); background: var(--surface2); }
.vmt-tile-name     { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.vmt-tile-value    { font-size: 24px; color: var(--text); margin-top: 2px; }
.vmt-tile-sub      { font-size: 11px; color: var(--muted2); }
.vmt-dot           { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.vmt-dot.live      { background: var(--accent2); }
.vmt-dot.down      { background: var(--muted); }

.vmt-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  margin-bottom: 18px;
  position: relative;
}
.vmt-chart-title { font-size: 12px; color: var(--muted2); margin-bottom: 10px; }
.vmt-chart-title strong { color: var(--text); font-weight: normal; }
.vmt-chart svg   { display: block; width: 100%; }
.vmt-chart text  { font-variant-numeric: tabular-nums; }

.vmt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.vmt-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted2);
}
.vmt-legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

.vmt-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 11px;
  z-index: 20;
  min-width: 180px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.1s;
}
.vmt-tooltip.show   { opacity: 1; }
.vmt-tt-head        { color: var(--muted2); margin-bottom: 6px; }
.vmt-tt-row         { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.vmt-tt-key         { width: 12px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.vmt-tt-val         { color: var(--text); font-variant-numeric: tabular-nums; }
.vmt-tt-name        { color: var(--muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vmt-table-wrap { overflow-x: auto; }
table.vmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.vmt-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted2);
  font-weight: normal;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}
table.vmt-table th:hover { color: var(--text); }
table.vmt-table th.sorted { color: var(--accent); }
table.vmt-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--surface2);
  vertical-align: top;
}
table.vmt-table tr:hover td { background: var(--surface2); }
table.vmt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.vmt-ip     { color: var(--text); }
.vmt-ptr    { color: var(--muted2); word-break: break-all; }
.vmt-org    { color: var(--muted2); font-size: 11px; }
.vmt-ports  { color: var(--muted2); font-size: 11px; word-break: break-all; }

/* Scope is a category, not a status -- the word carries the meaning and the
   tint only supports it. */
.vmt-scope {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted2);
  white-space: nowrap;
}
.vmt-scope.public    { border-color: #7a4a3a; color: #e8a184; }
.vmt-scope.cgnat     { border-color: #7a4a3a; color: #e8a184; }
.vmt-scope.vpn       { border-color: #6a5a2a; color: var(--warn); }
.vmt-scope.private   { border-color: #2f4a6e; color: #8fb4e8; }
.vmt-scope.multicast,
.vmt-scope.linklocal { border-color: var(--border); color: var(--muted); }

.vmt-empty { color: var(--muted2); font-size: 13px; padding: 24px 0; }
.vmt-note  { color: var(--muted); font-size: 11px; margin-top: 10px; }
.vmt-stale { color: var(--warn); font-size: 12px; }

/* ── Concerts ────────────────────────────────────────────────────────── */
.concert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* thumb | artist+venue+reason | date | tickets */
.concert-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.concert-card:hover { border-color: var(--accent); }

.concert-thumb {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}
.concert-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  color: var(--muted);
  font-size: 16px;
}

.concert-info   { min-width: 0; }
.concert-artist {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.concert-meta   { font-size: 12px; color: var(--muted2); }
.concert-reason { font-size: 12px; margin-top: 3px; }

.concert-date {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.concert-action { white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* The star sits next to Tickets, so it has to read as a toggle rather than a
   second call to action -- fixed width keeps ☆/★ from nudging the row. */
.concert-fav {
  width: 2.1em;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
  line-height: 1;
  font-size: 1.05em;
}
.concert-fav.active { color: var(--accent); border-color: var(--accent); }
.concert-fav:disabled { opacity: 0.5; cursor: default; }

/* Setup / empty states — the tab is inert without API keys, so say so loudly
   rather than showing an indistinguishable "no results". */
.concert-setup {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}
.concert-setup h3   { color: var(--warn); margin-bottom: 10px; font-size: 14px; }
.concert-setup ol   { margin: 10px 0 0 20px; color: var(--muted2); font-size: 13px; }
.concert-setup li   { margin-bottom: 6px; }
.concert-setup code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 700px) {
  .concert-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .concert-date, .concert-action { grid-column: 2; text-align: left; }
}
.concert-count { margin-bottom: 8px; }
/* Selects reuse .btn styling; these only fix what a native select needs. */
#concerts-city-select, #concerts-venue-select {
  max-width: 210px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
}
#concerts-venue-select { max-width: 260px; }
/* Search boxes reuse .btn chrome but need input-specific bits. */
.concert-search {
  min-width: 130px;
  max-width: 190px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.concert-search::placeholder { color: var(--muted); }
.concert-search:focus { outline: none; border-color: var(--accent); }

/* ── City / venue dropdowns ──────────────────────────────────────────────── */
.concert-search {
  min-width: 110px;
  max-width: 150px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.concert-search::placeholder { color: var(--muted); }
.concert-search:focus { outline: none; border-color: var(--accent); }

.concert-select {
  max-width: 230px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
}

.concert-spotify { color: var(--accent2); text-decoration: none; }
.concert-spotify:hover { text-decoration: underline; }

/* Multi-night runs: every date sits in the one card. */
.concert-days {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.concert-day {
  display: inline-block;
  font-size: 12px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
a.concert-day:hover { border-color: var(--accent); color: var(--accent); }
.concert-days-time { font-size: 11px; text-align: right; margin-top: 3px; }
.concert-nights { font-size: 11px; text-align: center; margin-top: 3px; }

/* Search + dropdown pair. While searching, the select expands into a list box
   overlaying the page rather than pushing the header around. */
.picker { position: relative; display: flex; gap: 4px; align-items: flex-start; }
.picker .concert-select.expanded {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 240px;
  max-width: 320px;
  z-index: 200;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.picker .concert-select.expanded option { padding: 3px 6px; }
.concert-spotify-web { color: var(--muted2); text-decoration: none; font-size: 11px; }
.concert-spotify-web:hover { color: var(--accent2); }
.concert-rank {
  margin-left: 8px;
  font-size: 11px;
  color: var(--accent2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 6px;
}
/* Selected state for every toggle-style button. This was missing entirely --
   .active was being toggled on the filter, range and weekend buttons with no
   rule behind it, so nothing looked selected. Global on purpose: the station
   tab's filters toggle .active the same way and were equally invisible. */
.btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface2);
}
.btn.active:hover { background: var(--border); }
.sort-arrow { font-size: 10px; }

/* ── Thrift (eBay saved searches) ─────────────────────────────────────── */
/* Sub-tabs read as a second, quieter level of the nav strip above: same
   shape, underlined rather than filled, so the two rows don't compete. */
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.subtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted2);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.subtab:hover  { color: var(--text); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); }
.subtab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.ebay-blurb { margin-bottom: 14px; }

.ebay-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.ebay-btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ebay-ctl-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ebay-ctl-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}
.ebay-count { margin-left: auto; }

.ebay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.ebay-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s;
}
.ebay-card:hover { border-color: var(--accent); }
.ebay-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Square crop keeps the grid on a baseline no matter how the seller shot it. */
.ebay-shot {
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  overflow: hidden;
}
.ebay-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.ebay-card:hover .ebay-shot img { transform: scale(1.04); }

.ebay-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  flex: 1;
}
.ebay-title {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}
.ebay-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.ebay-price  { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.ebay-ask    { font-size: 18px; font-weight: bold; color: var(--text); }
.ebay-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted2);
}

@media (max-width: 700px) {
  .ebay-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .ebay-count { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ebay-shot img { transition: none; }
  .ebay-card:hover .ebay-shot img { transform: none; }
}
