/* =========================================
   HOPLY — Design System
   ========================================= */

:root {
  --bg: #07080c;
  --surface: #0e1117;
  --surface-2: #141820;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 229, 212, 0.3);
  --text: #eceef2;
  --text-muted: #7a8694;
  --text-dim: #4e5a66;
  --cyan: #00E5D4;
  --cyan-glow: rgba(0, 229, 212, 0.15);
  --cyan-dark: #00b8ac;
  --lime: #c8ff5a;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 75% -10%, rgba(0, 229, 212, 0.055) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 10% 80%, rgba(0, 180, 168, 0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(48px, 6.5vw, 88px);
  line-height: 1.0;
}

h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--cyan) 0%, #a0ffe8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(32px, 4.5vw, 58px);
  line-height: 1.08;
}

h3 { font-size: 20px; font-weight: 600; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
  margin-top: 12px;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--cyan);
  color: #030a09;
  padding: 13px 22px;
  font-size: 14px;
  box-shadow: 0 0 0 0 var(--cyan-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(0, 229, 212, 0.3);
  opacity: 0.92;
}
.btn-secondary {
  background: transparent;
  color: var(--text-2);
  padding: 11px 20px;
  font-size: 14px;
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.group-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 15px;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 13px 22px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn-ghost.btn-lg { padding: 16px 28px; font-size: 15px; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 13px 22px;
  font-size: 14px;
}
.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.btn-full { width: 100%; justify-content: center; }

.ghost-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s;
}
.ghost-link:hover { color: var(--text); }

/* =========================================
   NAV
   ========================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 5vw;
  height: 68px;
  background: rgba(7, 8, 12, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0cbfb5, #00E5D4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand { justify-self: start; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: center;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  justify-self: end;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  background: rgba(9, 10, 15, 0.98);
  border-bottom: 1px solid var(--border);
  z-index: 49;
  padding: 16px 5vw 24px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border: none; margin-top: 12px; }

/* =========================================
   LAYOUT HELPERS
   ========================================= */
.section {
  padding: 100px 5vw;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header .section-sub {
  margin: 12px auto 0;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  padding: 80px 5vw 100px;
  position: relative;
  z-index: 1;
}

.hero-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-accent);
  background: rgba(0, 229, 212, 0.06);
  color: var(--cyan);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 212, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(0, 229, 212, 0); }
}

.hero-copy h1 {
  margin-bottom: 20px;
}

.lead {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
}

.stat {
  padding-right: 28px;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.stat span {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 28px 0 0;
  flex-shrink: 0;
}

/* FLOW CARD */
.hero-visual {
  display: flex;
  justify-content: flex-end;
}

.flow-card {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 229, 212, 0.06);
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.4s ease;
}

.flow-card:hover {
  transform: perspective(1200px) rotateY(-1deg) rotateX(0deg);
}

.flow-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dots { display: flex; gap: 6px; }
.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  list-style: none;
}

.url-bar {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.url-accent { color: var(--cyan); }

.live-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--lime);
  background: rgba(200, 255, 90, 0.1);
  border: 1px solid rgba(200, 255, 90, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.flow-body { padding: 24px; }

.flow-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.flow-diagram {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.flow-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.3s ease;
}

.flow-node-icon {
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

.fn-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.fn-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.flow-source { border-color: rgba(0, 229, 212, 0.3); background: rgba(0, 229, 212, 0.06); }
.flow-source .flow-node-icon { color: var(--cyan); }

.flow-mid { background: rgba(255, 255, 255, 0.03); }

.flow-success { border-color: rgba(200, 255, 90, 0.3); background: rgba(200, 255, 90, 0.06); }
.flow-success .flow-node-icon { color: var(--lime); }

.flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  flex-shrink: 0;
  position: relative;
}

.flow-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.flow-packet {
  position: absolute;
  top: -2px;
  left: -10px;
  width: 10px;
  height: 6px;
  background: var(--cyan);
  border-radius: 3px;
  animation: movePacket 2.4s ease-in-out infinite;
  box-shadow: 0 0 8px var(--cyan);
}

#pkt-2 { animation-delay: 1.2s; }

@keyframes movePacket {
  0% { left: -10px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.flow-rule {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.flow-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.fmetric { text-align: center; }
.fmetric-val {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.fmetric-val.accent { color: var(--cyan); }
.fmetric-val.positive { color: var(--lime); }
.fmetric-val.muted { color: var(--text-muted); }
.fmetric-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
  display: block;
}

/* =========================================
   LOGOS BAR
   ========================================= */
.logos-section {
  padding: 32px 5vw 48px;
  text-align: center;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

.logos-section p {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.marquee {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
  will-change: transform;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track span {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =========================================
   HOW IT WORKS
   ========================================= */
.how-section {
  border-top: 1px solid var(--border);
}

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.step {
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}

.step:hover {
  border-color: rgba(0, 229, 212, 0.2);
  transform: translateY(-3px);
}

.step-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--cyan);
  opacity: 0.4;
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: -0.04em;
}

.step-content h3 {
  margin-bottom: 10px;
}

.step-content p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.step-arrow {
  font-size: 24px;
  color: var(--border);
  padding: 0 16px;
  flex-shrink: 0;
}

/* =========================================
   FEATURES
   ========================================= */
.features-section {
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.features-intro {
  position: sticky;
  top: 100px;
}

.features-intro h2 { margin-bottom: 16px; }

.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feat-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}

.feat-card:hover {
  border-color: rgba(0, 229, 212, 0.2);
  background: rgba(0, 229, 212, 0.03);
}

.feat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 212, 0.1);
  color: var(--cyan);
  margin-bottom: 18px;
}

.feat-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.feat-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* =========================================
   ENGINE SECTION
   ========================================= */
.engine-section {
  border-top: 1px solid var(--border);
}

.engine-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.engine-card, .params-card {
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.engine-card h2 { margin-bottom: 32px; }
.params-card h3 { margin-bottom: 14px; font-size: 24px; letter-spacing: -0.03em; }
.params-card > p { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }

.rule-table { display: flex; flex-direction: column; gap: 8px; }

.rule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.rule-row:hover { background: rgba(0, 229, 212, 0.04); }

.rule-condition, .rule-then {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rule-condition { flex: 1; }
.rule-then { flex: 1; }

.rule-kw {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  min-width: 20px;
}

.rule-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.rule-action {
  font-size: 14px;
  color: var(--text-muted);
}

.code-block {
  background: #040608;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 2;
}

.code-comment { color: var(--text-dim); }
.code-key { color: var(--cyan); }
.code-val { color: #c8ff5a; }

.params-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.params-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.params-stats div span {
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================
   SECURITY
   ========================================= */
.security-section {
  border-top: 1px solid var(--border);
}

.security-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.security-copy h2 { margin-bottom: 20px; }
.security-copy p { font-size: 16px; color: var(--text-muted); line-height: 1.7; }

.security-items { display: flex; flex-direction: column; gap: 12px; }

.sec-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s;
}

.sec-item:hover { border-color: rgba(0, 229, 212, 0.2); }

.sec-check {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
  margin-top: 1px;
}

/* =========================================
   PRICING
   ========================================= */
.pricing-section {
  border-top: 1px solid var(--border);
}

.pricing-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
  margin: 0 auto 48px;
}

.ptoggle {
  padding: 8px 20px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.ptoggle.active {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.save-badge {
  font-size: 11px;
  background: rgba(200, 255, 90, 0.15);
  color: var(--lime);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  font-weight: 600;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}

.pricing-cards-4 { /* 4-column alias — same as .pricing-cards base */ }

.pricing-cards-5 {
  grid-template-columns: repeat(5, 1fr);
  max-width: 1320px;
  gap: 14px;
}

.pricing-cards-5 .pcard { padding: 24px 20px; }
.pricing-cards-5 .pcard-price strong { font-size: 36px; }

.pricing-note {
  max-width: 760px;
  margin: 28px auto 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Gradient hover border on pricing buttons (double-background technique) */
.pcard .btn {
  border: 2px solid transparent;
}

.pcard .btn-outline { border-color: var(--border); }

.pcard .btn:hover:not([disabled]) {
  border-color: transparent;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #00E5D4 0%, #a0ffe8 35%, #4db8ff 70%, #00E5D4 100%) border-box;
  background-size: 100% 100%, 250% 250%;
  color: var(--text);
  box-shadow: 0 10px 32px rgba(0, 229, 212, 0.28);
  transform: translateY(-1px);
  animation: gradShift 2.5s ease infinite;
}

.pcard .btn-primary:hover:not([disabled]) {
  background:
    linear-gradient(var(--cyan), var(--cyan)) padding-box,
    linear-gradient(135deg, #ffffff 0%, #a0ffe8 40%, #4db8ff 80%, #ffffff 100%) border-box;
  background-size: 100% 100%, 250% 250%;
  color: #030a09;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%, 0% 50%; }
  50% { background-position: 0% 50%, 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard .btn:hover:not([disabled]),
  .pcard:not(.pcard-featured):hover,
  .pcard-featured { animation: none; }
}

body.light .pcard:not(.pcard-featured):hover {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #00a89b 0%, #4db8ff 60%, #00a89b 100%) border-box;
  background-size: 100% 100%, 250% 250%;
}

body.light .pcard-featured {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #00a89b 0%, #4db8ff 60%, #00a89b 100%) border-box;
  background-size: 100% 100%, 250% 250%;
}

body.light .pcard .btn:hover:not([disabled]) {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #00a89b 0%, #4db8ff 60%, #00a89b 100%) border-box;
  background-size: 100% 100%, 250% 250%;
}

body.light .pcard .btn-primary:hover:not([disabled]) {
  background:
    linear-gradient(var(--cyan), var(--cyan)) padding-box,
    linear-gradient(135deg, #ffffff 0%, #4db8ff 60%, #ffffff 100%) border-box;
  background-size: 100% 100%, 250% 250%;
  color: #fff;
}

/* Equal-height pricing cards */
.pricing-cards, .pricing-cards-5, .app-plan-cards { align-items: stretch; }

.pcard {
  display: flex;
  flex-direction: column;
}

.pcard-features { flex: 1; }
.pcard > .btn { margin-top: auto; }

.pcard-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime);
  background: rgba(200, 255, 90, 0.08);
  border: 1px solid rgba(200, 255, 90, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

body.light .pcard-tag { color: #4a7a00; background: rgba(74, 122, 0, 0.07); border-color: rgba(74, 122, 0, 0.3); }

.pcard {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  position: relative;
  transition: transform 0.25s;
}

/* Gradient border on card hover */
.pcard:not(.pcard-featured):hover {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #00E5D4 0%, #a0ffe8 35%, #4db8ff 70%, #00E5D4 100%) border-box;
  background-size: 100% 100%, 250% 250%;
  animation: gradShift 2.5s ease infinite;
  transform: translateY(-4px);
}

/* Featured card: gradient border always on, no fill */
.pcard-featured {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #00E5D4 0%, #a0ffe8 35%, #4db8ff 70%, #00E5D4 100%) border-box;
  background-size: 100% 100%, 250% 250%;
  animation: gradShift 2.5s ease infinite;
  transform: translateY(-8px);
}

.pcard-featured:hover { transform: translateY(-12px); }

.pcard-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cyan);
  color: #030a09;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.pcard-header h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.pcard-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.pcard-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}

.pcard-price strong {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.pcard-price span {
  font-size: 14px;
  color: var(--text-muted);
}

.pcard-annual-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}

.pcard-features {
  list-style: none;
  margin: 20px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pcard-features li {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pcard-features li::before {
  content: '✓';
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.pcard-features li.disabled {
  color: var(--text-dim);
  text-decoration: line-through;
}

.pcard-features li.disabled::before {
  color: var(--text-dim);
  content: '–';
}

/* =========================================
   FAQ
   ========================================= */
.faq-section {
  border-top: 1px solid var(--border);
}

.faq-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.faq-header {
  position: sticky;
  top: 100px;
}

.faq-header h2 { margin-top: 12px; }

.faq-list { display: flex; flex-direction: column; gap: 0; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-item summary {
  cursor: pointer;
  padding: 22px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--cyan);
}

.faq-item p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  padding-bottom: 22px;
}

/* =========================================
   WAITLIST
   ========================================= */
.waitlist-section {
  padding: 100px 5vw;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.waitlist-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.waitlist-glow {
  position: absolute;
  width: 600px;
  height: 400px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(0, 229, 212, 0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.waitlist-inner h2 {
  margin: 12px auto 16px;
}

.waitlist-inner > p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.7;
}

.signup-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.signup-form input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 0 20px;
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.15s;
  height: 52px;
}

.signup-form input:focus {
  outline: none;
  border-color: var(--border-accent);
}

.signup-form input::placeholder { color: var(--text-dim); }

.signup-success {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 16px;
}

.signup-success.visible { display: flex; }

/* =========================================
   FOOTER
   ========================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 5vw 28px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text); }
.footer-col .brand { margin-bottom: 4px; }

.footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 260px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
}

/* =========================================
   SCROLL ANIMATIONS
   ========================================= */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero { min-height: auto; padding: 60px 5vw 80px; }
  .hero-visual { justify-content: center; }
  .flow-card { max-width: 100%; transform: none; }
  .flow-card:hover { transform: none; }
  .features-grid { grid-template-columns: 1fr; }
  .features-intro { position: static; }
  .engine-inner { grid-template-columns: 1fr; }
  .security-inner { grid-template-columns: 1fr; gap: 48px; }
  .faq-inner { grid-template-columns: 1fr; gap: 32px; }
  .faq-header { position: static; }
  .pricing-cards, .pricing-cards-5 { grid-template-columns: repeat(2, 1fr); }
  .pcard-featured { transform: none; }
  .pcard-featured:hover { transform: translateY(-4px); }
}

@media (max-width: 768px) {
  .nav { display: flex; justify-content: space-between; }
  .nav-links, .nav-actions { display: none; }
  .hamburger { display: flex; }
  .section { padding: 72px 5vw; }
  .steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
  .feature-cards { grid-template-columns: 1fr; }
  .pricing-cards, .pricing-cards-5 { grid-template-columns: 1fr; }
  .signup-form { flex-direction: column; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .stat-divider { display: none; }
  .flow-metrics { grid-template-columns: repeat(2, 1fr); }
  .flow-diagram { flex-wrap: nowrap; overflow-x: auto; }
}

@media (max-width: 480px) {
  h1 { font-size: 40px; }
  h2 { font-size: 30px; }
  .hero-cta { flex-direction: column; }
  .btn-lg { width: 100%; justify-content: center; }
}

/* =========================================
   UTILITIES (CSP-safe: no inline styles)
   ========================================= */
.eyebrow-center { text-align: center; }
.features-cta { margin-top: 32px; }
.is-hidden { display: none !important; }
.nav-links a.nav-active { color: var(--text); }

/* Honeypot — visually removed, still in DOM for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.signup-error, .demo-error {
  font-size: 14px;
  font-weight: 500;
  color: #ff7a7a;
  margin-top: 12px;
}

/* =========================================
   ADVANTAGE BENTO
   ========================================= */
.advantage-section { border-top: 1px solid var(--border); }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.bento-cell {
  grid-column: span 1;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.bento-cell:hover {
  border-color: rgba(0, 229, 212, 0.25);
  background: rgba(0, 229, 212, 0.03);
  transform: translateY(-3px);
}

.bento-wide { grid-column: span 2; }

.bento-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 18px;
}

.bento-tag strong { color: var(--lime); font-weight: 700; }

.bento-cell h3 { font-size: 19px; margin-bottom: 10px; }

.bento-cell p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.autofill-demo {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.af-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #040608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
}

.af-label { color: var(--text-dim); min-width: 70px; }
.af-value { color: var(--text); font-family: 'SF Mono', 'Fira Code', monospace; }
.af-type::after {
  content: '|';
  color: var(--cyan);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.af-key {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 3px 10px;
}

.pay-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.pay-chip {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #040608;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* =========================================
   LIVE DEMO
   ========================================= */
.demo-section { border-top: 1px solid var(--border); }

.demo-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

.demo-copy h2 { margin-bottom: 8px; }

.demo-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.demo-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.demo-input-row { display: flex; gap: 10px; }

.demo-input-row input {
  flex: 1;
  min-width: 0;
  background: #040608;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 0 20px;
  font-size: 14px;
  font-family: var(--font-body);
  height: 48px;
  transition: border-color 0.15s;
}

.demo-input-row input:focus { outline: none; border-color: var(--border-accent); }
.demo-input-row input::placeholder { color: var(--text-dim); }

.demo-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.demo-link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.demo-link-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.demo-link {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.07);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 8px 18px;
  word-break: break-all;
}

.demo-routes { display: flex; flex-direction: column; gap: 8px; }

.demo-route {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 14px;
}

.dr-platform { font-weight: 500; color: var(--text); flex: 1; }
.dr-arrow { color: var(--cyan); }
.dr-action { color: var(--text-muted); flex: 1; text-align: right; }

.demo-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.proof-strip {
  max-width: 1100px;
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  background: rgba(0, 229, 212, 0.04);
}

.proof-copy {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.proof-copy strong { color: var(--text); }

/* =========================================
   ANALYTICS DASHBOARD PREVIEW
   ========================================= */
.analytics-section { border-top: 1px solid var(--border); }

.dash-card {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 229, 212, 0.05);
}

.dash-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dash-body { padding: 28px; }

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.dash-kpi {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.dash-kpi strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.dash-kpi-delta { font-size: 12px; font-weight: 600; }
.dash-kpi-delta.up { color: var(--lime); }
.dash-kpi-delta.down { color: var(--text-muted); }

.dash-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.dash-chart, .dash-side {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
}

.dash-chart-title, .dash-side-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.dash-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
}

.dash-bars i {
  flex: 1;
  height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--cyan), rgba(0, 229, 212, 0.25));
  opacity: 0.85;
  transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-bars i:nth-child(even) { opacity: 0.55; }

.dash-source {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.dash-source span { min-width: 76px; color: var(--text-muted); }
.dash-source em { font-style: normal; color: var(--text); font-weight: 600; min-width: 36px; text-align: right; }

.dash-meter {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dash-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--cyan);
}

.dash-meter .w72 { width: 72%; }
.dash-meter .w58 { width: 58%; }
.dash-meter .w30 { width: 30%; }
.dash-meter .w18 { width: 18%; }
.dash-meter .w8 { width: 8%; }

/* =========================================
   COMPARISON TABLE
   ========================================= */
.compare-section { border-top: 1px solid var(--border); }

.compare-wrap {
  max-width: 1000px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.compare-table th, .compare-table td {
  padding: 16px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.compare-table tbody th {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

.compare-table td { color: var(--text-dim); }

.compare-table tr:last-child th,
.compare-table tr:last-child td { border-bottom: none; }

.compare-table .compare-hoply {
  color: var(--cyan);
  font-weight: 600;
  background: rgba(0, 229, 212, 0.05);
}

.compare-table thead .compare-hoply {
  color: var(--cyan);
  font-size: 15px;
}

/* =========================================
   SECURITY BADGES
   ========================================= */
.sec-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.sec-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.07);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 6px 14px;
}

/* =========================================
   TESTIMONIALS
   ========================================= */
.testimonials-section { border-top: 1px solid var(--border); }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.tcard {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.tcard:hover { border-color: rgba(0, 229, 212, 0.2); transform: translateY(-3px); }

.tcard blockquote {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.tcard figcaption { display: flex; flex-direction: column; gap: 2px; }
.tname { font-weight: 600; font-size: 14px; color: var(--text); }
.trole { font-size: 13px; color: var(--text-muted); }

/* =========================================
   RESPONSIVE — NEW SECTIONS
   ========================================= */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-wide { grid-column: span 2; }
  .demo-inner { grid-template-columns: 1fr; gap: 36px; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-main { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .bento { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
  .demo-input-row { flex-direction: column; }
  .demo-input-row input { height: 52px; }
  .dr-action { text-align: left; }
  .demo-route { flex-wrap: wrap; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* =========================================
   AUTH (login page)
   ========================================= */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.auth-title {
  font-size: 28px;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 18px 0 8px;
}

.auth-label:first-of-type { margin-top: 0; }

.auth-input {
  width: 100%;
  background: #040608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 16px;
  font-size: 14px;
  font-family: var(--font-body);
  height: 48px;
  transition: border-color 0.15s;
}

.auth-input:focus { outline: none; border-color: var(--border-accent); }
.auth-input::placeholder { color: var(--text-dim); }

.auth-error {
  font-size: 14px;
  font-weight: 500;
  color: #ff7a7a;
  margin-top: 14px;
}

/* Remember me */
.auth-remember {
  margin-top: 16px;
}
.auth-check-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.auth-check-label:hover { color: var(--text); }
.auth-checkbox { display: none; }
.auth-check-box {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.auth-check-box::after {
  content: '';
  width: 5px; height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition: opacity 0.1s;
}
.auth-checkbox:checked + .auth-check-box {
  background: var(--cyan);
  border-color: var(--cyan);
}
.auth-checkbox:checked + .auth-check-box::after { opacity: 1; }

.auth-submit { margin-top: 22px; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }

.auth-note {
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.auth-note a { color: var(--cyan); font-weight: 600; }

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

/* Google OAuth button */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
  font-family: inherit;
}
.auth-google-btn:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-label-hint { color: var(--text-dim); font-weight: 400; }

.auth-demo-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

/* =========================================
   APP DASHBOARD
   ========================================= */
.app-body { overflow-x: hidden; }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.side-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 14px 12px 6px;
}

.side-link {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.side-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.side-link.active {
  background: rgba(0, 229, 212, 0.08);
  color: var(--cyan);
  font-weight: 600;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.side-user { display: flex; align-items: center; gap: 10px; padding: 0 4px; }

.side-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0cbfb5, #00E5D4);
  color: #030a09;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.side-user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.side-user-plan { font-size: 12px; color: var(--text-dim); }

.app-main {
  padding: 32px 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-title { font-size: 26px; }
.app-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.app-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.app-charts { display: grid; }

.app-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.app-card-title {
  font-size: 17px;
  margin-bottom: 18px;
}

.create-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.create-field .auth-label { margin-top: 0; }

.slug-wrap { display: flex; align-items: center; }

.slug-prefix {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--text-dim);
}

.slug-input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.create-btn { height: 48px; }

.links-table-wrap { overflow-x: auto; }

.links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.links-table th, .links-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.links-table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.link-slug {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.07);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.link-dest {
  color: var(--text-muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-recovered { color: var(--lime); font-weight: 600; }

.link-actions { text-align: right; white-space: nowrap; }

.mini-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
  margin-left: 6px;
}

.mini-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }

.mini-btn-danger:hover {
  color: #ff7a7a;
  border-color: rgba(255, 122, 122, 0.4);
  background: rgba(255, 122, 122, 0.06);
}

.links-empty {
  padding: 28px 0 8px;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}

.app-demo-note { margin-top: 8px; }

@media (max-width: 1024px) {
  .app-kpis { grid-template-columns: repeat(2, 1fr); }
  .create-row { grid-template-columns: 1fr; align-items: stretch; }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: static;
    height: auto;
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .app-main { padding: 24px 5vw 40px; }
  .app-kpis { grid-template-columns: 1fr 1fr; }
}

/* =========================================
   DASHBOARD v2 — links-first manager
   ========================================= */
.side-btn,
button.side-link {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

button.side-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
button.side-link.active { background: rgba(0, 229, 212, 0.08); color: var(--cyan); font-weight: 600; }
body.light button.side-link:hover { background: rgba(10, 30, 40, 0.04); }
body.light button.side-link.active { background: rgba(0, 168, 155, 0.1); }

.side-usage {
  margin: 14px 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.side-usage-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.side-usage-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 8px;
}

.side-usage-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--cyan);
  transition: width 0.4s ease;
}

.side-usage-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.side-usage-plan { color: var(--cyan); font-weight: 600; }

.topbar-actions { display: flex; gap: 10px; }

.create-card { border-color: var(--border-accent); }
.create-row-2 { margin-top: 14px; grid-template-columns: 1fr 1.4fr auto; }

/* Toolbar */
.links-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 44px;
  color: var(--text-dim);
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  height: 100%;
}

.search-wrap input:focus { outline: none; }
.search-wrap:focus-within { border-color: var(--border-accent); }
.search-wrap input::placeholder { color: var(--text-dim); }

.toolbar-select {
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  padding: 0 12px;
  cursor: pointer;
}

.toolbar-select:focus { outline: none; border-color: var(--border-accent); }

.links-found {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Groups */
.groups-container { display: flex; flex-direction: column; gap: 14px; }

.group-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--text);
  text-align: left;
}

.group-head:hover { background: rgba(255, 255, 255, 0.02); }

.group-chevron {
  color: var(--text-dim);
  font-size: 12px;
  transition: transform 0.2s;
}
.group-chevron.closed { transform: rotate(-90deg); }

.group-name { font-size: 16px; font-weight: 600; flex: 1; }

.group-count {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 4px 12px;
}

/* Link rows */
.link-row-wrap { border-top: 1px solid var(--border); }

.link-row {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 0.7fr 1.2fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 20px;
}

.link-row-header {
  padding: 10px 20px 8px;
  border-top: 1px solid var(--border);
}

.lcell { min-width: 0; }

.lcell-h {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lcell-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.status-dot.on { background: #3ddc84; box-shadow: 0 0 8px rgba(61, 220, 132, 0.5); }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}
.icon-btn:hover { color: var(--cyan); }

/* Link row — Analytics + Gear buttons */
.link-an-btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.link-an-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,229,212,0.06);
}
.link-an-btn-active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,229,212,0.08);
}
.link-gear-btn {
  appearance: none; -webkit-appearance: none;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px; border-radius: 6px;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.link-gear-btn:hover { color: var(--text); }

body.light .link-an-btn { background: rgba(0,0,0,0.03); }
body.light .link-an-btn:hover { background: rgba(0,229,212,0.08); }

.lcell-dest {
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lcell-type { font-size: 13px; color: var(--text-dim); }

.notes-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 8px 12px;
  transition: border-color 0.15s;
}
.notes-input:focus { outline: none; border-color: var(--border-accent); }
.notes-input::placeholder { color: var(--text-dim); }

.lcell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.link-row-paused .link-slug { opacity: 0.5; }
.link-row-paused .lcell-dest { opacity: 0.5; }

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s;
  cursor: pointer;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.switch input:checked + .switch-slider { background: #3ddc84; }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Per-link analytics panel */
.link-analytics {
  padding: 18px 20px 22px;
  border-top: 1px dashed var(--border);
  background: rgba(0, 229, 212, 0.02);
}

.la-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.la-kpi {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.la-kpi-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.la-kpi strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.03em;
}

.la-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
}

.la-chart, .la-sources {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px 16px;
}

.la-chart-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.la-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 80px;
}

.la-bars i {
  flex: 1;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, var(--cyan), rgba(0, 229, 212, 0.25));
  opacity: 0.85;
}

.la-bars i:nth-child(even) { opacity: 0.55; }

/* =========================================
   DASHBOARD v3 — views, icons, sections
   ========================================= */
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-link svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.side-link.active svg { opacity: 1; }

.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view[hidden] { display: none; }

/* Stack lists (domains, team, invoices, security) */
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.stack-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-body);
}

.stack-sub {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.stack-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.badge-ok {
  color: #3ddc84;
  background: rgba(61, 220, 132, 0.1);
  border: 1px solid rgba(61, 220, 132, 0.3);
}

.badge-pending {
  color: #ffce6b;
  background: rgba(255, 206, 107, 0.08);
  border: 1px solid rgba(255, 206, 107, 0.3);
}

.inline-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.07);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 2px 8px;
}

/* Domains / team create rows */
.create-row-domain { grid-template-columns: 1fr auto; }
.create-row-team { grid-template-columns: 1.2fr 1fr auto; }

.toolbar-select-full {
  width: 100%;
  height: 48px;
  cursor: pointer;
}

/* API view */
.api-key-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.api-key {
  flex: 1;
  min-width: 240px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--cyan);
  background: #040608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-actions { display: flex; gap: 6px; }

.api-code { margin-bottom: 18px; }

.api-endpoints {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.api-endpoint code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text);
}

.api-method {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 3px 9px;
  min-width: 52px;
  text-align: center;
}

.api-desc {
  margin-left: auto;
  color: var(--text-dim);
}

/* Profile v2 (Bouncy-style) */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.crumb-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.crumb-link:hover { color: var(--cyan); }
.crumb-current { color: var(--text); font-weight: 500; }

.acc-card { padding: 0; overflow: hidden; }

.acc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.acc-summary::-webkit-details-marker { display: none; }
.acc-summary:hover { background: rgba(255, 255, 255, 0.02); }

.acc-chevron {
  color: var(--text-dim);
  font-size: 13px;
  transition: transform 0.2s;
}
.acc-card[open] .acc-chevron { transform: rotate(180deg); }

.acc-body {
  padding: 4px 24px 24px;
  max-width: 560px;
}

.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head-row .app-card-title { margin-bottom: 4px; }
.tfa-title { margin-bottom: 2px; }

.card-center {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.sub-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sub-tile {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.sub-tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.sub-tile-head svg { color: var(--cyan); flex-shrink: 0; }

.sub-tile-line {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.sub-tile-amount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.danger-card { border-color: rgba(255, 122, 122, 0.25); }

.danger-note {
  padding: 14px 16px;
  border: 1px solid rgba(255, 122, 122, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(255, 122, 122, 0.05);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.danger-note strong { color: #ff9b9b; }

.danger-sub { margin-bottom: 4px; }

.btn-danger {
  color: #ff7a7a;
  border-color: rgba(255, 122, 122, 0.4);
}
.btn-danger:hover {
  background: rgba(255, 122, 122, 0.08);
  border-color: rgba(255, 122, 122, 0.6);
}

/* Status page */
.status-wrap { max-width: 560px; }
.status-card { width: 100%; }

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.status-head .auth-title { margin-bottom: 0; }
.status-note { margin-top: 20px; }
.status-back { color: var(--cyan); font-weight: 600; }

/* Advanced link options */
.adv-opts {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.adv-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.adv-summary::-webkit-details-marker { display: none; }

/* Chevron icon */
.adv-summary::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='currentColor' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='currentColor' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  opacity: 0.5;
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* Cyan dot indicator */
.adv-summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

.adv-opts[open] .adv-summary::after { transform: rotate(180deg); }
.adv-opts[open] .adv-summary { color: var(--text); border-bottom: 1px solid var(--border); }
.adv-summary:hover { background: rgba(255,255,255,0.03); color: var(--text); }

.adv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
}

.adv-block {
  padding: 18px 20px 20px;
  border-right: 1px solid var(--border);
}

.adv-block:last-child { border-right: none; }

.adv-block .auth-label {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.adv-block .auth-label:first-of-type { margin-top: 0; }

.adv-block .auth-input {
  margin-top: 4px;
  background: rgba(255,255,255,0.03);
}

.adv-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.geo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.geo-cc {
  width: 60px;
  flex-shrink: 0;
  text-transform: uppercase;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lime);
  background: rgba(200, 255, 90, 0.08);
  border: 1px solid rgba(200, 255, 90, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .adv-grid { grid-template-columns: 1fr; }
  .adv-block { border-right: none; border-bottom: 1px solid var(--border); }
  .adv-block:last-child { border-bottom: none; }
}

body.light .adv-opts { background: rgba(10, 30, 40, 0.02); border-color: var(--border); }
body.light .adv-block { border-right-color: var(--border); }
body.light .adv-opts[open] .adv-summary { border-bottom-color: var(--border); }
body.light .adv-title { border-bottom-color: var(--border); }
body.light .chip { color: #4a7a00; background: rgba(74, 122, 0, 0.07); border-color: rgba(74, 122, 0, 0.3); }

/* Affiliate */
.aff-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.aff-step {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.aff-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--cyan);
  background: rgba(0, 229, 212, 0.08);
  border: 1px solid var(--border-accent);
  margin-bottom: 16px;
}

.aff-step h3 { font-size: 16px; margin-bottom: 8px; }

.aff-step p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

.aff-sub { margin: -8px 0 16px; }
.aff-input { max-width: 480px; }
.aff-hint { margin-top: 8px; }

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.terms-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--cyan);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.terms-row span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.aff-tiles { margin-top: 18px; }

@media (max-width: 900px) {
  .aff-steps { grid-template-columns: 1fr; }
}

body.light .terms-row { background: rgba(10, 30, 40, 0.02); }
body.light .aff-num { background: rgba(0, 168, 155, 0.08); }

/* In-app pricing */
.pricing-head-app { text-align: center; margin-bottom: 18px; }
.app-pricing-toggle { margin: 0 auto 24px; }

.app-plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: start;
}

.app-plan-cards .pcard { padding: 22px 18px; }
.app-plan-cards .pcard-price strong { font-size: 32px; }

.app-plan-cards .pcard-featured { transform: none; }
.app-plan-cards .pcard-featured:hover { transform: translateY(-4px); }
.app-plan-cards .btn[disabled] { opacity: 0.5; cursor: default; }

.app-compare { border-radius: var(--radius-md); }

.profile-card { max-width: 560px; }

.save-ok {
  margin-left: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #3ddc84;
}

/* Billing */
.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cyan);
}

.plan-meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.plan-meter-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.plan-meter-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 2px 0;
}

@media (max-width: 768px) {
  .create-row-domain, .create-row-team { grid-template-columns: 1fr; }
  .plan-meters { grid-template-columns: 1fr; }
  .api-desc { display: none; }
}

@media (max-width: 1200px) {
  .app-plan-cards { grid-template-columns: repeat(2, 1fr); }
  .sub-tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .app-plan-cards { grid-template-columns: 1fr; }
  .sub-tiles { grid-template-columns: 1fr; }
}

/* =========================================
   LIGHT MODE (dashboard)
   ========================================= */
body.light {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --border: rgba(10, 30, 40, 0.1);
  --border-accent: rgba(0, 160, 150, 0.35);
  --text: #0d1b1e;
  --text-muted: #50616b;
  --text-dim: #8295a0;
  --cyan: #00a89b;
  --cyan-glow: rgba(0, 168, 155, 0.15);
  --lime: #5a9e00;
  background-color: var(--bg);
}

body.light::before { display: none; }
body.light .grain { opacity: 0.015; }

body.light .side-usage,
body.light .group-head:hover { background: rgba(10, 30, 40, 0.025); }
body.light .side-usage-bar { background: rgba(10, 30, 40, 0.08); }
body.light .side-link:hover { background: rgba(10, 30, 40, 0.04); }
body.light .side-link.active { background: rgba(0, 168, 155, 0.1); }
body.light .notes-input { background: rgba(10, 30, 40, 0.02); }
body.light .auth-input, body.light .slug-prefix { background: #fbfcfd; }
body.light .switch-slider { background: rgba(10, 30, 40, 0.15); }
body.light .dash-kpi { background: var(--surface); }
body.light .link-analytics { background: rgba(0, 168, 155, 0.03); }
body.light .group-count { background: rgba(0, 168, 155, 0.08); }
body.light .mini-btn { background: rgba(10, 30, 40, 0.03); }
body.light .stack-row,
body.light .api-endpoint,
body.light .plan-meter-item { background: rgba(10, 30, 40, 0.02); }
body.light .api-key { background: #fbfcfd; }
body.light .badge-pending { color: #b07b00; background: rgba(176, 123, 0, 0.07); border-color: rgba(176, 123, 0, 0.3); }
body.light .badge-ok { color: #1e8a4c; background: rgba(30, 138, 76, 0.08); border-color: rgba(30, 138, 76, 0.3); }
body.light .status-dot.on { background: #1e8a4c; }
body.light .code-block { background: #f4f6f8; border-color: var(--border); }
body.light .code-val { color: #4a7a00; }
body.light .sub-tile { background: rgba(10, 30, 40, 0.02); }
body.light .acc-summary:hover { background: rgba(10, 30, 40, 0.02); }
body.light .danger-note { background: rgba(200, 40, 40, 0.04); border-color: rgba(200, 40, 40, 0.25); }
body.light .danger-note strong { color: #c22; }
body.light .btn-danger { color: #c22; border-color: rgba(200, 40, 40, 0.35); }
body.light .btn-danger:hover { background: rgba(200, 40, 40, 0.06); }
body.light .icon-btn:hover { color: var(--cyan); }
body.light .btn-primary { background: var(--cyan); color: #fff; }
body.light .side-avatar { color: #fff; }

/* Invoice list rows */
.inv-list { display: flex; flex-direction: column; gap: 0; }

.inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.inv-row:last-child { border-bottom: none; }

.inv-row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.inv-row-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.inv-row-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.inv-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.inv-dl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

body.light .inv-row { border-bottom-color: var(--border); }

/* =========================================================
   USERNAME FIELD & SIDEBAR HANDLE
   ========================================================= */
.username-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}
.username-at {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}
.username-input {
  border-radius: 0 10px 10px 0 !important;
  flex: 1;
}
.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -6px;
  margin-bottom: 4px;
}
.side-user-handle {
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  margin-top: -2px;
  letter-spacing: 0.01em;
}
.side-link-admin {
  color: var(--cyan);
  opacity: 0.85;
}
.side-link-admin:hover {
  opacity: 1;
  color: var(--cyan);
}
.side-link-admin.active {
  color: var(--cyan);
}

/* =========================================================
   ADMIN PANEL — Discounts & Credits
   ========================================================= */
.admin-credit-form { display: flex; flex-direction: column; gap: 10px; }
.admin-credit-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.admin-credit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 220px;
}
.admin-credit-field-wide { flex: 1 1 260px; }
.credit-input-wrap {
  display: flex;
  align-items: center;
}
.credit-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.credit-input {
  border-radius: 0 10px 10px 0 !important;
  width: 120px;
}
/* Credit log */
.credit-log {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.credit-log:empty { display: none; }
.credit-log-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.credit-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.credit-log-row:last-child { border-bottom: none; }
.credit-log-left { display: flex; flex-direction: column; gap: 3px; }
.credit-log-user { font-size: 13px; font-weight: 700; color: var(--text); }
.credit-log-date { font-size: 11px; color: var(--text-muted); }
.credit-log-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.credit-log-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
}

.admin-disc-form {
  margin-top: 4px;
}
.admin-disc-row {
  display: grid;
  grid-template-columns: 1.6fr 1.1fr 0.7fr 1.2fr auto;
  gap: 12px;
  align-items: flex-end;
}
.create-field-sm {
  min-width: 0;
}

/* Discount list rows */
.disc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.disc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.disc-row:last-child { border-bottom: none; }
.disc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.disc-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  font-family: 'Space Grotesk', monospace;
}
.disc-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.disc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mini-btn {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mini-btn:hover {
  background: var(--surface-3, var(--border));
  border-color: var(--cyan);
}
.mini-btn-danger {
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.3);
}
.mini-btn-danger:hover {
  background: rgba(255,107,107,0.1);
  border-color: #ff6b6b;
}

/* =========================================================
   GEOGRAPHIC DISTRIBUTION
   ========================================================= */
.geo-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.geo-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.geo-card { padding: 0; overflow: hidden; }

.geo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.geo-header-left { display: flex; align-items: center; gap: 14px; }
.geo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(0,229,212,0.15) 0%, rgba(77,184,255,0.1) 100%);
  color: var(--cyan);
  flex-shrink: 0;
}
.geo-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.geo-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted);
}
.geo-pill-cyan {
  background: rgba(0,229,212,0.1);
  border-color: rgba(0,229,212,0.25);
  color: var(--cyan);
}
.geo-pill span { color: var(--text); font-weight: 700; }
.geo-pill-cyan span { color: var(--cyan); }

.geo-body { padding: 8px 24px 20px; }

.geo-list { display: flex; flex-direction: column; gap: 0; }
.geo-list[hidden] { display: none !important; }

.gd-row {
  display: grid;
  grid-template-columns: 36px 180px 1fr 90px;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.gd-row:last-child { border-bottom: none; }
.gd-row:hover { background: rgba(255,255,255,0.02); border-radius: 8px; }

.geo-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  min-width: 28px;
}
.geo-medal { font-size: 16px; line-height: 1; }

.geo-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.geo-flag { font-size: 18px; line-height: 1; flex-shrink: 0; }
.geo-country {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.geo-bar-wrap {
  height: 6px; border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.geo-bar-fill {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, #00E5D4 0%, #4db8ff 100%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.geo-bar-anim { width: var(--w); }
.geo-bar-gold   { background: linear-gradient(90deg, #f5c842 0%, #e8a000 100%); }
.geo-bar-silver { background: linear-gradient(90deg, #c0c0c0 0%, #9aa0a8 100%); }
.geo-bar-bronze { background: linear-gradient(90deg, #cd7f32 0%, #a05c1a 100%); }

.geo-stats {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  text-align: right; flex-shrink: 0;
}
.geo-clicks { font-size: 13px; font-weight: 700; color: var(--text); min-width: 38px; text-align: right; }
.geo-pct    { font-size: 11px; font-weight: 600; color: var(--text-muted); min-width: 38px; text-align: right; }

.geo-more-btn {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 8px;
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  font-family: inherit;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  margin: 10px 20px 16px auto; transition: border-color 0.15s, color 0.15s;
}
.geo-more-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.geo-more-btn svg { transition: transform 0.2s; }

/* =========================================================
   ANALYTICS VIEW — full redesign
   ========================================================= */

/* Live dot animation */
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* Header bar */
.an-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.an-header-left { display: flex; align-items: center; gap: 12px; }
.an-live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(0,229,212,0.1); border: 1px solid rgba(0,229,212,0.25);
  font-size: 12px; font-weight: 600; color: var(--cyan);
}
.an-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #00E5D4;
  animation: livePulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
.an-period-chip {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  padding: 5px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* KPI cards */
.an-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.an-kpi-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s, transform 0.15s;
}
.an-kpi-card:hover { border-color: rgba(0,229,212,0.3); transform: translateY(-1px); }
.an-kpi-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.an-kpi-cyan   { background: rgba(0,229,212,0.12); color: #00E5D4; }
.an-kpi-blue   { background: rgba(77,184,255,0.12); color: #4db8ff; }
.an-kpi-purple { background: rgba(129,140,248,0.12); color: #818cf8; }
.an-kpi-pink   { background: rgba(244,114,182,0.12); color: #f472b6; }
.an-kpi-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.an-kpi-label { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.an-kpi-val   { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.an-kpi-delta { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.an-kpi-delta.up   { color: #34d399; }
.an-kpi-delta.down { color: #f87171; }

/* Real-time card */
.an-rt-card { padding: 20px 24px 16px; }
.an-rt-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.an-rt-title { font-size: 15px; font-weight: 700; color: var(--text); }
.an-rt-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.an-live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(0,229,212,0.1); border: 1px solid rgba(0,229,212,0.25);
  font-size: 11px; font-weight: 700; color: var(--cyan);
}
.an-rt-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: center;
}
.an-rt-stats { display: flex; flex-direction: column; gap: 16px; }
.an-rt-stat {}
.an-rt-stat-val   { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.an-rt-stat-label { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 3px; }
.an-rt-stat-rate  { font-size: 11px; font-weight: 600; color: var(--cyan); margin-top: 2px; }
.an-rt-chart {
  display: block; width: 100%; height: 72px;
  border-radius: 8px;
}

/* Traffic overview chart */
.an-traffic-card { padding: 20px 24px 16px; }
.an-chart-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.an-chart-title { font-size: 15px; font-weight: 700; color: var(--text); }
.an-chart-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.an-chart-legend { display: flex; align-items: center; gap: 18px; }
.an-legend-item  { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.an-legend-item svg { flex-shrink: 0; }
.an-legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.an-chart-wrap { overflow: hidden; border-radius: 8px; }
/* SVG charts scale by viewBox aspect ratio — no fixed height needed */
.an-svg-chart { display: block; width: 100%; }

/* Geographic section — unified card */
.an-geo-card { padding: 20px 20px 4px; }
.an-geo-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.an-map-outer {
  position: relative;
  border-radius: 10px; overflow: hidden;
  background: #060f1c;
}
.an-world-svg { width: 100%; height: auto; display: block; }

/* Zoom controls */
.an-map-zoom-ctrl {
  position: absolute; top: 10px; right: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.an-zoom-btn {
  width: 30px; height: 30px;
  background: rgba(13,22,38,0.82);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; color: rgba(255,255,255,0.7);
  font-size: 17px; font-weight: 400; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: background 0.15s, color 0.15s;
}
.an-zoom-btn:hover { background: rgba(0,229,212,0.15); color: #00E5D4; border-color: rgba(0,229,212,0.3); }
.an-zoom-reset { font-size: 13px; }

.an-intensity-legend {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 4px;
}
.an-intensity-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.02em; }
.an-intensity-bar {
  flex: 1; height: 4px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(0,229,212,0.08) 0%, rgba(0,229,212,0.35) 40%, #00E5D4 100%);
}
.an-intensity-lo, .an-intensity-hi { font-size: 10px; color: var(--text-muted); font-weight: 500; }

/* Geo toggle */
.an-geo-toggle {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); flex-shrink: 0;
}
.an-toggle-btn {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: none; outline: none;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.an-toggle-btn:first-child { border-right: 1px solid var(--border); }
.an-toggle-active {
  background: rgba(0,229,212,0.1);
  color: var(--cyan);
}

/* Geo list section */
.an-geo-list-section { padding: 0; } /* kept for legacy */
.an-geo-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 8px; border-bottom: 1px solid var(--border); margin: 0;
}
.an-geo-list-title { font-size: 13px; font-weight: 700; color: var(--text); }
.geo-list { display: flex; flex-direction: column; padding: 4px 0; }
.geo-list[hidden] { display: none !important; }
.gd-row {
  display: grid;
  grid-template-columns: 28px 140px 1fr 72px;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.gd-row:last-child { border-bottom: none; }
.gd-row:hover { background: rgba(255,255,255,0.02); }

/* 2-column row */
.an-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Top links table */
.an-links-table { display: flex; flex-direction: column; gap: 0; }
.an-link-row {
  display: grid;
  grid-template-columns: 32px 1fr 200px 160px;
  align-items: center; gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.an-link-row:last-child { border-bottom: none; }
.an-link-row:hover { background: rgba(255,255,255,0.025); }
.an-link-rank {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  text-align: center;
}
.an-link-info { min-width: 0; }
.an-link-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-link-url  { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-link-bar-wrap {
  height: 6px; border-radius: 99px;
  background: var(--surface-2); overflow: hidden;
}
.an-link-bar {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, #00E5D4, #4db8ff);
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
}
.an-link-bar-anim { width: var(--lw); }
.an-link-stats { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.an-link-clicks { font-size: 13px; font-weight: 700; color: var(--text); }
.an-link-ctr    { font-size: 11px; color: var(--text-muted); }
.an-link-ctr strong { color: var(--text); font-weight: 700; }
.an-link-trend  { font-size: 11px; font-weight: 700; }
.an-link-up     { color: #34d399; }
.an-link-down   { color: #f87171; }

/* Bar list (devices / platforms) */
.an-bar-list { display: flex; flex-direction: column; gap: 14px; }
.an-bar-item { display: flex; flex-direction: column; gap: 6px; }
.an-bar-top  { display: flex; align-items: center; justify-content: space-between; }
.an-bar-label { font-size: 13px; font-weight: 600; color: var(--text); }
.an-bar-pct   { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.an-bar-track {
  height: 8px; border-radius: 99px;
  background: var(--surface-2); overflow: hidden;
}
.an-bar-fill2 {
  height: 100%; border-radius: 99px; width: 0;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.an-bar-anim { width: var(--aw); }

/* Analytics upgrade wall */
.an-upgrade-wall {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 340px; gap: 16px; text-align: center;
  padding: 48px 24px;
}
.an-upgrade-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,229,212,0.15), rgba(77,184,255,0.1));
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan);
}
.an-upgrade-title { font-size: 20px; font-weight: 700; color: var(--text); }
.an-upgrade-sub { font-size: 14px; color: var(--text-muted); max-width: 340px; line-height: 1.6; }

/* Responsive — dashboard v2 */
@media (max-width: 1024px) {
  .link-row { grid-template-columns: 1.3fr 1fr auto; }
  .lcell-type, .lcell-notes { display: none; }
  .la-kpis { grid-template-columns: repeat(2, 1fr); }
  .la-grid { grid-template-columns: 1fr; }
  .create-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .link-row { grid-template-columns: 1fr auto; }
  .lcell-dest { display: none; }
  .links-toolbar .toolbar-select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-packet { animation: none; }
  .pulse-dot { animation: none; }
  .marquee-track { animation: none; }
  .af-type::after { animation: none; }
  * { transition: none !important; animation: none !important; }
}
