/* ==========================================================================
   Vellio — modern UI system
   Background + accent palette preserved from the original theme.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Preserved palette */
  --bg: #080B14;
  --bg-2: #080B14;
  --sidebar: #0C1120;
  --panel: #121725;
  --panel-strong: #121725;
  --line: #252C3C;
  --line-strong: #394563;
  --text: #FFFFFF;
  --muted: #959DB3;
  --muted-2: #858FA8;
  --accent: #566BFF;
  --accent-2: #566BFF;
  --accent-3: #566BFF;
  --danger: #FF8B9F;
  --ok: #566BFF;

  /* Modern surface system */
  --surface: #101626;
  --surface-2: #0D1220;
  --elev-1: 0 1px 2px rgba(0, 0, 0, .4);
  --elev-2: 0 8px 24px -10px rgba(0, 0, 0, .65);
  --elev-3: 0 18px 44px -18px rgba(0, 0, 0, .75);
  --ring: 0 0 0 3px rgba(86, 107, 255, .22);
  --accent-soft: rgba(86, 107, 255, .10);
  --accent-line: rgba(86, 107, 255, .28);

  /* Medium-scale radii */
  --radius: 14px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  --ease: cubic-bezier(.22, .61, .36, 1);

  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(86, 107, 255, .10), transparent 62%),
    radial-gradient(700px 420px at 4% 4%, rgba(86, 107, 255, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before { display: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1D2539; border: 2px solid var(--bg); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: #2B3550; }

/* ---------- Typography ---------- */
h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; letter-spacing: -.035em; font-weight: 760; }
h1 span { color: var(--accent); }
h2 { margin: 0; font-size: clamp(19px, 2.1vw, 23px); line-height: 1.25; letter-spacing: -.022em; font-weight: 720; }
h3 { letter-spacing: -.015em; }

.eyebrow, .step {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.lead { max-width: 620px; margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.hidden { display: none !important; }

/* ---------- App layout ---------- */
.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px;
  background: linear-gradient(180deg, rgba(86, 107, 255, .05), transparent 30%), var(--sidebar);
  border-right: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.025em;
  font-size: 16px;
  padding: 4px 8px 18px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  box-shadow: 0 6px 18px -8px rgba(86, 107, 255, .8);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nav-label {
  margin: 12px 10px 6px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: var(--r-md);
  color: var(--muted);
  text-decoration: none;
  font-weight: 620;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav-link.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -1px; top: 50%;
  width: 3px; height: 18px;
  transform: translateY(-50%);
  border-radius: var(--r-pill);
  background: var(--accent);
}
.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 2px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
}
.sidebar-legal { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.sidebar-legal a { color: var(--muted); text-decoration: none; text-underline-offset: 3px; }
.sidebar-legal a:hover { color: var(--accent); }

/* ---------- Main column ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 3vw, 34px);
  background: rgba(12, 17, 32, .78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.topbar-title { font-size: 14px; font-weight: 720; letter-spacing: -.015em; }
.topbar-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 560; }
.menu-btn { display: none; }

.content { width: min(980px, 100%); margin: 0 auto; padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 34px) 56px; }

/* ---------- Pills / badges ---------- */
.server-state, .private-badge, .status-pill, .pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .03);
  color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
}
.server-state i { width: 6px; height: 6px; border-radius: 50%; background: #f4c263; box-shadow: 0 0 0 3px rgba(244, 194, 99, .16); }
.server-state.online i { background: var(--ok); box-shadow: 0 0 0 3px rgba(86, 107, 255, .2); }
.server-state.offline i { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 139, 159, .18); }
.private-badge { color: #AAB6FF; border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Hero ---------- */
.hero { padding: 6px 0 22px; max-width: 720px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- Panels (medium size) ---------- */
.panel {
  margin: 18px 0;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--surface);
  box-shadow: var(--elev-2);
  scroll-margin-top: 80px;
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 700; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .16s var(--ease), box-shadow .18s var(--ease);
}
.primary {
  color: #FFFFFF;
  background: linear-gradient(180deg, #6A7CFF, var(--accent));
  box-shadow: 0 8px 20px -10px rgba(86, 107, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.primary:hover { background: linear-gradient(180deg, #7A8AFF, #6172FF); transform: translateY(-1px); }
.primary:active { transform: translateY(0); }
.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border-color: var(--line-strong);
}
.secondary:hover { background: rgba(86, 107, 255, .12); border-color: var(--accent-line); transform: translateY(-1px); }
.primary:disabled, .secondary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Feature cards (medium) ---------- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px 0 4px; scroll-margin-top: 80px; }
.facts article {
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--elev-1);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.facts article:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--elev-2); }
.facts .fx-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px; margin-bottom: 14px;
  color: #AAB6FF; background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.facts .fx-icon svg { width: 17px; height: 17px; }
.facts span.num { color: var(--accent); font: 650 11px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.facts h3 { margin: 8px 0 7px; font-size: 16px; font-weight: 700; }
.facts p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ---------- Pricing cards (medium) ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0 6px; }
.price-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px 18px 20px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 38%), var(--surface);
  box-shadow: var(--elev-1);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.price-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--elev-3); }
.price-card.featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px rgba(86, 107, 255, .16), var(--elev-3); }
.price-badge {
  position: absolute; top: -10px; right: 16px;
  height: 22px; display: inline-flex; align-items: center;
  padding: 0 10px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #FFFFFF; background: var(--accent);
  box-shadow: 0 6px 16px -8px rgba(86, 107, 255, .9);
}
.price-card h3 { margin: 0 0 5px; font-size: 17px; font-weight: 720; }
.price-card .plan-desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.price-value { display: flex; align-items: baseline; gap: 5px; margin: 2px 0; }
.price-value .amount { font-size: 30px; font-weight: 760; letter-spacing: -.035em; color: var(--text); }
.price-value .interval { color: var(--muted); font-size: 13px; font-weight: 600; }
.entitlement { margin: 5px 0 16px; color: #AAB6FF; font-weight: 650; font-size: 13px; }
.feature-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.feature-list li { display: flex; align-items: flex-start; gap: 9px; color: #C3CAE0; font-size: 13px; line-height: 1.5; }
.feature-list svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent); }
.price-card .primary, .price-card .secondary { width: 100%; margin-top: auto; }
.billing-note { margin: 12px 0 0; color: var(--muted-2); font-size: 12px; line-height: 1.6; text-align: center; }

/* ---------- Custom form controls ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="url"],
input[type="tel"], textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input::placeholder, textarea::placeholder { color: #6E778F; }
input:hover, textarea:hover, select:hover { border-color: #47547A; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: #0F1526;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

/* Custom select */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select option { background: var(--panel); color: var(--text); }

/* Custom checkbox / radio */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; min-height: 0;
  flex: none; padding: 0; margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  display: inline-grid; place-content: center;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0); transform-origin: center;
  transition: transform .14s var(--ease);
}
input[type="radio"]::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; transform: scale(0); transition: transform .14s var(--ease);
}
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after, input[type="radio"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="radio"]:checked::after { transform: scale(1); }

/* ---------- Public footer & legal pages ---------- */
.site-footer {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; line-height: 1.6;
}
.site-footer p { max-width: 520px; margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; }
.site-footer a, .legal-page a { color: #BCC6E6; text-decoration: none; text-underline-offset: 3px; }
.site-footer a:hover, .legal-page a:hover { color: var(--accent); text-decoration: underline; }

.legal-shell { position: relative; z-index: 1; width: min(920px, 100%); margin: 0 auto; padding: 22px 18px 56px; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.legal-header .brand { padding: 0; }
.legal-back { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 650; }
.legal-back:hover { color: var(--accent); }
.legal-page {
  padding: clamp(20px, 3.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 30%), var(--surface);
  box-shadow: var(--elev-2);
}
.legal-page h1 { font-size: clamp(27px, 4.2vw, 38px); }
.legal-meta { margin: 12px 0 26px; color: var(--muted); font-size: 13.5px; }
.legal-page h2 { margin: 26px 0 10px; font-size: 19px; }
.legal-page h3 { margin: 18px 0 8px; font-size: 15.5px; }
.legal-page p, .legal-page li { color: #B0B9D6; line-height: 1.7; font-size: 14px; }
.legal-page ul { padding-left: 19px; }
.legal-page li + li { margin-top: 6px; }
.legal-callout {
  margin: 20px 0; padding: 14px 16px;
  border: 1px solid var(--accent-line); border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.legal-callout p { margin: 0; color: #D5DBF0; font-size: 13.5px; }
.legal-footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legal-footer nav a { text-decoration: none; font-size: 13px; }

/* contact block */
.contact-card { margin-top: 20px; display: grid; gap: 10px; }
.contact-row {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.contact-row:hover { border-color: var(--accent-line); background: rgba(86, 107, 255, .05); }
.contact-row svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.contact-row a { color: var(--text); font-weight: 650; text-decoration: none; font-size: 13.5px; }
.contact-row a:hover { color: var(--accent); }

.scrim { display: none; }

@media (max-width: 980px) { .pricing-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .menu-btn {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: var(--r-md);
    color: var(--text); background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
  }
  .menu-btn svg { width: 19px; height: 19px; }
  .sidebar {
    position: fixed; z-index: 40; width: 250px; left: 0; top: 0;
    transform: translateX(-105%);
    transition: transform .26s var(--ease);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(2, 3, 8, .66); backdrop-filter: blur(3px); }
}

@media (max-width: 620px) {
  .facts { grid-template-columns: 1fr; }
  .primary, .secondary { width: 100%; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .private-badge { align-self: flex-start; }
  .site-footer { flex-direction: column; }
  .site-footer nav { justify-content: flex-start; }
}

/* ---------- Website purchase flow ---------- */
.pricing-account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.web-account { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.buy-btn { cursor: pointer; font: inherit; }
.buy-btn:disabled, .purchase-login-form button:disabled { opacity: .6; cursor: progress; transform: none; }
.loading-card { min-height: 170px; justify-content: center; }
.trial-note { margin: 5px 0 0; color: #AAB6FF; font-size: 12px; font-weight: 650; }

.checkout-status {
  display: none;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13.5px;
  white-space: pre-line;
}
.checkout-status.visible { display: block; }
.checkout-status.success { border-color: var(--accent-line); border-left-color: var(--accent); color: #D7DDFF; background: var(--accent-soft); }
.checkout-status.error { border-color: rgba(248, 113, 113, .32); border-left-color: #F87171; color: #FFD0D0; background: rgba(248, 113, 113, .08); }

body.modal-open { overflow: hidden; }
.purchase-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.purchase-modal-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 14, .72); backdrop-filter: blur(6px); }
.purchase-modal-card {
  position: relative; z-index: 1;
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .9);
  animation: modal-in .22s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.purchase-modal-card h2 { margin-bottom: 8px; }
.modal-copy, .modal-fineprint { color: var(--muted); line-height: 1.55; }
.modal-copy { margin: 0 0 18px; font-size: 13.5px; }
.modal-fineprint { margin: 16px 0 0; font-size: 11.5px; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--muted); background: rgba(255, 255, 255, .04);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.purchase-login-form { display: grid; gap: 13px; }
.purchase-login-form label, .customer-form label { display: grid; gap: 6px; color: #DCE3EF; font-size: 12.5px; font-weight: 650; }
.purchase-login-form .primary { width: 100%; margin-top: 2px; }
.form-error { margin: 0; color: #FFB4B4; font-size: 12.5px; line-height: 1.45; }

@media (max-width: 620px) {
  .legal-header { align-items: flex-start; }
  .pricing-account-actions { gap: 8px; }
  .web-account { max-width: 180px; }
  .purchase-modal-card { padding: 20px 16px; }
}

/* ---------- Customer account / auth ---------- */
.customer-body { min-height: 100vh; }
.auth-shell, .success-shell { position: relative; z-index: 1; width: min(1040px, 100%); min-height: 100vh; margin: 0 auto; padding: 24px 18px 56px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 16px; font-weight: 750; letter-spacing: -.025em; }
.auth-card {
  position: relative; overflow: hidden;
  width: min(420px, 100%);
  margin: clamp(40px, 9vh, 88px) auto 0;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 34%), var(--surface);
  box-shadow: var(--elev-3);
}
.auth-glow { position: absolute; width: 220px; height: 220px; right: -90px; top: -110px; border-radius: 50%; background: rgba(86, 107, 255, .14); filter: blur(30px); pointer-events: none; }
.auth-card h1 { font-size: clamp(26px, 4.6vw, 34px); }
.auth-lead { margin: 12px 0 22px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.customer-form { display: grid; gap: 13px; }
.customer-form .primary { width: 100%; margin-top: 2px; }
.customer-form button:disabled { opacity: .6; cursor: progress; transform: none; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 12.5px; }
.auth-links a { color: var(--accent); text-decoration: none; font-weight: 650; }
.auth-links a:hover { text-decoration: underline; }
.auth-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }

.customer-shell { position: relative; z-index: 1; width: min(1140px, 100%); margin: 0 auto; padding: 22px 18px 52px; }
.customer-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 34px; }
.customer-header .brand { padding: 0; }
.customer-nav { display: flex; align-items: center; gap: 16px; }
.customer-nav a { color: var(--muted); text-decoration: none; font-size: 12.5px; font-weight: 650; }
.customer-nav a:hover { color: var(--accent); }

.account-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.account-hero h1 { max-width: 760px; font-size: clamp(27px, 4vw, 40px); }
.account-avatar {
  flex: none; display: grid; place-items: center;
  width: 60px; height: 60px;
  border: 1px solid var(--accent-line); border-radius: var(--r-lg);
  color: #FFFFFF; background: linear-gradient(180deg, #6A7CFF, var(--accent));
  box-shadow: 0 14px 34px -16px rgba(86, 107, 255, .9);
  font-size: 22px; font-weight: 800;
}
.account-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 14px; margin-top: 16px; }
.account-panel {
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 34%), var(--surface);
  box-shadow: var(--elev-2);
}
.account-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.account-panel-heading h2 { margin-top: 2px; }
.account-muted { margin: 10px 0 18px; color: var(--muted); line-height: 1.6; font-size: 13.5px; }

.status-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 24px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.status-chip.active, .status-chip.ok { color: #AAB6FF; border-color: var(--accent-line); background: var(--accent-soft); }
.status-chip.warning { color: #FFE0A3; border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .09); }
.status-chip.neutral { color: var(--muted); background: rgba(255, 255, 255, .04); }
.status-chip.danger { color: #FFD0D0; border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .09); }

.history-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.history-item strong { font-size: 13px; }
.history-item p { margin: 5px 0 0; color: var(--muted-2); font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere; }
.history-date { color: var(--muted-2); font-size: 11px; text-align: right; white-space: nowrap; }

.plan-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.plan-facts > div, .summary-list > div { padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.plan-facts span, .summary-list span { display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.plan-facts strong, .summary-list strong { color: var(--text); font-size: 13.5px; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.account-actions .primary, .account-actions .secondary, .account-actions .danger-button { min-height: 40px; width: auto; }
.account-fineprint { margin: 12px 0 0; color: var(--muted-2); font-size: 11.5px; line-height: 1.55; }
.summary-list { display: grid; gap: 8px; margin-top: 18px; }

.danger-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px;
  border: 1px solid rgba(248, 113, 113, .26); border-radius: var(--r-md);
  color: #FFD0D0; background: rgba(248, 113, 113, .09);
  font-size: 13.5px; font-weight: 700;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.danger-button:hover { background: rgba(248, 113, 113, .16); border-color: rgba(248, 113, 113, .4); }
.danger-button:disabled { opacity: .58; cursor: progress; }

.history-panel { margin-top: 14px; }
.purchase-history { display: grid; gap: 8px; margin-top: 16px; }
.history-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  color: inherit; background: var(--surface-2); text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.history-row:hover { border-color: var(--accent-line); background: rgba(86, 107, 255, .06); transform: translateY(-1px); }
.history-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #AAB6FF; background: var(--accent-soft); border: 1px solid var(--accent-line); font-weight: 800; font-size: 13px; }
.history-main, .history-amount { min-width: 0; }
.history-main strong, .history-main span, .history-amount strong, .history-amount span { display: block; }
.history-main strong { font-size: 13.5px; }
.history-main span { margin-top: 4px; overflow: hidden; color: var(--muted-2); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.history-amount { text-align: right; }
.history-amount strong { font-size: 13.5px; }
.history-amount span { margin-top: 3px; color: var(--muted-2); font-size: 11px; text-transform: capitalize; }
.history-empty { display: flex; flex-direction: column; gap: 5px; padding: 24px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--muted); text-align: center; font-size: 13px; }
.history-empty strong { color: var(--text); }

.customer-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11.5px; }
.customer-footer nav { display: flex; gap: 14px; }
.customer-footer a { color: var(--muted); text-decoration: none; }
.customer-footer a:hover { color: var(--accent); }

.cancel-card { text-align: left; }
.warning-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; border: 1px solid rgba(251, 191, 36, .28); border-radius: var(--r-md); color: #FFE0A3; background: rgba(251, 191, 36, .1); font-size: 19px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-actions .secondary, .modal-actions .danger-button { min-height: 40px; width: auto; }

/* ---------- Payment complete ---------- */
.success-shell { display: flex; flex-direction: column; }
.success-card {
  width: min(640px, 100%);
  margin: clamp(36px, 7vh, 72px) auto 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 32%), var(--surface);
  box-shadow: var(--elev-3);
  text-align: center;
}
.success-check { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border-radius: var(--r-lg); font-size: 26px; font-weight: 800; }
.success-check.loading { color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-soft); animation: pulse-success 1.3s ease-in-out infinite; }
.success-check.complete { color: #FFFFFF; background: linear-gradient(180deg, #6A7CFF, var(--accent)); box-shadow: 0 14px 34px -16px rgba(86, 107, 255, .9); }
.success-check.pending { color: #211704; background: #FDE68A; }
.success-check.failed { color: #250609; background: #FDA4AF; }
.success-card h1 { max-width: 560px; margin: 0 auto; font-size: clamp(24px, 4vw, 34px); }
.success-lead { max-width: 560px; margin: 14px auto 0; color: var(--muted); font-size: 14px; line-height: 1.68; }

.receipt-card { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; text-align: left; background: var(--surface-2); }
.receipt-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.receipt-top span, .receipt-grid span { display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.receipt-top strong { font-size: 16px; }
.receipt-total { text-align: right; }
.receipt-total strong { color: var(--accent); font-size: 21px; letter-spacing: -.02em; }
.receipt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.receipt-grid > div { min-width: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.receipt-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.receipt-grid strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.success-actions .primary, .success-actions .secondary { min-width: 160px; }
.success-note { margin: 20px auto 0; max-width: 560px; color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }
@keyframes pulse-success { 50% { transform: scale(.95); opacity: .7; } }

@media (max-width: 760px) {
  .account-grid { grid-template-columns: 1fr; }
  .account-hero { align-items: flex-start; }
  .account-avatar { width: 52px; height: 52px; }
  .history-row { grid-template-columns: 36px minmax(0, 1fr); }
  .history-amount { grid-column: 2; text-align: left; }
  .customer-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .auth-shell, .success-shell, .customer-shell { padding-left: 14px; padding-right: 14px; }
  .account-hero { display: block; }
  .account-avatar { margin-top: 18px; }
  .plan-facts, .receipt-grid { grid-template-columns: 1fr; }
  .receipt-grid > div:nth-child(odd) { border-right: 0; }
  .receipt-top { align-items: flex-start; flex-direction: column; }
  .receipt-total { text-align: left; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .secondary, .modal-actions .danger-button { width: 100%; }
}

/* ---------- Portal sidebar layout ---------- */
.portal-body { overflow-x: hidden; }
.portal-layout { position: relative; z-index: 1; display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.portal-sidebar {
  position: sticky; top: 0; align-self: start;
  display: flex; flex-direction: column;
  min-height: 100vh; height: 100vh;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(86, 107, 255, .05), transparent 28%), var(--sidebar);
}
.portal-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; color: var(--text); text-decoration: none; }
.portal-brand-copy { min-width: 0; }
.portal-brand-copy strong, .portal-brand-copy small { display: block; }
.portal-brand-copy strong { font-size: 15.5px; font-weight: 750; letter-spacing: -.025em; }
.portal-brand-copy small { margin-top: 2px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.portal-nav-group { display: grid; gap: 4px; }
.portal-nav-secondary { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.portal-nav-label { margin: 0 10px 6px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.portal-nav-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 0 11px;
  border: 1px solid transparent; border-radius: var(--r-md);
  color: var(--muted); background: transparent;
  text-align: left; text-decoration: none;
  font-size: 13px; font-weight: 640;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.portal-nav-link svg { width: 17px; height: 17px; flex: none; }
.portal-nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.portal-nav-link.active { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.portal-nav-link.active::before {
  content: ""; position: absolute; left: -1px; top: 50%;
  width: 3px; height: 18px; transform: translateY(-50%);
  border-radius: var(--r-pill); background: var(--accent);
}
.portal-nav-button { cursor: pointer; font: inherit; }
.portal-logout { color: #EFB9C0; }
.portal-logout:hover { color: #FFD7DC; border-color: rgba(248, 113, 113, .16); background: rgba(248, 113, 113, .07); }

.portal-sidebar-bottom { display: grid; gap: 8px; margin-top: auto; }
.portal-sidebar-bottom .portal-sidebar-account { margin-top: 0; }
.portal-bottom-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 38px; padding: 0 12px;
  border: 1px solid rgba(248, 113, 113, .16); border-radius: var(--r-md);
  color: #EFB9C0; background: rgba(248, 113, 113, .05);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.portal-bottom-logout svg { width: 15px; height: 15px; }
.portal-bottom-logout:hover { color: #FFD7DC; border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .1); }

.portal-sidebar-account {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px;
  margin-top: auto; padding: 11px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--elev-1);
}
.portal-sidebar-account-action { grid-template-columns: 30px 36px minmax(0, 1fr); gap: 8px; }
.portal-account-logout-icon {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid rgba(248, 113, 113, .16); border-radius: var(--r-sm);
  color: #EFB9C0; background: rgba(248, 113, 113, .06);
  cursor: pointer; transition: color .18s var(--ease), background .18s var(--ease);
}
.portal-account-logout-icon svg { width: 15px; height: 15px; }
.portal-account-logout-icon:hover { color: #FFF0F2; background: rgba(248, 113, 113, .13); }

.portal-user-avatar {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  color: #FFFFFF; background: linear-gradient(180deg, #6A7CFF, var(--accent));
  font-size: 14px; font-weight: 800;
}
.portal-user-copy { min-width: 0; }
.portal-user-copy span, .portal-user-copy strong { display: block; }
.portal-user-copy span { margin-bottom: 3px; color: var(--muted-2); font-size: 9.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.portal-user-copy strong { overflow: hidden; color: #FFFFFF; font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.portal-main { min-width: 0; }
.portal-content-shell { width: min(1140px, 100%); padding-top: clamp(26px, 4vw, 46px); }
.portal-pricing-shell { width: min(1140px, 100%); padding: clamp(26px, 4vw, 46px) 20px 56px; }
.portal-pricing-page { margin: 0; }

@media (max-width: 900px) {
  .portal-layout { grid-template-columns: 1fr; }
  .portal-sidebar {
    position: relative; z-index: 10; width: auto;
    min-height: auto; height: auto; padding: 14px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .portal-brand { padding: 0 4px 12px; }
  .portal-nav-group { display: flex; flex-wrap: wrap; gap: 6px; }
  .portal-nav-label { width: 100%; margin: 4px 4px 2px; }
  .portal-nav-link { width: auto; min-height: 38px; padding: 0 12px; }
  .portal-nav-link.active::before { display: none; }
  .portal-nav-secondary { margin-top: 8px; padding-top: 8px; }
  .portal-sidebar-bottom { margin-top: 12px; max-width: 400px; }
  .portal-sidebar-account { margin-top: 12px; max-width: 400px; }
  .portal-content-shell, .portal-pricing-shell { padding-top: 24px; }
}

@media (max-width: 560px) {
  .portal-sidebar { padding: 12px; }
  .portal-nav-group { display: grid; grid-template-columns: 1fr 1fr; }
  .portal-nav-label { grid-column: 1 / -1; }
  .portal-nav-link { width: 100%; }
  .portal-sidebar-bottom, .portal-sidebar-account { max-width: none; }
  .portal-pricing-shell { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Grouped plans + allowance selector ---------- */
.grouped-plan { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grouped-plan .plan-desc { min-height: 2.8em; }
.grouped-plan .feature-list { flex: 1; }
.grouped-plan .buy-btn { width: 100%; margin-top: auto; }
.plan-emblem {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  font-size: 20px; color: #AAB6FF;
}

.allowance-label { display: block; margin: 2px 0 5px; font-size: 11.5px; font-weight: 650; color: var(--muted); letter-spacing: .01em; }
.allowance-select-wrap { position: relative; width: 100%; min-width: 0; }
.allowance-select {
  appearance: none; -webkit-appearance: none;
  display: block; box-sizing: border-box;
  width: 100%; min-width: 0;
  height: 40px; min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  background-image: none;
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 620;
  line-height: normal;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.allowance-select:hover { border-color: #47547A; }
.allowance-select:focus, .allowance-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.allowance-select option { background: var(--panel); color: var(--text); }
.allowance-select-chevron {
  position: absolute; top: 50%; right: 12px;
  transform: translateY(-50%);
  color: var(--accent); font-size: 16px; line-height: 1;
  pointer-events: none;
}
.selected-allowance { margin: 0; font-size: 12px; color: #AAB6FF; line-height: 1.4; }
.buy-btn:disabled { cursor: not-allowed; opacity: .55; }

.grouped-plan .allowance-readonly {
  cursor: not-allowed; opacity: 1;
  color: var(--text); -webkit-text-fill-color: var(--text);
  padding-right: 34px;
  background: rgba(255, 255, 255, .03);
}
.grouped-plan .allowance-readonly-wrap { position: relative; }
.grouped-plan .allowance-select-lock { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 11px; opacity: .75; }
.grouped-plan #removeads-default-description { margin-top: -4px; }

/* ---------- Global accent details ---------- */
a:hover, .eyebrow { color: var(--accent); }
::selection { background: rgba(86, 107, 255, .85); color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
