:root {
  --bg: #06060c;
  --s1: #0c0c18;
  --s2: #121222;
  --s3: #1a1a30;
  --border: #1e1e3a;
  --border2: #2e2e58;
  --text: #f0f0f8;
  --text2: #a0a0c0;
  --text3: #9898b8;
  --accent: #ff5530;
  --accent2: #ff8058;
  --accent-glow: rgba(255,85,48,.16);
  --glass: #14142a;
  --glass-border: #2e2e58;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

* { margin:0; padding:0; box-sizing:border-box; }
::selection { background: rgba(255,77,32,.30); color: #fff; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
img { content-visibility: auto; }
a { color: inherit; text-decoration-skip-ink: auto; }
button { font-family: inherit; }

/* SMOOTH TRANSITIONS */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* GRAIN OVERLAY */
body::after {
  content: '';
  position: fixed; inset: 0;
  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='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999; opacity: .5;
}

/* HEADER */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  background: rgba(5,5,8,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: all .3s;
}
header.scrolled {
  padding: 10px 40px;
  background: rgba(5,5,8,.97);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
  will-change: padding, background;
}
header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .3;
}

.logo {
  font-size: 1.5rem; font-weight: 900;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.logo-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}
.logo span { color: var(--accent); }

/* HEADER NAV */
.hdr-nav {
  display: flex; align-items: center; gap: 28px;
  list-style: none;
}
.hdr-nav a {
  color: var(--text2); text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: color .2s, background .2s;
  padding: 6px 12px;
  border-radius: 8px;
}
.hdr-nav a:hover { color: var(--accent); background: var(--accent-glow); }

.hdr-actions {
  display: flex; align-items: center; gap: 14px;
}

/* GOOGLE LOGIN BUTTON */
.btn-google {
  display: flex; align-items: center; gap: 10px;
  background: var(--s2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: .92rem; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Outfit', sans-serif;
}
.btn-google:hover {
  background: var(--s3);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (max-width: 640px) {
  .btn-google-text { display: none; }
  .btn-google { padding: 10px; border-radius: 10px; }
}

/* USER AREA */
.user-area {
  display: none; align-items: center; gap: 10px;
  background: var(--s2); border: 1px solid var(--border2);
  padding: 6px 14px 6px 6px; border-radius: 10px;
  cursor: pointer; transition: all .2s;
}
.user-area:hover { background: var(--s3); border-color: var(--accent); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}
.user-name { font-size: .88rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout {
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); padding: 8px 14px; border-radius: 8px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  font-family: 'Outfit', sans-serif; transition: all .2s;
}
.btn-logout:hover { border-color: var(--accent); color: var(--accent); }

/* HERO */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 130px 24px 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 15%, rgba(255,77,32,.14) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 60%, rgba(100,60,255,.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(255,77,32,.06) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255,77,32,.03) 0%, transparent 50%);
}
.hero-content {
  position: relative; z-index: 1; width: 100%;
  max-width: 1140px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,77,32,.10); border: 1px solid rgba(255,77,32,.25);
  color: var(--accent2); padding: 6px 16px; border-radius: 100px;
  font-size: .82rem; font-weight: 600; margin-bottom: 28px;
  letter-spacing: .03em;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: .6; }
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--text2); max-width: 600px;
  margin: 0 auto clamp(32px, 5vw, 48px); line-height: 1.75;
}

.hero-search {
  display: flex; align-items: center; gap: 0;
  max-width: 560px; margin: 0 auto 36px;
  background: var(--s2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.hero-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 16px rgba(0,0,0,.2);
}
.hero-search input {
  flex: 1; padding: 16px 22px;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  caret-color: var(--accent);
}
.hero-search input::placeholder { color: var(--text3); transition: opacity .2s; }
.hero-search input:focus::placeholder { opacity: .5; }
.hero-search button {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 28px;
  background: var(--accent); color: #fff; border: none;
  font-size: .92rem; font-weight: 700;
  cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: background .2s, box-shadow .2s;
  white-space: nowrap;
}
.hero-search button:hover { background: var(--accent2); box-shadow: inset 0 0 24px rgba(255,255,255,.1); }
.hero-search button:active { transform: scale(.97); }
.hero-search button svg { width: 18px; height: 18px; flex-shrink: 0; }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent);
  color: #fff; border: none;
  padding: 16px 32px; border-radius: 12px;
  font-size: 1rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  font-family: 'Outfit', sans-serif;
  transition: all .2s;
  box-shadow: 0 4px 24px rgba(255,77,32,.35);
}
.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(255,77,32,.50);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 12px rgba(255,77,32,.30); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border2);
  padding: 16px 32px; border-radius: 12px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  font-family: 'Outfit', sans-serif;
  transition: all .2s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.btn-secondary:active { transform: translateY(0); }

/* TREND RESULTS */
.trend-results {
  max-width: 680px; margin: 48px auto 0;
  text-align: left;
  background: linear-gradient(135deg, var(--s1) 0%, rgba(18,18,34,.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 32px);
}
.trend-results-header { margin-bottom: 24px; }
.trend-results-title {
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: -0.3px; margin-bottom: 6px;
}
.trend-results-query {
  color: var(--text2); font-size: .88rem;
}
.trend-list {
  display: flex; flex-direction: column; gap: 18px;
}
.trend-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.trend-card:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  transform: translateY(-2px);
}
.trend-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.trend-card-title {
  font-size: 1.05rem; font-weight: 700;
}
.trend-card-category {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); text-transform: uppercase;
  background: rgba(255,77,32,.08);
  padding: 3px 8px; border-radius: 6px;
  white-space: nowrap;
}
.trend-card-desc {
  color: var(--text2); font-size: .92rem; line-height: 1.7;
  margin-bottom: 18px;
}
.trend-card-metrics {
  display: flex; gap: 24px; align-items: flex-end;
  flex-wrap: wrap;
}
.trend-metric { flex: 1; min-width: 140px; }
.trend-metric-label {
  font-size: .75rem; font-weight: 600;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.trend-metric-value {
  font-size: .75rem; font-weight: 700; color: var(--text);
}
.trend-bar {
  height: 7px; border-radius: 4px;
  background: var(--s3);
  overflow: hidden;
}
.trend-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.trend-bar-fill.high { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.trend-bar-fill.medium { background: linear-gradient(90deg, var(--accent2), #ffb070); }
.trend-bar-fill.low { background: var(--text3); }
.trend-change {
  display: inline-block;
  font-size: .92rem; font-weight: 800;
  color: #34d399;
  font-variant-numeric: tabular-nums;
}
.trend-period {
  display: block;
  font-size: .75rem; color: var(--text3); margin-top: 2px;
}

/* STATS BAR */
.stats-bar {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(20px, 4vw, 48px); flex-wrap: wrap;
  margin-top: clamp(40px, 6vw, 72px);
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 40px);
  background: linear-gradient(135deg, var(--s1) 0%, var(--s2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-sm);
}
.stat-item { text-align: center; }
.stat-num {
  font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 900;
  color: var(--accent); letter-spacing: -1px;
  display: block;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: .82rem; color: var(--text3); margin-top: 4px; }

/* SECTION */
section {
  max-width: 1140px; margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) clamp(12px, 3vw, 24px);
}
.section-divider {
  border-top: 1px solid var(--border);
}
.section-label {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
  background: rgba(255,77,32,.06);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,77,32,.12);
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 18px; line-height: 1.2;
}
.section-sub {
  font-size: clamp(.92rem, 1.5vw, 1.05rem); color: var(--text2);
  max-width: 580px; line-height: 1.75; margin-bottom: clamp(36px, 5vw, 60px);
}

/* LAYOUT UTILITY CLASSES */
.section-divider--center { text-align: center; }
.section-divider--center .section-sub { margin-left: auto; margin-right: auto; }
.section-sub--center { margin-left: auto; margin-right: auto; }
.dash-charts--preview { max-width: 900px; margin-left: auto; margin-right: auto; }
.dash-charts--mt { margin-top: 24px; }
.dash-panel--full { flex: 1 1 100%; grid-column: 1 / -1; }

/* ANCHOR SCROLL OFFSET (fixed header) */
#features,
#how,
#pricing {
  scroll-margin-top: 80px;
}

/* BELOW-FOLD RENDERING OPTIMIZATION */
#features,
.how-section,
#pricing,
.cta-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* FEATURES */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3vw, 40px) clamp(22px, 3vw, 34px);
  transition: border-color .3s, box-shadow .3s, transform .3s;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
  opacity: 0; transition: opacity .3s;
}
.feature-card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(255,77,32,.08);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: rgba(255,77,32,.10);
  border: 1px solid rgba(255,77,32,.20);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  font-size: 1.6rem;
}
.feature-card h3 {
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: 12px; letter-spacing: -.2px;
}
.feature-card p {
  color: var(--text2); line-height: 1.75; font-size: .95rem;
}
.feature-tag {
  display: inline-block; margin-top: 20px;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); text-transform: uppercase;
  background: rgba(255,77,32,.08);
  padding: 4px 10px; border-radius: 6px;
}

/* HOW IT WORKS */
.how-section { background: var(--s1); }
.how-inner {
  max-width: 1140px; margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) clamp(12px, 3vw, 24px);
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px; margin-top: 60px;
}
.step {
  text-align: center; padding: 28px;
}
.step-num {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  color: #fff; font-size: 1.3rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 24px var(--accent-glow);
  transition: transform .3s, box-shadow .3s;
}
.step:hover .step-num {
  transform: scale(1.1);
  box-shadow: 0 0 32px rgba(255,77,32,.3);
}
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.step p { color: var(--text2); font-size: .92rem; line-height: 1.75; }

/* PRICING */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 700px; margin: 0 auto;
}
.plan {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 3vw, 44px) clamp(20px, 3vw, 38px);
  position: relative; overflow: hidden;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.plan:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.plan.pro {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(255,77,32,.15);
}
.plan-badge {
  position: absolute; top: 20px; right: 20px;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 6px;
}
.plan-name {
  font-size: .82rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text2); margin-bottom: 10px;
}
.plan-price {
  font-size: 3rem; font-weight: 900; letter-spacing: -2px;
  line-height: 1; margin-bottom: 6px;
}
.plan-price sup { font-size: 1.2rem; letter-spacing: 0; }
.plan-price .period { font-size: 1rem; color: var(--text2); font-weight: 500; letter-spacing: 0; }
.plan-desc { color: var(--text2); font-size: .88rem; margin-bottom: 28px; margin-top: 8px; }
.plan-features { list-style: none; margin-bottom: 32px; }
.plan-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .9rem; color: var(--text2); padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li .check {
  color: var(--accent); font-size: 1rem;
  flex-shrink: 0; margin-top: 1px;
}
.plan-cta {
  width: 100%; padding: 14px;
  border-radius: 12px; border: none;
  font-size: .95rem; font-weight: 700;
  cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: background .2s, box-shadow .2s, transform .2s, color .2s;
}
.plan.free .plan-cta {
  background: var(--s2); color: var(--text);
  border: 1px solid var(--border2);
}
.plan.free .plan-cta:hover { background: var(--s3); }
.plan.pro .plan-cta {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 20px rgba(255,77,32,.30);
}
.plan.pro .plan-cta:hover {
  background: var(--accent2);
  box-shadow: 0 8px 30px rgba(255,77,32,.45);
  transform: translateY(-1px);
}

/* CTA SECTION */
.cta-section {
  background: linear-gradient(180deg, var(--s1) 0%, var(--s2) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-inner {
  max-width: 760px; margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) clamp(12px, 3vw, 24px); text-align: center;
}
.cta-inner h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900; letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.cta-inner h2 .accent { color: var(--accent); }
.cta-inner p {
  color: var(--text2); font-size: 1.05rem;
  margin-bottom: 40px; line-height: 1.7;
}

/* FOOTER */
footer {
  background: var(--s1);
  border-top: 1px solid var(--border);
  padding: clamp(36px, 5vw, 60px) clamp(12px, 3vw, 40px) clamp(20px, 3vw, 32px);
}
.footer-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 32px;
}
.footer-brand p { color: var(--text3); font-size: .85rem; max-width: 280px; line-height: 1.7; margin-top: 12px; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text2); margin-bottom: 14px;
}
.footer-col a {
  display: block; color: var(--text3); text-decoration: underline;
  text-decoration-color: var(--border2); text-underline-offset: 2px;
  font-size: .88rem; margin-bottom: 8px; transition: color .2s, text-decoration-color .2s;
}
.footer-col a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.footer-bottom {
  max-width: 1140px; margin: 40px auto 0;
  padding-top: 28px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { color: var(--text3); font-size: .82rem; }

/* LOGIN MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.75); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-overlay.show .modal {
  animation: fadeInUp .3s ease both;
}
.modal {
  background: var(--s1);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 48px) clamp(16px, 3vw, 40px);
  max-width: 420px; width: 90%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  position: relative;
}
.modal h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; }
.modal-desc { color: var(--text2); font-size: .92rem; margin-bottom: 32px; line-height: 1.6; }
.modal-close {
  position: absolute; top: 16px; right: 18px;
  background: transparent; border: none; color: var(--text2);
  font-size: 1.4rem; cursor: pointer; transition: color .2s;
  font-family: 'Outfit', sans-serif;
}
.modal-close:hover { color: var(--accent); }
.modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-google-big {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 24px;
  background: #fff; color: #1a1a2e;
  border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: all .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.btn-google-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.btn-google-big svg { width: 20px; height: 20px; }
.modal-legal { margin-top: 20px; font-size: .78rem; color: var(--text3); }
.modal-legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* DASHBOARD LAYOUT */
.dashboard {
  display: none;
  min-height: 100vh;
  padding-top: 67px;
}
.dashboard.active { display: flex; }
.landing.hidden { display: none; }

/* SIDEBAR */
.sidebar {
  position: fixed; top: 67px; left: 0; bottom: 0;
  width: 240px;
  background: var(--s1);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
  transition: transform .3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  min-height: 44px;
  color: var(--text2);
  text-decoration: none;
  font-size: .92rem; font-weight: 500;
  transition: color .2s, background .2s, border-color .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover {
  color: var(--text);
  background: var(--s2);
  border-left-color: var(--border2);
}
.sidebar-nav li a.active {
  color: var(--accent);
  background: rgba(255,77,32,.06);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-nav li a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 0;
}
.sidebar-nav li a svg {
  width: 20px; height: 20px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-section {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text3);
  padding: 24px 24px 8px; margin-top: 8px;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: clamp(24px, 3vw, 32px) clamp(20px, 3vw, 40px);
  min-height: calc(100vh - 67px);
  transition: margin-left .3s;
}
.main-content-header {
  margin-bottom: 32px;
}
.main-content-header h1 {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.main-content-header p {
  color: var(--text2); font-size: .95rem;
}
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-bottom: 32px;
}
.dash-card {
  background: linear-gradient(135deg, var(--s1) 0%, var(--s2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.5vw, 26px);
  transition: border-color .3s, box-shadow .3s, transform .3s;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity .3s;
}
.dash-card:hover::before { opacity: 1; }
.dash-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.dash-card-label {
  font-size: .78rem; font-weight: 600;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px;
}
.dash-card-value {
  font-size: 1.8rem; font-weight: 900;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.dash-card-value.accent { color: var(--accent); }
.dash-card-sub {
  font-size: .82rem; color: var(--text2); margin-top: 4px;
}
.dash-panel {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color .3s, box-shadow .3s;
}
.dash-panel:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-sm);
}
.dash-panel h3 {
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.dash-panel h3::before {
  content: '';
  width: 3px; height: 1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* DASHBOARD SECTIONS */
.main-content-section {
  margin-bottom: 32px;
}
.main-content-section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text2); text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dash-empty {
  text-align: center; padding: 48px 24px;
  color: var(--text3); font-size: .95rem;
}
.dash-charts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .dash-charts { grid-template-columns: 1fr; }
  .chart-container { min-height: 180px; max-height: 280px; }
}
@media (max-width: 480px) {
  .chart-container { min-height: 160px; max-height: 240px; padding: 12px; }
  .trend-chart-wrap { max-height: 280px; }
}
.chart-container {
  position: relative; width: 100%; min-height: 200px; max-height: 320px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  aspect-ratio: 16 / 9;
  transition: border-color .3s, box-shadow .3s;
}
.chart-container:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-sm);
}
.trend-chart-wrap {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; margin-bottom: 24px;
  max-height: 340px;
}
.trend-chart-title {
  color: var(--text2);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  margin: 0 0 8px;
}

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* SIDEBAR TOGGLE */
.sidebar-toggle {
  display: none;
  background: var(--s2); border: 1px solid var(--border2);
  color: var(--text); padding: 8px;
  border-radius: 8px; cursor: pointer;
  font-family: 'Outfit', sans-serif;
  margin-right: 8px;
}
.sidebar-toggle svg {
  width: 20px; height: 20px; display: block;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* TOUCH-FRIENDLY TARGETS */
@media (pointer: coarse) {
  .sidebar-nav li a { min-height: 48px; padding: 14px 24px; }
  .btn-primary, .btn-secondary { min-height: 48px; }
  .plan-cta { min-height: 48px; }
  .hero-search button { min-height: 48px; }
  .hdr-nav a { padding: 8px 4px; }
}

/* SAFE AREA INSETS */
@supports (padding: env(safe-area-inset-bottom)) {
  footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  header { padding-left: calc(40px + env(safe-area-inset-left)); padding-right: calc(40px + env(safe-area-inset-right)); }
}
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    header { padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
  }
}

/* SKIP LINK */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus {
  top: 0;
}

/* SCREEN READER ONLY */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* FOCUS VISIBLE */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
[tabindex="-1"]:focus {
  outline: none;
}

/* HIGH CONTRAST MODE */
@media (forced-colors: active) {
  .btn-primary, .btn-secondary, .plan-cta, .btn-google, .btn-google-big {
    border: 1px solid ButtonText;
  }
  .feature-card, .dash-card, .trend-card, .plan, .dash-panel {
    border: 1px solid CanvasText;
  }
  .skip-link:focus {
    outline: 2px solid Highlight;
  }
  .trend-bar-fill {
    background: Highlight;
  }
}

/* INCREASED CONTRAST PREFERENCE */
@media (prefers-contrast: more) {
  :root {
    --text2: #c8c8e0;
    --text3: #b0b0cc;
    --border: #2e2e50;
    --border2: #4e4e78;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header { padding: 14px 20px; }
  header.scrolled { padding: 10px 20px; }
  .logo { font-size: 1.2rem; }
  .hdr-nav { display: none; }
  .hdr-actions { gap: 8px; }
  .btn-google { padding: 8px 14px; font-size: .84rem; }
  .btn-google svg { width: 16px; height: 16px; }
  .user-name { max-width: 90px; }
  .footer-inner { flex-direction: column; }
  .footer-links { gap: 28px; }
  .section-divider { border-top: none; }
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.6);
  }
  .sidebar-toggle { display: block; }
  .main-content {
    margin-left: 0;
    padding: clamp(16px, 3vw, 24px) clamp(12px, 3vw, 20px);
  }
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .trend-card { padding: 20px; }
  .trend-card-metrics { gap: 16px; }
  .trend-results { max-width: 100%; padding: clamp(16px, 3vw, 24px); }
  .trend-chart-wrap { padding: 16px; }
  .modal { padding: 36px 28px; }
  .modal h2 { font-size: 1.3rem; }
  .stats-bar { border-radius: var(--radius-md); }
  .chart-container { aspect-ratio: 4 / 3; }
}
@media (max-width: 480px) {
  .btn-logout { display: none !important; }
  .btn-google span,
  .btn-google { font-size: .8rem; padding: 8px 10px; gap: 6px; }
  .user-area { padding: 4px 10px 4px 4px; }
  .user-avatar { width: 26px; height: 26px; }
  .user-name { max-width: 70px; font-size: .8rem; }
  .hero { padding: 110px 16px 60px; }
  .hero h1 { letter-spacing: -0.5px; }
  .hero-search { flex-direction: column; border-radius: 14px; }
  .hero-search input { padding: 14px 16px; }
  .hero-search button { width: 100%; justify-content: center; padding: 14px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary { justify-content: center; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  .dash-card-value { font-size: 1.5rem; }
  .main-content-header h1 { font-size: 1.3rem; }
  .trend-card-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .trend-metric { min-width: 100px; }
  .modal { width: 94%; }
  .btn-google-big { font-size: .92rem; padding: 12px 16px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .plan-price { font-size: 2.4rem; }
  .chart-container { aspect-ratio: auto; min-height: 160px; }
  .dash-panel { padding: 20px; }
  .dash-panel h3 { font-size: 1rem; margin-bottom: 14px; padding-bottom: 10px; }
}

/* TABLET LANDSCAPE */
@media (min-width: 769px) and (max-width: 1024px) {
  header { padding: 14px 28px; }
  .hdr-nav { gap: 18px; }
  .hdr-nav a { font-size: .84rem; }
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; }
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pricing-grid { max-width: 600px; }
  .footer-links { gap: 32px; }
}

/* EXTRA SMALL DEVICES */
@media (max-width: 360px) {
  header { padding: 12px 12px; }
  .logo { font-size: 1rem; gap: 6px; }
  .logo-icon { width: 28px; height: 28px; font-size: 11px; }
  .hero { padding: 100px 12px 48px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-sub { font-size: .92rem; }
  .modal { width: 96%; }
}

/* TAILWIND UTILITY REPLACEMENTS */
.tw-hidden { display: none; }
.tw-flex { display: flex; }
.tw-flex-col { flex-direction: column; }
.tw-grid { display: grid; }
.tw-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tw-gap-4 { gap: 1rem; }
.tw-gap-5 { gap: 1.25rem; }
.tw-gap-6 { gap: 1.5rem; }
.tw-gap-8 { gap: 2rem; }
.tw-items-center { align-items: center; }
.tw-justify-center { justify-content: center; }
.tw-max-w-\[700px\] { max-width: 700px; }
.tw-mx-auto { margin-left: auto; margin-right: auto; }
@media (min-width: 640px) {
  .sm\:tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:tw-flex-row { flex-direction: row; }
}
@media (min-width: 768px) {
  .md\:tw-flex { display: flex; }
  .md\:tw-flex-row { flex-direction: row; }
  .md\:tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .xl\:tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* LOADING SPINNER */
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.btn-loading {
  pointer-events: none;
  opacity: .7;
}
.btn-loading .loading-spinner {
  margin-right: 6px;
}

/* LOADING OVERLAY (dashboard) */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text2);
  font-size: .95rem;
  font-family: 'Outfit', sans-serif;
}
.loading-overlay .loading-spinner {
  width: 24px; height: 24px;
  border-color: var(--border2);
  border-top-color: var(--accent);
}

/* SW ERROR LOG PANEL */
.sw-log-actions {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.sw-log-list {
  max-height: 320px; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.sw-log-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.sw-log-row:last-child { border-bottom: none; }
.sw-log-time {
  font-size: .75rem; color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.sw-log-msg {
  color: #f87171; font-weight: 600;
  word-break: break-word;
}
.sw-log-detail {
  color: var(--text3); font-size: .78rem;
  word-break: break-word;
}
.sw-log-empty {
  text-align: center; padding: 24px;
  color: var(--text3); font-size: .88rem;
}

/* LARGE DESKTOP */
@media (min-width: 1440px) {
  .hero-sub { max-width: 640px; font-size: 1.25rem; }
  .hero-search { max-width: 620px; }
  section { max-width: 1280px; }
  .how-inner { max-width: 1280px; }
  .features-grid { gap: 32px; }
  .pricing-grid { max-width: 780px; }
  .dash-charts { gap: 32px; }
  .footer-inner { max-width: 1280px; }
  .footer-bottom { max-width: 1280px; }
}

/* MOBILE LANDSCAPE */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 80px 24px 40px; }
  .stats-bar { margin-top: 36px; }
  .modal { max-height: 90vh; overflow-y: auto; }
}

/* HOVER ONLY FOR POINTER DEVICES (prevent sticky hover on touch) */
@media (hover: hover) {
  .btn-google:hover { transform: translateY(-1px); }
  .btn-primary:hover { transform: translateY(-2px); }
  .feature-card:hover { transform: translateY(-4px); }
  .dash-card:hover { transform: translateY(-2px); }
  .trend-card:hover { transform: translateY(-2px); }
  .btn-google-big:hover { transform: translateY(-2px); }
  .plan.pro .plan-cta:hover { transform: translateY(-1px); }
}
@media (hover: none) {
  .btn-google:hover,
  .btn-primary:hover,
  .feature-card:hover,
  .dash-card:hover,
  .trend-card:hover,
  .btn-google-big:hover,
  .plan.pro .plan-cta:hover { transform: none; }
}

/* TABLET PORTRAIT (specific tweaks) */
@media (min-width: 601px) and (max-width: 768px) {
  .hdr-nav { display: none; }
  .stats-bar { gap: 24px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-links { gap: 24px; }
}

/* FADE-IN ANIMATION */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-content { animation: fadeInUp .6s ease both; }
.dash-card { animation: fadeInUp .4s ease both; }
.dash-card:nth-child(2) { animation-delay: .05s; }
.dash-card:nth-child(3) { animation-delay: .1s; }
.dash-card:nth-child(4) { animation-delay: .15s; }

/* PRINT STYLES */
@media print {
  body::after,
  header,
  .sidebar,
  .sidebar-overlay,
  .sidebar-toggle,
  .modal-overlay,
  #offlineBanner { display: none !important; }
  body { background: #fff; color: #000; }
  .main-content { margin-left: 0 !important; }
  .landing { display: block !important; }
  .hero-bg { display: none; }
  .btn-primary, .btn-secondary, .plan-cta { box-shadow: none; border: 1px solid #ccc; }
}
