/* ==========================================================================
   Eclipse RP — site styles

   One design system, no framework. The rules this file follows, so it stays
   editable by hand:

   - Every colour, radius and space comes from a token below. Nothing is styled
     with a one-off hex.
   - Type is a system stack: no webfont request, so the page paints instantly and
     works with no internet beyond the page itself.
   - Dark, but restrained: one accent colour, hairline borders, shadows only on
     things that actually float.
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #070910;
  --bg-soft: #0a0e17;
  --panel: #0e1420;
  --panel-2: #131b29;
  --line: #1e2836;
  --line-soft: #161e2b;

  /* type */
  --text: #e9eef7;
  --text-dim: #b9c4d4;
  --mute: #8595ab;
  --mute-2: #6b7a8f;

  /* brand */
  --accent: #7b8cff;
  --accent-soft: rgba(123, 140, 255, 0.14);
  --accent-ink: #080b14;
  --accent-2: #ffb27a;

  /* state */
  --ok: #3ddc97;
  --warn: #ffb020;
  --bad: #ff6b6b;

  /* shape */
  --r-xs: 6px;
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 20px;
  --shadow: 0 30px 70px -40px rgba(3, 6, 12, 0.95);
  --shadow-sm: 0 12px 30px -22px rgba(3, 6, 12, 0.9);
  --maxw: 1180px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Anchors land below the sticky header instead of under it. */
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 640px at 90% -10%, rgba(123, 140, 255, 0.14), transparent 62%),
    radial-gradient(940px 560px at -8% 108%, rgba(255, 178, 122, 0.11), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Cooler backdrop: a slowly drifting aurora glow fixed behind the content,
   over the dark base. Cards stay opaque so text remains readable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1150px 660px at 88% -12%, rgba(123, 140, 255, 0.20), transparent 62%),
    radial-gradient(980px 580px at -8% 110%, rgba(255, 178, 122, 0.15), transparent 58%),
    radial-gradient(760px 460px at 50% 0%, rgba(123, 140, 255, 0.08), transparent 60%);
  animation: aurora 26s ease-in-out infinite alternate;
}

@keyframes aurora {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.85;
  }
  50% {
    transform: translate3d(-45px, 25px, 0) scale(1.06);
    opacity: 1;
  }
  to {
    transform: translate3d(25px, -35px, 0) scale(1);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*
 * `hidden` has to beat the display values set below it. Without this, any element
 * that is hidden by script (the status pill, the connect box) stays visible,
 * because a class's `display: flex` outranks the browser's `[hidden]` rule.
 */
[hidden] {
  display: none !important;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

/* One visible focus treatment everywhere - keyboard users are not an edge case. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 640;
}

h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
}

h3 {
  font-size: 1.12rem;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 640;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 2.5rem 0;
}

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

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  border-top: 1px solid var(--line-soft);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 2.5rem;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 600;
  margin: 0 0 1rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: var(--r-sm);
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 9, 16, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line-soft);
  background: rgba(7, 9, 16, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 70px;
}

.header-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

/* Rank badge beside the header name: Owner / Admin / Member. Each rank its
   own multi-colour gradient — the owner badge is the loudest, three colours
   with an animated shift; admin two; member a quiet single-tone pill. */
.header-rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(120deg, #4b5563, #6b7280);
  white-space: nowrap;
}

.header-rank-owner {
  color: #0d0714;
  background: linear-gradient(115deg, #ffd166 0%, #ff7eb6 45%, #8a7bff 100%);
  background-size: 200% 200%;
  box-shadow: 0 0 12px rgba(255, 126, 182, 0.35);
  animation: rankShift 5s ease-in-out infinite;
}

.header-rank-admin {
  background: linear-gradient(115deg, #7b8cff 0%, #a78bfa 100%);
  box-shadow: 0 0 10px rgba(123, 140, 255, 0.35);
}

.header-rank-member {
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: none;
  font-weight: 650;
}

@keyframes rankShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .header-rank-owner { animation: none; }
}

.header-login-name {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Discord presence dot next to the name — the same color language as the
   client: green online, amber idle, red dnd, gray offline. Hidden entirely
   when the bot has no presence data (data-state="none"). */
.header-login-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #747f8d;
}

.header-login-dot[data-state='online'] {
  background: #3ba55d;
  box-shadow: 0 0 7px rgba(59, 165, 93, 0.55);
}

.header-login-dot[data-state='idle'] {
  background: #faa61a;
  box-shadow: 0 0 7px rgba(250, 166, 26, 0.55);
}

.header-login-dot[data-state='dnd'] {
  background: #ed4245;
  box-shadow: 0 0 7px rgba(237, 66, 69, 0.55);
}

.header-login-dot[data-state='offline'],
.header-login-dot[data-state='none'] {
  background: #747f8d;
  box-shadow: none;
}

/* Permission group chips: checkbox pills for multi-select grants. The custom
   entry is a text chip that matches visually. Two per row on narrow screens. */
.perm-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
  user-select: none;
}

.perm-chip:hover {
  border-color: var(--accent);
}

.perm-chip:has(input:checked) {
  color: var(--accent-ink);
  background: linear-gradient(120deg, var(--accent), #a78bfa);
  border-color: transparent;
}

.perm-chip input {
  accent-color: var(--accent-ink);
  margin: 0;
}

.perm-chip-custom input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  width: 11ch;
}

/* Drawer tabs (User / Admin) at the top of the hamburger. The nav element
   carries data-navtab="user|admin"; CSS shows the matching group. The site's
   nav is a drawer at every width — there is no inline desktop nav — so these
   rules are unconditional: wherever the hamburger opens, the tabs are there. */
.nav-tabs {
  display: flex;
  gap: 6px;
  padding: 0.1rem 0 0.7rem;
  border-bottom: 1px solid var(--line-soft);
}

.nav-tab {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.nav-tab[aria-selected="true"] {
  color: var(--accent-ink);
  background: linear-gradient(120deg, var(--accent), #a78bfa);
  border-color: transparent;
}

/* The tab groups themselves. */
#nav[data-navtab] .nav-item-admin,
#nav[data-navtab] .nav-item-user,
#nav[data-navtab] .nav-item-perms {
  display: none;
}

#nav[data-navtab="user"] .nav-item-user,
#nav[data-navtab="admin"] .nav-item-admin,
#nav[data-navtab="perms"] .nav-item-perms {
  display: block;
}

/* The gradient Join Discord button stays under whichever tab is active. */
#nav[data-navtab] a.btn {
  display: block !important;
}

/* Inside the Discord activity: the iframe is short, so the marketing-scale
   hero would push the stats below the fold. Compact everything — a slim
   title row instead of a hero, tighter sections, smaller stat numbers — so
   the whole dashboard fits one screen. The full-length styles stay for a
   normal browser. */
.in-activity .hero {
  padding: 0.7rem 0 0.6rem;
}

/* One slim line: title and the live pill side by side, eyebrow dropped —
   the activity's rows are precious, not a landing page's. */
.in-activity .hero .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.2rem;
}

.in-activity .hero .eyebrow {
  flex: 0 0 100%;
  margin: 0 0 0.15rem;
}

.in-activity .hero .stats-live {
  margin-left: auto;
}

.in-activity .hero h1 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 0;
}

/* The sticky header is slimmer as an app bar. */
.in-activity .header-inner {
  min-height: 54px;
}

.in-activity .hero .lede,
.in-activity .hero-points,
.in-activity .hero .cta-row {
  display: none;
}

.in-activity .section {
  padding: 0.9rem 0 1.2rem;
}

.in-activity .stats-grid {
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.in-activity .stat-card {
  padding: 0.75rem 0.9rem;
  gap: 2px;
}

.in-activity .stat-big {
  font-size: 1.6rem;
}

.in-activity .stat-note,
.in-activity .stat-denominator {
  font-size: 0.74rem;
}

.in-activity .dash-tile {
  padding: 10px 12px;
}

.in-activity .dash-tile-icon {
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.in-activity .dash-tile-title {
  font-size: 0.9rem;
}

.in-activity .dash-tile-sub {
  font-size: 0.78rem;
}

.in-activity .chart-svg {
  height: 200px;
}

.in-activity .site-footer {
  display: none;
}

/* Dashboard action tiles (server status page). Big tap targets that mirror
   the console tiles' language: icon, title, live sub-line, hover lift. The
   grid collapses to two columns on phones — it is the activity's home too. */
.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

/* Aligned variant (dashboard): fixed column counts per breakpoint so rows
   always fill edge-to-edge — with auto-fit, a 9-tile grid leaves an awkward
   gap after the last partial row. Known counts let the last row span wide. */
.dash-actions-aligned {
  grid-template-columns: repeat(6, 1fr);
}

.dash-actions-aligned .dash-tile {
  height: 100%;
  background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 100%);
}

@media (min-width: 1200px) {
  .dash-actions-aligned .dash-tile:nth-child(n + 7) {
    grid-column: span 2;
  }
}

@media (max-width: 1199px) {
  .dash-actions-aligned {
    grid-template-columns: repeat(4, 1fr);
  }
  .dash-actions-aligned .dash-tile:nth-child(9) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 899px) {
  .dash-actions-aligned {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-actions-aligned .dash-tile:nth-child(9) {
    grid-column: auto;
  }
}

@media (max-width: 599px) {
  .dash-actions-aligned {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-actions-aligned .dash-tile:nth-child(9) {
    grid-column: 1 / -1;
  }
}

.dash-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dash-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--accent-soft);
}

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

.dash-tile-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 4px;
}

.dash-tile-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.dash-tile-sub {
  color: var(--text-dim);
  font-size: 0.84rem;
}

/* Dashboard charts: hand-rolled SVG (no library), accent-gradient fill over a
   crisp line, range pills styled like the site's buttons. preserveAspectRatio=
   none lets the one viewBox stretch to any width; the line uses vector-effect
   so it never fattens when it does. */
.charts {
  padding: 1rem 1.1rem 0.8rem;
  margin-bottom: 1.4rem;
}

.charts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.charts-peak {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.charts-peak small {
  color: var(--mute);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0;
}

.charts-ranges {
  display: flex;
  gap: 6px;
}

.chart-range {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 5px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.chart-range:hover {
  color: var(--text);
  border-color: var(--accent);
}

.chart-range[aria-pressed="true"] {
  color: var(--accent-ink);
  background: linear-gradient(120deg, var(--accent), #a78bfa);
  border-color: transparent;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 260px;
}

@media (max-width: 599px) {
  .chart-svg {
    height: 200px;
  }
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  /* The pop: two chained bloom layers — a tight bright core and a wide soft
     halo, both in the accent colour. Pure CSS (Chromium renders it in the
     activity), no SVG filter machinery to keep in sync with the path. */
  filter: drop-shadow(0 0 5px rgba(123, 140, 255, 0.85)) drop-shadow(0 0 16px rgba(123, 140, 255, 0.4));
}

.chart-grid {
  stroke: var(--line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--mute);
  font-size: 0.78rem;
  padding: 4px 2px 6px;
}

.chart-avg {
  color: var(--text-dim);
}

/* The member's Discord avatar. A thin ring keeps it legible on both the dark
   header and over hero imagery, and the hover lift pairs it with the sign-out
   action beside it. */
.header-login-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  object-fit: cover;
  display: inline-block;
  transition: transform 160ms ease, border-color 160ms ease;
}

.header-login:hover .header-login-avatar {
  transform: translateY(-1px);
  border-color: var(--accent);
}

/* No avatar set (or the CDN URL died): a soft initial tile instead — never a
   broken-image icon. */
.header-login-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2, #7c5cff));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  user-select: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--mute-2);
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: flex;
  order: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 1.6px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/*
 * Sidebar drawer. The hamburger opens a slide-in panel that holds every link.
 * It starts off-canvas (translated right) and slides in, with a backdrop
 * behind it that closes on tap. Same behaviour on desktop and mobile.
 */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

.nav {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  width: min(320px, 86vw);
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 22px;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}

/* The drawer opens on body.nav-open (sets new app.js) OR on #nav.is-open (the
   state the older app.js sets), so it works even before the JS cache refreshes. */
body.nav-open .nav,
.nav.is-open {
  transform: translateX(0);
}

.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav > a {
  padding: 12px 13px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 0.98rem;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav > a:hover {
  background: var(--panel);
  color: var(--text);
}

.nav > a.is-current {
  color: var(--text);
}

.nav > a.btn {
  margin: 8px 0 0;
}

.nav > a.btn-primary,
.nav > a.btn-primary:hover {
  color: var(--accent-ink);
}

/* Segmented tab bar to switch between the User and Admin sides. */
.side-tabs {
  display: flex;
  width: max-content;
  margin: 18px auto 0;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.side-tab {
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.side-tab:hover {
  color: var(--text);
}

.side-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---- Dealership (cars page) ---- */
.dealership-hero {
  position: relative;
  padding: 3.2rem 0 1.4rem;
}

.dealership-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}

.dealership-hero .wrap {
  position: relative;
}

/* Store layout: sidebar (categories + actions) + main area (home view or grid). */
.store-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.4rem;
  align-items: start;
}

/* The sidebar carries a slowly-shifting multi-colour gradient: a moving
   conic sheen behind the panel (via the ::before layer) plus an animated
   gradient border. Both pause for reduced-motion users below. */
.store-side {
  position: sticky;
  top: 90px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(
      from var(--side-angle, 0deg),
      var(--accent),
      #9d6bff,
      var(--accent-2),
      #3ddc97,
      var(--accent)
    ) border-box;
  overflow: hidden;
}

.store-side::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: conic-gradient(
    from 0deg,
    rgba(123, 140, 255, 0.07),
    rgba(157, 107, 255, 0.12),
    rgba(255, 178, 122, 0.08),
    rgba(61, 220, 151, 0.07),
    rgba(123, 140, 255, 0.07)
  );
  animation: side-sheen 14s linear infinite;
  pointer-events: none;
}

@keyframes side-sheen {
  to {
    transform: rotate(1turn);
  }
}

@property --side-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.store-side {
  animation: side-border 8s linear infinite;
}

@keyframes side-border {
  to {
    --side-angle: 360deg;
  }
}

/* Everything inside sits above the sheen layer. */
.store-side > * {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .store-side::before,
  .store-side {
    animation: none;
  }

  .store-side {
    background:
      linear-gradient(var(--panel), var(--panel)) padding-box,
      linear-gradient(140deg, var(--accent), #9d6bff 45%, var(--accent-2)) border-box;
  }
}

.store-side-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 640;
}

.store-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-nav .dealer-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.store-nav .dealer-cat:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-2);
  transform: translateX(3px);
}

/* Active item: animated gradient fill + a soft moving glow edge, so the
   current category reads as lit rather than just coloured. */
.store-nav .dealer-cat.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(
    110deg,
    var(--accent),
    #9d6bff 40%,
    var(--accent-2) 75%,
    var(--accent)
  );
  background-size: 220% 100%;
  animation: cat-flow 5s ease infinite;
  box-shadow: 0 6px 18px -8px rgba(123, 140, 255, 0.55);
}

@keyframes cat-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-nav .dealer-cat,
  .store-nav .dealer-cat.is-active {
    animation: none;
    transition: none;
  }

  .store-nav .dealer-cat.is-active {
    background: var(--accent);
  }
}

.store-side-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.store-side-actions .admin-auth {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-tip {
  margin: 0 0 0.8rem;
}

.store-home .card h3 {
  margin-top: 0;
}

.dealer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.4rem;
}

@media (max-width: 860px) {
  .store-layout {
    grid-template-columns: 1fr;
  }

  .store-side {
    position: static;
  }

  .store-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .store-nav .dealer-cat {
    width: auto;
  }
}

.dealer-cat {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.dealer-cat:hover {
  color: var(--text);
}

.dealer-cat.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

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

.vehicle-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.vehicle-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-soft);
}

/* Buy button: the same animated multi-gradient language as the sidebar —
   a moving gradient fill plus a soft glow, so "this is the money button"
   reads instantly. Pauses for reduced-motion users. */
.vehicle-buy {
  margin-top: 10px;
  width: 100%;
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(
    110deg,
    var(--accent),
    #9d6bff 35%,
    var(--accent-2) 70%,
    var(--accent)
  );
  background-size: 220% 100%;
  animation: buy-flow 5s ease infinite;
  box-shadow: 0 8px 22px -10px rgba(123, 140, 255, 0.6);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.vehicle-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(157, 107, 255, 0.7);
}

.vehicle-buy:active {
  transform: translateY(0);
}

@keyframes buy-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vehicle-buy {
    animation: none;
    background: var(--accent);
  }
}

.vehicle-thumb {
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}

.vehicle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-ph {
  font-size: 2.4rem;
}

.vehicle-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vehicle-name {
  margin: 0;
  font-size: 1.05rem;
}

.vehicle-price {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.vehicle-model {
  margin: 0;
  font-size: 0.8rem;
  color: var(--mute);
  font-family: var(--mono);
}

.vehicle-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.vehicle-cat {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--mute-2);
}

/* Storefront admin editing */
.store-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.admin-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-auth input[type="password"] {
  padding: 7px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.admin-panel {
  margin-bottom: 1.4rem;
}

.admin-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.admin-cat-row input[type="text"] {
  padding: 7px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  min-width: 120px;
}

.dealer-add {
  min-height: 120px;
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.dealer-add:hover {
  color: var(--text);
  border-color: var(--accent);
}

.veh-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.vehicle-body input[type="text"],
.vehicle-body input[type="url"],
.vehicle-body input[type="number"],
.vehicle-body select {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
}

/* ---- Professional storefront polish ---- */
.dealership-hero {
  text-align: center;
  padding: 4.2rem 0 2rem;
}
.dealership-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  letter-spacing: -0.02em;
}
.dealership-hero .lede {
  max-width: 620px;
  margin: 0.7rem auto 0;
  font-size: 1.02rem;
  color: var(--text-dim);
}
.dealer-cats {
  justify-content: center;
}
.dealer-cat {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: rgba(123, 140, 255, 0.07);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
}
.dealer-cat:hover {
  color: var(--text);
  border-color: var(--accent);
}
.dealer-cat.is-active {
  background: linear-gradient(135deg, #7b8cff, #9d6bff);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 5px 20px rgba(123, 140, 255, 0.35);
}
.vehicle-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  border-top: 1px solid rgba(123, 140, 255, 0.18);
}
.vehicle-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
}
.vehicle-thumb {
  aspect-ratio: 16 / 10;
  background: radial-gradient(140% 120% at 20% 0%, rgba(123, 140, 255, 0.20), transparent 60%), var(--panel-2);
}
.vehicle-name {
  font-size: 1.1rem;
  font-weight: 700;
}
.vehicle-price {
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7b8cff, #ffb27a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vehicle-model {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
}
.vehicle-cat {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---- Animated neon flash (Webstore) ---- */
@media (prefers-reduced-motion: no-preference) {
  .dealership-hero h1 {
    background: linear-gradient(120deg, #7b8cff 0%, #ffb27a 25%, #7b8cff 50%, #9d6bff 75%, #7b8cff 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: storeTextShift 7s linear infinite;
    filter: drop-shadow(0 0 14px rgba(123, 140, 255, 0.35));
  }
  @keyframes storeTextShift {
    to { background-position: -220% center; }
  }

  .dealer-cat.is-active {
    animation: pillPulse 2.4s ease-in-out infinite;
  }
  @keyframes pillPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(123, 140, 255, 0), 0 5px 20px rgba(123, 140, 255, 0.3); }
    50% { box-shadow: 0 0 0 5px rgba(123, 140, 255, 0.12), 0 5px 26px rgba(123, 140, 255, 0.5); }
  }

  .vehicle-card {
    animation: cardGlow 4s ease-in-out infinite;
    border-color: rgba(123, 140, 255, 0.35);
  }
  .vehicle-card:hover {
    animation: none;
  }
  @keyframes cardGlow {
    0%, 100% { box-shadow: 0 0 18px -12px rgba(123, 140, 255, 0.45); }
    50% { box-shadow: 0 0 30px -10px rgba(123, 140, 255, 0.7); }
  }

  .vehicle-thumb {
    position: relative;
    overflow: hidden;
  }
  .vehicle-thumb::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    left: -60%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
  }
  .vehicle-card:hover .vehicle-thumb::after {
    left: 120%;
  }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 560;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease,
    color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--panel-2);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  background: #8f9dff;
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 9px 15px;
  font-size: 0.88rem;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem);
}

/* Two soft light sources and a faint grid: depth without a rainbow. */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(46% 44% at 22% 26%, rgba(123, 140, 255, 0.2), transparent 62%),
    radial-gradient(38% 38% at 78% 8%, rgba(255, 178, 122, 0.12), transparent 66%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.hero h1 {
  margin-bottom: 0.6em;
}

.lede {
  font-size: clamp(1.04rem, 1.35vw, 1.18rem);
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 1.8rem;
}

.hero-points {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--mute);
  font-size: 0.9rem;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hero-points li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ------------------------------------------------------------ side panel */

.panel {
  background: linear-gradient(180deg, rgba(19, 27, 41, 0.9), rgba(14, 20, 32, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 22px 8px;
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 620;
}

.facts {
  margin: 0;
  padding: 0;
}

.facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

.facts dt {
  color: var(--mute);
  font-size: 0.88rem;
}

.facts dd {
  margin: 0;
  text-align: right;
  font-size: 0.92rem;
  color: var(--text);
}

.facts dd a {
  color: var(--accent);
}

.connect {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 16px;
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.connect button {
  margin-left: auto;
  flex: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--r-xs);
  padding: 5px 10px;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.connect button:hover {
  background: var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 5px 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mute-2);
  flex: none;
}

.status[data-state="up"] .dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.16);
}

.status[data-state="down"] .dot {
  background: var(--bad);
}

/* ---------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: 18px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.card:hover {
  border-color: #283546;
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: 0.45em;
}

.card p {
  color: var(--mute);
  font-size: 0.94rem;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(123, 140, 255, 0.24);
  color: var(--accent);
  margin-bottom: 16px;
}

.card-icon svg {
  width: 19px;
  height: 19px;
}

.dept {
  position: relative;
  overflow: hidden;
}

.dept::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 72%);
  opacity: 0.8;
}

.dept[data-tone="ems"]::after {
  background: linear-gradient(90deg, #ff6b6b, transparent 72%);
}

.dept[data-tone="doj"]::after {
  background: linear-gradient(90deg, var(--accent-2), transparent 72%);
}

.tag {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------- steps */

.steps {
  counter-reset: step;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}

.steps h3 {
  font-size: 1rem;
}

.steps p {
  color: var(--mute);
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------- rules */

.rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.rule-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-xs);
  font-size: 0.94rem;
  color: var(--text-dim);
}

.rule-list li strong {
  color: var(--text);
}

.rule-group {
  margin-bottom: 2.5rem;
}

.rule-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 1.2rem;
}

.rule-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rule-group li {
  position: relative;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.rule-group li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mute-2);
}

.notice {
  border: 1px solid rgba(255, 176, 32, 0.28);
  background: rgba(255, 176, 32, 0.07);
  border-radius: var(--r);
  padding: 16px 18px;
  color: #f4d9a8;
  font-size: 0.94rem;
}

.rules-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.rules-nav {
  position: sticky;
  top: 94px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  background: var(--panel);
}

.rules-nav h2 {
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 12px;
}

.rules-nav a {
  display: block;
  padding: 7px 0;
  color: var(--text-dim);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line-soft);
}

.rules-nav a:last-child {
  border-bottom: 0;
}

.rules-nav a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------- faq */

.faq {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--panel);
}

.faq details {
  border-bottom: 1px solid var(--line-soft);
}

.faq details:last-child {
  border-bottom: 0;
}

.faq summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 560;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.6px solid var(--mute);
  border-bottom: 1.6px solid var(--mute);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex: none;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
}

.faq .answer {
  padding: 0 22px 20px;
  color: var(--mute);
  font-size: 0.94rem;
}

/* ---------------------------------------------------------------- cta */

.cta-band {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(2rem, 4vw, 3rem);
  background:
    radial-gradient(60% 120% at 12% 0%, rgba(123, 140, 255, 0.16), transparent 60%),
    var(--panel);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta-band h2 {
  margin-bottom: 0.3em;
}

.cta-band p {
  color: var(--mute);
  max-width: 52ch;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 3rem 0 2.5rem;
  margin-top: 2rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  color: var(--mute);
  font-size: 0.92rem;
}

.footer-links a {
  color: var(--text-dim);
}

.footer-links a:hover {
  color: var(--accent);
}

.legal {
  color: var(--mute-2);
  font-size: 0.83rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 1.5rem;
}

.legal p {
  margin-bottom: 0.5em;
}

/* ---------------------------------------------------------------- motion */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .card:hover {
    transform: none;
  }
}

/* ---------------------------------------------------------------- responsive */

/* --------------------------------------------------------------- forms */

/* Only apply.html has fields today, but the styles live here so a second form does
   not invent a second look. Inputs inherit the dark palette rather than the browser's
   default white box, which is the single most common way a dark site looks unfinished. */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 560;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.field .req {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mute-2);
  font-weight: 500;
  margin-left: 6px;
}

.field input[type="text"],
.field input[type="number"],
.field textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 140, 255, 0.16);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--mute-2);
}

.field .hint {
  color: var(--mute);
  font-size: 0.82rem;
  margin: 7px 0 0;
}

.field.checkbox {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.field.checkbox input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.field.checkbox label {
  margin: 0;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--mute);
}

/* Honeypot: present in the DOM so a bot fills it in, and impossible to see or reach
   by keyboard so a person cannot. Not `display: none` — some bots skip hidden
   fields, and an off-screen field is filled just as reliably. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--text-dim);
}

.form-status[data-state="ok"] {
  border-color: rgba(61, 220, 151, 0.45);
  background: rgba(61, 220, 151, 0.07);
  color: var(--text);
}

.form-status[data-state="error"] {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.07);
}

.plain-steps {
  margin: 14px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 12px;
  color: var(--mute);
  font-size: 0.93rem;
}

.plain-steps strong {
  color: var(--text);
}

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .rules-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rules-nav {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding: 0 18px;
  }

  .header-inner {
    min-height: 64px;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-row .btn {
    width: 100%;
  }

  /* A 16px field stops iOS zooming the page when it focuses an input. */
  .field input[type="text"],
  .field input[type="number"],
  .field textarea {
    font-size: 16px;
  }
}

/* ---------------------------------------------------------------------------
   Small shared layout helpers used by the portal and staff pages.
   These are additions, not a redesign: same tokens, same radii, same buttons.
   --------------------------------------------------------------------------- */

.stack {
  display: grid;
  gap: 1rem;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xs);
  padding: 0.6rem 0.75rem;
  overflow-wrap: anywhere;
}

.narrow {
  max-width: 62ch;
}

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.ticks li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-dim);
}

.ticks li::before {
  content: "\2022";
  position: absolute;
  left: 0.3rem;
  color: var(--accent);
}

/* ---------- Staff area ---------- */

.staff-wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 2.5rem 0 5rem;
  display: grid;
  gap: 1.5rem;
}

.staff-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.staff-head h1 {
  margin: 0.2rem 0 0.4rem;
}

.staff-head .lede {
  max-width: 60ch;
  margin: 0;
}

.staff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.staff-group {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

.staff-group h4 {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem 1.2rem;
}

@media (max-width: 560px) {
  .staff-wrap {
    width: 94vw;
    padding-top: 1.5rem;
  }
}

/* ---------- Account dashboard (users.html, logged in) ---------- */

/* The whole dashboard is one dark card like the rest of the site, but the
   greeting row and the status banner give it a clear hierarchy instead of a
   flat wall of text. */

.acct-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.1rem;
}

.acct-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent);
  flex: none;
  overflow: hidden;
}

.acct-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acct-id {
  min-width: 0;
}

.acct-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.acct-sub {
  color: var(--mute);
  font-size: 0.88rem;
  margin: 2px 0 0;
}

/* Whitelist status banner: green when you are in, amber when not, grey when
   the account is not even in the Discord. One element, three states. */
.acct-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  margin-bottom: 1.4rem;
}

.acct-banner[data-state="ok"] {
  border-color: rgba(61, 220, 151, 0.4);
  background: rgba(61, 220, 151, 0.07);
}

.acct-banner[data-state="warn"] {
  border-color: rgba(255, 176, 32, 0.38);
  background: rgba(255, 176, 32, 0.07);
}

.acct-banner[data-state="info"] {
  border-color: rgba(123, 140, 255, 0.38);
  background: var(--accent-soft);
}

.acct-banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mute-2);
  flex: none;
}

.acct-banner[data-state="ok"] .acct-banner-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18);
}

.acct-banner[data-state="warn"] .acct-banner-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.16);
}

.acct-banner[data-state="info"] .acct-banner-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 140, 255, 0.18);
}

.acct-banner-text {
  min-width: 0;
}

.acct-banner-title {
  font-weight: 640;
  margin: 0;
  font-size: 1rem;
}

.acct-banner-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 3px 0 0;
}

.acct-banner .btn {
  margin-left: auto;
}

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.acct-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.acct-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.acct-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  margin-bottom: 8px;
  font-size: 0.93rem;
  color: var(--text-dim);
}

.acct-item:last-child {
  margin-bottom: 0;
}

.acct-item strong {
  color: var(--text);
}

/* Order rows carry the buyer's Discord avatar. baseline alignment is wrong
   once an image is in the row, so this variant centers and wraps the name+
   detail in its own column, letting the pill stay pinned right. */
.acct-item-with-avatar {
  align-items: center;
}

.acct-item-with-avatar .acct-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.acct-item-with-avatar .acct-main span {
  font-size: 0.85rem;
}

.order-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.order-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-avatar[data-fallback] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.acct-pill {
  margin-left: auto;
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.acct-pill[data-state="pending"] {
  border-color: rgba(255, 176, 32, 0.4);
  color: var(--warn);
}

.acct-pill[data-state="approved"] {
  border-color: rgba(61, 220, 151, 0.4);
  color: var(--ok);
}

.acct-pill[data-state="denied"] {
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--bad);
}

.acct-empty {
  color: var(--mute-2);
  font-size: 0.92rem;
  padding: 4px 0 2px;
  margin: 0;
}

/* Connect row inside the dashboard: same look as the panel's .connect box. */
.acct-connect {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.acct-connect button {
  margin-left: auto;
  flex: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--r-xs);
  padding: 5px 10px;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.acct-connect button:hover {
  background: var(--line);
}

/* The username lookup hero/form is for people who are not signed in; when a
   session exists the page hides it so the account view stands alone. */
body.is-logged-in .anon-only {
  display: none;
}

/* --- Account tabs: Overview / Orders / Applications / Tickets ------------
   The logged-in dashboard is tabbed; the bar sits inside the main card under
   the greeting, and only one pane is mounted at a time. */

.acct-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-soft);
  margin-bottom: 1.2rem;
}

.acct-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.acct-tab:hover {
  color: var(--text);
  background: var(--panel-2);
}

.acct-tab.is-active {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.acct-tab .acct-count {
  min-width: 19px;
  height: 19px;
  font-size: 0.72rem;
}

.acct-tab.is-active .acct-count {
  background: var(--accent);
  color: #fff;
}

.acct-tab-content {
  min-height: 200px;
}

/* Overview chips: big clickable numbers that jump to their tab. Reuses the
   .acct-card look; the whole chip is a button so the cursor tells the truth. */
button.acct-chip {
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

button.acct-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.acct-chip-big {
  margin: 0.35rem 0 0.45rem;
  font-size: 2.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.acct-chip .acct-empty {
  font-size: 0.86rem;
}

.acct-chip .btn {
  margin-top: 0.7rem;
}

/* ---------- Server status dashboard (server.html) ---------- */

.stats-live {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.stats-updated {
  color: var(--mute-2);
  font-size: 0.82rem;
}

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

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 620;
  margin: 0;
}

.stat-big {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.05;
}

.stat-mid {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

.stat-denominator {
  font-size: 0.45em;
  color: var(--mute);
  font-weight: 600;
  margin-left: 4px;
}

.stat-note {
  color: var(--mute);
  font-size: 0.86rem;
  margin: 2px 0 0;
}

.stat-note a {
  color: var(--accent);
}

.stat-hero {
  grid-column: 1 / -1;
}

.stat-hero-row {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  margin: 4px 0 6px;
}

/* Fill bar under the big number: instant "how full is the server" read. */
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  margin: 4px 0 8px;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #9d6bff);
  transition: width 0.6s ease;
}

.bar span[data-state="full"] {
  background: linear-gradient(90deg, var(--warn), var(--bad));
}

/* The gauge is a plain SVG ring; stroke-dasharray does the arc, so no JS
   chart library — one element, animated by the same transition as the bar. */
.gauge {
  position: relative;
  width: 108px;
  height: 108px;
  flex: none;
  margin-left: auto;
}

.gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track,
.gauge-fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.gauge-track {
  stroke: var(--bg-soft);
}

.gauge-fill {
  stroke: var(--accent);
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.8s ease, stroke 0.4s ease;
}

.gauge[data-state="busy"] .gauge-fill {
  stroke: var(--warn);
}

.gauge[data-state="full"] .gauge-fill {
  stroke: var(--bad);
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.stat-duo {
  display: flex;
  gap: 2rem;
  margin: 2px 0 4px;
}

/* Player list: compact chips, wrapping, so 100 names stay scannable. */
.player-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-list li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ---------- Staff console (console.html) — txAdmin-style overview ---------- */

.console-wrap {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 2.2rem 0 5rem;
  display: grid;
  gap: 1.1rem;
}

.console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.console-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.console-title h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.console-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  flex: 1 1 480px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-2);
}

/* A tile that is a real button into a section. Text-align resets for the
   button element; the affordances (border glow + lift) say "clickable" and
   match the rest of the console's hover language. */
.tile-link {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.tile-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: var(--accent-soft);
}

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

/* The tab bar under the masthead — the switcher between the dashboard and
   each section. Scopes horizontally on small screens rather than wrapping
   into two rows. */
.console-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 10px);
  background: var(--panel);
  overflow-x: auto;
  scrollbar-width: none;
}

.console-tabs::-webkit-scrollbar {
  display: none;
}

.console-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: calc(var(--r-sm, 10px) - 3px);
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease, background 140ms ease;
}

.console-tab:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.console-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

/* Each view is a simple stack of cards — the same rhythm the old grid had. */
.console-view {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.console-jump {
  flex-wrap: wrap;
}

.tile .bar {
  margin: 6px 0 0;
}

.console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  align-items: start;
}

.console-footer {
  margin-top: 1.4rem;
}


.setup-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 0;
  font-size: 0.92rem;
}

.setup-dot {
  font-size: 0.7rem;
  flex: none;
}

.setup-dot.ok {
  color: var(--ok);
}

.setup-dot.bad {
  color: var(--warn);
}

.setup-detail {
  color: var(--mute);
}

@media print {
  .site-header,
  .nav-toggle,
  .cta-band,
  .site-footer .footer-links {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ===== Events page ===== */

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.event-card {
  background: linear-gradient(160deg, rgba(88, 101, 242, 0.1), rgba(139, 92, 246, 0.06) 55%, rgba(7, 9, 16, 0.4));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.event-card.is-past {
  opacity: 0.55;
}

.event-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.event-title {
  margin: 0;
  font-size: 1.05rem;
}

.event-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  white-space: nowrap;
}

.event-tag.is-live {
  background: linear-gradient(90deg, #5865f2, #8b5cf6, #d946ef);
  color: #fff;
}

.event-when {
  margin: 0.45rem 0 0;
  font-weight: 600;
  color: #e2e8f0;
}

.event-desc {
  margin: 0.4rem 0 0;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.event-rsvp {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: #a5b4fc;
}

/* ===== Chart peak marker + busiest-hours heatmap ===== */

.chart-peak-dot {
  fill: #c4b5fd;
  stroke: rgba(196, 181, 253, 0.35);
  stroke-width: 6;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.9));
}

.heatmap {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.heatmap-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 2.4rem repeat(24, 1fr);
  gap: 3px;
  align-items: center;
}

.heatmap-day {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
}

.heatmap-cell {
  display: block;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, #5865f2, #8b5cf6, #d946ef);
  transition: transform 0.12s ease;
}

.heatmap-cell:hover {
  transform: scaleY(1.35);
}

.heatmap-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
  font-size: 0.68rem;
  color: #64748b;
}

.heatmap-cells {
  display: inline-flex;
  gap: 2px;
}

.heatmap-cells i {
  width: 16px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, #5865f2, #8b5cf6, #d946ef);
}

.heatmap-cells i:nth-child(1) { opacity: 0.14; }
.heatmap-cells i:nth-child(2) { opacity: 0.32; }
.heatmap-cells i:nth-child(3) { opacity: 0.52; }
.heatmap-cells i:nth-child(4) { opacity: 0.74; }
.heatmap-cells i:nth-child(5) { opacity: 0.95; }

@media (max-width: 700px) {
  .heatmap-grid { grid-template-columns: 1.8rem repeat(24, 1fr); gap: 2px; }
  .heatmap-cell { height: 10px; border-radius: 2px; }
}

/* ===== Audit page ===== */

.audit-line {
  margin: 0 0 0.45rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.06);
  font-size: 0.9rem;
  color: #e2e8f0;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.audit-kind {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.audit-perm .audit-kind { background: linear-gradient(90deg, #5865f2, #8b5cf6); color: #fff; }
.audit-access .audit-kind { background: linear-gradient(90deg, #8b5cf6, #d946ef); color: #fff; }
.audit-order .audit-kind { background: linear-gradient(90deg, #d946ef, #f472b6); color: #fff; }

.audit-when {
  color: #94a3b8;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.audit-unconfirmed {
  font-size: 0.72rem;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.audit-filter { opacity: 0.65; }
.audit-filter.is-active {
  opacity: 1;
  background: linear-gradient(90deg, #5865f2, #8b5cf6, #d946ef);
  color: #fff;
  border-color: transparent;
}

/* The "all" toggle on the permission grant chips */
.perm-chip-all {
  border: 1px dashed rgba(139, 92, 246, 0.55);
}

/* ===== Store discount code row ===== */

.promo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
  flex-wrap: wrap;
}

.promo-row input {
  background: rgba(7, 9, 16, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  color: #e2e8f0;
  font: inherit;
  max-width: 200px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.promo-row input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

/* ===== Admin ops: system health ===== */

.health-line {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 0.5rem;
  flex-wrap: wrap;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}

.health-dot.is-ok {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.health-dot.is-warn {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.health-dot.is-bad {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.7);
}

/* ===== Admin lists: application rows with actions ===== */

.app-row {
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  margin: 0 0 0.55rem;
}

.app-row p {
  margin: 0 0 0.35rem;
}

.app-answers summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #a5b4fc;
  margin-bottom: 0.35rem;
}

.app-answers pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(7, 9, 16, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0 0 0.5rem;
}

.app-actions {
  display: flex;
  gap: 0.5rem;
}

.app-approve {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-color: transparent;
  color: #fff;
}

.app-deny {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  border-color: transparent;
  color: #fff;
}

/* ===== Site-wide notice banner (injected by app.js on every page) ===== */

#site-notice.notice-banner {
  margin: 0.8rem auto 0;
  max-width: 1200px;
  width: calc(100% - 2rem);
  box-sizing: border-box;
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.14), rgba(139, 92, 246, 0.12), rgba(217, 70, 239, 0.1));
  color: #e2e8f0;
  font-weight: 600;
}

/* ==========================================================================
   ADMIN THEME — `body.theme-admin`
   A different look for the staff side: deep emerald surfaces instead of the
   public site's indigo, sharper corners, hairline borders. Everything else on
   the page keeps working; only the palette and chrome change.
   ========================================================================== */

body.theme-admin {
  --bg: #06110d;
  --bg-soft: #081811;
  --panel: #0a1f16;
  --panel-2: #0e291d;
  --line: #1b3a2b;
  --line-soft: #143023;

  --text: #e7f5ec;
  --text-dim: #b3cdbf;
  --mute: #7fa391;
  --mute-2: #628573;

  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --accent-ink: #04120c;
  --accent-2: #facc15;

  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow: 0 24px 60px -36px rgba(0, 0, 0, 0.9);
}

body.theme-admin {
  background:
    radial-gradient(1100px 640px at 92% -12%, rgba(52, 211, 153, 0.12), transparent 60%),
    radial-gradient(900px 560px at -6% 106%, rgba(250, 204, 21, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* Admin brand mark: a small emerald square so staff always know which world
   they are in, even before reading. */
.admin-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #0f3d2b, #14532d);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #34d399;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

body.theme-admin .site-header {
  background: rgba(6, 17, 13, 0.86);
  border-bottom-color: rgba(52, 211, 153, 0.16);
}

body.theme-admin .btn-primary {
  background: linear-gradient(90deg, #10b981, #34d399);
  color: #04120c;
}

body.theme-admin .card {
  border-color: rgba(52, 211, 153, 0.14);
}

body.theme-admin .eyebrow {
  color: #34d399;
}

/* The range pills and chart gradient follow the emerald theme here. */
body.theme-admin .chart-range[aria-pressed="true"] {
  background: linear-gradient(90deg, #10b981, #34d399);
  color: #04120c;
}

body.theme-admin .heatmap-cell,
body.theme-admin .heatmap-cells i {
  background: linear-gradient(90deg, #10b981, #34d399, #facc15);
}

/* ==========================================================================
   LANDING CHOOSER — the split screen at `/`
   Public on the left, admin on the right; members go straight in.
   ========================================================================== */

.landing {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.landing-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-half.public {
  background:
    radial-gradient(900px 520px at 20% -10%, rgba(123, 140, 255, 0.2), transparent 60%),
    var(--bg);
}

.landing-half.staff {
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(52, 211, 153, 0.18), transparent 60%),
    #06110d;
}

.landing-glyph {
  font-size: 2.6rem;
  line-height: 1;
}

.landing-title {
  margin: 0;
  font-size: 1.7rem;
}

.landing-sub {
  margin: 0;
  color: var(--text-dim);
  max-width: 34ch;
}

.landing-badge {
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.landing-half .btn {
  min-width: 220px;
}

.landing-switch {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--mute);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

.landing-switch:hover {
  color: var(--text);
}

/* The tiny chooser chrome while the login check runs. */
.landing-wait {
  font-size: 0.8rem;
  color: var(--mute);
}

@media (max-width: 760px) {
  .landing {
    grid-template-columns: 1fr;
  }
  .landing-half.staff {
    display: none;
  }
  .landing-half.public {
    min-height: 100vh;
  }
  /* On phones the admin entrance is a plain link under the public button. */
  .landing-admin-entry {
    position: static;
    transform: none;
    margin-top: 0.6rem;
  }
}

/* ==========================================================================
   VIBRANT PASS — a livelier public look without touching the layout logic.
   Glow cards, gradient tiles, animated accents. All of it respects
   prefers-reduced-motion.
   ========================================================================== */

/* --- 1. The page itself: a touch more colour in the ambient light ------- */

body {
  background:
    radial-gradient(1100px 640px at 90% -10%, rgba(123, 140, 255, 0.2), transparent 62%),
    radial-gradient(940px 560px at -8% 108%, rgba(217, 70, 239, 0.1), transparent 58%),
    radial-gradient(700px 420px at 55% 120%, rgba(255, 178, 122, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* --- 2. Stat cards: gradient number text + a colour bar per card -------- */

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(123, 140, 255, 0.22);
  background: linear-gradient(155deg, rgba(123, 140, 255, 0.12), rgba(139, 92, 246, 0.05) 45%, rgba(14, 20, 32, 0.9));
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #5865f2, #8b5cf6, #d946ef);
  opacity: 0.85;
}

.stat-big {
  background: linear-gradient(92deg, #aab6ff, #d946ef 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- 3. Dashboard tiles: each gets its own gradient and hover lift ------ */

.dash-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(160deg, rgba(88, 101, 242, 0.12), rgba(15, 20, 34, 0.85) 55%);
}

.dash-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, #5865f2, #8b5cf6, #d946ef);
  opacity: 0;
  transition: opacity 180ms ease;
}

.dash-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 14px 34px -18px rgba(139, 92, 246, 0.55);
}

.dash-tile:hover::after {
  opacity: 1;
}

.dash-tile:nth-child(6n + 1) { --tile-hue: 236; }
.dash-tile:nth-child(6n + 2) { --tile-hue: 262; }
.dash-tile:nth-child(6n + 3) { --tile-hue: 292; }
.dash-tile:nth-child(6n + 4) { --tile-hue: 320; }
.dash-tile:nth-child(6n + 5) { --tile-hue: 20; }
.dash-tile:nth-child(6n + 6) { --tile-hue: 160; }

.dash-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 1.1rem;
  background: hsla(var(--tile-hue, 250), 85%, 62%, 0.16);
  border: 1px solid hsla(var(--tile-hue, 250), 85%, 62%, 0.3);
}

.dash-tile:hover .dash-tile-icon {
  background: hsla(var(--tile-hue, 250), 85%, 62%, 0.28);
  box-shadow: 0 0 14px hsla(var(--tile-hue, 250), 85%, 62%, 0.4);
}

/* --- 4. Buttons: gradient by default, lift on hover ---------------------- */

.btn-primary {
  background: linear-gradient(92deg, #5865f2, #8b5cf6 55%, #d946ef);
  border: 0;
  box-shadow: 0 10px 26px -14px rgba(139, 92, 246, 0.7);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 14px 32px -14px rgba(139, 92, 246, 0.85);
}

/* --- 5. Header: subtle gradient hairline under it ------------------------ */

.site-header {
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(10, 12, 22, 0.92), rgba(10, 12, 22, 0.78));
  backdrop-filter: blur(14px);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
}

/* --- 6. Eyebrows get the gradient treatment ------------------------------ */

.eyebrow {
  background: linear-gradient(90deg, #8b9aff, #d946ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- 7. Hero: a third light and slightly stronger grid -------------------- */

.hero::before {
  background:
    radial-gradient(46% 44% at 22% 26%, rgba(88, 101, 242, 0.26), transparent 62%),
    radial-gradient(38% 38% at 78% 8%, rgba(217, 70, 239, 0.16), transparent 66%),
    radial-gradient(30% 30% at 60% 90%, rgba(255, 178, 122, 0.1), transparent 70%);
}

/* --- 8. Live pill: soft glow when the server is online -------------------- */

.status[data-state="online"] {
  box-shadow: 0 0 18px rgba(61, 220, 151, 0.35);
  border-color: rgba(61, 220, 151, 0.5);
}

/* --- 9. The admin (emerald) side gets its own vibrant accents ------------- */

body.theme-admin .stat-card {
  border-color: rgba(52, 211, 153, 0.25);
  background: linear-gradient(155deg, rgba(52, 211, 153, 0.12), rgba(14, 41, 29, 0.9) 50%);
}

body.theme-admin .stat-card::before {
  background: linear-gradient(180deg, #10b981, #34d399, #facc15);
}

body.theme-admin .stat-big {
  background: linear-gradient(92deg, #6ee7b7, #facc15 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-admin .dash-tile {
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.12), rgba(10, 31, 22, 0.85) 55%);
}

body.theme-admin .dash-tile::after,
body.theme-admin .btn-primary {
  background: linear-gradient(90deg, #10b981, #34d399, #facc15);
}

body.theme-admin .dash-tile:hover {
  box-shadow: 0 14px 34px -18px rgba(52, 211, 153, 0.55);
}

body.theme-admin .eyebrow {
  background: linear-gradient(90deg, #6ee7b7, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-admin .site-header::after {
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.55), transparent);
}

/* --- 10. Motion safety: every animation above is decoration --------------- */

@media (prefers-reduced-motion: reduce) {
  .dash-tile,
  .dash-tile::after,
  .btn-primary {
    transition: none;
  }
  .dash-tile:hover,
  .btn-primary:hover {
    transform: none;
  }
}

/* Sticky header needs its own positioning context for the gradient hairline. */
.site-header {
  position: sticky;
}

/* The live pill has no box-shadow baseline; the glow adds one cleanly. */
.status[data-state="online"] {
  box-shadow: 0 0 18px rgba(61, 220, 151, 0.35);
}
