/* ============================================================
   Arctic Dashboard — Premium Frosty Redesign
   Dark arctic theme | ice-blue #74c0fc | glassy cards
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --bg:            #06090f;
  --bg-mid:        #0d1420;
  --panel:         rgba(17, 24, 38, 0.72);
  --panel-solid:   #111826;
  --panel2:        rgba(29, 36, 52, 0.72);
  --panel2-solid:  #1d2434;
  --glass-edge:    rgba(116, 192, 252, 0.12);
  --glass-hover:   rgba(116, 192, 252, 0.22);
  --ice:           #74c0fc;
  --ice-dim:       rgba(116, 192, 252, 0.18);
  --ice-glow:      rgba(116, 192, 252, 0.30);
  --frost:         #a8d8f0;
  --text:          #e8eef7;
  --dim:           #7a93b0;
  --ok:            #57f287;
  --ok-dim:        rgba(87, 242, 135, 0.15);
  --err:           #ed4245;
  --err-dim:       rgba(237, 66, 69, 0.15);
  --warn:          #fee75c;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:      6px;
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-glow:    0 0 24px var(--ice-glow);
  --transition:     0.22s ease-out;
  --font-body:      "Inter", "Segoe UI", "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display:   "Outfit", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --aurora-2:       rgba(177, 151, 252, 0.07);
}
/* ── Keyframes ─────────────────────────────────────────── */
@keyframes aurora {
  0%   { opacity: 1; transform: scale(1) translate(0, 0); }
  33%  { opacity: 0.8; transform: scale(1.08) translate(-2%, 1%); }
  66%  { opacity: 0.9; transform: scale(0.96) translate(1%, -1%); }
  100% { opacity: 1; transform: scale(1) translate(0, 0); }
}
@keyframes snowfall {
  0%   { transform: translateY(-8px) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes eq1 { 0%, 100% { height:  6px; } 50% { height: 18px; } }
@keyframes eq2 { 0%, 100% { height: 10px; } 50% { height: 22px; } }
@keyframes eq3 { 0%, 100% { height:  8px; } 50% { height: 14px; } }
@keyframes toast-in  { from { opacity: 0; transform: translateX(120%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); }     to { opacity: 0; transform: translateX(120%); } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ── Base Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 400px at 75% -5%,  rgba(116, 192, 252, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 700px 350px at 20% 105%, rgba(168, 216, 240, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 600px at 50%  50%, rgba(13, 20, 32, 0.9)   0%, transparent 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4, .stat, .tab, button { font-family: var(--font-display); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 1200px 500px at 70% -10%, rgba(22, 32, 47, 0.8) 0%, transparent 65%),
    radial-gradient(ellipse 800px 420px at 15% 110%, var(--aurora-2) 0%, transparent 70%);
  /* aurora drift removed — flat backdrop */
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.7) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 180px 180px, 260px 260px, 200px 200px, 310px 310px;
  background-position: 0 0, 80px 120px, 40px 60px, 150px 90px;
  animation: snowfall 40s linear infinite;
  opacity: 0.12; /* whisper of frost */
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-edge); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ice-dim); }
::selection { background: var(--ice-dim); color: var(--frost); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: var(--radius-xs); }
/* ── Utilities ─────────────────────────────────────────── */
.hidden       { display: none !important; }
.dim          { color: var(--dim); }
.error        { color: var(--err); }
.ok           { color: var(--ok); }
.center       { display: grid; place-items: center; min-height: 70vh; }
.center-text  { text-align: center; margin-top: 3rem; }
code {
  background: var(--panel2-solid);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-xs);
  font-size: 0.9em;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: rgba(6, 9, 15, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-edge);
}
.brand-mark { font-size: 1.3rem; filter: drop-shadow(0 0 8px var(--ice-glow)); }
.topbar-brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-link { display: flex; align-items: center; gap: 0.6rem; }
.topbar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--ice) 0%, var(--frost) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-brand .dim { -webkit-text-fill-color: var(--dim); }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  display: inline-block;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.status-dot.online {
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
/* ── Cards (glassy) ────────────────────────────────────── */
.card {
  background: var(--panel2-solid);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.card-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 0.35rem;
}

/* ── Buttons ────────────────────────────────────────────────
   Class-based contract (v15): chrome rules below are opt-in via .btn.
   Every <button> in the dashboard carries `btn` in its class list;
   bare element rules would leak into widget/blank buttons, so the
   wide `button:not(...)` chains were re-rooted at `.btn` (same :not
   sets kept for exact visual parity). */
button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn:not(.tab):not(.guilds button) {
  background: var(--ice);
  color: #06121f;
  box-shadow: none;
}
.btn:not(.tab):not(.guilds button):hover {
  filter: brightness(1.08);
}
.btn:not(.tab):not(.guilds button):active {
  filter: brightness(0.94);
}
button.ghost {
  background: transparent !important;
  color: var(--dim) !important;
  border: 1px solid var(--glass-edge) !important;
  box-shadow: none !important;
  filter: none !important;
}
button.ghost:hover {
  background: var(--ice-dim) !important;
  color: var(--frost) !important;
  border-color: var(--ice-dim) !important;
}
/* ── Login ─────────────────────────────────────────────── */
.login {
  width: min(420px, 92vw);
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.login::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse 300px 200px at 50% 40%, rgba(116, 192, 252, 0.15) 0%, transparent 70%);
  pointer-events: none;
  /* aurora drift removed */
}
/* …that halo is 60px wider than the card on every side, which used to push the
   page to 435px wide (a 60px horizontal scrollbar on any phone). Clip the paint
   only — `clip` creates no scroll container, so nothing else is affected. */
#login-view { overflow-x: clip; }
.login h2 {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ice) 0%, var(--frost) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.1rem;
}

/* ── Login hero & feedback ─────────────────────────────── */
.login-logo {
  font-size: 3.2rem;
  text-align: center;
  filter: drop-shadow(0 0 18px var(--ice-glow));
  animation: float 4s ease-in-out infinite;
}
.login button[type="submit"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.shake { animation: shake 0.5s ease-in-out; }

/* ── Inputs & Forms ────────────────────────────────────── */
input, select {
  background: rgba(29, 36, 52, 0.85);
  color: var(--text);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input::placeholder { color: var(--dim); }
input:focus, select:focus {
  outline: none;
  border-color: var(--ice);
  box-shadow: 0 0 0 3px var(--ice-glow);
}
.form-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.form-row input { flex: 1; min-width: 120px; }
.form-row input#prefix-input { max-width: 120px; }

/* ── App Layout ────────────────────────────────────────── */
#app-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Guild Sidebar ─────────────────────────────────────── */
.guild-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-self: start;
  position: sticky;
  top: calc(60px + 1.5rem);
  max-height: calc(100vh - 60px - 3rem);
}
.guilds {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}
.guilds button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  text-align: left;
  width: 100%;
  transition: all var(--transition);
}
.guilds button:hover { background: var(--panel2-solid); border-color: var(--glass-hover); }
.guilds button.active { background: var(--ice-dim); border-color: var(--ice); color: var(--frost); }
.guilds img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel2-solid);
  flex-shrink: 0;
}
.guilds .g-text { display: flex; flex-direction: column; min-width: 0; }
.guilds .g-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guilds .g-count { font-size: 0.72rem; color: var(--dim); font-weight: 500; }

/* ── Guild Panel ───────────────────────────────────────── */
#guild-panel { display: flex; flex-direction: column; gap: 1rem; }
.guild-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
.guild-head:hover { transform: none; border-color: transparent; }
.guild-head img {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--panel2-solid);
  flex-shrink: 0;
}
.guild-head h2 { font-size: 1.25rem; font-weight: 700; }

/* ── Tabs ──────────────────────────────────────────────── */
.tab {
  background: transparent;
  color: var(--dim);
  border-radius: 99px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  box-shadow: none !important;
  filter: none !important;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.tab:hover { background: var(--ice-dim); color: var(--frost); }
.tab.active:not(.nav-item) {
  background: var(--ice) !important;
  color: #06121f !important;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--ice-glow) !important;
}
/* Sidebar nav: Sapphire-style subtle gray, never the ice pill */
.nav-item.active {
  background: rgba(255,255,255,.08) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  font-weight: 700;
}
.tabpage { animation: fade-up 0.25s ease-out; }
.tab { position: relative; z-index: 1; }

/* ── Stats Grid ────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.stat {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--ice) 0%, var(--frost) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

/* ── Key-Value List ────────────────────────────────────── */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--glass-edge);
  gap: 1rem;
  font-size: 0.9rem;
}
.kv:last-child { border-bottom: 0; }

/* ── Tables ────────────────────────────────────────────── */
table { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
th {
  text-align: left;
  padding: 0.5rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: var(--panel);
}
th:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
th:last-child  { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
td { padding: 0.75rem 0.85rem; background: var(--panel2-solid); font-size: 0.9rem; vertical-align: middle; }
tr:hover td:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
tr:hover td:last-child  { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
tr:nth-child(even) td { background: rgba(29, 36, 52, 0.55); }
tr:nth-child(even):hover td { background: var(--panel2-solid); }
.table-hover tr:hover td { background: var(--ice-dim) !important; }

/* ── Pills ─────────────────────────────────────────────── */
.pill {
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}
/* Action pills — these class names are DATA-DRIVEN: app.js builds
   `class="pill a-' + c.action`, so the literals never appear in the JS/HTML.
   They look unused to a grep-based audit — do not remove them. */
.pill.a-ban, .pill.a-massban, .pill.a-softban { background: var(--err-dim); border-color: rgba(237, 66, 69, 0.35); color: var(--err); }
.pill.a-kick, .pill.a-warn { background: rgba(254, 231, 92, 0.12); border-color: rgba(254, 231, 92, 0.3); color: var(--warn); }
.pill.a-timeout, .pill.a-mute { background: var(--ice-dim); border-color: var(--glass-hover); color: var(--ice); }
.pill.a-unban, .pill.a-untimeout { background: var(--ok-dim); border-color: rgba(87, 242, 135, 0.3); color: var(--ok); }

/* ── Now Playing (Music) ───────────────────────────────── */
.np { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.np img {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--panel2-solid);
  flex-shrink: 0;
}
.np-meta { flex: 1; min-width: 200px; }
.np-meta h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
.eq span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: var(--ice);
  box-shadow: 0 0 6px var(--ice-glow);
}
.eq span:nth-child(1) { animation: eq1 0.7s ease-in-out infinite; }
.eq span:nth-child(2) { animation: eq2 0.55s ease-in-out infinite 0.15s; }
.eq span:nth-child(3) { animation: eq3 0.65s ease-in-out infinite 0.3s; }

.np { position: relative; overflow: hidden; }
.np-art {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(140%);
  opacity: 0.25;
  pointer-events: none;
}
.np > *:not(.np-art) { position: relative; z-index: 1; }

/* ── Loading Skeletons ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--panel2-solid) 25%, rgba(40, 52, 70, 0.8) 50%, var(--panel2-solid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-xs);
}
.sk-stat  { height: 3.5rem; border-radius: var(--radius-sm); }
.sk-line  { height: 1rem; margin: 0.4rem 0; }
.sk-wid60 { width: 60%; }
.sk-row   { height: 2.6rem; margin: 4px 0; border-radius: var(--radius-xs); }

/* ── Toast Notifications ──────────────────────────────── */
#toasts {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.ok  { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--err); }
.toast.inf { border-left: 3px solid var(--ice); }
.toast.leaving { animation: toast-out 0.25s ease-in forwards; }

/* ── Empty / Error States ──────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--dim);
  text-align: center;
  animation: float 3s ease-in-out infinite;
}
.empty-icon { font-size: 3rem; display: block; }
.error-state {
  background: var(--err-dim);
  border-color: rgba(237, 66, 69, 0.25);
  color: var(--err);
  text-align: center;
  padding: 2rem;
}
.error-state:hover { border-color: rgba(237, 66, 69, 0.4); }

/* ── Live Poll Timestamp ───────────────────────────────── */
.live-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: pulse-dot 1.5s ease-in-out infinite;
  display: inline-block;
}
.live-label { font-size: 0.75rem; color: var(--dim); }

/* ── Toggle Switches ───────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--glass-edge);
}
.toggle-row:last-child { border-bottom: 0; }
.t-label { font-size: 0.9rem; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.switch .track {
  position: absolute;
  inset: 0;
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  transition: all var(--transition);
  pointer-events: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dim);
  transition: all var(--transition);
}
.switch input:checked + .track { background: var(--ice-dim); border-color: var(--ice); box-shadow: 0 0 10px var(--ice-glow); }
.switch input:checked + .track::after { left: 22px; background: var(--ice); box-shadow: 0 0 8px var(--ice-glow); }
.switch input:focus-visible + .track { outline: 2px solid var(--ice); outline-offset: 2px; }
.switch.loading { opacity: 0.5; pointer-events: none; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  #app-view { grid-template-columns: 1fr; padding: 1rem; }
  .topbar { padding: 0.75rem 1rem; }
}
/* Phones: the full phone block lives further down — only the tab label size
   is not covered there (its padding is set by the later top-level .tab rule). */
@media (max-width: 600px) {
  .tab { font-size: 0.8rem; }
}

/* ── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  body::after { display: none; }
}


/* ── v1.8: Discord OAuth login ── */
.login-divider { display: flex; align-items: center; gap: .75rem; color: var(--dim, #7a93b0); font-size: .8rem; margin: .25rem 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: rgba(116, 192, 252, .12); }
.discord-btn { display: block; text-align: center; background: #5865f2; color: #fff; font-weight: 700; border-radius: 10px; padding: .65rem 1rem; text-decoration: none; transition: filter .15s, transform .15s; }
.discord-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.topbar-user { display: flex; align-items: center; gap: .75rem; }
.user-chip { background: rgba(29, 36, 52, .72); border: 1px solid rgba(116, 192, 252, .12); border-radius: 99px; padding: .3rem .8rem; font-size: .85rem; color: var(--frost, #a8d8f0); }

/* ============================================================
   v2 "Aurora" polish — layered last so it wins ties
   ============================================================ */

/* Richer three-band aurora sky, slow drift */
body::before {
  background:
    radial-gradient(ellipse 1100px 480px at 75% -10%, rgba(116, 192, 252, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 900px 420px at 10% 110%, rgba(177, 151, 252, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 700px 380px at 45% 115%, rgba(87, 242, 199, 0.06) 0%, transparent 60%);
}

/* Login: rotating conic ice-ring around the card (graceful: static where unsupported) */
@property --ring { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes ring-spin { to { --ring: 360deg; } }
.login::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius) + 2px);
  padding: 2px;
  background: conic-gradient(from var(--ring), transparent 0%, rgba(116, 192, 252, 0.55) 12%, transparent 30%, transparent 60%, rgba(177, 151, 252, 0.35) 75%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: ring-spin 6s linear infinite;
  pointer-events: none;
}

/* Cards: deeper float on hover */
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45), 0 0 26px rgba(116, 192, 252, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Guild rows: active gets a glowing ice edge */
.guilds button { border-left: 3px solid transparent; }
.guilds button.active {
  border-left-color: var(--ice);
  box-shadow: 0 0 18px rgba(116, 192, 252, 0.16);
}

/* Buttons: sheen sweep on hover */
.btn:not(.tab):not(.guilds button), .discord-btn { position: relative; overflow: hidden; }
.btn:not(.tab):not(.guilds button)::after, .discord-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn:not(.tab):not(.guilds button):hover::after, .discord-btn:hover::after { left: 130%; }

/* Topbar: aurora hairline instead of flat border */
.topbar { border-bottom: 0; }
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116, 192, 252, 0.5), rgba(177, 151, 252, 0.35), transparent);
}

/* Stats: gradient text shimmers slowly */
@keyframes stat-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.stat { background-size: 200% 200%; animation: stat-shimmer 6s ease-in-out infinite; }

/* Table rows ease their hover */
td { transition: background var(--transition); }

/* ── Command Browser ─────────────────────────────────────── */
#commands-view { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1rem; animation: fade-up 0.25s ease-out; }
.cmd-browser { position: sticky; top: calc(60px + 1rem); z-index: 5; }
.cmd-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.cmd-chip {
  background: var(--panel2-solid);
  color: var(--dim);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
}
.cmd-chip:hover { color: var(--frost); border-color: var(--glass-hover); }
.cmd-chip.active { background: var(--ice-dim); color: var(--ice); border-color: var(--ice); }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.cmd-card { padding: 1rem 1.1rem; }
.cmd-name { font-family: var(--font-display); font-weight: 700; color: var(--frost); }
.cmd-desc { color: var(--dim); font-size: 0.85rem; margin-top: 0.45rem; }
.cmd-opts { margin-top: 0.4rem; font-size: 0.74rem; color: var(--dim); }
#commands-btn.active { color: var(--frost) !important; background: var(--ice-dim) !important; border-color: var(--ice) !important; }
@media (max-width: 600px) { .cmd-grid { grid-template-columns: 1fr; } }

/* ── Command Browser toggles ──────────────────────────────── */
.cmd-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cmd-card.cmd-disabled { opacity: 0.5; }
.cmd-card .switch { transform: scale(0.8); }
#cmd-chips .cmd-chip[style*="ok"] { border-color: rgba(87,242,135,.3); }
#cmd-chips .cmd-chip[style*="err"] { border-color: rgba(237,66,69,.3); }

/* ── Settings Portal forms ─────────────────────────────── */
select {
  background: rgba(29, 36, 52, 0.85);
  color: var(--text);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a93b0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
select:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px var(--ice-glow); }
select option { background: var(--panel-solid); color: var(--text); }
.form-row { display: flex; gap: 0.6rem; margin-top: 0.75rem; flex-wrap: wrap; align-items: center; }
.form-row input, .form-row select { flex: 1; min-width: 120px; }
/* a <select>'s intrinsic width is its longest <option> — drop the floor so
   flex can shrink it on narrow viewports (option text clips natively) */
.form-row select { min-width: 0; }
.form-row input#prefix-input { max-width: 120px; }
.form-row input#starboard-threshold, .form-row input#music-volume { max-width: 100px; }
.form-row[style*=column] input { max-width: none; }
.t-label { font-size: 0.8rem; color: var(--dim); font-weight: 500; }  /* no nowrap: long labels must wrap, not stretch cards */

/* ============================================================
   v3 POLISH — premium depth, hierarchy & mobile shell
   (appended at end so cascade order is preserved)
   ============================================================ */

/* ── Token refinements ──────────────────────────────────── */
:root {
  --dim:            #8ea3bd;                                   /* more readable dim text */
  --glass-edge:     rgba(116, 192, 252, 0.14);
  --glass-hover:    rgba(116, 192, 252, 0.30);
  --ice-glow:       rgba(116, 192, 252, 0.36);
  --panel:          rgba(17, 24, 38, 0.80);
  --panel2:         rgba(29, 36, 52, 0.80);
  --radius:         18px;
  --shadow-card:    0 6px 30px rgba(0, 0, 0, 0.42), 0 1px 4px rgba(0, 0, 0, 0.22);
  --grad-border:    linear-gradient(135deg, rgba(116,192,252,0.38) 0%, rgba(116,192,252,0.05) 42%, rgba(177,151,252,0.22) 100%);
}

/* ── Cards: gradient hairline border + deeper hover glow ── */
.card:not(.guild-head):not(.login):not(.error-state) {
  border-color: transparent;
  padding: 1.5rem;
  background-clip: padding-box;
}
.card:not(.guild-head):not(.login):not(.error-state)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
  transition: opacity var(--transition);
}
.card:not(.guild-head):not(.login):not(.error-state):hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 54px rgba(0,0,0,0.5), 0 0 34px rgba(116,192,252,0.16), inset 0 1px 0 rgba(255,255,255,0.07);
}
.card:not(.guild-head):not(.login):not(.error-state):hover::before { opacity: 1; }
.card { position: relative; }

/* ── Section breathing room ─────────────────────────────── */
#guild-panel { gap: 1.4rem; }
.grid { gap: 1.1rem; }
.tabpage { display: flex; flex-direction: column; gap: 1.1rem; }
.card-label { margin-bottom: 0.65rem; font-size: 0.72rem; letter-spacing: 0.1em; color: #9db1c9; }
.guild-head h2 { font-size: 1.35rem; letter-spacing: -0.01em; }

/* ── Settings portal: multi-column config grid ─────────── */
#tab-settings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.1rem;
  align-items: start;
}

.tab { padding: 0.5rem 1.15rem; font-weight: 600; }

/* ── Login: bigger logo, more glass, more air ──────────── */
.login {
  width: min(440px, 92vw);
  gap: 1.15rem;
  padding: 2.4rem 2rem 2rem;
  background: rgba(13, 20, 32, 0.55);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-radius: 22px;
}
.login-logo { font-size: 4rem; margin-bottom: 0.2rem; }
.login h2 { font-size: 1.9rem; letter-spacing: -0.02em; }
.login .dim { font-size: 0.92rem; line-height: 1.5; }
.login-divider { display: flex; align-items: center; gap: 0.8rem; color: var(--dim); font-size: 0.78rem; margin: 0.35rem 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--glass-edge); }
.discord-btn {
  display: block; text-align: center; text-decoration: none;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.95rem;
  background: rgba(88, 101, 242, 0.16); color: #c7d2fe;
  border: 1px solid rgba(88, 101, 242, 0.42); transition: all var(--transition);
}
.discord-btn:hover { background: rgba(88, 101, 242, 0.28); border-color: rgba(88, 101, 242, 0.7); transform: translateY(-1px); }


/* ── Guild sidebar: clearer separation ─────────────────── */
.guild-side {
  gap: 0.75rem;
  padding: 0.9rem;
  background: rgba(13, 20, 32, 0.46);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.guilds { gap: 0.45rem; }
.guilds button { padding: 0.6rem 0.7rem; }
#guild-filter { margin-bottom: 0.1rem; }
/* == end v3 chunk 1 == */

/* ── Premium form controls ──────────────────────────────── */
input, select {
  border-radius: 11px;
  padding: 0.78rem 0.95rem;
}
input:hover, select:hover { border-color: var(--glass-hover); }
input:focus, select:focus {
  outline: none;
  border-color: var(--ice);
  box-shadow: 0 0 0 3px var(--ice-glow), 0 0 18px rgba(116, 192, 252, 0.18);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2374c0fc' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-position: right 0.95rem center;
  background-size: 10px;
  padding-right: 2.4rem;
}
select option { background: #0d1420; color: var(--text); }
#tab-settings .form-row { align-items: center; gap: 0.7rem; margin-top: 0.65rem; }
#tab-settings .form-row .t-label { font-size: 0.82rem; color: #9db1c9; font-weight: 500; }
#tab-settings .form-row .t-hint { font-size: 0.72rem; color: var(--dim); font-weight: 400; margin: -0.15rem 0 0.3rem; line-height: 1.35; }
/* ── Uniform row heights in the config grids: short cards stretch to their
   row so neighbours no longer dangle at mismatched bottoms ─────────── */
#tab-settings, .settings-grid { align-items: stretch; }
.feat-grid .feat-card { display: flex; flex-direction: column; }
.feat-grid .feat-desc { flex: 1; }
.feat-grid .feat-actions { margin-top: auto; }
#tab-settings .card .stat { font-size: 2.2rem; margin: 0.1rem 0 0.6rem; }
#tab-settings > .grid { grid-column: 1 / -1; }   /* skeleton loader spans full width */

/* ── Mobile bottom navigation (hidden on desktop) ──────── */
.mobile-nav { display: none; }

/* hide bottom nav while the Commands browser is open (graceful: ignored if :has unsupported) */
#app-view:has(#commands-view:not(.hidden)) .mobile-nav { display: none; }

/* ── Responsive: tablet & mobile (<900px) ─────────────── */
@media (max-width: 900px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 200;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.4rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
    background: rgba(6, 9, 15, 0.86);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-top: 1px solid var(--glass-edge);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.45);
    overflow-x: auto;            /* 13 tabs don't fit phones — swipe the bar */
    scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav::before {
    content: "";
    position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(116,192,252,0.5), rgba(177,151,252,0.3), transparent);
  }
  .bnav-btn {
    flex: 0 0 auto;              /* natural width; the bar scrolls instead of squashing */
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 0.4rem 0.55rem;
    min-height: 54px;
    background: transparent !important;
    color: var(--dim) !important;
    border: 0 !important;
    border-radius: 14px;
    box-shadow: none !important;
    filter: none !important;
  }
  .bnav-btn::after { display: none; }
  .bnav-btn .bnav-ico { font-size: 1.3rem; line-height: 1; }
  .bnav-btn .bnav-lbl { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.01em; }
  .bnav-btn:hover { background: rgba(116, 192, 252, 0.08) !important; color: var(--frost) !important; }
  .bnav-btn.active {
    color: var(--ice) !important;
    background: var(--ice-dim) !important;
    box-shadow: 0 0 14px rgba(116, 192, 252, 0.25) !important;
  }
  .bnav-btn.active .bnav-lbl { color: var(--frost); }

  /* keep content clear of the fixed bar */
  #app-view { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* guild sidebar → horizontal scrollable strip */
  .guild-side { position: static; max-height: none; padding: 0.6rem; }
  #guild-filter { width: 100%; }
  .guilds {
    flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    gap: 0.5rem; padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .guilds button {
    width: auto; flex: 0 0 auto;
    padding: 0.5rem 0.8rem;
    border-left: 0; border-bottom: 3px solid transparent;
  }
  .guilds button.active { border-left-color: transparent; border-bottom-color: var(--ice); }
  .guilds img { width: 28px; height: 28px; }
  .guilds .g-text > span { max-width: 150px; }

  /* grid blowout guard: let children shrink so the nowrap guild strip
     scrolls internally instead of stretching the page to its min-content */
  #app-view > * { min-width: 0; }

  /* settings portal → single column */
  #tab-settings { grid-template-columns: 1fr; min-width: 0; }

  /* commands browser stacks cleanly; sticky search becomes static */
  #commands-view { gap: 0.9rem; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .cmd-browser { position: static; }
  .cmd-grid { grid-template-columns: 1fr; }

  /* bigger touch targets for topbar ghost buttons */
  button.ghost { padding: 0.6rem 0.9rem; min-height: 40px; white-space: nowrap; }
  #cmd-search { min-height: 44px; }
}

/* ── Responsive: phones (<600px) ──────────────────────── */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .grid { grid-template-columns: 1fr; }     /* full-width cards */
  .stat { font-size: 1.65rem; }
  .card:not(.guild-head):not(.login):not(.error-state) { padding: 1.15rem; }
  .login { padding: 2rem 1.4rem 1.7rem; gap: 1rem; }
  .login-logo { font-size: 3.4rem; }
  .topbar { padding: 0.7rem 0.9rem; }
  .topbar-brand h1 { font-size: 1.05rem; }
  /* phones: drop the "Dashboard" word + cap the user chip so brand + chip + Log out
     always fit without horizontal scroll */
  .topbar-brand h1 .dim { display: none; }
  .topbar-user { min-width: 0; gap: 0.5rem; }
  .topbar-user .user-chip { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .np { gap: 1rem; }
  .np img { width: 64px; height: 64px; }
  .np-meta { min-width: 0; }
  #toasts { left: 0.8rem; right: 0.8rem; top: 4.8rem; }
  .toast { min-width: 0; max-width: none; }
  .bnav-btn .bnav-lbl { font-size: 0.58rem; }
}

/* ── Horizontal-scroll safety ──────────────────────────── */
#app-view, #guild-panel, #commands-view, .tabpage, .grid, #tab-settings { min-width: 0; }
img { max-width: 100%; }
table { max-width: 100%; }
/* == end v3 polish == */

/* ============================================================
   v4 "Glacier" — premium depth, entrance motion, refined forms
   ============================================================ */

/* ── Enhanced color tokens ── */
:root {
  --bg-deep: #04070d;
  --bg-1: #06090f;
  --bg-2: #0a0f1a;
  --panel-glass: rgba(13, 20, 32, 0.65);
  --panel-glass-2: rgba(17, 24, 38, 0.55);
  --glow-ice: rgba(116, 192, 252, 0.12);
  --glow-strong: rgba(116, 192, 252, 0.25);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Aurora sky — deeper, more layered, more alive ── */
body::before {
  background:
    radial-gradient(ellipse 1200px 500px at 75% -15%, rgba(116, 192, 252, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 1000px 500px at 10% 115%, rgba(177, 151, 252, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 800px 400px at 50% 120%, rgba(87, 242, 199, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 600px 300px at 90% 50%, rgba(116, 192, 252, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 500px 400px at 5% 50%, rgba(177, 151, 252, 0.04) 0%, transparent 55%);
  animation-duration: 25s;
}

/* ── Cards: deeper glass, better depth ── */
.card {
  background: var(--panel-glass);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border-color: rgba(116, 192, 252, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card:hover {
  border-color: rgba(116, 192, 252, 0.28);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(116, 192, 252, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
}

/* ── Entrance animations for tab pages ── */
.tabpage { animation: page-in 0.4s var(--ease-out); }
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Staggered card entrances in grids ── */
.grid > .card { animation: card-in 0.35s var(--ease-out) both; }
.grid > .card:nth-child(1) { animation-delay: 0.02s; }
.grid > .card:nth-child(2) { animation-delay: 0.06s; }
.grid > .card:nth-child(3) { animation-delay: 0.1s; }
.grid > .card:nth-child(4) { animation-delay: 0.14s; }
.grid > .card:nth-child(5) { animation-delay: 0.18s; }
.grid > .card:nth-child(6) { animation-delay: 0.22s; }
.grid > .card:nth-child(n+7) { animation-delay: 0.26s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Typography hierarchy ── */
h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; letter-spacing: -0.005em; }
.card-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(122, 147, 176, 0.9);
  margin-bottom: 0.5rem;
}

/* ── Premium stat numbers ── */
.stat {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #74c0fc 0%, #a5d8ff 40%, #b197fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: stat-shimmer 6s ease-in-out infinite;
}

/* ── Topbar: more premium ── */
.topbar {
  background: rgba(4, 7, 13, 0.9);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  padding: 1rem 1.75rem;
}
.topbar-brand h1 { font-size: 1.25rem; letter-spacing: -0.02em; }

/* ── Buttons: more refined ── */
.btn:not(.tab):not(.guilds button):not(.cmd-chip) {
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: all var(--transition);
}
.btn:not(.tab):not(.guilds button):not(.cmd-chip):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--ice-glow), 0 2px 8px rgba(0,0,0,0.3);
}
.btn:not(.tab):not(.guilds button):not(.cmd-chip):active {
  transform: translateY(0);
  transition-duration: 0.05s;
}

/* ── Form controls: premium focus states ── */
input, select {
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s;
}
input:focus, select:focus {
  background: rgba(29, 36, 52, 0.95);
  border-color: var(--ice);
  box-shadow: 0 0 0 3px var(--ice-glow), 0 0 16px rgba(116, 192, 252, 0.15);
}
input::placeholder { color: rgba(122, 147, 176, 0.5); }

/* ── Guild sidebar: more polished ── */
.guild-side {
  padding: 0.5rem;
  background: var(--panel-glass-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  border: 1px solid rgba(116, 192, 252, 0.1);
}
.guilds button {
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.guilds button:hover {
  transform: translateX(4px);
}
.guilds button.active {
  transform: translateX(0);
  border-left: 3px solid var(--ice);
}

/* ── Tab bar: floating pill with glow ── */
.tab { font-weight: 500; }
.tab.active { font-weight: 700; }

/* ── Login page: more dramatic ── */
.login {
  padding: 2.5rem;
  gap: 1.25rem;
}
.login-logo { font-size: 4rem; }
.login h2 { font-size: 2rem; letter-spacing: -0.03em; }
.login .dim { font-size: 1rem; }

/* ── Empty states: more polished ── */
.empty { padding: 3.5rem 2rem; }
.empty-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.empty p { font-size: 0.95rem; line-height: 1.6; }

/* ── Skeleton loading: smoother ── */
.skeleton {
  background: linear-gradient(90deg, var(--panel2-solid) 25%, rgba(45, 56, 78, 0.7) 50%, var(--panel2-solid) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* ── Scrollbar: more visible ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(116, 192, 252, 0.2);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(116, 192, 252, 0.35);
}
::-webkit-scrollbar-track { background: transparent; }

/* ── Custom scrollbar for Firefox ── */
html { scrollbar-width: thin; scrollbar-color: rgba(116, 192, 252, 0.2) transparent; }

/* ── Selection: prettier ── */
::selection { background: rgba(116, 192, 252, 0.3); color: #e8eef7; }

/* ── Toast: slide from bottom on mobile, from right on desktop ── */
@media (min-width: 601px) {
  .toast { animation: toast-in-right 0.35s var(--ease-spring); }
}
@keyframes toast-in-right {
  from { opacity: 0; transform: translateX(120%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── (Reduced motion is handled by the universal block near the top). ── */

/* ── Settings portal: better section spacing ── */
#tab-settings .grid { gap: 1.25rem; }
#tab-settings .card { padding: 1.5rem; }
#tab-settings .toggle-row { padding: 0.65rem 0; }
#tab-settings .form-row { margin-top: 0.75rem; }

/* ── Command browser: cleaner cards ── */
.cmd-card { transition: all var(--transition); }
.cmd-card:hover { border-color: rgba(116, 192, 252, 0.35); }
.cmd-card.cmd-disabled { opacity: 0.45; filter: grayscale(0.3); }

/* ── Focus rings: beautiful + accessible ── */
:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ice-glow), 0 0 0 1px var(--ice);
}

/* == end v4 Glacier == */

/* ── v4.1 additions ─────────────────────────────────────────── */

/* Settings portal grid — cards flow into columns instead of one endless stack */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  align-items: stretch;
  gap: 1.1rem;
}
@media (max-width: 760px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
/* cards must be allowed to shrink below their content min-width (long
   channel names inside <select>s would otherwise stretch the portal) */
.settings-grid > .card { min-width: 0; }

/* File inputs (backup restore) — match the frosty form inputs */
.form-row input[type="file"] {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--dim);
  padding: 0.45rem 0.6rem;
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xs);
}
.form-row input[type="file"]::file-selector-button {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ice);
  background: var(--ice-dim);
  border: 0;
  border-radius: 99px;
  padding: 0.3rem 0.8rem;
  margin-right: 0.6rem;
  cursor: pointer;
}
.form-row input[type="file"]::file-selector-button:hover { color: var(--frost); }

/* ── v4.2 first-impression additions ────────────────────────── */

/* Login hero — the first thing anyone sees */
.login-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; max-width: 560px; }
.login-intro { text-align: center; animation: fade-up 0.4s ease-out; }
.hero-logo { font-size: 60px; animation: float 4s ease-in-out infinite; margin-bottom: 0.4rem; }
.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-ice {
  background: linear-gradient(135deg, var(--ice), #b4defe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--dim); font-size: 0.92rem; max-width: 460px; margin: 0.4rem auto 1.2rem; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; }
.feature-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  color: var(--frost);
}
.login-wrap .card { width: 100%; }

/* Tag content previews */
.tag-content { white-space: pre-wrap; word-break: break-word; color: var(--dim); font-size: 0.85rem; margin-top: 0.25rem; }

/* ── v4.3 public landing page (/)   ───────────────────────── */
.landing-main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.landing-hero { text-align: center; padding: 3rem 1rem 2.5rem; animation: fade-up 0.4s ease-out; }
.landing-title { font-size: 3rem; }
.landing-sub { max-width: 540px; margin: 0.6rem auto 1.6rem; font-size: 1rem; }
.hero-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.landing-btn { padding: 0.7rem 1.6rem; font-size: 0.95rem; border-radius: 99px; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-display); font-weight: 700; }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.landing-card { padding: 1.4rem 1.5rem; text-align: left; transition: transform var(--transition), border-color var(--transition); }
.landing-card:hover { transform: translateY(-3px); border-color: var(--glass-hover); }
.landing-ico { font-size: 30px; margin-bottom: 0.5rem; }
.landing-card h3 { margin-bottom: 0.35rem; }
.landing-card p { font-size: 0.85rem; }
.landing-foot { text-align: center; margin-top: 3rem; }
.landing-foot a { color: var(--ice); text-decoration: none; }
.landing-foot a:hover { color: var(--frost); }
@media (max-width: 640px) { .landing-title { font-size: 2.2rem; } .landing-hero { padding-top: 1.5rem; } }

/* ── v4.4 clickables ── */
.topbar-link { text-decoration: none; color: inherit; transition: filter var(--transition); }
.topbar-link:hover { filter: brightness(1.15); }
a.user-chip { text-decoration: none; cursor: pointer; }
a.user-chip:hover { filter: brightness(1.2); }

/* ── v4.5 Sapphire-style sidebar + Heist-style landing ── */

/* Sapphire-style module sidebar */
.side-items { display: flex; flex-direction: column; gap: 2px; margin-top: 0.75rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--dim);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.nav-item:hover { color: var(--text); background: var(--panel2); box-shadow: none; }
.nav-item.active { background: rgba(255,255,255,.08); color: var(--text); box-shadow: none; }
.nav-divider {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 1rem 0.8rem 0.3rem;
  font-weight: 700;
}

/* Heist-style landing hero */
.landing-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
  background: var(--ice-dim);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.4rem;
}
.landing-title { line-height: 1.05; margin-bottom: 0.9rem; font-weight: 800; }
.landing-title em { font-style: italic; font-weight: 600; }
.landing-brand { font-weight: 800; color: var(--ice); white-space: nowrap; }
.landing-statline { font-size: 1rem; color: var(--dim); margin-bottom: 0.4rem; }
.landing-statline b { color: var(--text); font-weight: 800; }

/* Trusted-by server row */
.trusted-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-top: 2.5rem; }
.trusted-server { display: flex; align-items: center; gap: 0.7rem; text-align: left; }
.trusted-server img { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--glass-edge); }
.trusted-meta { display: flex; flex-direction: column; }
.trusted-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.trusted-count { font-size: 0.75rem; color: var(--dim); }

/* ── v4.6 Sapphire-grade command cards ───────────────────────── */
.cmd-meta { font-size: 0.7rem; color: var(--dim); letter-spacing: 0.04em; margin-top: 0.3rem; }
.cmd-usage {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.55rem;
  color: var(--frost);
  overflow-x: auto;
  white-space: nowrap;
}

/* ── v4.7 security/whitelist textarea + status text ── */
.form-row textarea, textarea {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.7rem;
}
textarea:focus { border-color: var(--glass-hover); outline: none; }
.ok-text { color: var(--ok); font-weight: 600; }

/* ── v4.8 section headers for the settings grid ── */
.sec-header {
  grid-column: 1 / -1;
  padding: 0.35rem 0 0;
  border: 0;
  background: transparent;
}
.sec-header .card-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ice); }

/* ── v4.8 section headers ── */
.sec-header { grid-column: 1 / -1; padding: 0.35rem 0 0; border: 0; background: transparent; }
.sec-header .card-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ice); }

/* ══ v5.0 VISUAL OVERHAUL — reference-grade polish ═══════════ */

/* Guild hero header — the reference look: gradient banner, glowing icon */
.guild-head {
  padding: 1.4rem 1.6rem !important;
  background: linear-gradient(135deg, rgba(116,192,252,.14) 0%, rgba(23,32,49,.7) 60%) !important;
  border: 1px solid var(--glass-edge) !important;
  border-radius: var(--radius) !important;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card) !important;
}
.guild-head::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(116,192,252,.18) 0%, transparent 70%);
  pointer-events: none;
}
.guild-head img {
  width: 68px !important; height: 68px !important;
  border-radius: 18px !important;
  border: 2px solid rgba(116,192,252,.5);
  box-shadow: 0 0 24px rgba(116,192,252,.35), 0 4px 12px rgba(0,0,0,.4);
}
.guild-head h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }

/* Compact stat cards — icon + big value + sub, reference style */
.card .stat { font-size: 1.7rem; }
.card-label {
  font-size: 0.68rem !important;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim) !important;
  font-weight: 700 !important;
  margin-bottom: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Cards: stronger glass, consistent padding, clearer borders */
.card {
  border: 1px solid var(--glass-edge);
  background: linear-gradient(180deg, rgba(23,32,49,.78) 0%, rgba(17,24,38,.82) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
}

/* Section headers: divider lines like the references */
.sec-header {
  padding: 0.9rem 0 0.2rem !important;
  margin-top: 0.4rem;
}
.sec-header .card-label { color: var(--dim) !important; font-size: 0.7rem !important; letter-spacing: 0.1em !important; }

/* Sidebar nav: grouped module sections like sapph.xyz */
.side-items { margin-top: 1rem; }
.nav-divider {
  margin: 1.1rem 0.85rem 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--glass-edge);
}

/* Sidebar itself: give it a panel background */
.guild-side {
  background: linear-gradient(180deg, rgba(23,32,49,.6) 0%, rgba(17,24,38,.4) 100%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 0.85rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Search input refinement */
input[type="search"] {
  border-radius: 99px;
  padding-left: 1rem;
}

/* kv rows: slightly tighter, hover highlight */
.kv { padding: 0.5rem 0.15rem; border-radius: 6px; }
.kv:hover { background: rgba(116,192,252,.05); }

/* pill: softer look */
.pill { padding: 0.15rem 0.6rem; font-size: 0.72rem; }

/* Tag/AR content previews */
.tag-content { font-size: 0.8rem; }

/* ── Landing hero CTAs: Open Dashboard (main, ice) + Invite + View Commands ── */
.btn-ice {
  display: inline-flex;
  background: var(--ice);
  color: #06121f;
  font-weight: 700;
  border-radius: 99px;
  text-decoration: none;
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-ice:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px var(--ice-glow);
}
.hero-actions { margin-bottom: 0.9rem; }
.hero-actions-sub { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.hero-actions-sub .landing-btn { padding: 0.5rem 1.3rem; font-size: 0.88rem; }

/* ── v5.2 Login: Discord-first, key as the "or" ── */
.login-main { margin: 0.2rem 0 0.4rem; }
.discord-btn-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(88, 101, 242, 0.35);
  transition: all var(--transition);
}
.discord-btn-lg:hover { transform: translateY(-2px); box-shadow: 0 6px 26px rgba(88, 101, 242, 0.5); }
.key-login summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--dim);
  text-align: center;
  padding: 0.4rem 0;
  user-select: none;
}
.key-login summary:hover { color: var(--frost); }
.key-login[open] summary { margin-bottom: 0.6rem; }
.key-login button { width: 100%; margin-top: 0.6rem; }

/* ── v5.3 version badge — answers "is the site updated?" at a glance ── */
.version-chip {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  font-family: ui-monospace, monospace;
}
.version-chip:hover { color: var(--frost); border-color: var(--glass-hover); }

/* ── v5.4 hosting instance cards ── */
.kv-card { display: flex; flex-direction: column; gap: 0.7rem; }
.kv-top { display: flex; align-items: center; gap: 0.7rem; }
.kv-top img.kv-avatar { width: 36px; height: 36px; border-radius: 10px; }
.kv-name { font-weight: 700; font-size: 0.95rem; }
.kv-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* 📜 instance log tail — monospace, scrollable, never stretches the card */
.host-log {
  margin: 0.6rem 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(6, 12, 20, 0.72);
  border: 1px solid var(--glass-edge);
  color: var(--frost);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 600px) { .host-log { max-height: 180px; font-size: 0.68rem; } }

/* ── v5.5 Sapphire fidelity — page headers + topbar guild chip ── */
.page-head { display: flex; align-items: center; gap: 0.6rem; margin: 0.2rem 0 0.9rem; }
.page-head h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.page-head .ph-ico {
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--panel2-solid);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  flex-shrink: 0;
}
.guild-chip { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.85rem; color: var(--text); }
.guild-chip img { width: 22px; height: 22px; border-radius: 6px; }
.guild-chip .dim { font-weight: 400; font-size: 0.8rem; }
/* ── v5.6 Sapphire server-select + sidebar pills ─────────── */

/* Server-select view (ref: centered brand, "Logged in as" card, guild rows, © footer) */
#picker-view { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.picker-wrap { width: min(560px, 100%); display: grid; gap: 1.5rem; justify-items: center; }
.picker-brand { display: flex; align-items: center; gap: 0.6rem; }
.picker-brand h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.picker-brand .brand-mark { font-size: 1.9rem; }
.picker-hint { color: var(--dim); font-size: 0.9rem; margin-top: -0.75rem; text-align: center; }
.picker-card { width: 100%; padding: 1.5rem 1.4rem !important; }
.picker-me {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--dim); font-size: 0.9rem; margin-bottom: 1.1rem;
}
.picker-list { display: grid; gap: 0.35rem; }
/* Server rows: quiet list rows, never a button pill. Broad Sapphire button
   rules leak into class-styled buttons, so these are hardened — same approach
   as .nav-item.active below. Keep in sync with DESIGN_SPEC "failure modes". */
.picker-row {
  display: flex; align-items: center; gap: 0.8rem; width: 100%;
  padding: 0.75rem 0.85rem !important;
  background: transparent !important;
  border: 0; border-radius: 12px !important;
  color: var(--text) !important;
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; text-align: left;
  box-shadow: none !important; text-shadow: none !important;
  transition: background var(--transition);
}
.picker-row:hover { background: rgba(255, 255, 255, 0.05) !important; }
.picker-row.active { background: rgba(255, 255, 255, 0.08) !important; }
.picker-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--panel-solid); flex-shrink: 0; }
.p-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.p-name { font-weight: 700; font-size: 1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-count { font-weight: 400; font-size: 0.75rem; color: var(--dim); }
.p-go { color: var(--dim); font-size: 1.4rem; line-height: 1; padding-right: 0.2rem; }
.picker-row:hover .p-go { color: var(--text); }
.picker-foot { display: flex; align-items: center; gap: 0.5rem; color: var(--dim); font-size: 0.75rem; }
.picker-foot .dot { opacity: 0.5; }
.picker-foot a { color: var(--dim); text-decoration: none; }
.picker-foot a:hover { color: var(--ice); }

/* ============================================================
   v7 "Sapphire Among Us" — measured tokens from sapph.xyz
   (probed live via CDP on 1524078555439567000 / Among us Cz/Sk):
   html rgb(33,40,49) · topbar rgb(27,32,40) · nav 16.368px/400
   rgb(12,169,238), pad 10px, radius 8px, active bg rgba(189,189,189,.08)
   rows/cards rgba(189,189,189,.05), radius 10px, pad 15px,
   shadow 0 0 10px rgba(0,0,0,.15) · blue btn rgb(0,132,255)
   white text, 10px 12px pad, 7px radius · dark btn rgba(255,255,255,.05)
   toggle ON rgb(55,200,55) 31x17 radius 40px · server pill
   rgba(255,255,255,.05) radius 100px · font Onest.
   Kept Arctic: ice palette, Outfit font, glass blur, snow/aurora,
   frosty voice. Only geometry + flat fills follow Sapphire.
   ============================================================ */

/* Font: Onest (Sapphire body) sits after Inter, before system fallbacks */
body { font-family: "Inter", "Onest", "Segoe UI", "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }

/* Shell: Sapphire column rhythm + flat fills */
html { background: rgb(33, 40, 49); }
#app-view { gap: 0; background: transparent; }
#guild-panel, #commands-view { gap: 0.8rem; }
/* Sidebar panel: flat Sapphire rail */
.guild-side {
  background: rgb(33, 40, 49);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Cards + list rows: flat Sapphire fill, 10px radius, 15px padding */
.card {
  background: rgba(189, 189, 189, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  transform: none;
}
.set-row {
  background: rgba(189, 189, 189, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}

/* Nav: measured Sapphire metrics */
.nav-item {
  padding: 10px;
  border-radius: 8px;
  font-size: 1.023rem;
  font-weight: 400;
  color: rgb(12, 169, 238);
}
.nav-item:hover { background: transparent; }
.nav-item.active { background: rgba(189, 189, 189, 0.08); color: rgb(12, 169, 238); }

/* Topbar: flat Sapphire top */
.topbar { background: rgb(27, 32, 40); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Guild chip → server pill */
.guild-chip { background: rgba(255, 255, 255, 0.05); border-radius: 100px; padding: 3px 8px; }
.guild-chip .gname { font-size: 0.9rem; }

/* Buttons: measured blue + dark */
.btn:not(.tab):not(.side-pill):not(.cmd-chip):not(.bnav-btn),
.btn-primary {
  background: rgb(0, 132, 255);
  color: #fff;
  border-radius: 7px;
  padding: 10px 12px;
  box-shadow: none;
}
.btn:not(.tab):not(.side-pill):not(.cmd-chip):not(.bnav-btn):hover,
.btn-primary:hover { transform: none; box-shadow: none; filter: brightness(1.08); }
.btn-ghost, .ghost { background: rgba(255, 255, 255, 0.05); color: #fff; border-radius: 7px; box-shadow: none; }

/* Toggles: DESIGN_SPEC wins — 44×24, knob 18px, ice-blue ON. The earlier
   "measured green 31×17 Sapphire" override conflicted with DESIGN_SPEC.md
   (authoritative) and Mission A's ice-blue #74c0fc target, so it is removed;
   the v4 .switch rules above now apply unchanged. */
.switch { width: 44px; height: 24px; }
.switch .track { border-radius: 99px; }
.switch .track::after { width: 18px; height: 18px; top: 2px; left: 2px; background: var(--dim); }
.switch input:checked + .track { background: var(--ice-dim); border-color: var(--ice); box-shadow: 0 0 10px var(--ice-glow); }
.switch input:checked + .track::after { left: 22px; background: var(--ice); box-shadow: 0 0 8px var(--ice-glow); }

/* Page title: measured 35.2px/700 white Onest */
.page-head h2 { font-size: 2.2rem; font-weight: 700; }
.page-head { border-bottom: 0; }

/* == end v7 Sapphire Among Us == */

/* Sidebar: pill row (Home + Fetch roles/channels), row chevrons, © footer */
/* ── v8 Sapphire components: selects, inputs, scrollbars, hovers ── */

/* Native <select>, Sapphire-style: flat #1a2029 pill, gray chevron,
   border darkens on hover, sky-blue focus ring. Overrides the older
   ice-chevron rule above (cascade: this block is later). */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #1a2029;
  border: 1px solid #2e3540;
  border-radius: 8px;
  padding: 0.6rem 2.2rem 0.6rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: #dbdee1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23b5bac1' fill-rule='evenodd' d='M.3.3a1 1 0 0 1 1.4 0L5 3.6 8.3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
select:hover { border-color: #434951; }
select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
select:disabled { opacity: 0.5; cursor: not-allowed; }
select option { background: #1a2029; color: #dbdee1; }

/* Text inputs + textarea: same flat family */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea {
  background-color: #1a2029;
  border: 1px solid #2e3540;
  border-radius: 8px;
  color: #dbdee1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, textarea:hover { border-color: #434951; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
input::placeholder, textarea::placeholder { color: #87898c; }

/* Sapphire scrollbar: thin, dark track, gray thumb */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a2029; border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #2e3540; border: 2px solid transparent; background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: #1a2029 transparent; }

/* Flat hover-lift rows/cards, Sapphire touch: border lighten, no glow */
.card, .toggle-row { transition: border-color 0.15s ease, transform 0.15s ease; }
.card:hover { border-color: rgba(189, 189, 189, 0.10); }

/* Buttons: crisper radius + pressed state */
button { border-radius: 8px; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* == end v8 Sapphire components == */

/* == end v8 Sapphire components == */

/* ── v9 Sapphire EXACT — ported from sapph.xyz stylesheets ──
   Real tokens: --clr-background #181f25 · dark #11161b · darker #0b0f13
   primary #0084ff · primary-light #78beff · green hsl(120,61%,51%)
   Signature: 50px pill buttons with sliding gradient, white-alpha ghosts,
   5px #0e0e0e scrollbar, blur(20px) bar with rgba(255,255,255,.05) edge. */
:root {
  --sapph-bg: #181f25;
  --sapph-bg-dark: #11161b;
  --sapph-bg-darker: #0b0f13;
  --sapph-primary: #0084ff;
  --sapph-primary-light: #78beff;
  --sapph-secondary: #7281fd;
  --sapph-green: hsl(120, 61%, 51%);
  --sapph-edge: rgba(255, 255, 255, 0.05);
}

/* Base: Sapphire sets *{color:#fff} + Onest with lining numerals */
body {
  background: var(--sapph-bg);
  color: #fff;
  font-feature-settings: "lnum";
}
.card, .toggle-row, .stat, .dim { color: inherit; }
a:not(.bnav-btn):not(.side-item):not(.guild-chip) { color: var(--sapph-primary); }

/* Topbar: their fixed bar = blur(20px) + 1px white-alpha bottom edge */
.topbar, #topbar, header.topbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sapph-edge);
  background: rgba(24, 31, 37, 0.85);
}

/* Primary button: THE Sapphire pill — gradient slides in on hover */
.btn:not(.ghost):not(.bnav-btn):not(.side-item):not(.toggle):not([class*="file"]):not(.picker-row) {
  border-radius: 50px;
  padding: 6px 20px;
  font-weight: 600;
  color: #fff;
  border: none;
  background: linear-gradient(to right, var(--sapph-primary-light), var(--sapph-primary));
  background-size: 200%;
  background-position: right;
  transition: all 0.2s ease-in-out;
  text-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.5);
}
.btn:not(.ghost):not(.bnav-btn):not(.side-item):not(.toggle):not([class*="file"]):not(.picker-row):hover {
  opacity: 0.8;
  background-position: left;
  transform: none;
  box-shadow: none;
}
.btn:not(.ghost):not(.bnav-btn):not(.side-item):not(.toggle):not([class*="file"]):not(.picker-row):active {
  opacity: 0.7;
}

/* Ghost/secondary button: white-alpha pill */
.ghost, button.ghost, .bnav-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 50px !important;
  color: #fff !important;
  font-weight: 600;
  transition: background 0.2s ease-in-out;
}
.ghost:hover, button.ghost:hover, .bnav-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  opacity: 1;
}

/* Inputs/selects: recolor to Sapphire dark family + primary focus */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select, textarea {
  background-color: var(--sapph-bg-dark);
  border-color: var(--sapph-edge);
  color: #fff;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus, textarea:focus {
  border-color: var(--sapph-primary);
  box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.25);
}
select option { background: var(--sapph-bg-dark); color: #fff; }

/* Scrollbar: exact Sapphire — 5px, #0e0e0e thumb, #555 hover */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #0e0e0e; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
* { scrollbar-width: thin; scrollbar-color: #0e0e0e transparent; }

/* Toggle ON: their green */
.toggle-row .toggle.on, .toggle.on, input[type="checkbox"]:checked + .toggle {
  background: var(--sapph-green) !important;
}

/* Cards: darker Sapphire panel tone */
.card {
  background: var(--sapph-bg-dark);
  border: 1px solid var(--sapph-edge);
}

/* == end v9 Sapphire EXACT == */

/* ── v10 Sapphire DASHBOARD — measured live from dashboard.sapph.xyz
   (logged-in, computed styles via CDP) ──────────────────────────────
   nav/topbar rgb(27,32,40) · sidebar+cards rgb(33,40,49) · cards borderless
   shadow rgba(0,0,0,.5) 0 0 20px -2px · sidebar inset glow rgb(31,37,46)
   active pill white .1 + 1px border white .3 · in-card btn white .05 r7
   primary btn rgb(0,132,255) r7 fw500 · h1 32/700 · labels 11.5/600 ·
   copyright .4 white 12.8px ── */
:root {
  --sv-nav: rgb(27, 32, 40);
  --sv-panel: rgb(33, 40, 49);
  --sv-panel-glow: rgb(31, 37, 46);
  --sv-primary: rgb(0, 132, 255);
  --sv-white05: rgba(255, 255, 255, 0.05);
  --sv-white1: rgba(255, 255, 255, 0.1);
  --sv-edge3: rgba(255, 255, 255, 0.3);
  --sv-green: hsl(120, 61%, 51%);
}

/* Base surfaces */
body { background: var(--sv-nav); }
.topbar, #topbar {
  background: var(--sv-nav) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Cards: borderless dark panels with their soft drop shadow */
.card {
  background: var(--sv-panel) !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px -2px !important;
}

/* Sidebar: panel bg + Sapphire's inset edge glow, 10px padding, 5px gaps */
.guild-side, .side-items, .settings-side {
  background: var(--sv-panel) !important;
  border: none !important;
  box-shadow: var(--sv-panel-glow) -50px 0 50px 1px inset !important;
  padding: 10px !important;
  gap: 5px !important;
}

/* Sidebar items: compact 30px pill rows; active = white .1 + white .3 ring */
.side-item, .side-items a, .settings-side a, .side-items button {
  height: 30px;
  min-height: 30px;
  border-radius: 100px !important;
  padding: 0 20px !important;
  font-size: 13.4px !important;
  font-weight: 600 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: background 0.2s ease;
}
.side-item:hover, .side-items a:hover, .side-items button:hover { background: var(--sv-white05) !important; }
.side-item.active, .side-item[aria-current], .side-items a.active {
  background: var(--sv-white1) !important;
  border-color: var(--sv-edge3) !important;
}

/* Module group labels: tiny, bold, dim — like their MODULES caption */
.side-label, .side-group-label, .settings-side .label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.4) !important;
  padding: 10px 10px 0 !important;
  letter-spacing: 0.02em;
}

/* In-app buttons: flat, 7px radius — replaces the landing-page gradient pill */
#app-view .btn:not(.ghost):not(.bnav-btn):not(.toggle):not([class*="file"]):not(.side-item) {
  background: var(--sv-white05) !important;
  background-image: none !important;
  border: none !important;
  border-radius: 7px !important;
  color: #fff !important;
  font-weight: 500 !important;
  font-size: 0.92rem !important;
  padding: 0.45rem 1rem !important;
  text-shadow: none !important;
  transition: background 0.2s ease !important;
}
#app-view .btn:not(.ghost):not(.bnav-btn):not(.toggle):not([class*="file"]):not(.side-item):hover {
  background: var(--sv-white1) !important;
  opacity: 1 !important;
}
#app-view .btn.primary, #app-view .btn[class*="save"], #app-view #ov-prefix-save,
#app-view .form-row .btn:not(.ghost) {
  background: var(--sv-primary) !important;
}
#app-view .btn.primary:hover, #app-view .btn[class*="save"]:hover,
#app-view #ov-prefix-save:hover, #app-view .form-row .btn:not(.ghost):hover {
  background: #1a90ff !important;
}

/* Ghost stays a white-alpha pill (their user-chip / reload style) */
.ghost, .bnav-btn {
  background: var(--sv-white05) !important;
  border: none !important;
  border-radius: 100px !important;
}
.ghost:hover, .bnav-btn:hover { background: var(--sv-white1) !important; }

/* Page headers: 32px/700 like their h1.title; sub text .85 white */
#app-view h1, #app-view h2, .page-head h1, .page-head h2 {
  font-size: clamp(1.7rem, 3vw, 2rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}
#app-view .sub, #app-view .page-sub, #app-view .dim { color: rgba(255, 255, 255, 0.85) !important; }

/* User + guild chips: 100px pills, 3px 15px */
.user-chip, .guild-chip, .guild-pill {
  border-radius: 100px !important;
  padding: 3px 15px !important;
}

/* Inputs/selects: sit on nav-dark with hairline edge, primary focus */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select, textarea {
  background-color: var(--sv-nav) !important;
  border-color: var(--sv-edge3) !important;
  border-width: 1px !important;
  color: #fff !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus, textarea:focus {
  border-color: var(--sv-primary) !important;
  box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.25) !important;
}
select option { background: var(--sv-panel); color: #fff; }

/* Toggle ON: Sapphire green */
.toggle.on, .toggle-row .toggle.on, input[type="checkbox"]:checked + .toggle,
input[type="checkbox"]:checked {
  background: var(--sv-green) !important;
}

/* Footer links: .4 white, 12.8px */
.site-footer, .footer, footer a, .copyright {
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 12.8px !important;
}

/* Blue hexagon glow: ambient blob top-right of the content column.
   overflow-x: clip (not hidden — no scroll container) keeps the blob's
   negative offsets from widening the page on phones. */
#app-view { position: relative; overflow-x: hidden; overflow-x: clip; }
#app-view::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -60px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at 60% 40%, rgba(0, 132, 255, 0.35), rgba(0, 132, 255, 0.12) 45%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}
#app-view > * { position: relative; z-index: 1; }

/* == end v10 Sapphire DASHBOARD == */

/* ── v11 Sapphire HOME — welcome hero + roomy feature cards ──
   Layout language ported from their logged-in home page. */
.ov-hero { padding: 0.5rem 0 1.5rem; }
.ov-welcome {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
  color: #fff;
}
.ov-accent { color: var(--sv-primary, #0084ff); }
.ov-sub { color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; margin: 0; }

/* Feature grid: 2 roomy columns, 1 on mobile */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
@media (max-width: 760px) { .feat-grid { grid-template-columns: minmax(0, 1fr); } }

.feat-card {
  background: var(--sv-panel, #212831);
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px -2px;
  padding: 1.5rem 1.6rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.feat-card:hover { background: #262e38; transform: translateY(-2px); }
.feat-card:focus-visible { outline: 2px solid var(--sv-primary, #0084ff); outline-offset: 2px; }

.feat-ico { font-size: 1.5rem; line-height: 1; }
.feat-title { font-size: 1.18rem; font-weight: 700; margin: 0; color: #fff; }
.feat-desc { color: rgba(255, 255, 255, 0.72); font-size: 0.92rem; line-height: 1.5; margin: 0 0 0.4rem; flex: 1; }
.feat-actions { display: flex; gap: 0.6rem; }
.feat-btn {
  background: var(--sv-white05, rgba(255, 255, 255, 0.05)) !important;
  border: none !important;
  border-radius: 7px !important;
  color: #fff !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  padding: 0.45rem 1rem !important;
  cursor: pointer;
  transition: background 0.2s ease;
}
.feat-btn:hover { background: var(--sv-white1, rgba(255, 255, 255, 0.1)) !important; }

/* Lower column: feeds & quick-edit, single calm column */
.ov-lower { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.ov-lower .card { margin-top: 0 !important; }
.ov-quick .form-row { align-items: center; }
.ov-quick input { max-width: 120px; }

/* Vitals strip: inline stats with separators */
.ov-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  font-size: 0.95rem;
  padding: 0.3rem 0;
}
.ov-vitals b { font-size: 1.25rem; font-weight: 700; color: var(--sv-primary-light, #78beff); margin-right: 0.3rem; }

/* Now-playing title styling */
.ov-np { font-size: 1.05rem; font-weight: 600; color: var(--sv-primary-light, #78beff); padding: 0.2rem 0; }

/* == end v11 Sapphire HOME == */

/* ── v12 Heist-style landing: nav, live stat band, server wall ── */
.landing-nav { display: flex; gap: 1.4rem; margin-left: auto; margin-right: 1.2rem; }
.landing-navlink {
  color: rgba(255, 255, 255, 0.72) !important;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.landing-navlink:hover { color: #fff !important; }
.landing-navlink.active { color: #fff !important; border-bottom-color: var(--sv-primary, #0084ff); }
.topbar-cta { white-space: nowrap; }

/* Live stat band */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.6rem;
  margin: 1.9rem 0 1.2rem;
  padding: 1.2rem 1.5rem;
  background: var(--sv-panel, #212831);
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.5) 0 0 20px -2px;
}
.hstat { display: flex; flex-direction: column; gap: 0.1rem; }
.hstat-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  font-variant-numeric: lining-nums;
  letter-spacing: -0.02em;
}
.hstat-lbl { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }

/* Server wall */
.landing-wall { margin: 3rem 0 1rem; }
.wall-title {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 700;
  margin: 0 0 1rem;
  color: #fff;
}
.server-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem;
}
.wall-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--sv-panel, #212831);
  border-radius: 10px;
  transition: background 0.15s ease;
}
.wall-item:hover { background: #262e38; }
.wall-icon { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; }
.wall-meta { display: flex; flex-direction: column; min-width: 0; }
.wall-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wall-count { font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); }

@media (max-width: 720px) {
  .landing-nav { display: none; }
  .topbar-cta { padding: 0.4rem 0.8rem !important; font-size: 0.85rem !important; }
  .hero-stats { gap: 0.9rem 1.6rem; padding: 1rem 1.1rem; }
}

/* Live status page bits */
.status-hero { text-align: left; }
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.75rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.8em;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.status-pill.up { background: hsl(120, 61%, 51%); color: #04230a; }
.status-pill.down { background: hsl(0, 61%, 51%); color: #fff; }
.status-stats { margin-top: 1.4rem; }
/* 2×2 balance for the four detail cards (4 across on the widest screens) */
.status-details { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; }

/* == end v12 Heist landing == */

.guild-side { display: flex; flex-direction: column; }
.side-pills { display: flex; gap: 0.4rem; margin: 0.7rem 0 0.15rem; flex-wrap: wrap; }
.side-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  background: var(--panel2-solid) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: var(--dim) !important;
  font-size: 0.78rem; font-weight: 600;
  box-shadow: none !important;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.side-pill:hover {
  background: var(--panel-solid) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text) !important;
  transform: none !important;
}
/* Home pill is a real .tab (generic handler drives it) — keep its active state subtle gray */
.tab.side-pill.active {
  background: var(--panel-solid) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.guilds button::after { content: '›'; margin-left: auto; color: var(--dim); font-size: 1.2rem; line-height: 1; }
.guilds button.active::after { color: var(--text); }
.side-foot {
  margin-top: auto;
  padding: 0.9rem 0.2rem 0.3rem;
  font-size: 0.7rem;
  color: var(--dim);
  opacity: 0.85;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-foot a { color: var(--dim); text-decoration: none; }
.side-foot a:hover { color: var(--ice); }

/* ── Mobile: bottom nav replaces the module list ─────────
   Lives AFTER the .side-items display rules so source order wins the
   cascade (equal specificity → last declaration on top). */
@media (max-width: 900px) {
  .side-items { display: none; }
}

/* ── 🎉 Community v2 — giveaway board, ticket desk, composers ── */
.row-acts { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.mini-btn {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .72rem; padding: .18rem .5rem; border-radius: 999px;
  border: 1px solid var(--glass-hover, rgba(255,255,255,.12));
  background: rgba(255,255,255,.04); color: var(--dim); cursor: pointer;
  text-decoration: none; line-height: 1.4;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.mini-btn:hover { color: var(--ice); border-color: var(--ice); background: var(--ice-dim); }
.countdown { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: var(--ice); min-width: 5.2rem; text-align: right; }
.role-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; margin: .15rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); font-size: .8rem; }
.role-dot { width: .6rem; height: .6rem; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.rr-panel { border: 1px dashed rgba(255,255,255,.14); border-radius: 10px; padding: .5rem .6rem; margin: .4rem 0; background: rgba(255,255,255,.02); }
.rr-head { font-size: .7rem; color: var(--dim); margin-bottom: .25rem; font-family: ui-monospace, monospace; }
.rr-chips { display: flex; flex-wrap: wrap; }
.cat-chip { display: inline-block; font-size: .7rem; padding: .08rem .5rem; border-radius: 999px; background: var(--ice-dim); color: var(--ice); vertical-align: middle; }
.badge-claim, .badge-open { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .12rem .45rem; border-radius: 6px; }
.badge-claim { background: rgba(87,242,135,.14); color: var(--ok, #57f287); }
.badge-open { background: rgba(241,196,15,.14); color: #f1c40f; }
.comp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .55rem; margin-top: .7rem; }
.comp-field { display: flex; flex-direction: column; gap: .25rem; font-size: .74rem; color: var(--dim); font-weight: 600; }
.comp-field input, .comp-field select { width: 100%; font-weight: 500; }
.comp-out { margin-top: .85rem; display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.comp-hint { font-size: .72rem; font-weight: 500; }
.comp-copy { background: var(--ice-dim); color: var(--ice); border-color: transparent; font-weight: 700; }
.comp-copy:hover { background: var(--ice); color: var(--panel-solid); }
.cmd-out { display: block; width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; line-height: 1.5; padding: .55rem .7rem; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid rgba(116,192,252,.25); color: #cfe9ff; word-break: break-all; white-space: pre-wrap; }
.cmd-slash { font-size: .72rem; color: var(--dim); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
/* ══ v13 mobile & form fixes ══════════════════════════════════
   1. The v10 rule `#app-view > * { position: relative }` (ID specificity)
      outranked the ≤900px `.mobile-nav { position: fixed }` declaration, so
      the bottom tab bar sat at the END of the document (measured: top 4371px
      on a 4527px page) instead of pinned — phones could not switch tabs.
      Scope the v10 rule away from the nav and re-assert fixed on small screens.
   2. Phones: the topbar squeezed #logout to 26px wide while its label is
      nowrap → 7px of it spilled past the viewport (page panned sideways). */
#app-view > *:not(.mobile-nav) { position: relative; z-index: 1; }

@media (max-width: 900px) {
  .mobile-nav {
    position: fixed !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 200 !important;
  }
}

@media (max-width: 600px) {
  /* least useful chips on a phone — they free the room #logout needs.
     (The hero card right below already names the server, and the mobile
     server strip lists every guild, so neither pill is load-bearing.) */
  #version-chip { display: none !important; }
  .topbar-brand { min-width: 0; flex-wrap: nowrap; }
  #guild-chip { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .guild-chip .gname {
    display: inline-block;
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
  .topbar-user { flex: 0 0 auto; }
  .topbar-user > * { flex: 0 0 auto; }
  #logout { padding: 0.5rem 0.75rem; }
}
@media (max-width: 520px) {
  #guild-chip { display: none !important; }
}
@media (max-width: 400px) {
  .topbar-user .user-chip { max-width: 24vw; }
  .topbar-brand { gap: 0.4rem; }
}

/* File inputs (backup restore): the native "No file chosen" label got clipped
   to "No f…osen" when it shared a row with the Restore button — give it the
   whole row instead. `.form-row` already wraps. */
.form-row input[type="file"] { flex: 1 1 100%; }

/* ══ v14 visual polish: Settings & Commands tabs ═══════════════ */

/* Section headers in settings-grid: elegant frost dividers with trailing hairline */
.sec-header {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 1.2rem 0 0.4rem !important;
  margin-top: 0.8rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.sec-header .card-label {
  font-size: 0.72rem !important;
  letter-spacing: 0.12em !important;
  font-weight: 700 !important;
  color: var(--ice) !important;
  text-transform: uppercase !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.sec-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(116, 192, 252, 0.35) 0%, rgba(116, 192, 252, 0.05) 80%, transparent 100%);
}

/* Settings card depth & input refinements */
#tab-settings .card {
  transition: border-color var(--transition), transform var(--transition);
}
#tab-settings .card:not(.sec-header):hover {
  border-color: rgba(116, 192, 252, 0.25);
}
#tab-settings .card .card-label {
  display: block !important;
  width: 100% !important;
  margin-bottom: 0.6rem !important;
}
#tab-settings .card .stat {
  display: block !important;
  width: fit-content !important;
  font-family: var(--font-display);
  font-size: 1.8rem !important;
  font-weight: 800;
  color: var(--ice) !important;
  -webkit-text-fill-color: var(--ice) !important;
  background: rgba(116, 192, 252, 0.1) !important;
  animation: none !important;
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(116, 192, 252, 0.2);
  margin: 0 0 0.85rem !important;
}

/* Autoresponder rows in Settings */
#tab-settings .kv {
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  margin-bottom: 0.35rem;
  border-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
#tab-settings .kv:hover {
  background: rgba(116, 192, 252, 0.05);
  border-color: rgba(116, 192, 252, 0.15);
}
#tab-settings .kv .tag-content {
  font-size: 0.8rem;
  color: var(--dim);
  margin-top: 0.2rem;
}
#tab-settings .ar-del,
#tab-tags .tag-del {
  padding: 0.25rem 0.65rem !important;
  font-size: 0.75rem !important;
  border-radius: 6px !important;
  border: 1px solid rgba(237, 66, 69, 0.3) !important;
  background: rgba(237, 66, 69, 0.08) !important;
  color: #ff8587 !important;
  transition: all var(--transition) !important;
  cursor: pointer;
}
#tab-settings .ar-del:hover,
#tab-tags .tag-del:hover {
  background: rgba(237, 66, 69, 0.2) !important;
  border-color: rgba(237, 66, 69, 0.6) !important;
  color: #fff !important;
}

/* Command browser header & filters */
#tab-commands .cmd-browser {
  background: linear-gradient(180deg, rgba(23, 32, 49, 0.88) 0%, rgba(17, 24, 38, 0.92) 100%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  padding: 1.35rem 1.45rem;
  border-radius: var(--radius);
}
#tab-commands #cmd-search {
  background: rgba(10, 15, 24, 0.75);
  border: 1px solid var(--glass-edge);
  color: var(--text);
  font-size: 0.92rem;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  margin-top: 0.65rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#tab-commands #cmd-search:focus {
  border-color: var(--ice);
  box-shadow: 0 0 0 3px var(--ice-dim);
  outline: none;
}
#tab-commands .cmd-chips {
  margin-top: 0.9rem;
  margin-bottom: 1.1rem;
  gap: 0.45rem;
}
.cmd-chip {
  padding: 0.32rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dim);
  transition: all var(--transition);
  cursor: pointer;
}
.cmd-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--glass-hover);
}
.cmd-chip.active {
  background: rgba(116, 192, 252, 0.15) !important;
  border-color: rgba(116, 192, 252, 0.45) !important;
  color: var(--frost) !important;
  font-weight: 600;
}
#cmd-enable-all {
  background: rgba(87, 242, 135, 0.08) !important;
  border-color: rgba(87, 242, 135, 0.25) !important;
  color: #72f79b !important;
}
#cmd-enable-all:hover {
  background: rgba(87, 242, 135, 0.18) !important;
  border-color: rgba(87, 242, 135, 0.5) !important;
}
#cmd-disable-all {
  background: rgba(237, 66, 69, 0.08) !important;
  border-color: rgba(237, 66, 69, 0.25) !important;
  color: #ff8587 !important;
}
#cmd-disable-all:hover {
  background: rgba(237, 66, 69, 0.18) !important;
  border-color: rgba(237, 66, 69, 0.5) !important;
}

/* Command cards: Sapphire style crispness */
.cmd-card {
  background: linear-gradient(180deg, rgba(20, 28, 42, 0.75) 0%, rgba(14, 20, 31, 0.8) 100%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  min-width: 0; /* flex items default to min-width:auto — without this the
    nowrap .cmd-usage line forces the grid track to its min-content (~1119px)
    on phones, spilling cards past the viewport */
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.cmd-card:hover {
  border-color: rgba(116, 192, 252, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.cmd-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.cmd-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--frost);
  letter-spacing: -0.01em;
}
.cmd-meta {
  font-size: 0.72rem;
  color: var(--dim);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}
.cmd-desc {
  font-size: 0.85rem;
  color: #c0d1e5;
  margin-top: 0.45rem;
  line-height: 1.4;
  flex: 1;
}
.cmd-usage {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #92c9f5;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(116, 192, 252, 0.15);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  margin-top: 0.65rem;
  overflow-x: auto;
  white-space: nowrap;
}
.cmd-opts {
  font-size: 0.72rem;
  color: var(--dim);
  margin-top: 0.4rem;
}

#tab-media .media-list {
  display: grid;
  gap: 0.6rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}
#tab-media .media-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}
#tab-media .media-details {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  overflow-wrap: anywhere;
}
#tab-media .media-details span { color: var(--dim); font-size: 0.78rem; }
#tab-media #dashboard-media-usage { margin: 1rem 0 0.35rem; }
#tab-media #dashboard-media-status { min-height: 1.2rem; }
@media (max-width: 520px) {
  #tab-media .media-item { align-items: flex-start; flex-direction: column; }
}


/* ── Legal pages (Terms / Privacy): readable prose on the frosty theme ── */
.legal-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.legal-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
}
.legal-card .eyebrow { margin: 0 0 0.5rem; }
.legal-title {
  margin: 0 0 0.35rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.legal-updated { margin: 0 0 1.5rem; color: var(--dim); font-size: 0.8rem; }
.legal-card h3 {
  margin: 1.5rem 0 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--frost, #74c0fc);
}
.legal-card p, .legal-card li { font-size: 0.9rem; line-height: 1.65; color: var(--text); }
.legal-card ul { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.legal-card li { margin-bottom: 0.35rem; }
.legal-card a { color: var(--ice); }
.legal-foot {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--dim);
}
.legal-foot a { color: var(--dim); text-decoration: none; }
.legal-foot a:hover { color: var(--ice); }
@media (max-width: 520px) {
  .legal-card { padding: 1.5rem 1.25rem; }
}
