/* ================================================================
   Macro Recorder Pro — Design System
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ───────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --red:          #e74c3c;
  --red-deep:     #c0392b;
  --red-soft:     #ff6b6b;
  --red-alpha:    rgba(231,76,60,0.14);
  --red-glow:     rgba(231,76,60,0.28);

  --bg:           #0b0b0c;
  --bg-raised:    #111113;
  --surface:      #17171a;
  --panel:        #1e1e22;
  --card:         #232328;
  --card-high:    #2a2a30;

  --line:         rgba(255,255,255,0.07);
  --line-med:     rgba(255,255,255,0.12);

  --text:         #f0f0f2;
  --text-muted:   #8c8c9a;
  --text-dim:     #5c5c6a;

  --ok:           #2ecc71;
  --ok-alpha:     rgba(46,204,113,0.12);
  --warn:         #f39c12;
  --warn-alpha:   rgba(243,156,18,0.12);
  --danger:       #e74c3c;
  --danger-alpha: rgba(231,76,60,0.12);
  --info:         #3b82f6;
  --info-alpha:   rgba(59,130,246,0.12);

  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.5);
  --shadow-red: 0 8px 32px rgba(231,76,60,0.25);

  --gap-xs: 6px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;

  --max-w:  1160px;
  --nav-h:  62px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(231,76,60,0.1), transparent),
    radial-gradient(ellipse 60% 30% at 100% 60%, rgba(231,76,60,0.05), transparent);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--panel); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--card); }

/* ================================================================
   Layout
   ================================================================ */
.site-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap-md) var(--gap-xl);
}
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

/* ================================================================
   Navigation
   ================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(11,11,12,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-nav {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gap-md);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  margin-right: var(--gap-md);
}
.brand-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--red-soft), var(--red-deep));
  box-shadow: var(--shadow-red);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 16px; height: 16px; }
.site-nav-links {
  display: flex; align-items: center; gap: 2px; flex: 1;
}
.site-nav-links a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.site-nav-links a:hover,
.site-nav-links a.active { color: var(--text); background: rgba(255,255,255,.05); }
.site-nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.site-nav-actions a,
.site-nav-actions button {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  border: none; background: transparent;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.site-nav-actions a:hover { color: var(--text); background: rgba(255,255,255,.05); }

.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  margin-left: auto;
}
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--gap-sm) var(--gap-md) var(--gap-md);
  border-bottom: 1px solid var(--line);
  background: rgba(11,11,12,.97);
}
.nav-mobile-menu a {
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text-muted);
}
.nav-mobile-menu a:hover { color: var(--text); background: var(--surface); }
.nav-mobile-menu.open { display: flex; }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all .15s;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary, button.btn-primary, a.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff; box-shadow: var(--shadow-red);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 8px 40px rgba(231,76,60,.4); transform: translateY(-1px); }

.btn-secondary, button.btn-secondary {
  background: var(--panel); color: var(--text); border-color: var(--line-med);
}
.btn-secondary:hover { background: var(--card); border-color: rgba(255,255,255,.2); }

.btn-ghost, button.btn-ghost {
  background: transparent; color: var(--text-muted); border-color: var(--line);
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }

.btn-danger, button.btn-danger {
  background: var(--danger-alpha); color: var(--danger); border-color: rgba(231,76,60,.25);
}
.btn-danger:hover { background: rgba(231,76,60,.22); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }
.icon-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.icon-actions-end { justify-content: flex-end; }
.icon-actions form { display: inline-flex; }
.icon-action-btn {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  flex-shrink: 0;
}
.icon-action-btn.btn-sm { padding: 0; }
.icon-action-btn svg {
  width: 15px;
  height: 15px;
}
.icon-action-btn::after,
.icon-action-btn::before {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.icon-action-btn::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 9px);
  transform: translate(-50%, 6px);
  background: rgba(8,8,10,.96);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: .35rem .5rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  z-index: 10;
}
.icon-action-btn::before {
  content: '';
  bottom: calc(100% + 3px);
  transform: translate(-50%, 6px);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(8,8,10,.96);
  z-index: 9;
}
.icon-action-btn:hover::after,
.icon-action-btn:hover::before,
.icon-action-btn:focus-visible::after,
.icon-action-btn:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================================================================
   Cards
   ================================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--gap-lg);
}
.card-sm { padding: var(--gap-md); border-radius: var(--r-lg); }
.card-glass {
  background: rgba(30,30,34,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.card-red {
  background: linear-gradient(135deg, rgba(231,76,60,.1), rgba(192,57,43,.06));
  border-color: rgba(231,76,60,.2);
}

/* ================================================================
   Badges & Dots
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  letter-spacing: .03em; white-space: nowrap;
}
.badge-red     { background: var(--red-alpha);    color: var(--red-soft); border: 1px solid rgba(231,76,60,.25); }
.badge-green   { background: var(--ok-alpha);     color: var(--ok);       border: 1px solid rgba(46,204,113,.25); }
.badge-yellow  { background: var(--warn-alpha);   color: var(--warn);     border: 1px solid rgba(243,156,18,.25); }
.badge-blue    { background: var(--info-alpha);   color: var(--info);     border: 1px solid rgba(59,130,246,.25); }
.badge-neutral { background: rgba(255,255,255,.05); color: var(--text-muted); border: 1px solid var(--line); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background: var(--ok);   box-shadow: 0 0 6px var(--ok); }
.dot-red    { background: var(--red);  box-shadow: 0 0 6px var(--red); }
.dot-yellow { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.dot-gray   { background: var(--text-dim); }

/* ================================================================
   Typography
   ================================================================ */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--red-alpha);
  color: var(--red-soft);
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid rgba(231,76,60,.2);
}
.kicker-neutral {
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
  border-color: var(--line);
}
.lead { font-size: 1.05rem; color: var(--text-muted); line-height: 1.8; }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* ================================================================
   Forms
   ================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--gap-md); }
label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"],
input[type="date"], input[type="time"], input[type="datetime-local"],
textarea, select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line-med);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus,
input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, textarea:focus, select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(231,76,60,.15);
}
textarea { resize: vertical; min-height: 90px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%238c8c9a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}
.form-hint  { font-size: 12px; color: var(--text-dim); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-control.is-error { border-color: var(--danger) !important; }
.form-card {
  max-width: 460px; margin: 0 auto;
  padding: 36px;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--line);
}
.form-divider {
  display: flex; align-items: center; gap: var(--gap-sm);
  margin: var(--gap-md) 0;
  color: var(--text-dim); font-size: 13px;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ================================================================
   Tables
   ================================================================ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  font-size: 14px; color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:hover td { background: rgba(255,255,255,.02); }
.table tbody tr:last-child td { border-bottom: none; }
.table td strong, .table td .text-main { color: var(--text); }

/* ================================================================
   Grid / Flex helpers
   ================================================================ */
.grid   { display: grid; gap: var(--gap-md); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }

/* ================================================================
   Alerts & Toasts
   ================================================================ */
.messages { display: grid; gap: 8px; margin: var(--gap-md) 0; }
.alert {
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid transparent;
}
.alert-success { background: var(--ok-alpha);     border-color: rgba(46,204,113,.2);  color: var(--ok); }
.alert-error   { background: var(--danger-alpha);  border-color: rgba(231,76,60,.2);   color: var(--red-soft); }
.alert-warning { background: var(--warn-alpha);    border-color: rgba(243,156,18,.2);  color: var(--warn); }
.alert-info    { background: var(--info-alpha);    border-color: rgba(59,130,246,.2);  color: var(--info); }

#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 13px 18px;
  border-radius: var(--r-lg);
  background: var(--card-high);
  border: 1px solid var(--line-med);
  box-shadow: var(--shadow-lg);
  font-size: 14px; color: var(--text);
  pointer-events: all;
  display: flex; align-items: center; gap: 10px;
  animation: slideUp .25s ease;
  max-width: 340px;
}
.toast-ok   { border-color: rgba(46,204,113,.35); }
.toast-err  { border-color: rgba(231,76,60,.35); }
.toast-warn { border-color: rgba(243,156,18,.35); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   Footer
   ================================================================ */
.site-footer { margin-top: var(--gap-xl); padding: var(--gap-lg) 0 var(--gap-md); border-top: 1px solid var(--line); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}
.footer-brand p {
  margin-top: var(--gap-sm);
  font-size: 13px; color: var(--text-dim);
  line-height: 1.7; max-width: 240px;
}
.footer-col h4 {
  font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: var(--gap-sm);
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 14px; color: var(--text-muted); transition: color .15s; }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--gap-md);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--text-dim);
  gap: var(--gap-md); flex-wrap: wrap;
}
.footer-badges { display: flex; gap: 8px; }
.platform-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px; color: var(--text-muted);
}

/* ================================================================
   Hero
   ================================================================ */
.hero { padding: var(--gap-xl) 0 var(--gap-lg); text-align: center; }
.hero .kicker { margin-bottom: var(--gap-md); }
.hero-title {
  font-size: clamp(2.6rem, 5.5vw, 5rem);
  font-weight: 800; letter-spacing: -.045em; line-height: .92;
  max-width: 820px; margin: 0 auto var(--gap-md);
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--red-soft), var(--red-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  font-size: 1.1rem; color: var(--text-muted); line-height: 1.75;
  max-width: 560px; margin: 0 auto var(--gap-lg);
}
.hero-actions {
  display: flex; align-items: center; justify-content: center;
  gap: var(--gap-sm); flex-wrap: wrap;
}
.hero-platforms {
  display: flex; align-items: center; justify-content: center;
  gap: var(--gap-sm); margin-top: var(--gap-lg); flex-wrap: wrap;
}
.hero-platforms span { font-size: 13px; color: var(--text-dim); margin-right: 6px; }

/* ================================================================
   Feature Cards
   ================================================================ */
.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--red-alpha);
  border: 1px solid rgba(231,76,60,.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--gap-md); flex-shrink: 0;
}
.feature-icon svg { width: 22px; height: 22px; color: var(--red-soft); }
.feature-card .h3 { margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ================================================================
   Pricing
   ================================================================ */
.price-card {
  padding: var(--gap-lg);
  border-radius: var(--r-xl);
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--gap-md);
  transition: border-color .2s, box-shadow .2s;
}
.price-card.featured {
  border-color: rgba(231,76,60,.35);
  box-shadow: 0 0 0 1px rgba(231,76,60,.15), var(--shadow-lg);
}
.price-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red-alpha); color: var(--red-soft);
  border: 1px solid rgba(231,76,60,.25);
  border-radius: var(--r-pill); padding: 4px 12px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  width: fit-content;
}
.price-amount { font-size: 3rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.price-amount sup { font-size: 1.4rem; font-weight: 600; vertical-align: top; margin-top: 8px; margin-right: 2px; }
.price-note { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.price-features { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.price-feature {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--text-muted);
}
.price-feature-check {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok-alpha);
  border: 1px solid rgba(46,204,113,.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.price-feature-check svg { width: 10px; height: 10px; color: var(--ok); }

/* ================================================================
   Downloads
   ================================================================ */
.download-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--r-lg); border: 1px solid var(--line);
  width: fit-content; margin-bottom: var(--gap-lg);
}
.tab-btn {
  padding: 9px 22px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  background: transparent; border: none; cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; gap: 8px;
}
.tab-btn.active { background: var(--card-high); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-btn svg { width: 16px; height: 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.download-card {
  display: flex; align-items: center; gap: var(--gap-md);
  padding: var(--gap-md);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .15s;
}
.download-card:hover { border-color: var(--line-med); }
.download-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.download-icon svg { width: 24px; height: 24px; }
.download-info { flex: 1; min-width: 0; }
.download-name { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.download-meta { font-size: 13px; color: var(--text-muted); }
.download-checksum {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  margin-top: 4px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: color .15s;
}
.download-checksum:hover { color: var(--text-muted); }
.download-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ================================================================
   Portal (Customer)
   ================================================================ */
.portal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--gap-lg); align-items: start;
}
.portal-sidebar { position: sticky; top: calc(var(--nav-h) + var(--gap-md)); }
.portal-nav {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); overflow: hidden;
}
.portal-nav-header { padding: var(--gap-md); border-bottom: 1px solid var(--line); }
.portal-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: white;
  margin-bottom: 10px; flex-shrink: 0;
}
.portal-email { font-size: 13px; color: var(--text-muted); word-break: break-all; }
.portal-nav-links { display: flex; flex-direction: column; padding: 8px; }
.portal-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: all .15s;
  position: relative;
}
.portal-nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.portal-nav-link:hover { color: var(--text); background: var(--surface); }
.portal-nav-link.active { color: var(--text); background: var(--surface); }
.portal-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 2px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}
.portal-content { min-width: 0; }

/* Portal breadcrumb */
.portal-breadcrumb { display: flex; align-items: center; gap: .3rem; margin-bottom: 1.75rem; font-size: .8rem; color: var(--text-dim); }
.portal-breadcrumb-sep { opacity: .3; }
.portal-breadcrumb-link { color: var(--text-dim); text-decoration: none; transition: color .15s; }
.portal-breadcrumb-link:hover { color: var(--text-muted); }

.license-card {
  padding: var(--gap-md);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: var(--gap-sm);
}
.license-key {
  font-family: var(--font-mono); font-size: 14px; color: var(--text);
  background: var(--surface); padding: 8px 12px;
  border-radius: var(--r-md); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm);
}
.license-slots { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.slot-bar { flex: 1; height: 4px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.slot-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--red-soft)); }
.activation-row {
  display: flex; align-items: center; gap: var(--gap-sm);
  padding: 10px 12px;
  background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--line);
}
.platform-icon {
  width: 28px; height: 28px;
  background: var(--panel); border-radius: var(--r-sm); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.platform-icon svg { width: 14px; height: 14px; }

/* ================================================================
   Stats
   ================================================================ */
.stat-card {
  padding: var(--gap-md);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.stat-value { font-size: 2.2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 4px; }
.stat-delta.up   { color: var(--ok); }
.stat-delta.down { color: var(--danger); }

/* ================================================================
   Admin Panel
   ================================================================ */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.admin-sidebar-header { padding: var(--gap-md); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.admin-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.admin-logo-badge {
  font-size: 10px; font-weight: 600;
  background: var(--red-alpha); color: var(--red-soft);
  border: 1px solid rgba(231,76,60,.25);
  border-radius: var(--r-pill); padding: 2px 8px;
  letter-spacing: .06em; text-transform: uppercase;
}
.admin-nav { flex: 1; padding: var(--gap-sm); overflow-y: auto; }
.admin-nav-section { margin-bottom: var(--gap-md); }
.admin-nav-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); padding: 6px 10px 4px; display: block;
}
.admin-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-muted); transition: all .15s;
  position: relative;
}
.admin-nav-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.admin-nav-link:hover { color: var(--text); background: var(--panel); }
.admin-nav-link.active { color: var(--text); background: var(--panel); }
.admin-nav-link.active svg { opacity: 1; }
.admin-nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--red); border-radius: 0 2px 2px 0;
}
.admin-nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--panel); color: var(--text-dim);
  border-radius: var(--r-pill); padding: 1px 7px;
}
.admin-nav-badge.red { background: var(--red-alpha); color: var(--red-soft); }
.admin-sidebar-footer { padding: var(--gap-md); border-top: 1px solid var(--line); flex-shrink: 0; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-role { font-size: 11px; color: var(--text-dim); }
.admin-main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.admin-topbar {
  height: 58px; padding: 0 var(--gap-lg);
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md);
  border-bottom: 1px solid var(--line);
  background: var(--bg); flex-shrink: 0;
  position: sticky; top: 0; z-index: 50;
}
.admin-breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); }
.admin-breadcrumbs a { color: var(--text-muted); transition: color .15s; }
.admin-breadcrumbs a:hover { color: var(--text); }
.admin-breadcrumbs .sep { opacity: .4; }
.admin-breadcrumbs .current { color: var(--text); font-weight: 500; }
.admin-topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-topbar-actions .icon-actions { justify-content: flex-end; }
.admin-content { flex: 1; padding: var(--gap-lg); overflow: auto; }
.admin-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--gap-md); margin-bottom: var(--gap-lg); flex-wrap: wrap;
}
.admin-page-header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.admin-page-header p  { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.filter-bar {
  display: flex; align-items: center; gap: var(--gap-sm);
  margin-bottom: var(--gap-md); flex-wrap: wrap;
}
.filter-bar .form-control { width: auto; min-width: 160px; }

.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap-md); padding: var(--gap-md) var(--gap-lg);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.admin-card-header h2 { font-size: 15px; font-weight: 600; }
.admin-card-body { padding: var(--gap-lg); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: var(--gap-lg); }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  font-size: 14px; color: var(--text-muted);
  border: 1px solid var(--line); transition: all .15s;
}
.pagination a:hover { color: var(--text); background: var(--surface); }
.pagination .current { background: var(--red); color: white; border-color: transparent; }
.pagination .disabled { opacity: .3; pointer-events: none; }

/* ================================================================
   Modal
   ================================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: var(--gap-md);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line-med);
  border-radius: var(--r-xl); padding: var(--gap-lg);
  max-width: 440px; width: 100%; box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: var(--gap-lg); }
.modal-actions { display: flex; gap: var(--gap-sm); justify-content: flex-end; }

/* ================================================================
   Section header
   ================================================================ */
.section-header { text-align: center; margin-bottom: var(--gap-xl); }
.section-header .kicker { margin-bottom: var(--gap-sm); }
.section-header h2 { font-size: clamp(1.8rem,3vw,2.8rem); font-weight: 700; letter-spacing: -.03em; margin-bottom: var(--gap-sm); }
.section-header p { color: var(--text-muted); max-width: 540px; margin: 0 auto; }

/* ================================================================
   Utilities
   ================================================================ */
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-sm { margin-top: var(--gap-sm); } .mt-md { margin-top: var(--gap-md); } .mt-lg { margin-top: var(--gap-lg); }
.mb-sm { margin-bottom: var(--gap-sm); } .mb-md { margin-bottom: var(--gap-md); } .mb-lg { margin-bottom: var(--gap-lg); }
.text-muted { color: var(--text-muted); } .text-dim { color: var(--text-dim); }
.text-red   { color: var(--red-soft); } .text-green { color: var(--ok); }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; }
.font-mono { font-family: var(--font-mono); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.d-flex { display: flex; } .d-none { display: none; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--line); margin: var(--gap-lg) 0; }
.empty-state { text-align: center; padding: var(--gap-xl); color: var(--text-dim); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto var(--gap-md); opacity: .3; }
.empty-state p { font-size: 14px; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question {
  width: 100%; text-align: left;
  padding: var(--gap-md) 0;
  background: transparent; border: none;
  color: var(--text); font-size: 15px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md);
}
.faq-question svg { flex-shrink: 0; transition: transform .2s; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { display: none; padding-bottom: var(--gap-md); color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.faq-item.open .faq-answer { display: block; }

/* Copy btn */
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: none;
  color: var(--text-dim); font-size: 12px; cursor: pointer;
  padding: 3px 6px; border-radius: var(--r-sm); transition: all .15s;
}
.copy-btn:hover { color: var(--text-muted); background: var(--surface); }
.copy-btn.copied { color: var(--ok); }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell  { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open {
    display: flex; position: fixed;
    top: 0; left: 0; width: 280px; height: 100vh; z-index: 150;
  }
}
@media (max-width: 768px) {
  .site-nav-links, .site-nav-actions { display: none; }
  .nav-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .portal-layout { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; }
  .download-card { flex-wrap: wrap; }
  .download-actions { width: 100%; }
  .admin-content { padding: var(--gap-md); }
  .admin-page-header { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control { width: 100%; }
}
@media (max-width: 480px) {
  .site-shell { padding: 0 16px var(--gap-lg); }
  .card { padding: var(--gap-md); }
  .form-card { padding: var(--gap-md); }
  .hero { padding: var(--gap-lg) 0; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* ── 404 Error Page ─────────────────────────────────────── */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 200px);
  display: flex;
  align-items: center;
  padding: var(--gap-xl) 0;
}
.error-page-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--gap-lg);
}
.error-code-wrap {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  line-height: 1;
}
.error-digit {
  font-size: clamp(96px, 18vw, 160px);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--text);
  opacity: 0.12;
  font-variant-numeric: tabular-nums;
}
.error-icon-center {
  width: clamp(64px, 12vw, 100px);
  height: clamp(64px, 12vw, 100px);
  flex-shrink: 0;
  filter: drop-shadow(0 0 24px rgba(231,76,60,0.4));
  animation: error-pulse 3s ease-in-out infinite;
}
.error-icon-center svg {
  width: 100%;
  height: 100%;
}
@keyframes error-pulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(231,76,60,0.35)); }
  50%       { filter: drop-shadow(0 0 36px rgba(231,76,60,0.65)); }
}
.error-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
}
.error-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 440px;
  margin: 0;
}
.error-actions {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  justify-content: center;
}
.error-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.error-links {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.875rem;
}
.error-links-label {
  color: var(--text-dim);
}
.error-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.error-links a:hover { color: var(--red-soft); }
@media (max-width: 480px) {
  .error-actions { flex-direction: column; width: 100%; }
  .error-actions .btn { width: 100%; justify-content: center; }
}

/* ================================================================
   Ops shared components — Stripe-style
   ================================================================ */

/* ── Metrics strip ──────────────────────────────────────────── */
.metrics-strip {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--gap-md);
}
.metric-cell {
  flex: 1; padding: 1rem 1.25rem;
  border-right: 1px solid var(--line); min-width: 0;
}
.metric-cell:last-child { border-right: none; }
.metric-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: .3rem;
}
.metric-value {
  font-size: 1.55rem; font-weight: 700; letter-spacing: -.04em;
  line-height: 1; color: var(--text);
}
.metric-value.ok   { color: var(--ok); }
.metric-value.warn { color: var(--warn); }
.metric-value.info { color: var(--info); }
@media (max-width: 768px) {
  .metrics-strip { flex-wrap: wrap; }
  .metric-cell   { flex: 1 1 calc(50% - 1px); border-bottom: 1px solid var(--line); }
  .metric-cell:nth-last-child(-n+2) { border-bottom: none; }
}

/* ── Filter strip ───────────────────────────────────────────── */
.filter-strip {
  display: flex; gap: .5rem; align-items: center;
  flex-wrap: wrap; margin-bottom: var(--gap-md);
}
.filter-strip .form-control {
  height: 34px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line-med);
  border-radius: var(--r-sm); color: var(--text);
  padding: 0 .75rem; outline: none; transition: border-color .15s;
}
.filter-strip .form-control:focus { border-color: rgba(255,255,255,.25); }
.filter-strip .search-wrap {
  flex: 1; min-width: 200px; max-width: 300px; position: relative;
}
.filter-strip .search-wrap svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); pointer-events: none; color: var(--text-dim);
}
.filter-strip .search-wrap input { padding-left: 30px; width: 100%; }

/* ── Ops table ──────────────────────────────────────────────── */
.ops-table { width: 100%; border-collapse: collapse; }
.ops-table thead tr { border-bottom: 1px solid var(--line); }
.ops-table th {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-dim);
  padding: .65rem 1rem; text-align: left; white-space: nowrap;
}
.ops-table th:first-child { padding-left: 1.25rem; }
.ops-table th.right        { text-align: right; }
.ops-table tbody tr {
  border-bottom: 1px solid var(--line); transition: background .1s;
}
.ops-table tbody tr:last-child { border-bottom: none; }
.ops-table tbody tr.clickable { cursor: pointer; }
.ops-table tbody tr.clickable:hover { background: rgba(255,255,255,.025); }
.ops-table tbody tr:not(.clickable):hover { background: rgba(255,255,255,.015); }
.ops-table td {
  padding: .8rem 1rem; font-size: 13px;
  color: var(--text); vertical-align: middle;
}
.ops-table td:first-child { padding-left: 1.25rem; }
.ops-table td.right        { text-align: right; }
.ops-table td.muted        { color: var(--text-muted); }
.ops-table td.mono         { font-family: var(--font-mono); font-size: 12px; }
.ops-table .row-chevron {
  color: var(--text-dim); opacity: 0; transition: opacity .12s, transform .12s;
}
.ops-table tr.clickable:hover .row-chevron {
  opacity: 1; transform: translateX(2px);
}
.ops-empty {
  padding: 3.5rem 2rem; text-align: center;
}
.ops-empty svg { width: 36px; height: 36px; color: var(--text-dim); margin: 0 auto .75rem; }
.ops-empty p { color: var(--text-muted); font-size: 13.5px; }

/* ── Status pill ────────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--r-pill); white-space: nowrap;
}
.pill-paid, .pill-active      { background: var(--ok-alpha);               color: var(--ok);      }
.pill-pending                  { background: var(--warn-alpha);             color: var(--warn);    }
.pill-failed, .pill-cancelled,
.pill-revoked                  { background: var(--danger-alpha);           color: var(--danger);  }
.pill-refunded, .pill-inactive,
.pill-expired, .pill-neutral   { background: rgba(255,255,255,.07);         color: var(--text-muted); }
.pill-processed, .pill-stable  { background: var(--ok-alpha);               color: var(--ok);      }
.pill-received                 { background: var(--info-alpha);             color: var(--info);    }
.pill-beta, .pill-nightly      { background: var(--warn-alpha);             color: var(--warn);    }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.dot-paid, .dot-active, .dot-processed { background: var(--ok); box-shadow: 0 0 5px var(--ok); }
.dot-pending, .dot-received    { background: var(--warn); }
.dot-failed, .dot-cancelled,
.dot-revoked                   { background: var(--danger); }
.dot-refunded, .dot-inactive,
.dot-expired                   { background: var(--text-dim); }
.dot-blue                      { background: var(--info); box-shadow: 0 0 5px var(--info); }

/* ── Detail section ─────────────────────────────────────────── */
.detail-section {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--gap-md);
}
.detail-section:last-child { margin-bottom: 0; }
.detail-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem; border-bottom: 1px solid var(--line);
}
.detail-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim);
}
.meta-row {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .65rem 1.25rem; border-bottom: 1px solid var(--line);
}
.meta-row:last-child { border-bottom: none; }
.meta-key {
  font-size: 12px; color: var(--text-dim); min-width: 140px;
  flex-shrink: 0; font-weight: 500;
}
.meta-val {
  font-size: 13px; color: var(--text); flex: 1; min-width: 0;
  word-break: break-all; display: flex; align-items: center; gap: .5rem;
}
.meta-val.mono  { font-family: var(--font-mono); font-size: 12px; }
.meta-val.muted { color: var(--text-muted); }
.inline-copy {
  background: none; border: none; padding: 2px 5px; border-radius: 4px;
  cursor: pointer; color: var(--text-dim); transition: color .12s, background .12s;
  flex-shrink: 0;
}
.inline-copy:hover { color: var(--text); background: var(--panel); }
