:root {
  color-scheme: light dark;
  --primary: #0066cc;
  --primary-focus: #0071e3;
  --primary-on-dark: #2997ff;
  --ink: #1d1d1f;
  --body-on-dark: #ffffff;
  --body-muted: #cccccc;
  --ink-muted-80: #333333;
  --ink-muted-48: #7a7a7a;
  --divider-soft: #f0f0f0;
  --hairline: #e0e0e0;
  --canvas: #ffffff;
  --canvas-parchment: #f5f5f7;
  --surface-pearl: #fafafc;
  --surface-black: #000000;
  --surface-tile-1: #272729;
  --surface-tile-2: #2a2a2c;
  --subnav-bg: rgba(245, 245, 247, 0.82);

  --shadow-product: 3px 5px 30px rgba(0, 0, 0, 0.22);
  --chip-translucent: rgba(210, 210, 215, 0.64);
  --on-primary: #ffffff;
  --success: #248a3d;
  --success-bg: rgba(36, 138, 61, 0.1);
  --danger: #d70015;
  --danger-bg: rgba(215, 0, 21, 0.08);

  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 28px rgba(0, 0, 0, 0.07);

  --warn: #9a6700;
  --warn-bg: rgba(154, 103, 0, 0.1);
  --kick: #b35900;
  --kick-bg: rgba(179, 89, 0, 0.1);
  --mute: #0066cc;
  --mute-bg: rgba(0, 102, 204, 0.1);

  /* Liquid Glass surfaces — translucent frosted material used on the nav
     bars and buttons. --glass-dark-* is a fixed dark glass (not theme-
     dependent) for chrome that stays dark in both themes, like the global
     nav strip. --liquid-ease is the elastic curve used for press/morph
     transitions so they feel gel-like rather than mechanical. */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-highlight: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);
  --glass-dark-bg: rgba(20, 20, 24, 0.55);
  --glass-dark-border: rgba(255, 255, 255, 0.14);
  --liquid-ease: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Deliberately not derived from --ink: --ink flips light<->dark for body
     text, but this button should stay a filled dark chip in light mode and
     become a lighter gray chip (not white-on-white) in dark mode. */
  --btn-secondary-bg: #1d1d1f;
  --btn-secondary-fg: #ffffff;
  --btn-secondary-hover-bg: #333333;

  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 17px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark mode — same tokens, re-stepped against a dark surface (never an
   automatic invert). The media query covers an unset system preference;
   the explicit [data-theme] attribute (set by theme.js, persisted to
   localStorage) always wins over it in either direction. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary: #2997ff;
    --primary-focus: #409cff;
    --ink: #f5f5f7;
    --ink-muted-80: #d1d1d6;
    --ink-muted-48: #98989d;
    --divider-soft: #2c2c2e;
    --hairline: #38383a;
    --canvas: #1c1c1e;
    --canvas-parchment: #000000;
    --surface-pearl: #232325;
    --subnav-bg: rgba(28, 28, 30, 0.82);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 1px 2px rgba(0, 0, 0, 0.55), 0 12px 28px rgba(0, 0, 0, 0.4);
    --btn-secondary-bg: #3a3a3c;
    --btn-secondary-fg: #ffffff;
    --btn-secondary-hover-bg: #48484a;
    --glass-bg: rgba(40, 40, 45, 0.5);
    --glass-bg-strong: rgba(50, 50, 56, 0.68);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.16);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08),
      inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #2997ff;
  --primary-focus: #409cff;
  --ink: #f5f5f7;
  --ink-muted-80: #d1d1d6;
  --ink-muted-48: #98989d;
  --divider-soft: #2c2c2e;
  --hairline: #38383a;
  --canvas: #1c1c1e;
  --canvas-parchment: #000000;
  --surface-pearl: #232325;
  --subnav-bg: rgba(28, 28, 30, 0.82);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 1px 2px rgba(0, 0, 0, 0.55), 0 12px 28px rgba(0, 0, 0, 0.4);
  --btn-secondary-bg: #3a3a3c;
  --btn-secondary-fg: #ffffff;
  --btn-secondary-hover-bg: #48484a;
  --glass-bg: rgba(40, 40, 45, 0.5);
  --glass-bg-strong: rgba(50, 50, 56, 0.68);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--canvas-parchment);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.44;
  letter-spacing: -0.37px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

a {
  color: inherit;
}

/* Global nav — frosted glass strip, brand only. Sticky + blurred so it
   reads as a pane of glass over whatever scrolls underneath it, per the
   Liquid Glass treatment (see .nav-liquid-indicator below for the button
   morph half of that). Fixed dark glass regardless of theme, same as the
   old solid black strip was. */

.global-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--glass-dark-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-dark-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 0 rgba(0, 0, 0, 0.3);
}

.global-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.brand-mark {
  flex-shrink: 0;
  object-fit: contain;
}

.brand-word {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.16px;
  color: var(--body-on-dark);
}

.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  overflow: hidden;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: var(--body-on-dark);
  font: inherit;
  cursor: pointer;
  transition: background-color 150ms ease, transform 420ms var(--liquid-ease);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.theme-toggle:active {
  transform: scale(0.88);
}

.theme-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
  transition: transform 500ms var(--liquid-ease), opacity 250ms ease;
}

.theme-toggle-icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.4);
}

:root[data-theme="dark"] .theme-toggle-icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.4);
}

:root[data-theme="dark"] .theme-toggle-icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.4);
  }

  :root:not([data-theme="light"]) .theme-toggle-icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
}

/* Sub-nav — frosted parchment, sticky just beneath the glass global nav,
   category name + links. 54px matches the global nav's rendered height
   (padding + logo) so the two glass panes sit flush with no gap or overlap. */

.sub-nav {
  position: sticky;
  top: 54px;
  z-index: 20;
  background: var(--subnav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sub-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.sub-nav-title {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.19;
  letter-spacing: 0.23px;
  color: var(--ink);
}

.site-nav {
  position: relative;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  z-index: 1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: -0.22px;
  color: var(--ink-muted-48);
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Liquid Glass tab indicator — a frosted pill that morphs (position + size)
   between whichever site-nav link is hovered/focused, settling back on the
   active page link when the pointer leaves. Positioned/sized by nav.js via
   getBoundingClientRect, this CSS only owns its look and the elastic
   transition. z-index 0 keeps it under the link text (z-index 1 above). */

.nav-liquid-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  box-shadow: var(--glass-shadow);
  opacity: 0;
  pointer-events: none;
  transition: transform 480ms var(--liquid-ease), width 480ms var(--liquid-ease),
    height 480ms var(--liquid-ease), opacity 220ms ease;
}

/* Page shell */

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.page-header p {
  margin: 0;
  color: var(--ink-muted-48);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.37px;
  max-width: 34rem;
}

/* Status readout */

.status-band {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
  margin-bottom: 1.75rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  position: relative;
}

.status-dot.online {
  background: var(--success);
}

.status-dot.online::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 138, 61, 0.45);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(36, 138, 61, 0);
  }
}

.status-word {
  font-family: var(--font);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.3px;
  margin: 0;
  color: var(--ink);
}

.status-detail {
  margin: 0.35rem 0 0;
  color: var(--ink-muted-48);
  font-size: 1rem;
  letter-spacing: -0.22px;
}

/* Panel row */

.panel-row {
  display: flex;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.panel {
  flex: 1;
  padding: 1.6rem 1.75rem;
  min-width: 0;
}

.panel-divider {
  width: 1px;
  background: var(--hairline);
}

.panel-label {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted-48);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.panel-value {
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
}

/* Chart panel */

.chart-panel {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.75rem 2rem;
  margin-bottom: 1.75rem;
}

.chart-panel canvas {
  width: 100%;
  height: 120px;
  margin-top: 0.75rem;
}

/* Stat tiles — label / value / delta, per the dataviz stat-tile contract */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.stat-tile {
  background: var(--canvas);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-tile-label {
  font-size: 0.75rem;
  color: var(--ink-muted-48);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-tile-value {
  font-family: var(--font);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  font-variant-numeric: proportional-nums;
}

.stat-tile-delta {
  font-size: 0.8rem;
  font-weight: 600;
}

.stat-tile-delta.up { color: var(--success); }
.stat-tile-delta.down { color: var(--danger); }
.stat-tile-delta.flat { color: var(--ink-muted-48); }

/* Time range toggle — one row, above the charts it scopes */

.range-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.range-toggle-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-muted-48);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease,
    transform 420ms var(--liquid-ease), border-radius 420ms var(--liquid-ease);
}

.range-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--ink);
}

.range-toggle-btn:active {
  transform: scale(0.92);
  border-radius: calc(var(--radius-pill) + 6px);
}

.range-toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chart-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.chart-end-value {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: proportional-nums;
}

.chart-canvas-wrap {
  position: relative;
}

#message-chart {
  height: 220px;
}

#member-chart {
  height: 130px;
}

.chart-canvas-wrap canvas {
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  top: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--body-on-dark);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  box-shadow: var(--shadow-card-hover);
  z-index: 5;
}

.chart-tooltip strong {
  font-size: 0.85rem;
  font-weight: 700;
}

/* Ranked horizontal bars — command usage */

.bar-row {
  display: grid;
  grid-template-columns: 7rem 1fr 2.5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.bar-row-label {
  font-size: 0.85rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  background: var(--divider-soft);
  border-radius: var(--radius-sm);
  height: 20px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  background: var(--primary);
  border-radius: var(--radius-sm);
}

.bar-row-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted-48);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.error-message {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--danger);
}

/* Flat panel (tickets / commands / moderation / leveling admin cards) */

.panel-block {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem 2.1rem;
}

.panel-block + .panel-block {
  margin-top: 1.75rem;
}

.intro-panel {
  text-align: left;
  padding: 2.5rem;
}

/* Sub-groups within a long form — breaks a flat field list into scannable clusters */

.field-group {
  background: var(--surface-pearl);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem 0.25rem;
  margin-bottom: 1.5rem;
}

.field-group .field:last-child {
  margin-bottom: 1.15rem;
}

.field-group-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted-80);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.intro-panel p {
  color: var(--ink-muted-48);
  font-size: 1.0625rem;
  max-width: 32rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.6rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--divider-soft);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-header-row .who {
  font-size: 0.9rem;
  color: var(--ink-muted-48);
}

.panel-header-row .who strong {
  color: var(--ink);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-input {
  width: 12rem;
  max-width: 100%;
}

.guild-switcher-label {
  font-size: 0.85rem;
  color: var(--ink-muted-48);
}

.guild-switcher-select {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a7a' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 150ms ease;
}

.guild-switcher-select:focus {
  outline: 2px solid var(--primary-focus);
  outline-offset: 1px;
  border-color: var(--primary-focus);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.field:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.field select,
.field input:not([type="checkbox"]),
.field textarea {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 150ms ease;
}

.field input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.field-help {
  margin: 0;
  color: var(--ink-muted-48);
  font-size: 0.82rem;
  line-height: 1.45;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a7a' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.field textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.field select:focus,
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--primary-focus);
  outline-offset: 1px;
  border-color: var(--primary-focus);
}

.category-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.category-row input[type="text"],
.category-row input[type="number"],
.category-role-select,
.category-emoji-select {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 150ms ease;
}

.category-number-input {
  flex: 0 0 5rem;
  text-align: center;
}

.category-role-select,
.category-emoji-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a7a' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
}

.category-name-input {
  flex: 2;
  min-width: 0;
}

.category-emoji-select {
  flex: 0 0 4.75rem;
  text-align: center;
  text-align-last: center;
}

.category-role-select {
  flex: 2;
  min-width: 0;
}

.btn-row-action {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  background: transparent;
  color: var(--ink-muted-48);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.btn-row-action:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}

.btn-row-action:active {
  transform: scale(0.96);
}

.add-category-button {
  align-self: flex-start;
  margin-top: 0.25rem;
  background: transparent;
  color: var(--ink-muted-48);
  border: 1.5px dashed var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
}

.add-category-button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}

.tickets-intro {
  color: var(--ink-muted-48);
  font-size: 0.95rem;
}

.case-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.case-tab {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-muted-48);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease,
    transform 420ms var(--liquid-ease), border-radius 420ms var(--liquid-ease);
}

.case-tab:hover {
  border-color: var(--primary);
  color: var(--ink);
}

.case-tab:active {
  transform: scale(0.92);
  border-radius: calc(var(--radius-pill) + 6px);
}

.case-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tickets-table th {
  text-align: left;
  color: var(--ink-muted-48);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 0 0.5rem 0.7rem;
  border-bottom: 1px solid var(--divider-soft);
}

.tickets-table td {
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid var(--divider-soft);
  vertical-align: middle;
  color: var(--ink);
}

.tickets-table tr:last-child td {
  border-bottom: none;
}

.tickets-table a {
  color: var(--primary);
  text-decoration: none;
  transition: text-decoration-color 150ms ease;
}

.case-type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.case-type-warn { color: var(--warn); background: var(--warn-bg); }
.case-type-mute { color: var(--mute); background: var(--mute-bg); }
.case-type-unmute { color: var(--success); background: var(--success-bg); }
.case-type-kick { color: var(--kick); background: var(--kick-bg); }
.case-type-ban { color: var(--danger); background: var(--danger-bg); }
.case-type-unban { color: var(--success); background: var(--success-bg); }

.tickets-table a:hover {
  text-decoration: underline;
}


/* Buttons — two grammars: blue pill for primary actions, ink rect for
   utility actions. Both get a Liquid Glass treatment: a top-edge specular
   highlight (the ::before sheen) plus an elastic squish-and-round on press
   so the button feels like it's made of a soft, glassy material rather
   than a flat rect. */

.btn-primary,
.btn-secondary,
.btn-discord {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 150ms ease, transform 420ms var(--liquid-ease),
    border-radius 420ms var(--liquid-ease), box-shadow 200ms ease;
}

.btn-primary::before,
.btn-secondary::before,
.btn-discord::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
  z-index: 1;
}

.btn-primary:active,
.btn-secondary:active,
.btn-discord:active {
  transform: scale(0.93);
  border-radius: calc(var(--radius-pill) + 8px);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.37px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px rgba(0, 102, 204, 0.25);
}

.btn-primary:hover {
  background: var(--primary-focus);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.94rem;
  font-size: 0.875rem;
  line-height: 1.29;
  font-weight: 400;
  letter-spacing: -0.22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-secondary:active {
  border-radius: calc(var(--radius-sm) + 6px);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover-bg);
}

.btn-discord {
  background: #5865f2;
  color: white;
  border-radius: var(--radius-pill);
  padding: 0.875rem 1.75rem;
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
  background: #4a55d6;
}

.tickets-message {
  margin-top: 1rem;
  font-size: 0.88rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
}

.tickets-message-success {
  color: var(--success);
  background: var(--success-bg);
}

.tickets-message-error {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Legal / prose pages (privacy, terms) */

.legal-body h2 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 2.25rem 0 0.75rem;
}

.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body p {
  color: var(--ink-muted-80);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.legal-body ul {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
  color: var(--ink-muted-80);
  font-size: 1rem;
  line-height: 1.6;
}

.legal-body li {
  margin-bottom: 0.4rem;
}

.legal-body strong {
  color: var(--ink);
}

.legal-body a {
  color: var(--primary);
  text-decoration: underline;
}

.legal-updated {
  color: var(--ink-muted-48);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

footer.site-footer {
  text-align: center;
  color: var(--ink-muted-48);
  font-size: 0.75rem;
  letter-spacing: -0.12px;
  padding: 3rem 1.5rem 3.5rem;
  border-top: 1px solid var(--hairline);
}

.footer-links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-links a {
  color: var(--ink-muted-48);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Marketing homepage — full-bleed alternating tiles, the one place the
   product-photography shadow is used (per the design system: exactly one
   shadow, reserved for imagery resting on a surface, never chrome) */

.tile {
  width: 100%;
}

.tile-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.tile-light {
  background: var(--canvas);
}

.tile-parchment {
  background: var(--canvas-parchment);
}

.tile-dark {
  background: var(--surface-tile-1);
  color: var(--body-on-dark);
}

.tile-dark .hero-lead,
.tile-dark .tile-lead {
  color: var(--body-muted);
}

.hero-tile .tile-inner {
  padding-top: 6rem;
  padding-bottom: 6rem;
  text-align: center;
}

.hero-title {
  font-family: var(--font);
  font-weight: 600;
  font-size: 3.5rem;
  line-height: 1.07;
  letter-spacing: -0.5px;
  margin: 0 auto 1.25rem;
  max-width: 40rem;
  color: var(--ink);
}

.hero-lead {
  font-size: 1.375rem;
  line-height: 1.4;
  letter-spacing: 0.01px;
  color: var(--ink-muted-48);
  max-width: 34rem;
  margin: 0 auto 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.btn-secondary-pill {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.37px;
  text-decoration: none;
  transition: background-color 150ms ease, backdrop-filter 150ms ease, transform 420ms var(--liquid-ease),
    border-radius 420ms var(--liquid-ease);
}

.btn-secondary-pill:hover {
  background: rgba(0, 102, 204, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn-secondary-pill:active {
  transform: scale(0.93);
  border-radius: calc(var(--radius-pill) + 8px);
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-muted-48);
  font-size: 0.85rem;
  text-decoration: none;
}

.live-status-pill:hover {
  color: var(--ink);
}

.live-status-pill .status-dot {
  width: 8px;
  height: 8px;
}

.tile-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.tile-title {
  font-family: var(--font);
  font-weight: 600;
  font-size: 2.125rem;
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0 0 0.75rem;
}

.tile-lead {
  font-size: 1.0625rem;
  line-height: 1.47;
  color: var(--ink-muted-48);
  max-width: 34rem;
  margin: 0 auto;
}

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

.feature-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
}

.feature-card h3 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.2px;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.feature-card p {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted-48);
  margin: 0;
}

.browser-mockup {
  max-width: 860px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-product);
  background: var(--canvas);
}

.browser-mockup-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  background: #e5e5ea;
}

.browser-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.browser-dot-red { background: #ff5f57; }
.browser-dot-yellow { background: #febc2e; }
.browser-dot-green { background: #28c840; }

.browser-mockup-url {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 1rem;
  min-width: 0;
}

.browser-mockup-url span {
  background: var(--canvas);
  color: var(--ink-muted-48);
  font-size: 0.78rem;
  padding: 0.3rem 1.5rem;
  border-radius: var(--radius-pill);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.showcase-image {
  display: block;
  width: 100%;
  height: auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.step-number {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.step h3 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.step p {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted-48);
  margin: 0;
}

.cta-tile .tile-inner {
  text-align: center;
}

.cta-tile .tile-title {
  color: var(--body-on-dark);
}

.cta-tile .tile-lead {
  color: var(--body-muted);
  margin-bottom: 2rem;
}

.btn-store-hero {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  padding: 0.9rem 2rem;
  font-size: 1.125rem;
  font-weight: 300;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px rgba(0, 102, 204, 0.25);
  transition: background-color 150ms ease, transform 420ms var(--liquid-ease),
    border-radius 420ms var(--liquid-ease);
}

.btn-store-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
  z-index: 1;
}

.btn-store-hero:active {
  transform: scale(0.93);
  border-radius: calc(var(--radius-pill) + 8px);
}

.btn-store-hero:hover {
  background: var(--primary-focus);
}

@media (max-width: 640px) {
  .global-nav-inner,
  .sub-nav-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .sub-nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  /* backdrop-filter blur on a sticky element can leave a smeared ghost of
     previous content on mobile Safari — drop to a solid background instead */
  .global-nav {
    background: var(--surface-black);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sub-nav {
    background: var(--canvas-parchment);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .page {
    padding-top: 2.5rem;
  }

  .page-header {
    margin-bottom: 2rem;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .status-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem;
  }

  .panel-row {
    flex-direction: column;
  }

  .panel-divider {
    width: auto;
    height: 1px;
  }

  .panel-block,
  .intro-panel {
    padding: 1.5rem;
  }

  /* four side-by-side fields (name/emoji/role/remove) don't fit a phone
     width — stack them instead of forcing the row (and the whole page) wide */
  .category-row {
    flex-direction: column;
    align-items: stretch;
  }

  .category-name-input,
  .category-emoji-select,
  .category-role-select,
  .category-number-input {
    flex: 1 1 auto;
    width: 100%;
  }

  .category-row .btn-row-action {
    align-self: flex-end;
  }

  .header-right {
    width: 100%;
  }

  .filter-input {
    width: 100%;
  }

  .tile-inner {
    padding: 3rem 1.25rem;
  }

  .hero-tile .tile-inner {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-lead {
    font-size: 1.1rem;
  }

  .tile-title {
    font-size: 1.7rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
