/* ---------- Tokens ---------- */
:root {
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --a1: #00d4ff;
  --a2: #7c5cff;
  --a3: #ff5fa2;
  --grad: linear-gradient(120deg, var(--a1), var(--a2), var(--a3));
  --radius-xl: 32px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-mode="dark"] {
  --bg: #0b1220; --surface: #111a2e; --surface-2: #172240; --text: #e8eefb; --muted: #97a6c2;
  --border: #26345a; --shadow: 0 24px 60px rgba(0, 0, 0, .45); --glass: rgba(17, 26, 46, .78); --input: #0e1730;
  color-scheme: dark;
}
[data-mode="light"] {
  --bg: #f3f6fb; --surface: #ffffff; --surface-2: #eef3fa; --text: #0f172a; --muted: #55657e;
  --border: #d9e2ef; --shadow: 0 24px 60px rgba(15, 23, 42, .10); --glass: rgba(255, 255, 255, .80); --input: #f7f9fd;
  color-scheme: light;
}
[data-mode="oled"] {
  --bg: #000; --surface: #07090f; --surface-2: #0d1220; --text: #f1f5ff; --muted: #8b95aa;
  --border: #182034; --shadow: 0 24px 60px rgba(0, 0, 0, .8); --glass: rgba(7, 9, 15, .85); --input: #05070c;
  color-scheme: dark;
}
[data-mode="contrast"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f0f0f0; --text: #000000; --muted: #1a1a1a;
  --border: #000000; --shadow: 0 0 0 2px #000; --glass: rgba(255, 255, 255, .97); --input: #ffffff;
  color-scheme: light;
}
[data-mode="sepia"] {
  --bg: #f4ecd8; --surface: #fbf5e6; --surface-2: #f1e6cc; --text: #3b2f1e; --muted: #7a6a51;
  --border: #e0d1b0; --shadow: 0 24px 60px rgba(92, 70, 30, .15); --glass: rgba(251, 245, 230, .85); --input: #fdf9ee;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.08; letter-spacing: .01em; }
[hidden] { display: none !important; }

/* ---------- Animated background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span {
  position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%; filter: blur(70px); opacity: .35;
  background: radial-gradient(circle, var(--a1), transparent 65%);
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(2) { top: 40%; left: 55%; background: radial-gradient(circle, var(--a2), transparent 65%); animation-duration: 32s; }
.aurora span:nth-child(3) { top: -20%; left: -15%; background: radial-gradient(circle, var(--a3), transparent 65%); animation-duration: 38s; }
@keyframes drift { to { transform: translate(12vw, 8vh) scale(1.15); } }

/* ---------- Gradient text ---------- */
.grad-text {
  background: var(--grad); background-size: 260% 260%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-shift 9s linear infinite;
}
@keyframes grad-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 10px; z-index: 30; margin: 10px 12px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 14px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.orb {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  font: 900 1.05rem var(--font-display); color: #fff; background: var(--grad); background-size: 260% 260%;
  animation: grad-shift 7s linear infinite; box-shadow: 0 0 22px color-mix(in srgb, var(--a1) 55%, transparent);
}
.brand-name { font: 900 1.05rem var(--font-display); letter-spacing: .14em; }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--a1) 30%, transparent); border-color: var(--a1); }
.icon-btn:focus-visible, .dock-item:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--a1) 70%, transparent); outline-offset: 2px;
}

/* ---------- Layout ---------- */
.view { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 22px 16px 28px; animation: enter .6s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font: 700 .72rem var(--font-display); letter-spacing: .18em; text-transform: uppercase;
  background: color-mix(in srgb, var(--a1) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--a1) 40%, transparent);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 10px var(--a1); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

.hero { padding: 26px 4px 8px; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 5rem); font-weight: 900; margin: 16px 0 14px; }
.hero h1 .plain { display: block; color: var(--text); }
.lead { font-size: clamp(1.02rem, 2.4vw, 1.2rem); color: var(--muted); max-width: 46ch; margin: 0 0 26px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 14px 0 22px; }
.page-head .head-icon {
  width: 84px; height: 84px; border-radius: 30px; display: grid; place-items: center; font-size: 2.6rem;
  background: var(--grad); background-size: 260% 260%; animation: grad-shift 8s linear infinite; box-shadow: 0 14px 40px color-mix(in srgb, var(--a2) 40%, transparent);
  flex: 0 0 auto;
}
.page-head h1 { font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 900; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 1.05rem; }
.page-head .grow { flex: 1 1 200px; min-width: 0; }

.section-title { font: 800 1.45rem var(--font-display); margin: 34px 0 16px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: var(--grad); background-size: 260% 260%; animation: grad-shift 8s linear infinite; opacity: .7; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- Cards ---------- */
.card {
  position: relative; padding: 22px; border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
a.card, button.card { text-align: left; width: 100%; color: inherit; text-decoration: none; display: block; }
a.card:hover, button.card:hover { transform: translateY(-4px); border-color: var(--a1); box-shadow: 0 22px 50px color-mix(in srgb, var(--a2) 22%, transparent); }
.card h3 { font-size: 1.2rem; font-weight: 800; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.card-head { display: flex; align-items: center; gap: 14px; }

.server-card .avatar {
  width: 58px; height: 58px; border-radius: 22px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
  background: var(--grad); background-size: 260% 260%; font: 900 1.2rem var(--font-display); color: #fff;
}
.server-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.server-card .name { font-weight: 800; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font: 600 .74rem var(--font-body);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-top: 8px;
}
.badge.ok { color: #0ea56b; border-color: color-mix(in srgb, #0ea56b 40%, transparent); background: color-mix(in srgb, #0ea56b 12%, transparent); }
.badge.warn { color: #d97706; border-color: color-mix(in srgb, #d97706 40%, transparent); background: color-mix(in srgb, #d97706 12%, transparent); }
.badge.owner { color: var(--a2); border-color: color-mix(in srgb, var(--a2) 40%, transparent); background: color-mix(in srgb, var(--a2) 12%, transparent); }

.feature-card .ico {
  width: 60px; height: 60px; border-radius: 22px; display: grid; place-items: center; font-size: 1.8rem;
  background: var(--grad); background-size: 260% 260%; animation: grad-shift 8s linear infinite;
}
.feature-card h3 { margin-top: 16px; font-size: 1.25rem; }
.feature-card .go { margin-top: 14px; font: 700 .72rem var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--a1); }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat { padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat .num { font: 900 clamp(1.7rem, 5vw, 2.4rem) var(--font-display); }
.stat .lbl { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font: 700 .86rem var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .12); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  position: relative; overflow: hidden; border: 0; color: #fff; background: var(--grad); background-size: 260% 260%;
  animation: grad-shift 6s linear infinite; box-shadow: 0 14px 34px color-mix(in srgb, var(--a2) 45%, transparent);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 3.6s var(--ease) infinite;
}
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-primary.wide, .btn.wide { width: 100%; }
.btn-ghost { background: transparent; }
.btn-danger { color: #e11d48; border-color: color-mix(in srgb, #e11d48 45%, transparent); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: .74rem; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; }
.group { padding: 22px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.group h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.group h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--grad); background-size: 260% 260%; animation: grad-shift 6s linear infinite; }
.field { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--border); }
.field:first-of-type { border-top: 0; padding-top: 4px; }
.field > label, .field > .label { font-weight: 700; font-size: .95rem; }
.field .help { color: var(--muted); font-size: .85rem; margin-top: -4px; }
.input, .field input[type="text"], .field input[type="number"], .field input[type="search"], .field select, .field textarea, .field input[type="password"] {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--input); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 22%, transparent);
}
.row-inline { display: grid; gap: 10px; grid-template-columns: 1fr auto; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { appearance: none; width: 56px; height: 32px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .25s, border-color .25s; margin: 0; flex: 0 0 auto; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--grad); background-size: 260% 260%; border-color: transparent; animation: grad-shift 5s linear infinite; }
.switch input:checked::after { transform: translateX(24px); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--grad); background-size: 260% 260%; color: #fff; animation: grad-shift 5s linear infinite; box-shadow: 0 8px 18px color-mix(in srgb, var(--a2) 35%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--input); cursor: pointer; font-size: .9rem; font-weight: 600; }
.chip input { margin: 0; accent-color: var(--a2); }
.chip[aria-pressed="true"], .chip:has(input:checked) { border-color: var(--a1); background: color-mix(in srgb, var(--a1) 14%, var(--input)); }
.color-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.color-row input[type="color"] { width: 56px; height: 50px; padding: 4px; border-radius: 16px; border: 1px solid var(--border); background: var(--input); }

.savebar {
  position: fixed; left: 50%; bottom: 104px; transform: translate(-50%, 24px); z-index: 40; opacity: 0; visibility: hidden; pointer-events: none;
  width: min(560px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 20px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .45s var(--ease), opacity .3s, visibility .3s;
}
.savebar.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
.savebar span { font-weight: 700; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font: 700 .7rem var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rank { font: 900 .95rem var(--font-display); color: var(--a1); }
.list-wrap { overflow-x: auto; }
.mono { font-family: var(--font-mono); font-size: .85rem; }
.muted { color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: grid; gap: 14px; }
.form-inline { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.form-inline .btn { align-self: end; }

/* ---------- Bottom dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 35;
  width: min(540px, calc(100% - 24px)); height: 74px; padding: 8px; border-radius: 999px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.dock-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent;
  border-radius: 999px; color: var(--muted); text-decoration: none; font: 700 .66rem var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  transition: color .25s, background .3s var(--ease), transform .2s var(--ease);
}
.dock-item:active { transform: scale(.94); }
.dock-item[aria-current="page"], .dock-item.active { color: #fff; background: var(--grad); background-size: 260% 260%; animation: grad-shift 6s linear infinite; box-shadow: 0 10px 24px color-mix(in srgb, var(--a2) 40%, transparent); }

/* ---------- Drawer (features menu) ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 18, .45); backdrop-filter: blur(4px); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 60; width: min(380px, calc(100% - 20px));
  display: flex; flex-direction: column; border-radius: var(--radius-xl); padding: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateX(calc(100% + 24px)); transition: transform .45s var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 12px; }
.drawer-head h2 { font-size: 1.35rem; font-weight: 900; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 50px; border-radius: 999px; border: 1px solid var(--border); background: var(--input); color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; min-width: 0; padding: 12px 0; }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 22%, transparent); }
.drawer-list { margin-top: 14px; overflow-y: auto; padding-right: 4px; display: grid; gap: 6px; }
.d-group { font: 700 .68rem var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 14px 6px 4px; }
.d-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; border-radius: 22px; border: 1px solid transparent; background: transparent; text-align: left; text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.d-item:hover { background: var(--surface-2); border-color: var(--border); transform: translateX(-3px); }
.d-item .d-ico { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 auto; background: color-mix(in srgb, var(--a1) 16%, var(--surface-2)); }
.d-item strong { display: block; font-weight: 800; }
.d-item small { color: var(--muted); font-size: .8rem; }
.d-item .d-go { margin-left: auto; color: var(--muted); }

/* ---------- Appearance sheet (theme panel) ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 90vh; overflow-y: auto;
  padding: 12px 18px 30px; border-radius: 34px 34px 0 0; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
  transform: translateY(105%); transition: transform .5s var(--ease);
}
.sheet.open { transform: translateY(0); }
.sheet-grab { width: 48px; height: 5px; border-radius: 5px; background: var(--border); margin: 0 auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; max-width: 620px; margin: 0 auto 6px; }
.sheet-head h2 { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 900; }
#appearance { max-width: 620px; margin: 0 auto; }
.ap-label { font: 600 .74rem var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 12px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-tile {
  min-height: 92px; border-radius: 26px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font: 700 .72rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.mode-tile:hover { transform: translateY(-2px); }
.mode-tile[aria-pressed="true"] { color: var(--a1); border-color: var(--a1); background: color-mix(in srgb, var(--a1) 10%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 18%, transparent); }
.mode-tile .mi { font-size: 1.35rem; line-height: 1; }
.swatches { display: flex; gap: 12px; flex-wrap: nowrap; align-items: center; }
.swatch { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; border: 3px solid transparent; background: var(--c); box-shadow: inset 0 0 0 4px color-mix(in srgb, #fff 20%, transparent); transition: transform .2s var(--ease); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { border-color: var(--surface); outline: 3px solid var(--c); outline-offset: 2px; }
.hex-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; margin-top: 18px; align-items: center; }
.hex-row .chipbox { width: 56px; height: 56px; border-radius: 18px; background: var(--a1); border: 1px solid var(--border); }
.hex-row input[type="text"] { min-height: 56px; border-radius: 20px; font: 500 1.1rem var(--font-mono); letter-spacing: .08em; padding: 0 18px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card { padding: 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.theme-card:hover { transform: translateY(-3px); }
.theme-card[aria-pressed="true"] { border-color: var(--a1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 25%, transparent); }
.theme-card .strips { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 46px; }
.theme-card .tname { display: block; padding: 10px 12px 12px; font: 600 .74rem var(--font-mono); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-btn { width: 100%; margin-top: 14px; min-height: 56px; border-radius: 999px; background: transparent; border: 1px solid var(--border); color: var(--a1); font: 600 .9rem var(--font-mono); letter-spacing: .14em; }
.reset-btn { width: 100%; margin-top: 16px; min-height: 60px; border: 0; border-radius: 999px; background: var(--a1); color: #001018; font: 700 .9rem var(--font-mono); letter-spacing: .14em; box-shadow: 0 12px 30px color-mix(in srgb, var(--a1) 35%, transparent); }
.toggle-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; margin-top: 12px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 10px; width: min(460px, calc(100% - 28px)); pointer-events: none; }
.toast {
  padding: 14px 18px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; animation: toast-in .4s var(--ease) both; border-left: 5px solid var(--a1);
}
.toast.error { border-left-color: #e11d48; }
.toast.ok { border-left-color: #0ea56b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* ---------- Login ---------- */
.login-cta { display: grid; gap: 14px; max-width: 520px; }
.login-cta .btn-primary { min-height: 68px; font-size: 1rem; }
.note { color: var(--muted); font-size: .88rem; }
.feature-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Motion preference ---------- */
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation: none !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 560px) {
  .theme-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .theme-card .tname { font-size: .66rem; padding: 9px 9px 11px; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 359px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-name { font-size: .92rem; letter-spacing: .1em; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- routing, commands and footer ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; font: 600 .85rem var(--font-body); color: var(--muted); }
.crumbs a { color: var(--a1); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs i { font-style: normal; opacity: .6; }
.crumbs span[aria-current] { color: var(--text); }

.cmd-card { display: flex; flex-direction: column; gap: 10px; }
.cmd-top { display: flex; align-items: center; gap: 10px; }
.cmd-name { font: 700 1.05rem var(--font-mono); color: var(--a1); background: none; padding: 0; }
.cmd-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cmd-title { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 900; word-break: break-word; }
.req { color: var(--a3); font-weight: 800; }
.cmd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.cmd-result { margin-top: 22px; display: grid; gap: 12px; scroll-margin-top: 90px; }
.result-head { font: 800 .75rem var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--a1); }
.result-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 12px; }
.result-text { margin: 0; white-space: normal; line-height: 1.6; }
.result-text code, .embed code { font-family: var(--font-mono); font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.embed { border-left: 4px solid var(--ec, var(--a1)); padding: 14px 16px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 8px; }
.embed-author { font-size: .85rem; color: var(--muted); font-weight: 600; }
.embed h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.embed h3 a { color: var(--a1); }
.embed p { margin: 0; line-height: 1.55; }
.embed-fields { margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.embed-fields > div { min-width: 0; }
.embed-fields dt { font-weight: 700; font-size: .9rem; }
.embed-fields dd { margin: 2px 0 0; color: var(--muted); line-height: 1.5; word-break: break-word; }
.embed-foot { font-size: .8rem; color: var(--muted); }
@media (min-width: 640px) { .embed-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .embed-fields > .inl { grid-column: span 1; } .embed-fields > div:not(.inl) { grid-column: 1 / -1; } }

.notice { padding: 16px 18px; border-radius: var(--radius-lg); border: 1px dashed var(--border); color: var(--muted); background: var(--surface); line-height: 1.55; }
.notice code { font-family: var(--font-mono); color: var(--a1); }

.foot { position: relative; z-index: 1; text-align: center; padding: 8px 16px 132px; font-size: .72rem; letter-spacing: .04em; color: var(--muted); opacity: .75; font-weight: 400; }
.foot-sep { margin: 0 4px; }

/* ---------- admin page and cookie notice ---------- */
.avatar-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.avatar-preview { width: 56px; height: 56px; border-radius: 18px; object-fit: cover; border: 1px solid var(--border); }
.cookie {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 45;
  bottom: calc(108px + env(safe-area-inset-bottom)); width: min(540px, calc(100% - 24px));
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 22px;
  border-radius: 28px; border: 1px solid var(--border); background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; flex: 1; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.cookie strong { color: var(--text); }
@media (max-width: 480px) { .cookie { flex-direction: column; align-items: stretch; text-align: center; } }
