/* ============================================================
   Fusion Shop Config Editor — dark theme
   ============================================================ */
:root {
  --bg: #0b0d10;
  --bg-panel: #14171c;
  --bg-panel-2: #191d23;
  --bg-input: #1f242c;
  --bg-input-focus: #242a33;
  --bg-hover: #1c2128;
  --border: #262c35;
  --border-light: #303743;
  --text: #e8eaed;
  --text-dim: #9aa3b0;
  --text-faint: #6b7480;
  --accent: #1f7cff;
  --accent-hover: #3d8eff;
  --accent-dim: rgba(31, 124, 255, 0.14);
  --danger: #ff4d7d;
  --danger-dim: rgba(255, 77, 125, 0.12);
  --success: #2ecc71;
  --success-dim: rgba(46, 204, 113, 0.14);
  --warning: #f5a623;
  --warning-dim: rgba(245, 166, 35, 0.12);
  --pink: #e84393;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --mono: 'Cascadia Code', 'Consolas', 'SF Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c333d; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4250; }

/* ---------- Title bar ---------- */
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #000;
  flex-shrink: 0;
}
.titlebar-left { display: flex; align-items: center; gap: 10px; }
.titlebar-title { font-size: 13px; color: var(--text-dim); }
.titlebar-title strong { color: var(--text); font-weight: 600; }
.version-badge {
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
}
.titlebar-right { display: flex; align-items: center; gap: 14px; }
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.header-btn svg { width: 14px; height: 14px; }
.header-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-faint); }
.file-indicator { font-size: 12px; color: var(--text-faint); display: flex; align-items: center; gap: 7px; }
.file-indicator .dirty-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warning);
  display: inline-block;
}

/* ---------- Tab bar ---------- */
.tabbar {
  display: flex;
  gap: 4px;
  margin: 8px 14px 0;
  padding: 5px;
  background: #15181d;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.tab-btn {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--bg-hover); }
.tab-btn.active { background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- Main view ---------- */
.view {
  flex: 1;
  overflow-y: auto;
  margin: 12px 14px;
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 22px 26px;
}

/* ---------- Footer toolbar ---------- */
.toolbar {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 10px;
  background: #000;
  flex-shrink: 0;
}
.toolbar-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text); }
.toolbar-btn svg { width: 20px; height: 20px; }

/* ---------- Section headers ---------- */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}
.section-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h1 svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.section-sub { margin: 5px 0 0; color: var(--text-faint); font-size: 13px; }
.section-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: none;
  border-radius: 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-secondary { background: var(--bg-input); color: var(--text); }
.btn-secondary:hover { background: var(--bg-input-focus); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Tables ---------- */
.table-wrap { border-radius: var(--radius-sm); overflow: hidden; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data thead th {
  text-align: left;
  padding: 11px 14px;
  background: var(--bg-panel-2);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
}
table.data tbody td {
  padding: 12px 14px;
  border-top: 1px solid #1a1e24;
  vertical-align: middle;
}
table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:hover { background: var(--bg-hover); }
.cell-name { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.cell-name svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.cell-dim { color: var(--text-faint); font-size: 12.5px; }
.cell-mono {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11.5px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-row td { text-align: center; color: var(--text-faint); padding: 36px 0 !important; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-dim);
}
.badge svg { width: 12px; height: 12px; }
.badge.green { background: var(--success-dim); color: var(--success); }
.badge.blue { background: var(--accent-dim); color: var(--accent-hover); }
.badge.pink { background: var(--danger-dim); color: var(--danger); }
.badge.amber { background: var(--warning-dim); color: var(--warning); }

/* ---------- Row action icons ---------- */
.row-actions { display: flex; gap: 10px; justify-content: flex-end; }
.icon-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-faint);
  border-radius: 5px;
  display: inline-flex;
  transition: color 0.13s, background 0.13s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn.edit { color: var(--accent); }
.icon-btn.copy { color: #8e7cf3; }
.icon-btn.del { color: var(--danger); }
.icon-btn.edit:hover { color: var(--accent-hover); }
.icon-btn.del:hover { color: #ff7099; }

/* ---------- Search input ---------- */
.search-box {
  position: relative;
  max-width: 320px;
  flex: 1;
}
.search-box svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.search-box input:focus { border-color: var(--accent); background: var(--bg-input-focus); }
.search-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.search-meta { color: var(--text-faint); font-size: 12.5px; }

/* ---------- Form fields ---------- */
.field {
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 13px 9px;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}
.field:focus-within { border-color: var(--accent); background: var(--bg-input-focus); }
.field-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 3px;
  user-select: none;
}
.field-label .req { color: var(--danger); margin-left: 2px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 0;
}
.field select { cursor: pointer; appearance: none; }
.field.has-select { position: relative; }
.field.has-select::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.7px solid var(--text-dim);
  border-bottom: 1.7px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field select option { background: var(--bg-panel-2); color: var(--text); }
.field textarea { resize: vertical; min-height: 52px; }
.field.mono input, .field.mono textarea { font-family: var(--mono); font-size: 12.5px; }
.field-hint { font-size: 11.5px; color: var(--text-faint); margin: 4px 2px 0; }
.form-group { margin-bottom: 13px; }

/* ---------- Slider rows ---------- */
.slider-row { margin-bottom: 16px; }
.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.slider-head label { font-size: 13.5px; font-weight: 600; }
.slider-head input[type="number"] {
  width: 76px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: right;
  padding: 5px 9px;
  outline: none;
}
.slider-head input[type="number"]:focus { border-color: var(--accent); }
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), #2c333d var(--fill, 0%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  cursor: grab;
}

/* ---------- Toggles ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.toggle-row .t-label { font-size: 13.5px; }
.toggle-row .t-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.switch {
  position: relative;
  width: 38px; height: 21px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .knob {
  position: absolute;
  inset: 0;
  background: #2c333d;
  border-radius: 21px;
  cursor: pointer;
  transition: background 0.18s;
}
.switch .knob::before {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  left: 3px; top: 3px;
  background: #aab3bf;
  border-radius: 50%;
  transition: transform 0.18s, background 0.18s;
}
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::before { transform: translateX(17px); background: #fff; }

/* ---------- Tag chips (groups) ---------- */
.tags-panel {
  background: var(--bg-panel-2);
  border-radius: var(--radius);
  padding: 16px;
}
.tags-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.tags-panel-head svg { width: 16px; height: 16px; }
.tags-panel-head.blue svg { color: var(--accent); }
.tags-panel-head.red svg { color: var(--danger); }
.tags-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.tags-input-row input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.tags-input-row input:focus { border-color: var(--accent); }
.tags-add-btn {
  width: 36px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.tags-add-btn.blue { background: var(--accent-dim); color: var(--accent-hover); }
.tags-add-btn.red { background: var(--danger-dim); color: var(--danger); }
.tags-add-btn:hover { filter: brightness(1.3); }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.tags-empty { color: var(--text-faint); font-size: 12.5px; width: 100%; text-align: center; padding: 8px 0; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px 4px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.tag-chip.blue { background: var(--accent-dim); color: var(--accent-hover); }
.tag-chip.red { background: var(--danger-dim); color: var(--danger); }
.tag-chip button {
  background: rgba(255,255,255,0.12);
  border: none;
  color: inherit;
  width: 16px; height: 16px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.tag-chip button:hover { background: rgba(255,255,255,0.25); }

/* ---------- Editor page ---------- */
.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.editor-head h1 { margin: 0; font-size: 19px; display: flex; align-items: center; gap: 9px; }
.editor-head h1 svg { width: 20px; height: 20px; color: var(--accent); }
.editor-actions { display: flex; gap: 10px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; }
.card {
  background: var(--bg-panel-2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Sub tabs (packet editor) ---------- */
.subtabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.subtab {
  background: none;
  border: none;
  padding: 10px 2px 11px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subtab svg { width: 15px; height: 15px; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Item / variant cards ---------- */
.entry-card {
  background: var(--bg-panel-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.entry-card.open { border-color: var(--accent); }
.entry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}
.entry-card-head:hover { background: var(--bg-hover); }
.entry-card-head .e-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-card-head .e-meta { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 12px; flex-shrink: 0; }
.entry-card-body { padding: 0 16px 16px; }
.variant-card {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.variant-head:hover { background: var(--bg-input-focus); }
.variant-head .v-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.variant-head .v-name { color: var(--accent-hover); font-weight: 700; font-size: 13px; }
.variant-head .v-actions { display: flex; gap: 8px; flex-shrink: 0; }
.variant-body { padding: 4px 13px 14px; }
.variant-body .field { background: var(--bg-panel-2); }
.add-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* ---------- Checkbox ---------- */
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}
.check-row input { display: none; }
.check-row .box {
  width: 17px; height: 17px;
  border: 1.5px solid var(--text-faint);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.13s, border-color 0.13s;
  flex-shrink: 0;
}
.check-row input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check-row input:checked + .box::after {
  content: '';
  width: 4px; height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fade-in 0.13s ease;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  animation: pop-in 0.16s ease;
}
.modal.wide { width: 860px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.modal-head h2 svg { width: 18px; height: 18px; color: var(--accent); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } }

/* ---------- Raw JSON editor ---------- */
.json-editor {
  width: 100%;
  height: 56vh;
  background: #0e1116;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #cdd6e0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  padding: 14px;
  outline: none;
  resize: vertical;
  white-space: pre;
  tab-size: 2;
}
.json-editor:focus { border-color: var(--accent); }

/* ---------- Validation results ---------- */
.vr-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}
.vr-item svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.vr-item.error { background: var(--danger-dim); color: #ffb3c8; }
.vr-item.error svg { color: var(--danger); }
.vr-item.warning { background: var(--warning-dim); color: #ffd9a0; }
.vr-item.warning svg { color: var(--warning); }
.vr-ok {
  display: flex; align-items: center; gap: 10px;
  background: var(--success-dim);
  color: var(--success);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.vr-ok svg { width: 18px; height: 18px; }

/* ---------- File manager ---------- */
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-panel-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  gap: 12px;
}
.file-row .f-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 9px; min-width: 0; }
.file-row .f-name svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.file-row .f-meta { color: var(--text-faint); font-size: 11.5px; flex-shrink: 0; }
.file-row .f-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Toasts ---------- */
.toast-root {
  position: fixed;
  bottom: 64px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 200;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 360px;
  animation: toast-in 0.2s ease;
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success { border-left-color: var(--success); }
.toast.success svg { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Misc ---------- */
.muted { color: var(--text-faint); }
.spacer { flex: 1; }
.mb-0 { margin-bottom: 0; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .tabbar { overflow-x: auto; }
  .view { padding: 16px; }
  .section-head { flex-direction: column; }
}
