/* =========================================================
   Probe — product site
   Restrained dark violet theme.

   Sizing model:
   - One viewport, no scroll, WHEN THE CONTENT ACTUALLY FITS.
     A small script measures the active view and adds
     `body.scroll-mode` when it doesn't, so nothing is ever clipped
     at any window size, aspect ratio, or browser zoom level.
   - Type and spacing are sized in rem (+ a small vw term), never in
     raw vh, so browser zoom and user font-size settings work.
   ========================================================= */

:root {
  --bg: #08070f;

  --brand: #8b5cf6;
  --brand-soft: #a78bfa;
  --brand-strong: #7c3aed;

  --text: #eeecf6;
  --muted: #9b96b0;
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(167, 139, 250, 0.4);

  --surface: rgba(255, 255, 255, 0.035);

  /* rem, so it grows with zoom and with the large-screen bump below */
  --maxw: 70rem;

  --pad-x: clamp(1rem, 0.7rem + 1.4vw, 1.5rem);
  --view-gap: clamp(0.65rem, 0.4rem + 0.8vw, 1.15rem);

  /* Motion. One easing curve for entrances (decelerates hard, settles without
     overshoot) and one for state changes, so nothing feels bouncy or abrupt. */
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-state: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-entrance: 0.7s;
  --dur-fade: 0.45s;
  --stagger: 60ms;
}

/* Very large displays: nudge the base size up so the layout doesn't
   read as a small island. A percentage keeps the user's own font-size
   preference intact (an absolute px value would override it). */
@media (min-width: 1700px) {
  :root { font-size: 112.5%; }
}

/* Short viewports (laptops, landscape phones): tighten so the
   single-screen look survives without shrinking the text. */
@media (max-height: 800px) {
  :root { --view-gap: clamp(0.5rem, 0.3rem + 0.6vw, 0.8rem); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;

  /* Default: exactly one viewport. The script relaxes this when the
     content is too tall to fit (see body.scroll-mode). */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Content doesn't fit — let the page grow and scroll instead of clipping. */
body.scroll-mode {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
}

a { color: inherit; }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--brand-soft);
  outline-offset: 3px;
}

/* One soft glow at the top. That is the only background gradient. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 55% at 50% -8%, rgba(124, 58, 237, 0.28) 0%, transparent 60%),
    var(--bg);
}

/* ---------------- Header ---------------- */
.header {
  position: relative;   /* containing block for the open mobile menu */
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  /* deliberately not positioned: an absolutely positioned grid item would
     resolve left/right against its grid area instead of the header */
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem var(--pad-x);
  padding-left: max(var(--pad-x), env(safe-area-inset-left));
  padding-right: max(var(--pad-x), env(safe-area-inset-right));

  /* 1fr | auto | 1fr keeps the nav optically centred whether or not
     the hamburger is showing. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.nav {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.4rem + 1.6vw, 1.75rem);
}
.nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 0.25s var(--ease-state);
}
.nav a:hover, .nav a.selected { color: var(--text); }

.header-actions {
  grid-column: 3;
  justify-self: start;
  margin-left: clamp(1rem, 0.6rem + 1vw, 1.6rem);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.portal-link {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 0.25s var(--ease-state);
}
.portal-link:hover,
.portal-link.selected { color: var(--text); }
.discord-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  color: var(--muted);
  transition: color 0.25s var(--ease-state), transform 0.35s var(--ease-entrance);
}
.discord-link:hover { color: var(--brand-soft); transform: translateY(-2px); }
.discord-link svg { width: 22px; height: 22px; display: block; }

.menu-btn {
  grid-column: 1;
  justify-self: start;
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.25s var(--ease-state);
}
.menu-btn:hover { border-color: var(--line-bright); }

/* The three bars fold into a close mark. */
.menu-btn svg line {
  transform-box: view-box;
  transform-origin: 12px 12px;
  transition: transform 0.35s var(--ease-entrance), opacity 0.2s var(--ease-state);
}
/* Order matters: the bar must slide to the centre line *before* it rotates,
   otherwise it pivots away from the icon's centre and the X sits off-axis. */
.menu-btn[aria-expanded="true"] .bar-top    { transform: rotate(45deg) translateY(6px); }
.menu-btn[aria-expanded="true"] .bar-middle { opacity: 0; }
.menu-btn[aria-expanded="true"] .bar-bottom { transform: rotate(-45deg) translateY(-6px); }

/* ---------------- Main ---------------- */
main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}
body.scroll-mode main { min-height: auto; }

/* Views overlap and crossfade while everything fits on one screen. */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: clamp(0.8rem, 2.5vh, 2rem) var(--pad-x);
  padding-left: max(var(--pad-x), env(safe-area-inset-left));
  padding-right: max(var(--pad-x), env(safe-area-inset-right));

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* visibility flips instantly, but only after the fade has finished */
  transition: opacity var(--dur-fade) var(--ease-state), visibility 0s linear var(--dur-fade);
}
.view.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-fade) var(--ease-state), visibility 0s linear 0s;
}
/* Inactive views are still laid out (so they can crossfade) and a taller one
   can bleed past the viewport. Clip them so they never add phantom height. */
.view:not(.active) { overflow: hidden; }

/* In scroll mode the views rejoin the flow so the page can grow. */
body.scroll-mode .view {
  position: static;
  flex: 1 1 auto;
  padding-block: clamp(1.75rem, 5vh, 3rem);
  padding-bottom: max(clamp(1.75rem, 5vh, 3rem), env(safe-area-inset-bottom));
}
body.scroll-mode .view:not(.active) { display: none; }

.view-inner {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--view-gap);
  text-align: center;
}

/* Staggered entrance each time a view becomes active.
   Each animated element carries its own `--i` in the markup, so the cascade
   always runs strictly top-to-bottom. Deriving it from :nth-child instead put
   trailing elements ahead of the cards sitting above them. */
.view.active .view-inner > *:not(.card-row):not(.empty-state),
.view.active .card-row > .card,
.view.active .empty-state > * {
  /* `backwards`, not `both`: it holds the hidden state through the stagger
     delay, but must not pin `transform: none` afterwards — a filled end state
     outranks .card:hover and would kill the lift. */
  animation: rise var(--dur-entrance) var(--ease-entrance) backwards;
  animation-delay: calc(var(--stagger) * var(--i, 0));
}

.anim-0 { --i: 0; }
.anim-1 { --i: 1; }
.anim-2 { --i: 2; }
.anim-3 { --i: 3; }
.anim-4 { --i: 4; }
.anim-5 { --i: 5; }
.anim-6 { --i: 6; }
.anim-7 { --i: 7; }

/* Less travel than before, with a trace of scale — it reads as settling into
   place rather than sliding up. */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.hero-mark {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}
.hero-mark img {
  width: clamp(3.4rem, 2.6rem + 2.4vw, 5.75rem);
  height: clamp(3.4rem, 2.6rem + 2.4vw, 5.75rem);
  border-radius: 0;
  display: block;
  position: relative;
  z-index: 1;
  border: 1px solid var(--line-bright);
  animation: float 7s var(--ease-state) infinite;
}
.hero-mark::after {
  content: "";
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent 70%);
  filter: blur(28px);
  z-index: 0;
  /* Same period as the float so the mark and its glow move as one object,
     rather than drifting in and out of phase. */
  animation: breathe 7s var(--ease-state) infinite;
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -5px, 0); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.42; transform: scale(0.97); }
  50%      { opacity: 0.68; transform: scale(1.04); }
}

h1 {
  font-size: clamp(1.95rem, 1.35rem + 2.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #fff;
}
@media (max-height: 800px) {
  h1 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.6rem); }
}

.tagline {
  max-width: 42rem;
  font-size: clamp(0.95rem, 0.88rem + 0.3vw, 1.15rem);
  color: var(--muted);
}
.tagline b { color: var(--text); font-weight: 500; }

/* ---------------- Buttons ---------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  /* small extra beat on top of the container gap, not a full second gap */
  margin-top: clamp(0.1rem, 0.5vh, 0.4rem);
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: clamp(0.6rem, 0.5rem + 0.3vw, 0.82rem) clamp(1.25rem, 0.9rem + 1.4vw, 1.85rem);
  border-radius: 0;
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.25s var(--ease-state),
    border-color 0.25s var(--ease-state),
    box-shadow 0.35s var(--ease-entrance),
    transform 0.35s var(--ease-entrance);
}
.btn svg { flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: 0.09s; }

.btn-primary {
  color: #fff;
  background: var(--brand-strong);
  border-color: var(--brand);
}
.btn-primary:hover {
  background: var(--brand);
  box-shadow: 0 10px 24px -12px rgba(139, 92, 246, 0.75);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--line-bright); }

.btn-danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.3);
}
.btn-danger:hover {
  border-color: #f87171;
  background: rgba(153, 27, 27, 0.42);
}

.btn-wide { width: 100%; }
.btn-compact {
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}
.btn:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

/* ---------------- Cards ---------------- */
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(0.7rem, 0.5rem + 0.5vw, 0.95rem);
  width: 100%;
  margin-top: clamp(0.2rem, 0.8vh, 0.6rem);
  min-height: 0;
}

/* The four primary features share one perimeter and continuous dividers. */
.card-row.quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
}
.card-row.quad .card {
  border: 0;
  border-right: 1px solid var(--line);
}
.card-row.quad .card:last-child { border-right: 0; }
.card-row.quad .card:hover {
  border-color: var(--line);
  transform: none;
}

@media (min-width: 46rem) and (max-width: 66rem) {
  .card-row.quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-row.quad .card { border-right: 1px solid var(--line); }
  .card-row.quad .card:nth-child(2n) { border-right: 0; }
  .card-row.quad .card:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 45.99rem) {
  .card-row.quad { grid-template-columns: 1fr; }
  .card-row.quad .card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .card-row.quad .card:last-child { border-bottom: 0; }
}

.card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(0.9rem, 0.75rem + 0.55vw, 1.4rem);
  border-radius: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  transition:
    border-color 0.3s var(--ease-state),
    background 0.3s var(--ease-state),
    transform 0.4s var(--ease-entrance);
}
.card:hover {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.card .icon {
  width: clamp(2rem, 1.8rem + 0.6vw, 2.5rem);
  height: clamp(2rem, 1.8rem + 0.6vw, 2.5rem);
  display: grid;
  place-items: center;
  border-radius: 0;
  margin-bottom: clamp(0.5rem, 0.4rem + 0.4vw, 0.85rem);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--brand-soft);
}
.card .icon svg { width: 60%; height: 60%; }

.card h3 {
  font-size: clamp(0.98rem, 0.94rem + 0.15vw, 1.06rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card p {
  margin-top: 0.35rem;
  font-size: clamp(0.82rem, 0.79rem + 0.12vw, 0.88rem);
  line-height: 1.5;
  color: var(--muted);
}
.card p b { color: var(--text); font-weight: 600; }

/* ---------------- Reviews ---------------- */
.card.review { justify-content: space-between; }
.card.review .quote {
  margin: 0;
  font-size: clamp(0.86rem, 0.82rem + 0.15vw, 0.95rem);
  line-height: 1.5;
  color: var(--text);
}
.card.review .quote::before { content: "\201C"; }
.card.review .quote::after { content: "\201D"; }
.card.review .who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(0.8rem, 0.6rem + 0.9vw, 1.3rem);
}
.card.review .avatar {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-soft);
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid var(--line-bright);
}
.card.review .name { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.card.review .handle { font-size: 0.76rem; color: var(--muted); }

/* ---------------- Pricing (purchase page) ---------------- */
.price-card {
  width: 100%;
  max-width: 27rem;
  padding: clamp(1.2rem, 0.9rem + 1.4vw, 2rem);
  text-align: left;
  flex: 0 0 auto;
}
.price-card .badge {
  align-self: flex-start;
  padding: 0.28rem 0.7rem;
  border-radius: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-soft);
  border: 1px solid var(--line-bright);
}
.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: clamp(0.6rem, 0.45rem + 0.6vw, 1rem) 0 0.2rem;
}
.price .amount {
  font-size: clamp(2.2rem, 1.8rem + 1.8vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
}
.price .per { color: var(--muted); font-size: 0.95rem; }
.price-note { color: var(--muted); font-size: 0.83rem; }

.feature-list {
  list-style: none;
  margin: clamp(0.7rem, 0.5rem + 0.8vw, 1.2rem) 0;
}
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: clamp(0.15rem, 0.1rem + 0.2vw, 0.35rem) 0;
  font-size: clamp(0.85rem, 0.82rem + 0.15vw, 0.92rem);
  color: #cfcadd;
}
.feature-list svg { flex-shrink: 0; margin-top: 3px; color: var(--brand-soft); }

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: clamp(0.7rem, 0.5rem + 0.8vw, 1.2rem);
}
.chip {
  padding: 0.28rem 0.65rem;
  border-radius: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--brand-soft);
  border: 1px solid var(--line);
  background: var(--surface);
}

/* ---------------- Resellers ---------------- */
.empty-state {
  width: 100%;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--view-gap);
}
.empty-state .icon {
  width: clamp(2.75rem, 2.3rem + 1.4vw, 3.75rem);
  height: clamp(2.75rem, 2.3rem + 1.4vw, 3.75rem);
  display: grid;
  place-items: center;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-soft);
}
.empty-state .icon svg { width: 55%; height: 55%; }

.checkout-status {
  min-height: 1.25rem;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}
.checkout-status.error { color: #fca5a5; }

/* ---------------- User portal ---------------- */
.portal-view { max-width: 64rem; }
.portal-shell {
  width: 100%;
  max-width: 58rem;
  margin-top: clamp(0.2rem, 0.8vh, 0.6rem);
  text-align: left;
}
.portal-state { width: 100%; }

/* Unavailable notice */
.portal-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.5rem, 1.1rem + 2vw, 2.8rem);
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: rise var(--dur-entrance) var(--ease-entrance) backwards;
}
.portal-state-icon {
  display: inline-flex;
  color: var(--brand-soft);
  margin-bottom: 1rem;
}
.portal-state-icon svg { width: 2.4rem; height: 2.4rem; }
.portal-unavailable h2 {
  font-size: 1.05rem;
  line-height: 1.25;
}
.portal-unavailable p {
  max-width: 35rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Sign-in / register card */
.portal-auth {
  max-width: 27rem;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: rise var(--dur-entrance) var(--ease-entrance) backwards;
}
.portal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.portal-tab {
  min-height: 3rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s var(--ease-state), background 0.25s var(--ease-state);
}
.portal-tab:last-child { border-right: 0; }
.portal-tab:hover { color: var(--text); }
.portal-tab.selected {
  color: #fff;
  background: rgba(139, 92, 246, 0.1);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.portal-form {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.1rem, 0.9rem + 1vw, 1.65rem);
}

/* Shared form primitives */
.field {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
}
.field label {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}
.field input,
.portal-inline-form input,
.field select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.86rem;
  outline: 0;
  transition: border-color 0.2s var(--ease-state), background 0.2s var(--ease-state);
}
.field input:hover,
.portal-inline-form input:hover,
.field select:hover { border-color: rgba(255, 255, 255, 0.16); }
.field input:focus,
.portal-inline-form input:focus,
.field select:focus {
  border-color: var(--brand-soft);
  background: rgba(0, 0, 0, 0.42);
}
.field input::placeholder,
.portal-inline-form input::placeholder { color: #6f6982; }
.field select { appearance: none; }
.portal-status {
  min-height: 1.15rem;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}
.portal-status.error { color: #fca5a5; }
.portal-status.success { color: #86efac; }
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Dashboard frame: sidebar + stacked content.
   The signed-in shell is always taller than the viewport, so the page stays in
   scroll-mode — switching panels can never recenter the layout or toggle the
   scrollbar. */
#portal .portal-shell:has(.portal-dashboard:not([hidden])) { min-height: 120vh; }
.portal-dashboard {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  gap: clamp(1.2rem, 0.8rem + 1.1vw, 2rem);
  align-items: start;
  animation: rise var(--dur-entrance) var(--ease-entrance) backwards;
}
.portal-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: clamp(1.2rem, 0.8rem + 1.1vw, 2rem);
  border-right: 1px solid var(--line);
  align-self: start;
}
.portal-user {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.15rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.portal-user > strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.65rem 0;
  flex: 0 0 auto;
}
.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.62rem 0.2rem 0.62rem 0.75rem;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.2s var(--ease-state),
    border-color 0.2s var(--ease-state);
}
.portal-nav-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.portal-nav-item:hover {
  color: var(--text);
}
.portal-nav-item.selected {
  color: var(--brand-soft);
  border-left-color: var(--brand);
}
.portal-nav-item:focus-visible {
  outline: 0;
  color: var(--text);
  border-left-color: var(--brand-soft);
}
.portal-sign-out {
  border-top: 1px solid var(--line);
  border-left: 2px solid transparent;
  margin-top: 0.15rem;
  padding: 0.8rem 0.2rem 0.35rem 0.75rem;
}
.portal-sign-out:hover { color: #fca5a5; }

.portal-content {
  display: grid;
  gap: clamp(0.7rem, 0.5rem + 0.6vw, 1rem);
  min-width: 0;
}
.portal-panel {
  display: grid;
  gap: clamp(0.7rem, 0.5rem + 0.6vw, 1rem);
  min-width: 0;
}
.portal-panel:not([hidden]) {
  animation: portal-panel-reveal 0.22s var(--ease-state);
}
@keyframes portal-panel-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Panel cards share the feature-card vocabulary */
.panel-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1rem, 0.85rem + 0.5vw, 1.35rem);
  transition: border-color 0.3s var(--ease-state);
}
.panel-card:hover { border-color: rgba(255, 255, 255, 0.14); }
.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel-card-head > div { display: grid; gap: 0.25rem; min-width: 0; }
.panel-card-head h2 {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.panel-card-icon {
  display: inline-flex;
  color: var(--brand-soft);
  margin-bottom: 0.65rem;
}
.panel-card-icon svg { width: 1.3rem; height: 1.3rem; }
.panel-tool {
  display: flex;
  flex-direction: column;
}
.panel-tool h2 { font-size: 0.98rem; letter-spacing: -0.01em; }
.panel-tool > p:not(.portal-status) {
  margin: 0.35rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
.panel-tool .btn { margin-top: auto; align-self: flex-start; }
.panel-tool .btn-wide { align-self: stretch; }
.panel-tool .portal-status { margin-top: 0.5rem; text-align: left; }

/* Status pill + joined stat tiles */
.status-pill {
  flex-shrink: 0;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-pill.active {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.4);
  background: rgba(134, 239, 172, 0.08);
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.stat-row-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-tile {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.8rem 0.95rem;
  border-right: 1px solid var(--line);
}
.stat-tile:last-child { border-right: 0; }
.stat-tile span { color: var(--muted); font-size: 0.68rem; }
.stat-tile strong { font-size: 0.92rem; overflow-wrap: anywhere; }

/* Order + admin lists: one boxed list with continuous dividers */
.portal-order-list,
.admin-list {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
}
.portal-order {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(6rem, 0.8fr) minmax(5rem, 0.55fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}
.portal-order:last-child,
.admin-account-row:last-child,
.admin-order-row:last-child { border-bottom: 0; }
.portal-order-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.portal-order-date { color: var(--muted); }
.portal-order-status {
  justify-self: end;
  color: var(--brand-soft);
  font-weight: 700;
  text-transform: capitalize;
}
.portal-order-status.finished { color: #86efac; }
.portal-order-status.failed,
.portal-order-status.expired { color: #fca5a5; }
.portal-empty { color: var(--muted); font-size: 0.8rem; }

.panel-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.7rem, 0.5rem + 0.6vw, 1rem);
}
.portal-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.portal-inline-form .btn { border-left: 0; align-self: stretch; margin-top: 0; }

/* Danger zone */
.panel-danger { border-color: rgba(248, 113, 113, 0.28); }
.portal-delete-form > p { color: var(--muted); font-size: 0.78rem; }
.portal-delete-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.portal-delete-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.portal-delete-form .portal-status { margin-top: 0.55rem; text-align: left; }

/* Admin panel */
.admin-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}
.admin-action {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 0.9fr) minmax(0, 1.2fr) 7.5rem;
  grid-template-rows: auto auto auto auto;
  column-gap: clamp(0.75rem, 0.5rem + 0.8vw, 1.2rem);
  row-gap: 0.15rem;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: clamp(0.85rem, 0.72rem + 0.45vw, 1.1rem);
}
.admin-action:last-child { border-bottom: 0; }
.admin-action .panel-card-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;
  margin: 0;
  padding-top: 0.12rem;
}
.admin-action h2 {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}
.admin-action.panel-tool > p:not(.portal-status) {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin: 0.18rem 0 0;
}
.admin-action .admin-action-fields,
.admin-action > .field {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
}
.admin-action.panel-tool > .btn {
  grid-column: 4;
  grid-row: 1 / 3;
  align-self: end;
  width: 100%;
  margin-top: 0;
  white-space: nowrap;
}
.admin-action-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: 0.6rem;
}
.admin-key-output {
  grid-column: 2 / -1;
  grid-row: 3;
  min-height: 0;
  margin-top: 0.35rem;
  color: #86efac;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}
.admin-key-output:empty { display: none; }
.admin-action > .portal-status {
  grid-column: 2 / -1;
  grid-row: 4;
  min-height: 0;
  margin-top: 0.25rem;
}
.admin-action > .portal-status:empty { display: none; }
.admin-section-note { color: var(--muted); font-size: 0.7rem; align-self: center; }
.admin-overview-status { margin-top: 0.8rem; text-align: left; min-height: 0; }
.admin-overview-status:empty { display: none; }
.portal-admin-panel.is-loading #admin-refresh svg {
  animation: admin-refresh-spin 0.8s linear infinite;
}
@keyframes admin-refresh-spin { to { transform: rotate(360deg); } }
.admin-data-panel .portal-empty {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
}
.admin-account-row,
.admin-order-row {
  display: grid;
  gap: 0.75rem;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
}
.admin-account-row { grid-template-columns: minmax(0, 1.2fr) 5rem minmax(7rem, 0.8fr) 4rem; }
.admin-order-row { grid-template-columns: minmax(0, 1.2fr) minmax(6rem, 0.8fr) 6rem minmax(7rem, 0.7fr); }
.admin-row-primary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.admin-row-muted { color: var(--muted); }
.admin-row-status {
  color: var(--brand-soft);
  font-weight: 700;
  text-transform: capitalize;
}
.admin-row-status.active,
.admin-row-status.finished { color: #86efac; }

@media (max-width: 52rem) {
  .portal-dashboard { grid-template-columns: 1fr; }
  .portal-sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    padding-right: 0;
    padding-bottom: 0.8rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .portal-user { grid-column: 1 / -1; padding-top: 0; }
  .portal-nav { flex-direction: row; padding: 0.65rem 0 0; }
  .portal-nav-item {
    width: auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0.55rem 0.7rem;
  }
  .portal-nav-item.selected { border-bottom-color: var(--brand); }
  .portal-nav-item:focus-visible {
    border-left-color: transparent;
    border-bottom-color: var(--brand-soft);
  }
  .portal-sign-out {
    border-top: 0;
    border-left: 1px solid var(--line);
    border-bottom: 0;
    margin: 0.65rem 0 0;
    padding: 0.55rem 0 0.55rem 0.85rem;
    width: auto;
  }
  .stat-row,
  .stat-row-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tile:nth-child(2n) { border-right: 0; }
  .stat-tile:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .panel-split,
  .admin-actions { grid-template-columns: 1fr; }
  .admin-action {
    grid-template-columns: 1.4rem minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto auto auto auto;
  }
  .admin-action.panel-tool > .btn {
    grid-column: 3;
    grid-row: 3;
    justify-self: start;
    width: auto;
    margin-top: 0.55rem;
  }
  .admin-key-output { grid-column: 2 / -1; grid-row: 4; }
  .admin-action > .portal-status { grid-column: 2 / -1; grid-row: 5; }
  .portal-order { grid-template-columns: minmax(0, 1fr) auto; }
  .portal-order-date { display: none; }
  .admin-account-row { grid-template-columns: minmax(0, 1fr) 5rem minmax(6rem, 0.7fr); }
  .admin-account-row > :last-child { display: none; }
  .admin-order-row { grid-template-columns: minmax(0, 1fr) 6rem minmax(6rem, 0.7fr); }
  .admin-order-row > :nth-child(2) { display: none; }
}

@media (max-width: 28rem) {
  .panel-card-head { flex-direction: column; align-items: stretch; }
  .panel-card-head .btn { width: 100%; }
  .status-pill { align-self: flex-start; }
  .stat-row,
  .stat-row-four { grid-template-columns: 1fr; }
  .stat-tile,
  .stat-tile:nth-child(2n) { border-right: 0; }
  .stat-tile:nth-child(-n + 2) { border-bottom: 0; }
  .stat-tile:not(:last-child) { border-bottom: 1px solid var(--line); }
  .portal-inline-form { grid-template-columns: 1fr; gap: 0.5rem; }
  .portal-inline-form .btn { border-left: 1px solid var(--line); }
  .portal-delete-fields { grid-template-columns: 1fr; }
  .admin-action {
    grid-template-columns: 1.3rem minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto auto;
  }
  .admin-action .panel-card-icon { grid-column: 1; grid-row: 1 / 3; }
  .admin-action h2 { grid-column: 2; grid-row: 1; }
  .admin-action.panel-tool > p:not(.portal-status) { grid-column: 2; grid-row: 2; }
  .admin-action .admin-action-fields,
  .admin-action > .field { grid-column: 2; grid-row: 3; margin-top: 0.65rem; }
  .admin-action.panel-tool > .btn { grid-column: 2; grid-row: 4; justify-self: start; margin-top: 0.65rem; }
  .admin-key-output { grid-column: 2; grid-row: 5; }
  .admin-action > .portal-status { grid-column: 2; grid-row: 6; }
  .admin-account-row { grid-template-columns: minmax(0, 1fr) 4.5rem; }
  .admin-account-row > :nth-child(3) { display: none; }
  .admin-order-row { grid-template-columns: minmax(0, 1fr) 5.5rem; }
  .admin-order-row > :last-child { display: none; }
}

/* ---------------- Footer ---------------- */
footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.8rem var(--pad-x);
  padding-left: max(var(--pad-x), env(safe-area-inset-left));
  padding-right: max(var(--pad-x), env(safe-area-inset-right));
  padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.footer-links a { text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

/* ---------------- Narrow: collapse the nav into a menu ---------------- */
@media (max-width: 40rem) {
  .nav {
    display: none;
    width: 100%;
  }
  .nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.8rem max(var(--pad-x), env(safe-area-inset-left));
    border-bottom: 1px solid var(--line);
    background: #0b0a16;
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85);
    z-index: 60;
    animation: menu-in 0.32s var(--ease-entrance) backwards;
  }
  .nav.open a { animation: rise 0.4s var(--ease-entrance) backwards; }
  .nav.open a:nth-child(1) { animation-delay: 0.05s; }
  .nav.open a:nth-child(2) { animation-delay: 0.09s; }
  .nav.open a:nth-child(3) { animation-delay: 0.13s; }
  .nav.open a:nth-child(4) { animation-delay: 0.17s; }
  .nav.open a:nth-child(5) { animation-delay: 0.21s; }
  .nav.open a {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    font-size: 1rem;
  }
  .menu-btn { display: block; }
  /* nav is collapsed, so the icon holds the left edge and account actions the right */
  .header-actions { justify-self: end; margin-left: 0; }
}

@keyframes menu-in {
  from { opacity: 0; transform: translate3d(0, -8px, 0); }
  to   { opacity: 1; transform: none; }
}

/* Small phones: stack the call-to-action buttons full width. */
@media (max-width: 25rem) {
  .actions { flex-direction: column; align-self: stretch; }
  .actions .btn { width: 100%; }
}

/* Short viewports: the purchase card is the tallest single block, so trim it
   first to keep that page on one screen. Must come after the base .price-card
   rule — same specificity, so source order decides. */
@media (max-height: 800px) {
  .price-card { padding-block: clamp(1rem, 0.8rem + 0.8vw, 1.4rem); }
  .feature-list { margin-block: clamp(0.5rem, 0.4rem + 0.4vw, 0.85rem); }
  .feature-list li { padding-block: clamp(0.1rem, 0.08rem + 0.15vw, 0.28rem); }
}

/* ---------------- Input / motion preferences ---------------- */
@media (hover: none) {
  .btn:hover, .discord-link:hover, .card:hover { transform: none; }
  .card:hover { border-color: var(--line); background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .card:hover, .discord-link:hover { transform: none; }
  .hero-mark img,
  .hero-mark::after,
  .view.active .view-inner > *,
  .view.active .card-row > .card,
  .view.active .empty-state > *,
  .nav.open,
  .nav.open a { animation: none; }
  .menu-btn svg line { transition: none; }
  /* keep the crossfade, just make it instant rather than jumping mid-motion */
  .view, .view.active { transition-duration: 0.01ms; }
}
