/* Config editor — reuses the portal's tokens (--acc, --surf, --border, …). */

.ed-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .ed-wrap { grid-template-columns: 1fr; } }

/* ── Tab strip ─────────────────────────────────────────────────────────── */
.ed-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 5px; margin-bottom: 14px;
  background: var(--surf); border: 1px solid var(--border); border-radius: var(--r2);
}
.ed-tab {
  flex: 1 1 auto; padding: 8px 14px; border: 0; border-radius: var(--r);
  background: transparent; color: var(--sub); cursor: pointer;
  font: 600 12.5px 'Outfit', system-ui, sans-serif; white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.ed-tab:hover { color: var(--text); background: var(--surf3); }
.ed-tab.active {
  color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc2));
  box-shadow: 0 4px 14px rgba(109, 124, 255, .3);
}

/* ── Groups ────────────────────────────────────────────────────────────── */
.ed-group {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 16px 18px; margin-bottom: 14px;
}
.ed-group-title {
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.ed-group-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(var(--acc), var(--cyan));
}
.ed-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 11px 20px; }

.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.ed-row.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.ed-label { font-size: 12.5px; color: var(--sub); flex: 1 1 auto; }
.ed-row:hover .ed-label { color: var(--text); }

/* ── Switch ────────────────────────────────────────────────────────────── */
.ed-sw {
  position: relative; flex: 0 0 auto; width: 38px; height: 21px;
  border-radius: 11px; border: 1px solid var(--border2); background: var(--surf3);
  cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ed-sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--muted);
  transition: transform .22s var(--spring), background .2s var(--ease);
}
.ed-sw[aria-checked="true"] { background: var(--acc-dim); border-color: var(--acc); }
.ed-sw[aria-checked="true"]::after { transform: translateX(17px); background: var(--acc); }
.ed-sw:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ── Slider ────────────────────────────────────────────────────────────── */
.ed-slide { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; width: 158px; }
.ed-slide input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1 1 auto; width: 100%;
  height: 4px; border-radius: 2px; background: var(--surf3); cursor: pointer;
}
.ed-slide input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--acc); cursor: pointer; border: 2px solid var(--surf);
  box-shadow: 0 0 0 1px var(--acc);
}
.ed-slide input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: var(--acc);
  cursor: pointer; border: 2px solid var(--surf); box-shadow: 0 0 0 1px var(--acc);
}
.ed-num {
  width: 58px; flex: 0 0 auto; padding: 4px 6px; text-align: right;
  background: var(--surf); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font: 500 11.5px var(--mono);
}
.ed-num:focus { outline: 0; border-color: var(--acc); }
.ed-unit { font-size: 10.5px; color: var(--muted); min-width: 16px; }

/* ── Select / key / number ─────────────────────────────────────────────── */
.ed-sel, .ed-key {
  flex: 0 0 auto; min-width: 118px; padding: 5px 9px;
  background: var(--surf); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font: 500 12px 'Outfit', system-ui, sans-serif; cursor: pointer;
}
.ed-sel:focus, .ed-key:focus { outline: 0; border-color: var(--acc); }
.ed-key { font-family: var(--mono); font-size: 11.5px; text-align: center; }
.ed-key.listening {
  border-color: var(--acc); color: var(--acc);
  background: var(--acc-dim); animation: edPulse 1.1s ease-in-out infinite;
}
@keyframes edPulse { 50% { opacity: .55; } }

/* ── Colour ────────────────────────────────────────────────────────────── */
.ed-col { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ed-col input[type=color] {
  width: 30px; height: 24px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid var(--border2); border-radius: 6px;
}
.ed-col input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.ed-col input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.ed-col input[type=range] {
  -webkit-appearance: none; appearance: none; width: 62px; height: 4px;
  border-radius: 2px; cursor: pointer;
}
.ed-col input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border2);
}
.ed-col input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 1px solid var(--border2);
}
.ed-alpha { font: 500 10.5px var(--mono); color: var(--muted); min-width: 26px; text-align: right; }

/* ── Tables (outfit / friends / teleports) ─────────────────────────────── */
.ed-table-wrap { overflow-x: auto; }
.ed-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ed-table th {
  text-align: left; padding: 6px 8px; color: var(--muted);
  font: 600 10.5px 'Outfit', system-ui, sans-serif; text-transform: uppercase;
  letter-spacing: .5px; border-bottom: 1px solid var(--border);
}
.ed-table td { padding: 4px 8px; border-bottom: 1px solid rgba(28, 35, 64, .5); }
.ed-table tr:last-child td { border-bottom: 0; }
.ed-table .ed-idx { color: var(--muted); font: 500 11px var(--mono); width: 34px; }
.ed-inp {
  width: 100%; padding: 5px 8px; background: var(--surf);
  border: 1px solid var(--border); border-radius: 7px; color: var(--text);
  font: 500 12px 'Outfit', system-ui, sans-serif;
}
.ed-inp:focus { outline: 0; border-color: var(--acc); }
.ed-inp.mono { font-family: var(--mono); font-size: 11.5px; }
.ed-inp.num { text-align: right; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.ed-side {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 15px; position: sticky; top: 16px;
}
@media (max-width: 1000px) { .ed-side { position: static; } }
.ed-side-title {
  font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--sub); margin-bottom: 10px;
}
.ed-save-row { display: flex; gap: 7px; margin-bottom: 8px; }
.ed-save-row .ed-inp { flex: 1 1 auto; }
.ed-hint { font-size: 10.5px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.ed-hint b { color: var(--sub); font-weight: 600; }

.ed-list { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.ed-item {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 8px 10px; background: var(--surf); transition: border-color .18s var(--ease);
}
.ed-item:hover { border-color: var(--border2); }
.ed-item.active { border-color: var(--acc); background: var(--acc-dim); }
.ed-item-name { font-weight: 600; font-size: 12.5px; word-break: break-word; }
.ed-item-meta { font: 500 10px var(--mono); color: var(--muted); margin-top: 1px; }
.ed-item-actions { display: flex; gap: 5px; margin-top: 7px; }
.ed-item-actions .btn { flex: 1 1 auto; }

.ed-note {
  border: 1px solid var(--border2); border-left: 3px solid var(--yellow);
  background: rgba(255, 178, 36, .07); border-radius: var(--r);
  padding: 9px 12px; font-size: 11.5px; color: var(--sub); margin-bottom: 14px;
}
.ed-dirty { color: var(--yellow); font-weight: 700; }
.ed-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; }
