/* ═══════════════════════════════════════════════════════════════
   NetherStar CC — Design System
   Aesthetic: Dark OLED Luxury + Neo-Glass
   Base: 4px grid · OKLCH-leaning · system sans + mono
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette ── */
  --ns-bg:           #060810;
  --ns-bg-soft:       #0b0f1c;
  --ns-surface:       rgba(14, 18, 30, 0.82);
  --ns-surface-solid: #0f1322;
  --ns-surface-raised: rgba(20, 26, 44, 0.88);
  --ns-border:        rgba(255, 255, 255, 0.08);
  --ns-border-soft:   rgba(255, 255, 255, 0.05);
  --ns-border-strong: rgba(96, 165, 250, 0.35);

  --ns-text:      #edf0fa;
  --ns-text-dim:  #c8cddc;
  --ns-muted:     #8892ae;
  --ns-faint:     #586380;

  --ns-brand:     #60a5fa;
  --ns-brand-dim: #3b82f6;
  --ns-purple:    #8b5cf6;
  --ns-gold:      #c9a050;
  --ns-gold-dim:  #a68430;
  --ns-mint:      #34d399;
  --ns-amber:     #f59e0b;
  --ns-rose:      #fb7185;
  --ns-danger:    #ef4444;

  /* ── Typography ── */
  --font-sans:  "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
  --font-mono:  "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --text-xs:    0.71875rem;   /* 11.5px */
  --text-sm:    0.8125rem;    /* 13px   */
  --text-base:  0.9375rem;    /* 15px   */
  --text-lg:    1.125rem;     /* 18px   */
  --text-xl:    1.375rem;     /* 22px   */
  --text-2xl:   1.75rem;      /* 28px   */
  --text-3xl:   2.25rem;      /* 36px   */
  --leading-tight: 1.15;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  /* ── Spacing (4px base) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Radius ── */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 999px;

  /* ── Shadows ── */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md:   0 8px 30px rgba(0, 0, 0, 0.50);
  --shadow-lg:   0 18px 60px rgba(0, 0, 0, 0.55);
  --shadow-xl:   0 28px 90px rgba(0, 0, 0, 0.60);
  --shadow-glow: 0 0 40px rgba(96, 165, 250, 0.10);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.30), 0 8px 24px rgba(0,0,0,0.40);

  /* ── Transitions ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 350ms;
}

/* ═══════════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  min-height: 100vh;
  margin: 0; padding: 0;
  color: var(--ns-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background:
    radial-gradient(ellipse 80% 50% at 10% -15%, rgba(96, 165, 250, 0.18), transparent 38%),
    radial-gradient(ellipse 60% 50% at 85% 0%,  rgba(139, 92, 246, 0.14), transparent 34%),
    radial-gradient(ellipse 70% 60% at 70% 85%, rgba(52, 211, 153, 0.08), transparent 32%),
    linear-gradient(180deg, #060810 0%, #0a0e1a 45%, #060810 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.45), transparent 70%);
}

* { -webkit-tap-highlight-color: transparent; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ── Selection ── */
::selection { background: rgba(96, 165, 250, 0.25); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.ns-page {
  width: 100%; max-width: 1180px; margin: 0 auto; padding: var(--space-5);
}
@media (min-width: 768px) { .ns-page { padding: var(--space-8); } }

/* ── Glass panels ── */
.glass-panel {
  width: calc(100% - 32px) !important;
  max-width: 1080px !important;
  margin: var(--space-5) auto !important;
  padding: var(--space-5) !important;
  background:
    linear-gradient(180deg, rgba(20, 26, 44, 0.78), rgba(10, 14, 26, 0.88)) !important;
  border: 1px solid var(--ns-border) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  overflow: hidden;
  position: relative;
}
.glass-panel::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent);
  pointer-events: none;
  border-radius: inherit;
}

body.page-admin .glass-panel    { max-width: 1220px !important; }
body.page-calculator .glass-panel { max-width: 980px !important; }

@media (min-width: 768px) {
  .glass-panel {
    margin: var(--space-8) auto !important;
    padding: var(--space-8) !important;
  }
}

/* ── Cards & surfaces ── */
.ns-card, .stat-card, .section-card, .quick-card, .auth-card, .modal-dialog {
  background:
    linear-gradient(180deg, rgba(20, 26, 44, 0.72), rgba(12, 16, 28, 0.82)) !important;
  border: 1px solid var(--ns-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  transition: transform var(--duration-fast) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.ns-card:hover, .quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--ns-border-strong) !important;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* ── Hero (index) ── */
.ns-hero {
  position: relative; overflow: hidden;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(20, 28, 48, 0.70), rgba(10, 14, 28, 0.82)) !important;
  border: 1px solid var(--ns-border) !important;
  box-shadow: var(--shadow-lg);
}
.ns-hero::after {
  content: "";
  position: absolute; right: -80px; top: -100px;
  width: 340px; height: 340px; border-radius: 999px;
  background: radial-gradient(circle, rgba(96, 165, 250, .28), rgba(139,92,246,.12) 42%, transparent 70%);
  pointer-events: none;
}
.ns-hero > * { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════════
   TOP BAR — 统一导航
   ═══════════════════════════════════════════════════════════════ */

.ns-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: var(--space-5);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ns-border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.ns-topbar-left {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex-shrink: 0;
}

.ns-topbar-right {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; justify-content: flex-end;
}

.ns-topbar-sep {
  width: 1px; height: 22px;
  background: var(--ns-border);
  flex-shrink: 0;
}
@media (max-width: 640px) { .ns-topbar-sep { display: none; } }

/* ── Brand ── */
.ns-brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--ns-text); text-decoration: none;
  font-weight: 900; font-size: var(--text-base); letter-spacing: -0.02em;
}
.ns-brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 17px;
  background:
    radial-gradient(circle at 36% 30%, rgba(255,255,255,.40), transparent 18%),
    linear-gradient(135deg, var(--ns-brand), var(--ns-purple));
  box-shadow: 0 10px 24px rgba(96, 165, 250, 0.20);
  flex-shrink: 0;
}
.ns-brand-subtitle {
  display: block;
  color: var(--ns-faint);
  font-size: 10px; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase;
}

/* ── Nav links (pill buttons) ── */
.ns-nav-links {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.ns-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--ns-border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ns-text-dim);
  font-size: var(--text-xs); font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: all var(--duration-normal) var(--ease-out);
}
.ns-link:hover {
  transform: translateY(-1px);
  border-color: var(--ns-border-strong);
  color: var(--ns-text);
}
.ns-link.is-active,
.ns-link-primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  color: #fff !important;
  border-color: rgba(147, 197, 253, .40) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTON SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.ns-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ns-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ns-text);
  font-size: var(--text-sm); font-weight: 700;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}
.ns-btn:hover {
  transform: translateY(-1px);
  border-color: var(--ns-border-strong);
  box-shadow: var(--shadow-sm);
}

/* Primary — blue-purple gradient */
.ns-btn-primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  color: #fff !important;
  border-color: rgba(147, 197, 253, .40) !important;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.16);
}
.ns-btn-primary:hover { box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22); }

/* Success — emerald */
.ns-btn-success {
  background: linear-gradient(135deg, #059669, #14b8a6) !important;
  color: #fff !important;
  border-color: rgba(52, 211, 153, .34) !important;
}

/* Ghost — subtle outline */
.ns-btn-ghost {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--ns-muted) !important;
  border-color: var(--ns-border) !important;
}
.ns-btn-ghost:hover { color: var(--ns-text) !important; background: rgba(255,255,255,0.05) !important; }

/* Danger — red outline */
.ns-btn-danger {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
  color: #fecaca !important;
}
.ns-btn-danger:hover { background: rgba(239, 68, 68, 0.14) !important; }

/* Danger solid */
.ns-btn-danger-solid {
  background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
  color: #fff !important;
  border-color: rgba(248, 113, 113, .30) !important;
}

/* ── Small buttons (table actions, tags) ── */
.ns-btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ns-border);
  font-size: var(--text-xs); font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  color: var(--ns-muted);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.ns-btn-sm.ns-btn-primary  { padding: 4px 14px; }
.ns-btn-sm.ns-btn-success  { padding: 4px 14px; }
.ns-btn-sm.ns-btn-danger   { padding: 4px 12px; }
.ns-btn-sm:hover { border-color: var(--ns-border-strong); }

/* ── Extra-small (icon delete) ── */
.ns-btn-xs {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--ns-faint); font-size: 15px; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.ns-btn-xs:hover { background: rgba(239, 68, 68, 0.12); color: var(--ns-rose); }

/* ── Button groups ── */
.ns-btn-group {
  display: flex; align-items: center; gap: 6px;
}
.ns-btn-group + .ns-btn-group {
  padding-left: 10px;
  border-left: 1px solid var(--ns-border);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════ */

.ns-page-header {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-5);
}

.ns-page-header-left  { min-width: 0; flex: 1; }
.ns-page-header-right {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
}
.ns-page-title {
  font-size: var(--text-2xl); font-weight: 900;
  color: var(--ns-text);
  letter-spacing: -0.025em;
  margin: 0 0 2px;
}
.ns-page-subtitle {
  font-size: var(--text-xs); color: var(--ns-muted);
}

/* ═══════════════════════════════════════════════════════════════
   FORM CONTROLS
   ═══════════════════════════════════════════════════════════════ */

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid var(--ns-border) !important;
  color: var(--ns-text) !important;
  border-radius: var(--radius-md) !important;
  outline: none !important;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: 10px 14px;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(96, 165, 250, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.10) !important;
}

input::placeholder, textarea::placeholder {
  color: var(--ns-faint) !important; opacity: 1;
}
select option { background: #0f1322; color: #fff; }
textarea { resize: vertical; font-family: var(--font-mono); font-size: var(--text-xs); }

/* Range slider */
.custom-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.10) !important; outline: none;
}
.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ns-brand), var(--ns-purple));
  box-shadow: 0 0 0 5px rgba(96,165,250,.10), 0 0 20px rgba(96,165,250,.35);
  cursor: pointer; transition: box-shadow var(--duration-fast);
}
.custom-range::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 8px rgba(96,165,250,.14), 0 0 28px rgba(96,165,250,.45);
}

/* ═══════════════════════════════════════════════════════════════
   TABLE SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.excel-table {
  border-collapse: collapse; font-size: var(--text-xs);
  font-family: var(--font-mono);
}
.excel-table th {
  background: rgba(8, 10, 20, 0.96) !important;
  color: var(--ns-muted);
  font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
  text-align: center; padding: 10px 8px;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 2;
}
.excel-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--ns-text-dim);
}

/* Data row alternating */
.row-odd  { background: rgba(255,255,255,.015); }
.row-even { background: rgba(255,255,255,.030); }

/* Subtotals */
.row-subtotal {
  background: rgba(96, 165, 250, 0.04) !important;
  font-weight: 700; font-size: var(--text-xs);
}
.row-month-sub {
  background: rgba(139, 92, 246, 0.05) !important;
  font-weight: 700; font-size: var(--text-xs);
}
.row-grand {
  background: rgba(201, 160, 80, 0.06) !important;
  font-weight: 700; font-size: var(--text-sm);
  border-top: 2px solid rgba(201, 160, 80, 0.15);
}

/* Month header — strongest hierarchy */
.month-header { cursor: pointer; user-select: none; }
.month-header td {
  background: rgba(12, 12, 36, 0.94) !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.10);
}
.month-header:hover td { background: rgba(18, 18, 48, 0.94) !important; }

/* Date group — secondary */
.date-group-header { cursor: pointer; user-select: none; }
.date-group-header td {
  background: rgba(18, 18, 40, 0.82) !important;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.date-group-header:hover td { background: rgba(24, 24, 50, 0.82) !important; }

/* Clickable order row */
.order-clickable { cursor: pointer; }
.order-clickable:hover {
  background: rgba(96, 165, 250, 0.06) !important;
  outline: 1px solid rgba(96,165,250,0.15);
  outline-offset: -1px;
}

/* Collapse */
.collapse-icon {
  display: inline-block; transition: transform var(--duration-normal) var(--ease-out);
}
.collapsed .collapse-icon { transform: rotate(-90deg); }
.hidden-rows { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   AUTH GATE & MODAL
   ═══════════════════════════════════════════════════════════════ */

.admin-locked .glass-panel { display: none; }

.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background:
    radial-gradient(circle at 30% 12%, rgba(96,165,250,.20), transparent 32%),
    radial-gradient(circle at 86% 0%, rgba(139,92,246,.16), transparent 28%),
    var(--ns-bg);
}

.auth-card {
  border-radius: var(--radius-xl) !important;
  max-width: 440px !important;
}

.modal-overlay {
  backdrop-filter: blur(12px);
  background: rgba(0,0,0,0.65) !important;
}
.modal-dialog {
  border-radius: var(--radius-lg) !important;
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  padding: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════════
   AUTH NAV
   ═══════════════════════════════════════════════════════════════ */

.ns-nav-auth {
  display: flex; align-items: center; gap: var(--space-2);
  flex-shrink: 0;
}

.ns-auth-user {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--ns-text); white-space: nowrap;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}

.ns-auth-role {
  font-size: 10px; padding: 2px 7px; border-radius: var(--radius-full);
  font-weight: 800; white-space: nowrap; line-height: 1.6;
}

.ns-auth-role.admin {
  background: rgba(96,165,250,.12);
  color: #93c5fd;
  border: 1px solid rgba(96,165,250,.22);
}

.ns-auth-role.player {
  background: rgba(52,211,153,.10);
  color: #6ee7b7;
  border: 1px solid rgba(52,211,153,.20);
}

.ns-auth-role.boss {
  background: rgba(245,158,11,.10);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.20);
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* Chip / badge */
.ns-chip {
  display: inline-flex; align-items: center; gap: 5px;
  width: fit-content;
  padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid rgba(96,165,250,.22);
  background: rgba(96,165,250,.08);
  color: #bfdbfe;
  font-size: 11px; font-weight: 800;
}

/* Eyebrow label */
.ns-eyebrow {
  color: var(--ns-brand);
  font-size: 11px; font-weight: 900;
  letter-spacing: .14em; text-transform: uppercase;
}

/* Title display */
.ns-title {
  color: var(--ns-text); font-weight: 950;
  letter-spacing: -0.04em; line-height: var(--leading-tight);
}

/* Gradient text */
.ns-gradient-text {
  background: linear-gradient(135deg, #fff 0%, #bfdbfe 40%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Muted/faint text */
.ns-muted { color: var(--ns-muted); }
.ns-faint { color: var(--ns-faint); }

/* Stat card */
.stat-card, .section-card {
  background:
    linear-gradient(180deg, rgba(20, 26, 44, 0.65), rgba(12, 16, 28, 0.78)) !important;
  border: 1px solid var(--ns-border) !important;
  border-radius: var(--radius-lg) !important;
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
}

/* Player stat highlight */
.player-stat {
  background:
    linear-gradient(180deg, rgba(20, 26, 44, 0.60), rgba(12, 16, 28, 0.74)) !important;
  border: 1px solid var(--ns-border) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-4);
}

/* Glow */
.glow-bg {
  background: radial-gradient(circle, rgba(96,165,250,0.18), rgba(139,92,246,.08) 44%, rgba(0,0,0,0) 72%) !important;
}

/* Price table */
.ns-price-card table { width: 100%; border-collapse: collapse; }
.ns-price-card th {
  color: var(--ns-faint); font-size: var(--text-xs); font-weight: 800;
  padding: 12px 0;
  border-bottom: 1px solid var(--ns-border);
}
.ns-price-card td {
  padding: 12px 0; font-size: var(--text-sm);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ns-price-card tr:last-child td { border-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════
   NUMBER DISPLAY
   ═══════════════════════════════════════════════════════════════ */

.ns-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.ns-number-red  { color: var(--ns-rose); }
.ns-number-green { color: var(--ns-mint); }
.ns-number-gold { color: var(--ns-gold); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  :root {
    --text-2xl: 1.5rem;
    --text-xl: 1.25rem;
  }

  .ns-topbar {
    flex-direction: column; align-items: stretch;
  }
  .ns-topbar-right {
    justify-content: flex-start; width: 100%;
  }
  .ns-nav-links {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    width: 100%;
  }
  .ns-link { width: 100%; padding: 6px 10px; font-size: 11px; }
  .ns-nav-auth {
    width: 100%; justify-content: flex-end;
    padding-top: var(--space-2);
    border-top: 1px solid var(--ns-border);
    margin-top: 2px;
  }
  .glass-panel {
    width: calc(100% - 18px) !important;
    margin: 10px auto !important; padding: 14px !important;
    border-radius: 22px !important;
  }
  .ns-hero { padding: 22px; }
  .ns-page-header { flex-direction: column; align-items: flex-start; }
  .ns-page-header-right { width: 100%; }
  .ns-page-header-right .ns-btn-group + .ns-btn-group {
    border-left: none; padding-left: 0; margin-top: 4px;
  }
  .ns-topbar-sep { display: none; }
  .ns-btn { min-height: 36px; padding: 6px 14px; font-size: var(--text-xs); }
}
