/* ============================================================
   AFK Console Client — command center UI
   Dark, emerald-accented. No external assets; icons are inline SVG.
   ============================================================ */

:root {
  --bg: #08090a;
  --surface: #0e1112;
  --surface-2: #14181a;
  --surface-3: #1a1f21;
  --border: #1e2426;
  --border-hi: #2b3336;

  --text: #e9efec;
  --text-dim: #7d8b88;
  --text-faint: #4d5856;

  --accent: #10b981;
  --accent-2: #14b8a6;
  --accent-dim: #0d8f64;
  --accent-glow: rgba(16, 185, 129, 0.16);
  --accent-soft: rgba(16, 185, 129, 0.08);

  --red: #ef4444;
  --red-dark: #b91c1c;
  --red-glow: rgba(239, 68, 68, 0.16);
  --amber: #f59e0b;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

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

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Thin, dark scrollbars so overflow areas don't break the palette. */
* { scrollbar-width: thin; scrollbar-color: var(--border-hi) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulseRingRed {
  0%   { box-shadow: 0 0 0 0 var(--red-glow); }
  70%  { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.45s var(--ease);
}
.auth-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-bottom: 18px;
}
.auth-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-title { font-size: 24px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.3px; }
.auth-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }
.auth-error { color: var(--red); min-height: 18px; font-size: 13px; margin: 0 0 8px; }
.auth-actions { display: flex; gap: 10px; margin-top: 20px; }
.auth-actions .btn { flex: 1; }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 14px 16px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: #04120c; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent); }
.brand-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--text-faint); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.tab {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.tab:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.tab:active { transform: translateX(2px) scale(0.985); }
.tab[aria-selected="true"] {
  background: var(--accent-soft);
  border-color: rgba(16, 185, 129, 0.22);
  color: var(--accent);
  font-weight: 600;
}
/* Left accent bar on the active row. */
.tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: translateY(-50%);
  animation: fadeIn 0.25s var(--ease);
}
.nav-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.conn { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.conn-text { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: 0.3px; }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; font-size: 12px; color: var(--text-faint); }

/* Shared status dot. `.live` pulses; `.raid` pulses red; `.down` is inert. */
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: 0 0 auto; transition: background 0.25s var(--ease); }
.dot.live { background: var(--accent); animation: pulseRing 2s infinite; }
.dot.raid { background: var(--red); animation: pulseRingRed 1.1s infinite; }
.dot.down { background: var(--red); }
.dot.warn { background: var(--amber); }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-text { min-width: 0; }
.page-title { font-size: 23px; font-weight: 680; margin: 0; letter-spacing: -0.45px; }
.page-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--text-dim); }
.topbar-meta { display: flex; align-items: center; gap: 10px; }
.pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* ---------- Main body: views + rail ---------- */
.main-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 22px;
  padding: 22px 28px 28px;
  min-height: 0;
  overflow: hidden;
}
.main-body.no-rail { grid-template-columns: minmax(0, 1fr); }
.main-body.no-rail .rail { display: none; }

.views { min-height: 0; overflow-y: auto; padding-right: 4px; }
.view { display: flex; flex-direction: column; gap: 20px; }
.rail { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }

/* Cards stagger in whenever their view becomes visible. `backwards` holds them
   invisible through the delay instead of flashing at full opacity first. */
.view:not(.hidden) > .card,
.rail > .card { animation: fadeUp 0.4s var(--ease) backwards; }
.view:not(.hidden) > .card:nth-child(1) { animation-delay: 0.02s; }
.view:not(.hidden) > .card:nth-child(2) { animation-delay: 0.14s; }
.view:not(.hidden) > .card:nth-child(3) { animation-delay: 0.20s; }
.view:not(.hidden) > .card:nth-child(4) { animation-delay: 0.26s; }
.rail > .card:nth-child(1) { animation-delay: 0.10s; }
.rail > .card:nth-child(2) { animation-delay: 0.16s; }

/* ---------- Summary tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 15px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeUp 0.4s var(--ease) backwards;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease);
}
.tile:hover { border-color: var(--border-hi); transform: translateY(-1px); }
/* Thin accent rule along the bottom edge, fading out to the right. */
.tile::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.45;
}
.tile:nth-child(1) { animation-delay: 0.02s; }
.tile:nth-child(2) { animation-delay: 0.06s; }
.tile:nth-child(3) { animation-delay: 0.10s; }
.tile:nth-child(4) { animation-delay: 0.14s; }
.tile-k {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.1px; color: var(--text-faint);
}
.tile-v {
  font-size: 27px; font-weight: 700; letter-spacing: -1px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-v.sm { font-size: 18px; letter-spacing: -0.4px; }
.tile-v.accent { color: var(--accent); }
.tile-v.bad { color: var(--red); }
.tile-f { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-bar { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.tile-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-2));
  transition: width 0.4s var(--ease);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.card:hover { border-color: var(--border-hi); transform: translateY(-1px); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.card-head h3 { font-size: 14.5px; font-weight: 650; margin: 0; letter-spacing: -0.1px; }
.card-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.card-head .link-btn { margin-left: auto; }
.card-body { padding: 18px; }
.card-subhead {
  font-family: var(--mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim);
  margin: 26px 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
/* Console card fills the available height. */
.card-tall { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.card-body-tall { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 12px; }
#view-console { height: 100%; }

.rail-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); font-weight: 600; }
.rail-body { padding: 12px; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 18px;
  transition: background 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:active { transform: scale(0.975); }
.btn-green { background: var(--accent-dim); color: #04120c; font-weight: 600; }
.btn-green:hover { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-red { background: var(--red-dark); }
.btn-red:hover { background: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.btn-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 8px 18px;
  font-size: 13px;
}
.btn-pill:hover { background: var(--surface-3); border-color: var(--border-hi); }
.btn-warn { border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.btn-warn:hover { border-color: var(--red); color: var(--red); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }

.icon-btn {
  width: 38px; height: 38px; flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.icon-btn:hover { background: var(--accent-soft); border-color: rgba(16, 185, 129, 0.35); color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }

.link-btn {
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  padding: 2px 4px;
  border-radius: 5px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.link-btn:hover { color: var(--accent); background: var(--accent-soft); }
.link-btn.danger { color: #b4666a; }
.link-btn.danger:hover { color: var(--red); background: rgba(239, 68, 68, 0.09); }

/* ---------- Inputs ---------- */
.text-input, .select-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.text-input::placeholder { color: var(--text-faint); }
.text-input:hover, .select-input:hover { border-color: var(--border-hi); }
.text-input:focus, .select-input:focus {
  outline: none;
  background: var(--surface-3);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.select-input { cursor: pointer; }
.field-label, .settings-label { color: var(--text); font-size: 14px; }
.hint { color: var(--text-dim); font-size: 12px; line-height: 1.55; margin: 12px 0 0; }
.hint code {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; color: var(--accent);
}
.muted-note { color: var(--text-dim); font-family: var(--mono); font-size: 11px; margin: 10px 0; }

/* Toggle */
.toggle {
  position: relative;
  width: 42px; height: 23px; flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  padding: 0;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.toggle::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: left 0.24s var(--ease), background 0.24s var(--ease);
}
.toggle:hover { border-color: var(--border-hi); }
.toggle[aria-pressed="true"] { background: var(--accent-dim); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.toggle[aria-pressed="true"]::after { left: 21px; background: #04120c; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 210px;
  align-items: center;
  row-gap: 14px;
  column-gap: 18px;
}
.settings-grid .text-input,
.settings-grid .btn-pill,
.settings-grid .select-input { justify-self: stretch; width: 100%; }
.proxy-pool { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical; }
.reminder-box { font-family: var(--mono); font-size: 12px; line-height: 1.6; resize: vertical; }
/* Multi-line settings labels need to sit at the top of their grid row, not centred against a
   3-row textarea. */
.settings-grid:has(.reminder-box) { align-items: center; }
.settings-grid .reminder-box { align-self: start; }
.label-sub { color: var(--text-faint); font-size: 11px; font-family: var(--mono); }

/* ---------- Accounts ---------- */
.account-form { margin-bottom: 16px; }
.account-inputs { display: flex; align-items: flex-end; gap: 10px; }
.input-group { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.acc-hint { color: var(--text-dim); font-size: 12px; margin: 8px 0 0; }
.account-list-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 8px; }
.select-all { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.select-all input { accent-color: var(--accent); cursor: pointer; }

.account-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg);
}
.account-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  transition: background 0.16s var(--ease), box-shadow 0.16s var(--ease);
  animation: slideInLeft 0.28s var(--ease) backwards;
}
.account-row:last-child { border-bottom: none; }
.account-row:hover { background: var(--surface-2); }
/* The selected row is the target for chat and the inventory buttons — make that obvious. */
.account-row.selected { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.account-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-tag { font-family: var(--mono); font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.account-status { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.3px; }
/* Uptime · ping for a connected bot. Empty (and so invisible) for everything else. */
.account-metrics { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.account-status.online { color: var(--accent); }
.account-status.connecting { color: var(--amber); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: 0 0 auto; transition: background 0.25s var(--ease); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.status-dot.connecting { background: var(--amber); animation: pulseRing 1.4s infinite; }
.status-dot.enabled { background: var(--text-dim); }
.account-power, .account-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 13px; padding: 2px 5px; border-radius: 5px;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.account-power:hover { color: var(--accent); background: var(--accent-soft); }
.account-del:hover { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.account-empty, .leaderboard-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 22px 8px; }
.account-footer { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

/* ---------- Data lists (leaderboard, checkers, roster) ---------- */
.data-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg);
}
.leaderboard-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.16s var(--ease);
  animation: slideInLeft 0.26s var(--ease) backwards;
}
.leaderboard-row:hover { background: var(--surface-2); }
.leaderboard-rank {
  flex: 0 0 auto; width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 5px; background: var(--surface-3); color: var(--text-dim);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
}
.leaderboard-row:first-child .leaderboard-rank { background: var(--accent-dim); color: #04120c; }
.leaderboard-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-points { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text); }
.leaderboard-gain { color: var(--accent); font-family: var(--mono); font-size: 10.5px; flex: 0 0 auto; }
.roster-badge { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px; }
.roster-badge.ok { color: var(--accent); border-color: rgba(16, 185, 129, 0.3); background: var(--accent-soft); }

/* ---------- Wall bot ---------- */
.wall-state {
  margin-left: auto;
  font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.wall-state.on { color: var(--accent); border-color: rgba(16, 185, 129, 0.35); background: var(--accent-soft); }
.wall-state.raid { color: var(--red); border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); font-weight: 700; animation: pulseRingRed 1.2s infinite; }
.wall-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wall-actions-end { margin-top: 14px; }
.wall-confirm {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  margin-top: 12px; padding: 11px 13px;
  font-size: 12.5px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.24s var(--ease);
}
.wall-confirm .btn-pill { padding: 6px 13px; font-size: 12px; }
.wall-note { color: var(--text-dim); font-size: 11.5px; margin-top: 10px; font-family: var(--mono); }
.wall-note a { color: var(--accent); }

/* ---------- Rail ---------- */
.stat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 6px;
  transition: background 0.18s var(--ease);
}
.stat:last-child { margin-bottom: 0; }
.stat:hover { background: var(--surface-3); }
.stat-k { font-size: 12.5px; color: var(--text-dim); }
.stat-v { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-v.good { color: var(--accent); }
.stat-v.bad { color: var(--red); }
.stat-v.warn { color: var(--amber); }

.activity { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.activity-row {
  display: flex; gap: 9px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  animation: slideInLeft 0.28s var(--ease);
}
.activity-row:hover { background: var(--surface-2); }
.activity-time { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); flex: 0 0 auto; padding-top: 1px; }
.activity-text { color: var(--text-dim); min-width: 0; overflow-wrap: anywhere; }
.activity-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 18px 8px; }

/* ---------- Console ---------- */
.console-select { width: auto; margin-left: auto; font-size: 12.5px; padding: 6px 10px; }
.console-output {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}
.console-line { color: var(--text-dim); overflow-wrap: anywhere; animation: fadeIn 0.2s var(--ease); }
.console-line .who { color: var(--accent); }
.console-line.err { color: #f2a0a0; }
/* Line kinds: server chat reads brightest, the panel's own log stays quiet. */
.console-line.kind-chat { color: #cfe0d7; }
.console-line.kind-whisper { color: #8ab4f8; }
.console-line.kind-error { color: #f2a0a0; }
.console-line.kind-error .who { color: var(--red); }

.console-filters { display: flex; gap: 5px; flex: 0 0 auto; flex-wrap: wrap; }
.chip-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.chip-btn:hover { color: var(--text); border-color: var(--border-hi); }
.chip-btn.on { color: var(--accent); background: var(--accent-soft); border-color: rgba(16, 185, 129, 0.3); }
.console-input-row { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 50;
  animation: fadeIn 0.2s var(--ease);
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s var(--ease);
}
.modal-card h3 { margin: 0 0 10px; font-size: 18px; }
.modal-card p { color: var(--text-dim); font-size: 13.5px; margin: 0 0 18px; }
.msa-code {
  font-family: var(--mono);
  font-size: 26px; letter-spacing: 4px;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}
.msa-link { display: inline-block; color: var(--accent); margin-bottom: 20px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1150px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .tiles { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 1100px) {
  .main-body { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 820px) {
  /* Sidebar becomes a top strip; the page scrolls as a whole. */
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; border-right: none; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .brand { padding: 0 10px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .tab { width: auto; padding: 8px 12px; }
  .tab[aria-selected="true"]::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: none; flex-direction: row; align-items: center; gap: 14px; }
  .main-body { overflow: visible; padding: 16px; }
  .views { overflow: visible; }
  .settings-grid { grid-template-columns: 1fr; row-gap: 8px; }
  .settings-grid .toggle { justify-self: start; }
  .console-output { min-height: 340px; max-height: 60vh; }
  .topbar { padding: 14px 16px; }
}

/* ---------- Reduced motion ----------
   One switch that disables every animation and transition above. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
