/* ====================================================================
   File: themes/default/assets/theme.css
   Purpose: Default theme for HoneyGate v2 admin + super-admin surfaces.

   Layers (top to bottom):
     1. Design tokens (colours, radii, spacing, fonts)
     2. Global shell (sidebar + topbar + main)
     3. Components (cards, buttons, inputs, tables, badges, alerts)
     4. Dashboard pieces (hero, bento, activity feed, quick actions,
        health, up-next)
     5. Responsive rules
     6. Utilities + scrollbar

   Design system delivered via Claude Design 2026-04-18. Token names
   match docs/THEME-TOKENS.md so module authors keep their contract.

   Last edited: 2026-04-18
   ==================================================================== */

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

:root {
  /* ——— Surface (deep warm near-black) ——— */
  --base:   oklch(14% 0.006 70);      /* deepest bg, alias --base-0 */
  --base-0: oklch(14% 0.006 70);
  --surf1:  oklch(17% 0.008 72);      /* card bg, alias --base-1 */
  --base-1: oklch(17% 0.008 72);
  --surf2:  oklch(20% 0.010 74);      /* elevated / input bg, alias --base-2 */
  --base-2: oklch(20% 0.010 74);
  --base-3: oklch(24% 0.012 74);      /* hover / dense input */
  --line:   oklch(28% 0.014 75);      /* dividers */
  --line-strong: oklch(34% 0.018 76);

  /* ——— Text ——— */
  --txt:     oklch(95% 0.008 80);
  --txt-2:   oklch(78% 0.012 80);
  --txt-dim: oklch(62% 0.012 80);
  --txt-mute:oklch(46% 0.010 78);

  /* ——— Accent / brand ——— */
  --gold:      oklch(78% 0.12 80);
  --gold-rich: oklch(74% 0.13 78);
  --gold-deep: oklch(58% 0.10 75);
  --gold-hi:   oklch(88% 0.14 85);
  --gold-glow: oklch(88% 0.14 85);    /* legacy name — same as --gold-hi */
  --gold-lo:   oklch(58% 0.10 75);
  --honey:     oklch(72% 0.16 65);
  --amber:     oklch(82% 0.14 72);

  /* ——— Status ——— */
  --ok:   oklch(75% 0.16 150);
  --warn: oklch(80% 0.14 82);
  --err:  oklch(68% 0.18 25);
  --info: oklch(70% 0.14 255);

  /* ——— Long-form aliases — modules reference these with hex fallbacks —
     keeping the aliases alive means theme swaps actually propagate. —— */
  --color-success: var(--ok);
  --color-warning: var(--warn);
  --color-error:   var(--err);
  --color-info:    var(--info);
  --color-gold:    var(--gold);
  --color-border:  var(--line);

  /* ——— Geometry ——— */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* ——— Spacing scale (kept for back-compat with existing docs) ——— */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;

  --pad: 24px;

  /* ——— Typography ——— */
  --f-ui:      'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --f-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Legacy aliases for --font-body / --font-display / --font-mono */
  --font-body:    var(--f-ui);
  --font-display: var(--f-display);
  --font-mono:    var(--f-mono);

  color-scheme: dark;
}

/* ==================== Base ==================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-ui);
  font-feature-settings: "ss01", "cv11";
  background: var(--base);
  color: var(--txt);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Film grain — subtle texture overlay. Turn on via body[data-grain="on"]. */
body[data-grain="on"]::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
  z-index: 999;
}

/* Pointer spotlight — optional decorative cursor glow. */
.spotlight {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    420px 420px at var(--mx, 50%) var(--my, 30%),
    color-mix(in oklch, var(--gold) 8%, transparent),
    transparent 70%
  );
  transition: opacity .3s;
}

/* ==================== Shell ==================== */
.shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.shell-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Legacy layout wrapper still used by some pages */
.app-layout { display: flex; min-height: calc(100vh - 60px); }

/* ==================== Sidebar ==================== */
.side, .sidebar {
  flex: 0 0 260px;
  background: linear-gradient(180deg, var(--base-1), var(--base-0) 70%);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 22px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-word {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--gold-hi);
  font-style: italic;
}
.brand-word em {
  font-style: normal;
  color: var(--txt);
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-group-label, .sidebar-group-label {
  padding: 14px 22px 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-mute);
}
.sidebar-group-label:first-child { padding-top: 6px; }

.nav-item, .sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 22px;
  color: var(--txt-2);
  font-size: 13.5px;
  font-weight: 450;
  text-decoration: none;
  position: relative;
  transition: color .15s, background .15s;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-item:hover, .sidebar a:hover {
  color: var(--txt);
  background: color-mix(in oklch, var(--gold) 4%, transparent);
}
.nav-item .ico, .sidebar a svg {
  width: 16px; height: 16px; flex: 0 0 16px;
  color: var(--txt-dim);
}
.nav-item:hover .ico, .sidebar a:hover svg { color: var(--gold); }
.nav-item.active, .sidebar a.active {
  color: var(--txt);
  background: linear-gradient(90deg, color-mix(in oklch, var(--gold) 12%, transparent), transparent);
}
.nav-item.active::before, .sidebar a.active::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px var(--gold);
}
.nav-item.active .ico, .sidebar a.active svg { color: var(--gold); }

.nav-item .badge, .sidebar .nav-badge {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--gold) 18%, var(--base-2));
  color: var(--gold-hi);
  border: 1px solid color-mix(in oklch, var(--gold) 30%, transparent);
}
.nav-item .dot {
  margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--err);
  box-shadow: 0 0 6px var(--err);
}

.sidebar-superadmin-link {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sidebar-superadmin-link a { color: var(--gold); }
.sidebar-superadmin-link a:hover { color: var(--gold-hi); background: color-mix(in oklch, var(--gold) 8%, transparent); }

/* ==================== Top bar ==================== */
.topbar, .top-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--base-0) 92%, transparent);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.top-bar h1 { font: 800 20px/1 var(--f-display); margin: 0; }
.top-bar .user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.top-bar .user img { width: 32px; height: 32px; border-radius: 50%; }

.top-bar-superadmin { border-bottom-color: color-mix(in oklch, var(--gold) 30%, var(--line)); }

/* Portal / Admin / Super Admin switcher — sits in the top bar so the
   admin always knows which surface they're on + can jump between the
   ones they have access to. Hidden entirely when the user only has
   one destination (see render_portal_switcher in core/theme.php). */
.portal-switcher {
  display: inline-flex;
  padding: 3px;
  background: var(--base-0);
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 2px;
}
.portal-switch-item {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--txt-dim);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.portal-switch-item:hover { color: var(--txt); }
.portal-switch-item.active {
  background: var(--base-3);
  color: var(--gold-hi);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--gold) 30%, transparent);
}

.guild-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--base-1);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-decoration: none;
  color: inherit;
}
.guild-pill:hover { border-color: var(--line-strong); background: var(--base-2); }
.guild-pill select {
  appearance: none;
  background: transparent;
  color: inherit;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding-right: 16px;
}
.guild-ava {
  width: 26px; height: 26px; border-radius: 50%;
  background: conic-gradient(from 45deg, var(--gold), var(--honey), var(--gold-hi), var(--gold));
  display: grid; place-items: center;
  font-family: var(--f-display);
  color: var(--base-0);
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 26px;
}
.guild-name { font-weight: 500; font-size: 13.5px; }
.guild-chev { color: var(--txt-dim); font-size: 12px; }

.topbar .spacer, .top-bar .spacer { flex: 1; }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--base-1);
  min-width: 280px;
  color: var(--txt-dim);
  font-size: 13px;
  cursor: text;
  transition: border-color .15s;
}
.searchbar:hover { border-color: var(--line-strong); }
.searchbar kbd {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--base-2);
  border: 1px solid var(--line);
  color: var(--txt-mute);
}

.iconbtn {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--base-1);
  color: var(--txt-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.iconbtn:hover { border-color: var(--line-strong); color: var(--txt); background: var(--base-2); }
.iconbtn .pip {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.me-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--base-1);
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.me-pill:hover { border-color: var(--line-strong); background: var(--base-2); }
.me-pill img { width: 26px; height: 26px; border-radius: 50%; }
.me-ava {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #ec4899 60%, #f97316);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 12px;
  font-family: var(--f-ui);
}
.me-name { font-size: 13.5px; font-weight: 500; }
.me-status { font-family: var(--f-mono); font-size: 10px; color: var(--ok); letter-spacing: 0.05em; }

/* ==================== Main ==================== */
.main {
  padding: 32px 32px 64px;
  max-width: 1500px;
  width: 100%;
  flex: 1;
  overflow-x: auto;
}
body[data-density="dense"] .main { padding: 20px 24px 40px; }

/* ==================== Cards ==================== */
.card {
  position: relative;
  background: var(--base-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad);
  margin-bottom: var(--sp-md);
  overflow: hidden;
}
.card.elev { background: linear-gradient(180deg, var(--base-2), var(--base-1)); }
.card h2 { margin: 0 0 12px; font: 600 18px/1.3 var(--f-ui); letter-spacing: -0.005em; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.card .h-row { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.card .h-row h3, .card .h-row h2 { margin: 0; }
.card .h-row .sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--txt-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.card .h-row .spacer { flex: 1; }

/* Page-header (legacy pattern used by a few older pages) */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-header h1 { font: 400 28px/1.2 var(--f-display); letter-spacing: -0.01em; }
.page-header .subtitle { color: var(--txt-dim); margin-top: 4px; }

.gold-text {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--base-2);
  color: var(--txt);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:hover { background: var(--base-3); border-color: var(--line-strong); }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #2a1f06;
  border-color: color-mix(in oklch, var(--gold) 50%, white 10%);
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 color-mix(in oklch, white 30%, transparent),
    0 1px 2px rgba(0,0,0,.3),
    0 0 0 0 var(--gold);
  transition: box-shadow .25s, transform .1s;
}
.btn-primary:hover {
  /* Base .btn:hover flips background to dark; keep the primary button
     gold on hover too (matches the design brief) so the dark text
     stays readable. Without re-asserting background here, .btn:hover
     wins and we end up with dark-on-dark. */
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: color-mix(in oklch, var(--gold) 60%, white 20%);
  color: #2a1f06;
  box-shadow:
    inset 0 1px 0 color-mix(in oklch, white 40%, transparent),
    0 2px 4px rgba(0,0,0,.3),
    0 0 24px color-mix(in oklch, var(--gold) 45%, transparent);
  transform: translateY(-1px);
}
.btn-ghost { background: transparent; }
.btn-success { background: var(--ok); color: #0d1a12; border-color: color-mix(in oklch, var(--ok) 50%, transparent); }
.btn-danger { background: var(--err); color: white; border-color: color-mix(in oklch, var(--err) 50%, transparent); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn .sh { font-family: var(--f-mono); font-size: 10px; color: var(--txt-mute); margin-left: 4px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; }

/* ==================== Grid ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ==================== Hero (dashboard only) ==================== */
.hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 40px 44px;
  background:
    radial-gradient(800px 300px at 90% -10%, color-mix(in oklch, var(--gold) 18%, transparent), transparent 60%),
    radial-gradient(600px 240px at 10% 120%, color-mix(in oklch, var(--honey) 14%, transparent), transparent 60%),
    linear-gradient(180deg, var(--base-2), var(--base-1));
  overflow: hidden;
  margin-bottom: 24px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    color-mix(in oklch, var(--gold) 60%, transparent) 40deg,
    transparent 80deg,
    transparent 200deg,
    color-mix(in oklch, var(--honey) 40%, transparent) 240deg,
    transparent 280deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: rot 8s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes rot { to { --angle: 360deg; } }

.hero-honeycomb {
  position: absolute; inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><g fill='none' stroke='%23CBA44D' stroke-width='1'><polygon points='28,2 54,16 54,48 28,62 2,48 2,16'/><polygon points='28,10 46,20 46,44 28,54 10,44 10,20'/></g></svg>");
  mask-image: radial-gradient(ellipse at 85% 20%, black 0%, transparent 60%);
}

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.hero-eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--ok) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 400;
  color: var(--txt);
  max-width: 780px;
}
.hero-title .accent {
  font-style: italic;
  color: var(--gold-hi);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--txt-dim);
  font-size: 15px;
  max-width: 640px;
  margin: 0 0 28px;
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: color-mix(in oklch, var(--base-0) 60%, transparent);
  backdrop-filter: blur(6px);
  overflow: hidden;
  max-width: 900px;
}
.hero-stat {
  flex: 1;
  padding: 16px 22px;
  border-right: 1px solid var(--line);
  position: relative;
}
.hero-stat:last-child { border-right: none; }
.hero-stat .k {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-mute);
  margin-bottom: 6px;
}
.hero-stat .v {
  font-family: var(--f-display);
  font-size: 30px;
  line-height: 1;
  color: var(--txt);
  letter-spacing: -0.01em;
}
.hero-stat .v .small { font-size: 18px; color: var(--txt-dim); }
.hero-stat .d {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--txt-dim);
  margin-top: 6px;
}
.hero-stat .d.up { color: var(--ok); }
.hero-stat .d.warn { color: var(--warn); }

.hero-actions {
  position: absolute;
  top: 32px;
  right: 36px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

/* ==================== Module bento ==================== */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
body[data-density="dense"] .bento { gap: 10px; }
.bento-item {
  background: var(--base-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .15s, background .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.bento-item:hover {
  border-color: color-mix(in oklch, var(--gold) 40%, var(--line));
  background: var(--base-2);
  transform: translateY(-1px);
}
.bento-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(200px 80px at var(--bmx, 50%) 0%, color-mix(in oklch, var(--gold) 22%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.bento-item:hover::after { opacity: 1; }
.bento-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bento-ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--base-3);
  display: grid; place-items: center;
  color: var(--gold);
}
.bento-ico svg { width: 15px; height: 15px; }
.bento-name { font-size: 13px; font-weight: 550; }
.bento-cat {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--txt-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bento-spark { height: 28px; width: 100%; margin-top: 4px; display: block; }
.bento-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bento-val {
  font-family: var(--f-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.bento-unit { color: var(--txt-dim); font-size: 12px; font-family: var(--f-mono); }
.bento-delta {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--ok) 18%, transparent);
  color: var(--ok);
  border: 1px solid color-mix(in oklch, var(--ok) 30%, transparent);
}
.bento-delta.warn { background: color-mix(in oklch, var(--warn) 18%, transparent); color: var(--warn); border-color: color-mix(in oklch, var(--warn) 30%, transparent); }
.bento-delta.dim  { background: var(--base-2); color: var(--txt-dim); border-color: var(--line); }
.bento-status {
  position: absolute; top: 14px; right: 14px;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--txt-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bento-status .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}
.bento-status .d.warn { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.bento-status .d.off  { background: var(--txt-mute); box-shadow: none; }

/* ==================== Activity feed ==================== */
.feed { position: relative; }
.feed-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  position: relative;
  align-items: start;
}
.feed-item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: -12px;
  width: 1px;
  background: var(--line);
}
.feed-item:last-child::before { display: none; }
.feed-ico {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--base-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--txt-dim);
  z-index: 1;
  flex: 0 0 32px;
}
.feed-ico.install   { color: var(--gold); border-color: color-mix(in oklch, var(--gold) 40%, var(--line)); background: color-mix(in oklch, var(--gold) 6%, var(--base-2)); }
.feed-ico.uninstall { color: var(--err);  border-color: color-mix(in oklch, var(--err)  35%, var(--line)); background: color-mix(in oklch, var(--err)  6%, var(--base-2)); }
.feed-ico.config    { color: var(--info); }
.feed-ico.alert     { color: var(--warn); }

.feed-body { min-width: 0; }
.feed-text { font-size: 13.5px; line-height: 1.5; }
.feed-text .name { font-weight: 550; }
.feed-text .tag {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--base-3);
  color: var(--txt-2);
  border: 1px solid var(--line);
  margin: 0 2px;
}
.feed-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--txt-mute);
  margin-top: 3px;
  display: flex; gap: 10px; align-items: center;
}
.feed-meta .sep { color: var(--txt-mute); }
.feed-time {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--txt-mute);
  white-space: nowrap;
  text-align: right;
}

/* ==================== Quick actions ==================== */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--base-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
}
.qa:hover {
  background: var(--base-3);
  border-color: color-mix(in oklch, var(--gold) 40%, var(--line));
  transform: translateY(-1px);
}
.qa-ico {
  width: 30px; height: 30px; border-radius: 8px;
  background: color-mix(in oklch, var(--gold) 10%, var(--base-1));
  color: var(--gold);
  display: grid; place-items: center;
  flex: 0 0 30px;
}
.qa-ico svg { width: 14px; height: 14px; }
.qa-label { font-weight: 550; font-size: 13px; }
.qa-hint  { font-size: 11px; color: var(--txt-dim); margin-top: 1px; font-family: var(--f-mono); }

/* ==================== Health + Up next ==================== */
.health-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.health-row:last-child { border-bottom: none; }
.health-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: 0 0 8px; }
.health-row .dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.health-row .dot.err  { background: var(--err);  box-shadow: 0 0 8px var(--err); }
.health-row .label { font-size: 13px; flex: 1; }
.health-row .meta  { font-family: var(--f-mono); font-size: 11px; color: var(--txt-dim); }

.upnext-item {
  display: flex; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.upnext-item:last-child { border-bottom: none; padding-bottom: 0; }
.upnext-when {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--gold-hi);
  line-height: 1;
  letter-spacing: -0.01em;
  width: 58px;
  flex: 0 0 58px;
}
.upnext-when .u { font-family: var(--f-mono); font-size: 10px; color: var(--txt-dim); display: block; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px; }
.upnext-body .t { font-size: 13.5px; font-weight: 500; }
.upnext-body .s { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }

/* ==================== Forms (preserved for module admin pages) ==================== */
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--txt-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-field .required { color: var(--err); }
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=url],
.form-field input[type=number],
.form-field input[type=password],
.form-field input[type=datetime-local],
.form-field select,
.form-field textarea,
.form-input,
input.form-input, select.form-input, textarea.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--base-2);
  color: var(--txt);
  font: inherit;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.form-input:focus, input.form-input:focus, select.form-input:focus, textarea.form-input:focus {
  outline: none;
  border-color: color-mix(in oklch, var(--gold) 60%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold) 14%, transparent);
}
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: var(--err); }
.form-help  { display: block; color: var(--txt-dim); font-size: 12px; margin-top: 4px; }
.form-error { display: block; color: var(--err);     font-size: 12px; margin-top: 4px; }
.form-checkbox label { text-transform: none; font-size: 14px; color: var(--txt); display: flex; align-items: center; gap: 8px; }
.form-checkbox input { width: 18px; height: 18px; accent-color: var(--gold); }

input[type="color"] { width: 44px; height: 30px; padding: 2px; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--base-2); }

/* ==================== Tables ==================== */
.table-wrap, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 600px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--txt-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid color-mix(in oklch, var(--line) 50%, transparent); }
tbody tr:hover { background: color-mix(in oklch, var(--gold) 4%, transparent); }

/* ==================== Alerts (flash + inline) ==================== */
.alert { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; border: 1px solid; }
.alert-success { background: color-mix(in oklch, var(--ok)   10%, transparent); border-color: var(--ok);   color: var(--ok); }
.alert-error   { background: color-mix(in oklch, var(--err)  10%, transparent); border-color: var(--err);  color: var(--err); }
.alert-warning { background: color-mix(in oklch, var(--warn) 10%, transparent); border-color: var(--warn); color: var(--warn); }
.alert-info    { background: color-mix(in oklch, var(--info) 10%, transparent); border-color: var(--info); color: var(--info); }

/* ==================== Badges ==================== */
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: var(--r-xs); text-transform: uppercase; letter-spacing: .5px; }
.badge-success { background: color-mix(in oklch, var(--ok)   15%, transparent); color: var(--ok); }
.badge-warning { background: color-mix(in oklch, var(--warn) 15%, transparent); color: var(--warn); }
.badge-error   { background: color-mix(in oklch, var(--err)  15%, transparent); color: var(--err); }
.badge-info    { background: color-mix(in oklch, var(--info) 15%, transparent); color: var(--info); }
.badge-default { background: color-mix(in oklch, var(--txt)  6%,  transparent); color: var(--txt-dim); }

/* ==================== Utilities ==================== */
.text-dim  { color: var(--txt-dim); }
.text-mute { color: var(--txt-mute); }
.text-sm   { font-size: 13px; }
.text-center { text-align: center; }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.hidden { display: none; }
.mono   { font-family: var(--f-mono); }
.serif  { font-family: var(--f-display); }

/* ==================== Density variants ==================== */
body[data-density="dense"] { font-size: 13px; }
body[data-density="dense"] .card { padding: 18px; }
body[data-density="dense"] .bento-item { padding: 13px; }
body[data-density="dense"] .hero { padding: 28px 32px; }
body[data-density="dense"] .hero-title { font-size: clamp(30px, 3.6vw, 44px); }
body[data-density="dense"] .grid-2 { gap: 14px; margin-bottom: 16px; }

/* Gold intensity knob */
body[data-gold="subtle"]    { --gold: oklch(72% 0.08 80); --gold-hi: oklch(82% 0.10 85); --honey: oklch(68% 0.10 65); }
body[data-gold="prominent"] { --gold: oklch(82% 0.16 80); --gold-hi: oklch(92% 0.17 85); --honey: oklch(76% 0.20 65); }

/* ==================== Mobile ==================== */
.menu-btn {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--base-1);
  color: var(--txt);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex: 0 0 38px;
}
.menu-btn svg { width: 18px; height: 18px; }

.scrim {
  display: none;
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--base-0) 70%, transparent);
  backdrop-filter: blur(3px);
  z-index: 30;
  animation: fade-in .2s ease;
}
.scrim.open { display: block; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 24px; }
  .hero { padding: 32px 32px; }
  .hero-actions { position: static; margin-bottom: 20px; justify-content: flex-end; display: flex; }
}

@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }

  .side, .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 24px rgba(0,0,0,.4);
  }
  .side.open, .sidebar.open { transform: translateX(0); }

  .shell-main, .app-layout { width: 100%; }

  .topbar, .top-bar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .searchbar { order: 10; flex-basis: 100%; min-width: 0; padding: 8px 12px; }
  .searchbar kbd { display: none; }
  .me-pill .me-name, .me-pill .me-status { display: none; }
  .me-pill { padding: 4px; }
  .guild-name { font-size: 12.5px; }

  .main { padding: 16px; }

  .hero { padding: 24px 20px; border-radius: 20px; }
  .hero-actions { position: static; display: flex; justify-content: flex-end; margin-bottom: 16px; gap: 6px; }
  .hero-actions .btn { padding: 6px 10px; font-size: 12px; }
  .hero-title { font-size: clamp(28px, 7vw, 38px); }
  .hero-sub { font-size: 14px; }
  .hero-stats { flex-direction: column; }
  .hero-stat { border-right: none; border-bottom: 1px solid var(--line); padding: 14px 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .hero-stat:last-child { border-bottom: none; }
  .hero-stat .k { margin: 0; flex: 1; }
  .hero-stat .v { font-size: 22px; }
  .hero-stat .d { margin: 0; }

  .bento { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bento-item { padding: 14px; }
  .bento-val { font-size: 22px; }

  .card { padding: 18px; border-radius: 16px; }
  .card .h-row { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .card .h-row .sub { order: 3; }

  .qa-grid { grid-template-columns: 1fr; }

  .feed-item { grid-template-columns: 28px 1fr; row-gap: 6px; gap: 10px; }
  .feed-ico { width: 28px; height: 28px; flex: 0 0 28px; }
  .feed-time { grid-column: 2; font-size: 10px; text-align: left; }
  .feed-text { font-size: 13px; }
}

@media (max-width: 400px) {
  .bento { grid-template-columns: 1fr; }
  .guild-name { display: none; }
  .iconbtn { width: 32px; height: 32px; }
}

/* ==================== Reveal on load ==================== */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise    { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.rise.d1 { animation-delay: .05s; }
.rise.d2 { animation-delay: .10s; }
.rise.d3 { animation-delay: .15s; }
.rise.d4 { animation-delay: .20s; }
.rise.d5 { animation-delay: .25s; }

/* ==================== Help tooltip ==================== */
/* Small '?' icon rendered next to admin-form labels. Hover or keyboard
   focus reveals the explanation in a popover below. Replaces the old
   inline "<div>help text</div>" that lived under every input. See
   help_tooltip() in core/theme.php + docs/ADMIN-UI-STANDARDS.md. */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--base-2);
  color: var(--txt-dim);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 6px;
  cursor: help;
  position: relative;
  vertical-align: middle;
  outline: none;
  transition: color .12s, border-color .12s, background .12s;
  text-transform: none;
  letter-spacing: 0;
}
.help-tip:hover,
.help-tip:focus,
.help-tip.open {
  color: var(--gold);
  border-color: color-mix(in oklch, var(--gold) 55%, var(--line));
  background: color-mix(in oklch, var(--gold) 10%, var(--base-2));
}
.help-tip-mark {
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 700;
}

.help-tip-content {
  /* position: fixed so the tooltip escapes every parent's overflow clip
     (cards have overflow: hidden, .main has overflow-x: auto). Exact
     left/top are set by JS from the mark's viewport rect — see the
     positionHelpTip() helper in the admin/super-admin/portal layouts. */
  position: fixed;
  left: 0; top: 0;  /* placeholder; JS overwrites */
  width: max-content;
  max-width: 300px;
  min-width: 180px;
  padding: 10px 12px;
  background: var(--base-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--txt-2);
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  letter-spacing: 0;
  white-space: normal;
  word-wrap: break-word;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s, visibility .12s;
  z-index: 1000;
  box-shadow:
    0 10px 28px rgba(0,0,0,.45),
    0 0 0 1px color-mix(in oklch, var(--gold) 12%, transparent);
}
.help-tip-content::before {
  /* Arrow pointing up at the mark. JS sets --arrow-x to the mark's
     horizontal center within the tooltip so the arrow tracks the icon
     even when the tooltip shifts sideways to avoid the viewport edge. */
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  top: -5px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px;
  background: var(--base-1);
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}
/* When there's no room below, JS adds .flip-up and the arrow moves to
   the bottom of the tooltip pointing down. */
.help-tip-content.flip-up::before {
  top: auto;
  bottom: -5px;
  border-top: none;
  border-left: none;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
}
.help-tip-content strong { color: var(--gold-hi); font-weight: 600; }
.help-tip-content code {
  font-family: var(--f-mono);
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--base-3);
  color: var(--txt);
}
.help-tip-content a { color: var(--gold); }
.help-tip-content a:hover { color: var(--gold-hi); }

.help-tip:hover .help-tip-content,
.help-tip:focus .help-tip-content,
.help-tip:focus-within .help-tip-content,
.help-tip.open .help-tip-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar        { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb  { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--base-0); }
::-webkit-scrollbar-track  { background: transparent; }

/* ════════════════════════════════════════════════════════════════════
   LANDING PAGE — delivered via Claude Design 2026-04-18 handoff.
   All classes are .lp-* scoped so they don't touch admin/portal pages.
   See data/claude-design-bundle-landing/honeygate/ for source.
   ════════════════════════════════════════════════════════════════════ */
.lp { min-height: 100vh; position: relative; }
.lp-wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* Nav */
.lp-nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--base-0) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent);
}
.lp-nav-inner { display: flex; align-items: center; gap: 24px; padding: 16px 0; }
a.lp-brand, .lp-foot-col a.lp-brand {
  display: inline-flex !important; align-items: center; gap: 10px;
  text-decoration: none !important;
  padding: 0; border: none; margin: 0;
}
.lp-foot-col a.lp-brand { margin-bottom: 14px; }
.lp-brand .brand-mark { flex: 0 0 28px; display: grid; place-items: center; }
.lp-brand .brand-mark svg { width: 28px; height: 28px; }
.lp-brand .brand-word { text-decoration: none; }
.lp-nav-links { display: flex; gap: 28px; margin-left: 32px; }
.lp-nav-links a {
  color: var(--txt-2); text-decoration: none;
  font-size: 13.5px; font-weight: 450; transition: color .15s;
}
.lp-nav-links a:hover { color: var(--gold-hi); }
.lp-nav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lp-menu-btn {
  display: none; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--base-1); color: var(--txt); cursor: pointer;
  align-items: center; justify-content: center; padding: 0;
}
.lp-menu-btn svg { width: 20px; height: 20px; }

/* Hero */
.lp-hero { position: relative; padding: 100px 0 80px; text-align: center; overflow: hidden; }
.lp-hero-honeycomb {
  position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><g fill='none' stroke='%23CBA44D' stroke-width='1'><polygon points='28,2 54,16 54,48 28,62 2,48 2,16'/><polygon points='28,10 46,20 46,44 28,54 10,44 10,20'/></g></svg>");
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
}
.lp-hero-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, color-mix(in oklch, var(--gold) 16%, transparent), transparent 60%);
  pointer-events: none; filter: blur(30px);
}
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border: 1px solid color-mix(in oklch, var(--gold) 30%, var(--line));
  border-radius: 999px;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); background: color-mix(in oklch, var(--gold) 5%, var(--base-1));
  position: relative; z-index: 1;
}
.lp-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
  animation: pulse 2s infinite;
}
.lp-hero h1 {
  position: relative; z-index: 1;
  font-family: var(--f-display);
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1.0; letter-spacing: -0.025em;
  margin: 28px auto 24px; font-weight: 400;
  max-width: 1000px; color: var(--txt);
}
.lp-hero h1 .accent {
  font-style: italic;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-hero .lp-sub {
  position: relative; z-index: 1;
  color: var(--txt-dim); font-size: 18px;
  max-width: 640px; margin: 0 auto 36px; line-height: 1.5;
}
.lp-hero-cta { position: relative; z-index: 1; display: inline-flex; gap: 10px; margin-bottom: 56px; }
.btn-lg { padding: 12px 22px; font-size: 14px; border-radius: 12px; }
.btn-ghost-lg { padding: 12px 22px; font-size: 14px; border-radius: 12px; background: transparent; border: 1px solid var(--line); color: var(--txt); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost-lg:hover { background: var(--base-2); border-color: var(--line-strong); color: var(--txt); }

.lp-hero-frame {
  position: relative; z-index: 1;
  margin: 0 auto; max-width: 1100px;
  border: 1px solid var(--line-strong);
  border-radius: 24px; padding: 12px;
  background: linear-gradient(180deg, var(--base-2), var(--base-1));
  box-shadow:
    0 24px 80px rgba(0,0,0,.5),
    0 0 0 1px color-mix(in oklch, var(--gold) 15%, transparent),
    0 0 120px color-mix(in oklch, var(--gold) 10%, transparent);
  overflow: hidden;
}
.lp-hero-frame::before {
  content: ""; position: absolute; inset: -1px;
  border-radius: inherit; padding: 1px;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    color-mix(in oklch, var(--gold) 70%, transparent) 40deg,
    transparent 80deg, transparent 200deg,
    color-mix(in oklch, var(--honey) 50%, transparent) 240deg,
    transparent 280deg, transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rot 10s linear infinite; pointer-events: none; opacity: 0.8;
}
.lp-hero-frame-inner {
  border-radius: 14px; overflow: hidden;
  background: var(--base-0); border: 1px solid var(--line);
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  position: relative; color: var(--txt-mute);
}
.lp-hero-frame-inner img { width: 100%; height: 100%; object-fit: cover; }

.lp-hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  margin: 48px auto 0; max-width: 760px;
  border: 1px solid var(--line); border-radius: 16px;
  background: color-mix(in oklch, var(--base-1) 70%, transparent);
  backdrop-filter: blur(8px); position: relative; z-index: 1;
}
.lp-hero-stat { padding: 18px 24px; border-right: 1px solid var(--line); text-align: left; }
.lp-hero-stat:last-child { border-right: none; }
.lp-hero-stat .k { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--txt-mute); margin-bottom: 6px; }
.lp-hero-stat .v { font-family: var(--f-display); font-size: 32px; line-height: 1; color: var(--gold-hi); letter-spacing: -0.01em; }

/* Section scaffolding */
.lp-section { position: relative; padding: 100px 0; }
.lp-section.alt {
  background: linear-gradient(180deg, transparent, color-mix(in oklch, var(--base-1) 80%, transparent) 10%, color-mix(in oklch, var(--base-1) 80%, transparent) 90%, transparent);
}
.lp-section-head { max-width: 760px; margin: 0 auto 60px; text-align: center; }
.lp-section-kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.lp-section-head h2 { font-family: var(--f-display); font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 16px; font-weight: 400; }
.lp-section-head h2 .accent { font-style: italic; color: var(--gold-hi); }
.lp-section-head p { color: var(--txt-dim); font-size: 17px; margin: 0; line-height: 1.55; }

/* Features */
.lp-feature-tabs { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 40px; }
.lp-feature-tab {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--base-1);
  color: var(--txt-2); font-family: var(--f-ui); font-size: 13px;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.lp-feature-tab .count { font-family: var(--f-mono); font-size: 10px; color: var(--txt-mute); padding: 1px 6px; background: var(--base-3); border-radius: 999px; }
.lp-feature-tab:hover { border-color: var(--line-strong); color: var(--txt); }
.lp-feature-tab.on {
  background: linear-gradient(180deg, color-mix(in oklch, var(--gold) 16%, var(--base-1)), color-mix(in oklch, var(--gold) 8%, var(--base-1)));
  border-color: color-mix(in oklch, var(--gold) 40%, var(--line));
  color: var(--gold-hi);
}
.lp-feature-tab.on .count { background: color-mix(in oklch, var(--gold) 20%, var(--base-3)); color: var(--gold-hi); }
.lp-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lp-feature-card {
  position: relative; padding: 22px;
  background: var(--base-1); border: 1px solid var(--line);
  border-radius: 16px; transition: all .2s; overflow: hidden; cursor: default;
}
.lp-feature-card:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--gold) 40%, var(--line)); background: var(--base-2); }
.lp-feature-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(300px 120px at var(--fx, 50%) 0%, color-mix(in oklch, var(--gold) 18%, transparent), transparent 70%);
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.lp-feature-card:hover::after { opacity: 1; }
.lp-feature-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in oklch, var(--gold) 8%, var(--base-2));
  border: 1px solid color-mix(in oklch, var(--gold) 22%, var(--line));
  color: var(--gold); display: grid; place-items: center; margin-bottom: 16px;
}
.lp-feature-ico svg { width: 17px; height: 17px; }
.lp-feature-name { font-size: 15px; font-weight: 600; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; letter-spacing: -0.005em; }
.lp-feature-tag {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--gold); background: color-mix(in oklch, var(--gold) 14%, var(--base-2));
  border: 1px solid color-mix(in oklch, var(--gold) 30%, transparent);
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase;
}
.lp-feature-desc { color: var(--txt-dim); font-size: 13px; line-height: 1.55; margin: 0; }

/* Steps */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-step { position: relative; background: var(--base-1); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; overflow: hidden; }
.lp-step-num { font-family: var(--f-display); font-size: 74px; line-height: 1; color: color-mix(in oklch, var(--gold) 60%, transparent); font-style: italic; letter-spacing: -0.03em; margin-bottom: 20px; position: relative; }
.lp-step-num::after {
  content: attr(data-n); position: absolute; top: 0; left: 0;
  background: linear-gradient(180deg, var(--gold-hi), transparent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  mix-blend-mode: overlay;
}
.lp-step h3 { font-size: 17px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.005em; }
.lp-step p { color: var(--txt-dim); font-size: 14px; line-height: 1.55; margin: 0 0 24px; }
.lp-step-visual { height: 140px; border-radius: 12px; background: var(--base-0); border: 1px solid var(--line); display: grid; place-items: center; color: var(--txt-mute); font-family: var(--f-mono); font-size: 11px; position: relative; overflow: hidden; }
.lp-step-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Comparison */
.lp-compare { background: var(--base-1); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.lp-compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lp-compare table { width: 100%; border-collapse: collapse; min-width: 760px; }
.lp-compare th, .lp-compare td { padding: 14px 16px; text-align: center; font-size: 13px; border-bottom: 1px solid var(--line); }
.lp-compare thead th { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt-mute); background: var(--base-2); font-weight: 500; padding-top: 18px; padding-bottom: 18px; }
.lp-compare thead th.hg {
  color: var(--gold-hi);
  background: linear-gradient(180deg, color-mix(in oklch, var(--gold) 18%, var(--base-2)), color-mix(in oklch, var(--gold) 6%, var(--base-2)));
  position: relative;
}
.lp-compare thead th.hg::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); }
.lp-compare td.feat { text-align: left; color: var(--txt); font-weight: 500; }
.lp-compare td.cat { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); text-align: left; background: var(--base-2); }
.lp-compare td.hg { background: color-mix(in oklch, var(--gold) 4%, transparent); }
.lp-compare .cat-inline { display: inline-block; padding: 2px 8px; margin-right: 8px; border-radius: 4px; background: color-mix(in oklch, var(--gold) 10%, var(--base-2)); color: var(--gold); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-family: var(--f-mono); }
.chk-y { color: var(--ok); font-size: 16px; }
.chk-n { color: var(--txt-mute); font-size: 14px; }
.chk-p { color: var(--warn); font-size: 14px; }
.lp-compare tfoot td { padding: 20px 16px; font-family: var(--f-mono); font-size: 13px; color: var(--txt-dim); background: var(--base-2); }
.lp-compare tfoot td.score { color: var(--txt); font-weight: 600; }
.lp-compare tfoot td.score.hg { color: var(--gold-hi); font-family: var(--f-display); font-size: 22px; font-weight: 400; }

/* Network */
.lp-network { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.lp-network-viz { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 24px; background: var(--base-1); overflow: hidden; }
.lp-network-viz svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-network-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lp-network-feat { padding: 18px; background: var(--base-1); border: 1px solid var(--line); border-radius: 14px; }
.lp-network-feat h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--gold-hi); }
.lp-network-feat p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--txt-dim); }

/* Pricing */
.lp-pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-plan { position: relative; background: var(--base-1); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; }
.lp-plan.pop {
  background: linear-gradient(180deg, color-mix(in oklch, var(--gold) 12%, var(--base-1)), var(--base-1));
  border-color: color-mix(in oklch, var(--gold) 50%, var(--line));
  box-shadow: 0 20px 60px color-mix(in oklch, var(--gold) 12%, transparent);
}
.lp-plan-pop-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #2a1f06;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em;
  padding: 4px 12px; border-radius: 999px; text-transform: uppercase; font-weight: 600;
}
.lp-plan-name { font-family: var(--f-display); font-style: italic; font-size: 28px; color: var(--gold-hi); margin-bottom: 8px; }
.lp-plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.lp-plan-price .p { font-family: var(--f-display); font-size: 48px; line-height: 1; letter-spacing: -0.02em; color: var(--txt); }
.lp-plan-price .u { color: var(--txt-dim); font-size: 14px; font-family: var(--f-mono); }
.lp-plan-tag { color: var(--txt-dim); font-size: 13px; margin: 0 0 22px; }
.lp-plan-feats { list-style: none; padding: 0; margin: 0 0 24px; }
.lp-plan-feats li { padding: 8px 0; font-size: 13.5px; color: var(--txt-2); display: flex; gap: 10px; border-bottom: 1px solid var(--line); }
.lp-plan-feats li:last-child { border-bottom: none; }
.lp-plan-feats li::before { content: "✓"; color: var(--gold); flex: 0 0 14px; }

/* Tokenomics */
.lp-token { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: stretch; }
.lp-token-flow { background: var(--base-1); border: 1px solid var(--line); border-radius: 20px; padding: 32px; position: relative; overflow: hidden; }
.lp-token-title { font-family: var(--f-display); font-size: 24px; font-style: italic; color: var(--gold-hi); margin-bottom: 4px; }
.lp-token-sub { color: var(--txt-dim); font-size: 13px; margin-bottom: 28px; }
.lp-token-split { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.lp-token-slice { padding: 20px 16px; border-radius: 14px; background: var(--base-2); border: 1px solid var(--line); text-align: center; }
.lp-token-slice .pct { font-family: var(--f-display); font-size: 32px; color: var(--gold-hi); line-height: 1; margin-bottom: 6px; }
.lp-token-slice .lbl { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt-dim); }
.lp-token-bar { height: 8px; border-radius: 999px; overflow: hidden; display: flex; margin-bottom: 20px; border: 1px solid var(--line); }
.lp-token-bar .a { flex: 2; background: var(--gold); }
.lp-token-bar .b { flex: 1; background: var(--honey); border-left: 1px solid var(--base-0); }
.lp-token-bar .c { flex: 1; background: var(--amber); border-left: 1px solid var(--base-0); }
.lp-token-stats { background: var(--base-1); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; }
.lp-token-addr { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--base-0); border: 1px solid var(--line); border-radius: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--txt-dim); margin-bottom: 24px; word-break: break-all; }
.lp-token-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 24px; }
.lp-token-kv { padding: 16px; background: var(--base-1); }
.lp-token-kv .k { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt-mute); margin-bottom: 6px; }
.lp-token-kv .v { font-family: var(--f-display); font-size: 26px; color: var(--txt); letter-spacing: -0.01em; }
.lp-token-kv .v.gold { color: var(--gold-hi); }

/* Security */
.lp-security { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lp-sec { padding: 24px; background: var(--base-1); border: 1px solid var(--line); border-radius: 16px; }
.lp-sec-ico { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in oklch, var(--gold) 10%, var(--base-2)); color: var(--gold); display: grid; place-items: center; margin-bottom: 14px; }
.lp-sec h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.lp-sec p { margin: 0; font-size: 13px; color: var(--txt-dim); line-height: 1.5; }

/* CTA */
.lp-cta {
  position: relative; overflow: hidden;
  margin: 40px 0 80px; padding: 80px 32px;
  border-radius: 28px;
  border: 1px solid color-mix(in oklch, var(--gold) 30%, var(--line));
  background:
    radial-gradient(600px 300px at 50% 0%, color-mix(in oklch, var(--gold) 20%, transparent), transparent 70%),
    linear-gradient(180deg, var(--base-2), var(--base-1));
  text-align: center;
}
.lp-cta h2 { font-family: var(--f-display); font-size: clamp(36px, 5vw, 64px); line-height: 1.0; letter-spacing: -0.02em; margin: 0 0 20px; font-weight: 400; max-width: 700px; margin-left: auto; margin-right: auto; }
.lp-cta h2 .accent { font-style: italic; color: var(--gold-hi); }
.lp-cta p { color: var(--txt-dim); margin: 0 0 32px; font-size: 16px; }
.lp-cta-small { margin-top: 18px !important; font-size: 12px !important; font-family: var(--f-mono); color: var(--txt-mute) !important; letter-spacing: 0.08em; }

/* Footer */
.lp-footer { padding: 60px 0 40px; border-top: 1px solid var(--line); }
.lp-foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.lp-foot-col h5 { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--txt-mute); margin: 0 0 16px; }
.lp-foot-col a { display: block; color: var(--txt-2); text-decoration: none; font-size: 13.5px; padding: 5px 0; transition: color .15s; }
.lp-foot-col a.lp-brand { padding: 0; display: flex; margin-bottom: 14px; }
.lp-foot-col a:hover { color: var(--gold-hi); }
.lp-foot-tag { color: var(--txt-dim); font-size: 13px; margin: 10px 0 0; max-width: 240px; }
.lp-foot-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; border-top: 1px solid var(--line); color: var(--txt-mute); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; }

/* Landing responsive */
@media (max-width: 980px) {
  .lp-wrap { padding: 0 20px; }
  .lp-nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    padding: 8px 20px 16px; background: var(--base-1);
    border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(0,0,0,.4);
  }
  .lp-nav-links.open { display: flex; }
  .lp-nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  .lp-nav-links a:last-child { border-bottom: none; }
  .lp-nav-inner { position: relative; }
  .lp-menu-btn { display: inline-flex; }
  .lp-nav-portal { display: none; }
  .lp-hero { padding: 60px 0 50px; }
  .lp-section { padding: 64px 0; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-network { grid-template-columns: 1fr; }
  .lp-pricing { grid-template-columns: 1fr; }
  .lp-token { grid-template-columns: 1fr; }
  .lp-security { grid-template-columns: 1fr; }
  .lp-foot-grid { grid-template-columns: 1fr 1fr; }
  .lp-hero-stats { grid-template-columns: 1fr; }
  .lp-hero-stat { border-right: none; border-bottom: 1px solid var(--line); }
  .lp-hero-stat:last-child { border-bottom: none; }
  .lp-cta { padding: 56px 24px; margin-bottom: 48px; }
}

/* ══════════════════════════════════════════════════════════════════
   Portal dashboard tiles — the 4-tile stats row on /portal/
   (level · points · streak · wallets)
   ══════════════════════════════════════════════════════════════════ */
.portal-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 28px;
}
.portal-tile {
  position: relative;
  background: linear-gradient(180deg, var(--base-2), var(--base-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.portal-tile.portal-tile-link:hover {
  border-color: color-mix(in oklch, var(--gold) 55%, var(--line));
  transform: translateY(-1px);
}
.portal-tile.is-placeholder {
  background: var(--base-1);
  border-style: dashed;
}
.portal-tile-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-mute);
}
.portal-tile-label svg { width: 14px; height: 14px; opacity: 0.75; }
.portal-tile-value {
  font: 600 34px/1 var(--f-display);
  letter-spacing: -0.01em;
  color: var(--txt);
  margin-top: auto;
}
.portal-tile-value.portal-tile-dim { color: var(--txt-mute); font-weight: 400; }
.portal-tile-sub {
  font-size: 12px;
  color: var(--txt-dim);
  line-height: 1.35;
}
.portal-tile-progress {
  height: 4px;
  background: var(--base-0);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0 -2px;
}
.portal-tile-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi, var(--gold)));
  border-radius: inherit;
  transition: width .3s ease;
}

@media (max-width: 860px) {
  .portal-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .portal-tiles { grid-template-columns: 1fr; }
  .portal-tile-value { font-size: 28px; }
}

/* ══════════════════════════════════════════════════════════════════
   Portal NFT gallery (/portal/nfts/) — MVP grid of NFT cards
   ══════════════════════════════════════════════════════════════════ */
.portal-nfts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 0 0 40px;
}
.portal-nft-card {
  background: linear-gradient(180deg, var(--base-2), var(--base-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
  display: flex; flex-direction: column;
}
.portal-nft-card:hover {
  border-color: color-mix(in oklch, var(--gold) 45%, var(--line));
  transform: translateY(-1px);
}
.portal-nft-media {
  aspect-ratio: 1 / 1;
  background: var(--base-0);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.portal-nft-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: var(--base-0);
}
.portal-nft-img-failed {
  visibility: hidden;
}
.portal-nft-img-missing {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  color: var(--txt-mute);
  opacity: 0.55;
}
.portal-nft-meta {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.portal-nft-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-nft-sub {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--txt-dim);
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .portal-nfts-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ══════════════════════════════════════════════════════════════════
   Portal NFT gallery — collapsible collection groups
   ══════════════════════════════════════════════════════════════════ */
.portal-nfts-groups { display: flex; flex-direction: column; gap: 16px; margin: 0 0 40px; }

.portal-nft-group {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--base-2), var(--base-1));
  overflow: hidden;
}
.portal-nft-group[open] { padding-bottom: 4px; }

.portal-nft-group-header {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  user-select: none;
  transition: background .15s ease;
}
.portal-nft-group-header::-webkit-details-marker { display: none; }
.portal-nft-group-header:hover { background: color-mix(in oklch, var(--gold) 6%, transparent); }

.portal-nft-group-chevron {
  display: inline-flex;
  align-items: center;
  transition: transform .18s ease;
  color: var(--txt-dim);
}
.portal-nft-group-chevron svg { width: 16px; height: 16px; }
.portal-nft-group[open] .portal-nft-group-chevron { transform: rotate(90deg); }

.portal-nft-group-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--txt);
  letter-spacing: -0.005em;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-nft-group-count {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--txt-dim);
  background: var(--base-0);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  min-width: 32px;
  text-align: center;
}

.portal-nft-group .portal-nfts-grid {
  padding: 4px 18px 18px;
  margin: 0;
}

/* Clickable card (was <article>, now <button>) — reset defaults */
button.portal-nft-card {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

/* ══════════════════════════════════════════════════════════════════
   Portal NFT gallery — detail modal
   ══════════════════════════════════════════════════════════════════ */
.portal-nft-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 24px;
}
.portal-nft-modal[hidden] { display: none !important; }
/* Inline elements inside the modal use display:grid / flex in their
   base rules, which beats the default user-agent [hidden]{display:none}.
   Force the attribute to win for any element we programmatically show/hide. */
.portal-nft-modal [hidden] { display: none !important; }
.portal-nft-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.portal-nft-modal-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 40%) 1fr;
  max-width: 960px;
  width: 100%;
  max-height: calc(100vh - 48px);
  background: var(--base-1);
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: rise .25s cubic-bezier(.2,.8,.2,1) both;
}
.portal-nft-modal-close {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 2;
  width: 32px; height: 32px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.portal-nft-modal-close:hover { background: rgba(0, 0, 0, 0.85); }

.portal-nft-modal-media {
  background: var(--base-0);
  display: grid; place-items: center;
  min-height: 280px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}
.portal-nft-modal-media img {
  max-width: 100%; max-height: calc(100vh - 48px);
  object-fit: contain;
  display: block;
}

.portal-nft-modal-body {
  padding: 24px 26px 26px;
  overflow: auto;
  max-height: calc(100vh - 48px);
}
.portal-nft-modal-header { margin-bottom: 14px; }
.portal-nft-modal-collection {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-mute);
  margin-bottom: 6px;
}
.portal-nft-modal-title {
  margin: 0;
  font: 600 22px/1.2 var(--f-display);
  letter-spacing: -0.01em;
  color: var(--txt);
}
.portal-nft-modal-description {
  margin: 10px 0 0;
  color: var(--txt-dim);
  font-size: 13.5px;
  line-height: 1.55;
}

.portal-nft-modal-section { margin-top: 22px; }
.portal-nft-modal-section-title {
  font: 600 12px/1 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-mute);
  margin: 0 0 10px;
}

.portal-nft-modal-traits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.portal-nft-modal-trait {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--base-0);
  overflow: hidden;
}
.portal-nft-modal-trait .k {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-nft-modal-trait .v {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-nft-modal-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0;
}
.portal-nft-modal-kv dt {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-mute);
  align-self: center;
}
.portal-nft-modal-kv dd {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-nft-modal-addr {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}
.portal-nft-modal-addr:hover { border-bottom-color: var(--gold); color: var(--gold); }

.portal-nft-modal-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.portal-nft-modal-mkt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.portal-nft-modal-mkt-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--base-0);
  text-decoration: none;
  color: var(--txt);
  transition: border-color .15s ease, transform .15s ease;
  min-width: 0;
}
.portal-nft-modal-mkt-btn:hover {
  border-color: color-mix(in oklch, var(--gold) 55%, var(--line));
  transform: translateY(-1px);
}
.portal-nft-modal-mkt-btn img {
  flex: 0 0 auto;
  display: block;
  border-radius: 4px;
}
.portal-nft-modal-mkt-btn .mkt-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.portal-nft-modal-mkt-btn .mkt-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-nft-modal-mkt-btn .mkt-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-mute);
  margin-top: 2px;
}
.portal-nft-modal-action-btn {
  padding: 6px 14px;
  font-size: 13px;
}
.portal-nft-modal-action-btn.is-danger {
  background: color-mix(in oklch, #c0392b 25%, transparent);
  color: #ff8b7a;
  border-color: color-mix(in oklch, #c0392b 55%, var(--line));
}
.portal-nft-modal-action-btn.is-danger:hover:not(:disabled) {
  background: color-mix(in oklch, #c0392b 45%, transparent);
}
.portal-nft-modal-action-btn.is-primary {
  background: color-mix(in oklch, #2e7d32 30%, transparent);
  color: #84d99a;
  border-color: color-mix(in oklch, #2e7d32 55%, var(--line));
}
.portal-nft-modal-action-btn.is-primary:hover:not(:disabled) {
  background: color-mix(in oklch, #2e7d32 50%, transparent);
}
.portal-nft-modal-action-btn.is-warning {
  background: color-mix(in oklch, #e67e22 25%, transparent);
  color: #f5b97a;
  border-color: color-mix(in oklch, #e67e22 55%, var(--line));
}
.portal-nft-modal-action-btn.is-warning:hover:not(:disabled) {
  background: color-mix(in oklch, #e67e22 45%, transparent);
}
.portal-nft-modal-hide-hint {
  font-size: 12px;
  color: var(--txt-dim);
  flex: 1;
  min-width: 180px;
}

@media (max-width: 700px) {
  .portal-nft-modal-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .portal-nft-modal-media { min-height: 220px; max-height: 45vh; }
  .portal-nft-modal-body  { max-height: none; }
}

/* ==================== Module page header & status pill ==================== */
/* Used by core/module-ui.php — the canonical layout for every module
   admin page: title row on the left, status pill + Requires pill on the
   right. See docs/UX-AUDIT.md "Settings UX feedback". */
.module-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px 0;
}
.module-page-header-titles { min-width: 0; }
.module-page-title {
  margin: 0;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--txt);
}
.module-page-subtitle {
  margin-top: 4px;
  color: var(--txt-dim);
  font-size: 14px;
}
.module-page-header-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.2;
}
.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-pill-active {
  color: var(--ok);
  background: color-mix(in oklch, var(--ok) 10%, transparent);
  border-color: color-mix(in oklch, var(--ok) 35%, transparent);
}
.status-pill-active .status-pill-dot { background: var(--ok); box-shadow: 0 0 8px color-mix(in oklch, var(--ok) 60%, transparent); }
.status-pill-warn {
  color: var(--warn);
  background: color-mix(in oklch, var(--warn) 10%, transparent);
  border-color: color-mix(in oklch, var(--warn) 35%, transparent);
}
.status-pill-warn .status-pill-dot { background: var(--warn); }
.status-pill-warn a { color: var(--warn); text-decoration: underline; }
.status-pill-warn a:hover { color: var(--gold-hi); }
.status-pill-off {
  color: var(--txt-dim);
  background: color-mix(in oklch, var(--txt-dim) 10%, transparent);
  border-color: var(--line);
}
.status-pill-off .status-pill-dot { background: var(--txt-mute); }
.status-pill-reason { font-weight: 400; color: inherit; opacity: 0.85; }

/* Allow status pills to wrap reasons gracefully on narrow viewports */
@media (max-width: 600px) {
  .status-pill { white-space: normal; }
}

/* ==================== Module stats row ==================== */
.module-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 0 0 24px 0;
}
.module-stat-card { padding: 16px; }
.module-stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--txt);
  margin-top: 2px;
}

/* ==================== "Send me a preview" button row ==================== */
.module-preview-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.module-preview-hint {
  display: inline-block;
}

/* ==================== Save toast ==================== */
/* Auto-dismissing pill anchored to the bottom-right of the viewport.
   Triggered by the layout when a 'success' flash is rendered. */
.save-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: color-mix(in oklch, var(--ok) 18%, var(--base-2));
  color: var(--txt);
  border: 1px solid color-mix(in oklch, var(--ok) 50%, transparent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
  pointer-events: none;
}
.save-toast.is-shown {
  opacity: 1;
  transform: translateY(0);
}
.save-toast::before {
  content: "✓";
  display: inline-block;
  font-weight: 700;
  color: var(--ok);
}

/* ==================== Tag picker (multi-select replacement) ==================== */
.tag-picker { width: 100%; }
.tag-picker-ui {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--base-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  min-height: 42px;
  position: relative;
}
.tag-picker-ui:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold) 20%, transparent);
}
.tag-picker-tags {
  display: contents;
}
.tag-picker-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  background: color-mix(in oklch, var(--gold) 14%, var(--base-2));
  color: var(--gold-hi);
  border: 1px solid color-mix(in oklch, var(--gold) 30%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-picker-remove {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 999px;
  opacity: 0.7;
}
.tag-picker-remove:hover { opacity: 1; background: color-mix(in oklch, var(--err) 25%, transparent); color: var(--err); }
.tag-picker-input {
  flex: 1;
  min-width: 140px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--txt);
  font: inherit;
  padding: 4px 2px;
}
.tag-picker-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--base-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}
.tag-picker-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.tag-picker-suggestion:hover,
.tag-picker-suggestion.is-active {
  background: color-mix(in oklch, var(--gold) 10%, transparent);
}
.tag-picker-suggestion-group {
  font-size: 11px;
  color: var(--txt-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-picker-suggestion-empty {
  padding: 10px 12px;
  color: var(--txt-dim);
  font-size: 13px;
}

