/* ============================================================================
   Arcem dashboard — design tokens
   A restrained, high-contrast dark UI: near-black surfaces, hairline
   borders instead of glow/shadow, a single amber accent used sparingly,
   and a monospace type for anything numeric/technical (ids, stats,
   the guild console). Light theme mirrors the same structure with the
   surfaces inverted.
   ========================================================================= */

:root {
  --bg-canvas:      #0a0b0d;
  --bg-surface:     #131418;
  --bg-surface-alt: #0e0f12;
  --bg-inset:       #0a0b0d;
  --bg-hover:       #1b1d22;

  --border:         #23252b;
  --border-strong:  #33363e;

  --text:           #edeef1;
  --text-muted:     #9a9da6;
  --text-faint:     #64676f;

  --accent:         #cf9a4c;
  --accent-hover:   #dfae66;
  --accent-soft:    rgba(207, 154, 76, 0.14);
  --accent-ink:     #1a1408;

  --success:        #3fb676;
  --success-soft:   rgba(63, 182, 118, 0.14);
  --danger:         #e5555b;
  --danger-soft:    rgba(229, 85, 91, 0.14);
  --warning:        #d9822b;
  --warning-soft:   rgba(217, 130, 43, 0.14);
  --info:           #5c8fd6;
  --info-soft:      rgba(92, 143, 214, 0.14);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 9px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.28), 0 12px 28px rgba(0, 0, 0, 0.22);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.12s var(--ease);
}
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent-soft); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-surface-alt);
}
::-webkit-scrollbar-thumb:hover { background: #454851; }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.center-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(207, 154, 76, 0.05), transparent 45%),
    var(--bg-canvas);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 320px;
  text-align: center;
  box-shadow: var(--shadow-2);
}

.error { color: var(--danger); }
.success { color: var(--success); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease), transform 0.05s var(--ease);
}
.btn:hover { background: #23262c; border-color: #45484f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-small { font-size: 0.76rem; padding: 0.3rem 0.65rem; }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #1a1105; }
.btn-warning:hover { background: #e8933c; border-color: #e8933c; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #200608; }
.btn-danger:hover { background: #ee6a6f; border-color: #ee6a6f; }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); }

/* ── Top bar / layout ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.brand::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.spacer { flex: 1; }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s var(--ease);
}
.panel h2 {
  margin-top: 0;
  font-size: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.panel h3 {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status-msg { font-size: 0.8rem; color: var(--text-muted); }
.status-msg.error { color: var(--danger); }
.status-msg.success { color: var(--success); }

/* ── Stat grid ────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
}
.stat-box {
  background: var(--bg-inset);
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 0.15s var(--ease);
}
.stat-box:hover { background: var(--bg-hover); }
.stat-label {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Data table ───────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.data-table tbody tr { transition: background 0.1s var(--ease); }
.data-table tbody tr:hover { background: var(--bg-hover); }

.server-detail-card { margin-top: 1rem; }
.server-detail-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.server-detail-head h3 { margin: 0 0 0.15rem 0; font-size: 1.05rem; }
.server-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  object-fit: cover;
}
.server-detail-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
}

.console-box {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

#server-search {
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text);
  flex: 1;
  min-width: 180px;
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.12s var(--ease);
}
#server-search:focus { border-color: var(--accent); outline: none; }

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.7);
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  width: 360px;
  box-shadow: var(--shadow-2);
  animation: modal-in 0.14s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal textarea {
  width: 100%;
  min-height: 80px;
  margin: 0.75rem 0;
  padding: 0.6rem;
  background: var(--bg-inset);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  resize: vertical;
}
.modal textarea:focus { border-color: var(--accent); outline: none; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ── Nav tabs (user dashboard) ───────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.nav-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.nav-tabs a:hover { background: var(--bg-hover); color: var(--text); }
.nav-tabs a.active { background: var(--accent-soft); color: var(--accent); }
.nav-tabs a.active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: -0.61rem;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

/* ── Server cards ─────────────────────────────────────────────────────── */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.server-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.server-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.server-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.server-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  object-fit: cover;
  flex-shrink: 0;
}
.server-icon-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
}
.server-name-block { min-width: 0; }
.server-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-guild-id {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.server-card-body {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.server-card-footer { margin-top: auto; }
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.badge-pill.online { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-pill.online::before { background: var(--success); box-shadow: 0 0 0 2px var(--success-soft); }

/* ── Module cards ─────────────────────────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.module-card {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s var(--ease);
}
.module-card:hover { border-color: var(--border-strong); }
.module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.module-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.module-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.module-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
}
.module-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.module-status-pill.on { background: var(--success-soft); color: var(--success); }
.module-status-pill.on::before { background: var(--success); box-shadow: 0 0 0 2px rgba(63, 182, 118, 0.25); }
.module-status-pill.off { background: var(--bg-hover); color: var(--text-faint); }
.module-status-pill.off::before { background: var(--text-faint); }

/* ── Switch ───────────────────────────────────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background 0.15s var(--ease);
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 3px;
  top: 3px;
  background: #f4f5f7;
  border-radius: 50%;
  transition: transform 0.15s var(--ease);
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(17px); }

/* ── Form fields ──────────────────────────────────────────────────────── */
.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.field-row label {
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.field-row input[type="text"],
.field-row select {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.12s var(--ease);
}
.field-row input[type="text"]:focus,
.field-row select:focus { border-color: var(--accent); outline: none; }
.field-row input[type="text"] { max-width: 320px; }
.field-row.max-w-220 input[type="text"],
.field-row.max-w-220 select { max-width: 220px; }

/* ── Track list ───────────────────────────────────────────────────────── */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.track-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}
.track-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.track-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: var(--text-faint);
}
.track-title { font-weight: 500; font-size: 0.87rem; }
.track-title a { color: inherit; text-decoration: none; }
.track-title a:hover { color: var(--accent); }

/* ── Category list ────────────────────────────────────────────────────── */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.75rem 0 1.25rem;
}
.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.category-row-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.category-row-emoji { font-size: 1.2rem; line-height: 1.6; }
.category-row-label { font-weight: 600; font-size: 0.88rem; }
.category-add-form {
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px dashed var(--border-strong);
}
.category-add-form .field-row input[type="text"] { max-width: 260px; }

.prefix-hint { font-size: 0.76rem; color: var(--text-muted); }
.prefix-hint code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--accent);
}

/* ── Profile page ─────────────────────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-username { color: var(--text-muted); font-size: 0.88rem; }
.profile-userid { color: var(--text-faint); font-size: 0.76rem; font-family: var(--font-mono); }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.badge-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.theme-options { display: flex; gap: 0.5rem; }
.theme-option {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease);
}
.theme-option:hover { background: var(--bg-hover); }
.theme-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.coming-soon { opacity: 0.5; pointer-events: none; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.empty-state .icon-lg { color: var(--text-faint); opacity: 1; }
.empty-state code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85em;
}

/* ── Icon system (inline SVGs) ────────────────────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-sm { width: 0.85em; height: 0.85em; }

/* ── Layout helpers ───────────────────────────────────────────────────── */
.mt-1 { margin-top: 1rem; }
.mt-075 { margin-top: 0.75rem; }
.mt-125 { margin-top: 1.25rem; }
.max-w-220 { max-width: 220px; }
.icon-lg-64 { width: 64px; height: 64px; }
.text-lg { font-size: 1.15rem; }

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.panel-header-row h2 { margin: 0; padding-bottom: 0; border-bottom: none; }

/* ── Info box ─────────────────────────────────────────────────────────── */
.info-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font-size: 0.83rem;
  margin: 0.75rem 0;
}
.info-box.warn { border-color: rgba(217, 130, 43, 0.4); background: var(--warning-soft); color: var(--warning); }
.info-box .icon { flex-shrink: 0; }
.info-box-text { flex: 1; color: var(--text-muted); }
.info-box-text strong { color: var(--text); }
html[data-theme="light"] .info-box-text strong { color: #101114; }

.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ── Server detail actions row ───────────────────────────────────────── */
.server-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* ============================================================================
   Guild console — styled like a real terminal: monospace throughout, amber
   caret/prompt, hairline separators instead of nested cards.
   ========================================================================= */
.console-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.console-breadcrumb-sep { color: var(--text-faint); font-size: 1rem; line-height: 1; }
.console-breadcrumb-active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
}
.console-guild-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.25rem;
}
.console-guild-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 700;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.console-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.console-header-left { display: flex; align-items: center; gap: 0.55rem; }
.console-header-left h2 {
  margin: 0;
  font-size: 0.95rem;
  font-family: var(--font-mono);
}
.console-header-right { display: flex; align-items: center; gap: 0.4rem; }
.console-guild-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
  color: var(--text-muted);
}
.console-guild-icon-sm { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; }
.console-info-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.76rem;
  color: var(--text-faint);
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border);
}
.console-info-bar kbd {
  display: inline-block;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1.4;
}
.console-output {
  flex: 1;
  min-height: 340px;
  max-height: 540px;
  overflow-y: auto;
  padding: 0.85rem 1.1rem;
  background: var(--bg-inset);
  font-family: var(--font-mono);
  font-size: 0.81rem;
  scroll-behavior: smooth;
}
.console-line { line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.console-welcome { color: var(--accent); }
.console-hint { color: var(--text-faint); }
.console-spinner { color: var(--text-muted); font-style: italic; }
.console-input-echo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  margin-top: 0.4rem;
}
.console-prompt-sym { color: var(--accent); font-weight: bold; font-size: 0.85rem; }
.console-prompt { color: var(--success); font-size: 0.76rem; }
.console-meta { color: var(--text-faint); font-size: 0.76rem; }
.console-cmd-ref { color: var(--info); font-family: var(--font-mono); }
.console-cmd-text { color: var(--text); }
.console-output-block {
  margin: 0.2rem 0 0.6rem 1rem;
  padding: 0.4rem 0.7rem;
  border-left: 2px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.console-output-block.console-ok { border-left-color: var(--success); color: var(--text-muted); }
.console-output-block.console-err { border-left-color: var(--danger); color: var(--danger); }
.console-input-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface-alt);
}
.console-input-prefix {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: bold;
  color: var(--accent);
  padding: 0 0.5rem 0 0;
  user-select: none;
  line-height: 1;
}
.console-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  caret-color: var(--accent);
  padding: 0.25rem 0;
}
.console-input::placeholder { color: var(--text-faint); }
.console-shortcuts {
  padding: 0.3rem 1.1rem 0.6rem;
  font-size: 0.7rem;
  color: var(--text-faint);
  background: var(--bg-surface-alt);
}
.console-shortcuts kbd {
  display: inline-block;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 0.02rem 0.3rem;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── History modal ────────────────────────────────────────────────────── */
.console-history-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.75rem 0 0;
}
.console-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border);
}
.console-history-row .console-cmd-ref {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Server card button group ────────────────────────────────────────── */
.server-card-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

/* ============================================================================
   Light theme — same structural tokens, inverted surfaces. Applied via
   [data-theme="light"] on <html>, toggled by the theme switcher.
   ========================================================================= */
html[data-theme="light"] {
  color-scheme: light;
  --bg-canvas:      #f3f4f6;
  --bg-surface:     #ffffff;
  --bg-surface-alt: #f7f8fa;
  --bg-inset:       #f0f1f4;
  --bg-hover:       #eceef1;

  --border:         #e2e4e9;
  --border-strong:  #cfd2d9;

  --text:           #14151a;
  --text-muted:     #61646d;
  --text-faint:     #8b8e97;

  --accent-ink:     #1a1408;
}
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .topbar { box-shadow: var(--shadow-1); }
html[data-theme="light"] .switch-slider::before { background: #ffffff; }
