:root {
  --bg: #07020f;
  --panel: #160b2e;
  --panel-2: #241044;
  --line: rgba(216, 180, 254, 0.26);
  --text: #f4f0ff;
  --muted: #cbbce7;
  --blue: #7c3aed;
  --teal: #c084fc;
  --amber: #fde68a;
  --rose: #fb7185;
  --violet: #a855f7;
  --cyan: #f0abfc;
  --danger: #fb7185;
  --ok: #86efac;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(240, 171, 252, 0.22), transparent 170px),
    radial-gradient(circle at 12% 0%, rgba(124, 58, 237, 0.28), transparent 260px),
    linear-gradient(135deg, #07020f 0%, #17072d 52%, #090314 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mix-blend-mode: screen;
}

a { color: var(--text); text-decoration: none; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 5, 17, 0.82);
  backdrop-filter: blur(18px);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand { font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.navlinks { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.navlinks a { color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; }
.navlinks a:hover { color: var(--text); }
.nav-login, .nav-cta {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
}
.nav-cta {
  color: white !important;
  border-color: rgba(45, 212, 191, .36);
  background: linear-gradient(135deg, #7e22ce, #4f46e5);
  box-shadow: 0 12px 26px rgba(168, 85, 247, .24);
}

.hero { padding: 72px 0 36px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; }
.eyebrow { color: var(--cyan); text-transform: uppercase; font-weight: 800; letter-spacing: 0.12em; font-size: 12px; }
h1 { margin: 12px 0 16px; font-size: clamp(42px, 7vw, 86px); line-height: 0.95; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: clamp(26px, 4vw, 42px); letter-spacing: 0; }
h3 { margin: 0 0 8px; font-size: 18px; }
p { color: var(--muted); margin: 0 0 14px; }
.lead { color: #d9e5f7; font-size: 18px; max-width: 680px; }

.panel, .card, .auth-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(36, 16, 68, 0.94), rgba(13, 6, 28, 0.94));
  box-shadow: var(--shadow);
  border-radius: 8px;
}
.panel { padding: 24px; }
.hero-demo {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  position: relative;
}
.demo-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.demo-bar span { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.26); }
.demo-question {
  border: 1px solid rgba(240, 171, 252, .24);
  border-radius: 8px;
  padding: 18px;
  color: #eaf7ff;
  font-size: 20px;
  font-weight: 900;
  background: rgba(8, 13, 21, .62);
}
.demo-row, .demo-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255,255,255,.045);
}
.demo-row span, .demo-score span { color: var(--muted); }
.ok-row strong, .demo-score strong { color: var(--ok); }
.demo-score strong { font-size: 34px; line-height: 1; }
.page-head, .profile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  border: 1px solid rgba(216, 180, 254, 0.36);
  background: linear-gradient(135deg, #7e22ce, #4f46e5);
  color: white;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(168, 85, 247, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.btn.secondary { background: rgba(255,255,255,0.06); box-shadow: none; color: var(--text); }
.btn.table-action { padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.danger-btn { border-color: rgba(251, 113, 133, .5); color: #ffe4e6; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 250px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.card { padding: 18px; min-height: 120px; }
.metric { font-size: 30px; font-weight: 900; color: white; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--cyan); background: rgba(103,232,249,.08); font-size: 12px; font-weight: 800; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.danger { color: var(--danger); }

.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 32px 0; }
.auth-card { width: min(440px, 100%); padding: 28px; }
.auth-submit { width: 100%; margin-top: 20px; }
label { display: block; margin-top: 14px; color: var(--muted); font-weight: 700; }
input {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(190,148,255,.25);
  background: rgba(255,255,255,.06);
  color: var(--text);
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.table-head h2 { margin: 0; }
.table-search { max-width: 340px; margin: 0; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid rgba(190,148,255,.14); }
th { color: var(--cyan); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
td { color: #e8e0ff; }
tbody tr:hover { background: rgba(192, 132, 252, .06); }
.empty-cell { text-align: center; color: var(--muted); padding: 22px 12px; }
.section { padding: 34px 0; }
.status { min-height: 22px; color: var(--muted); margin-top: 10px; }
.extension-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 16px;
  margin: 26px 0 8px;
  align-items: stretch;
}
.download-card {
  border: 1px solid rgba(216, 180, 254, .34);
  border-radius: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at 82% 16%, rgba(255,255,255,.2), transparent 62px),
    linear-gradient(135deg, rgba(126, 34, 206, .32), rgba(79, 70, 229, .18)),
    linear-gradient(180deg, rgba(36, 16, 68, .96), rgba(13, 6, 28, .96));
  box-shadow: var(--shadow);
  min-height: 245px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.download-card h2 { margin-top: 12px; }
.connect-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.connect-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.connect-top h3 {
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: 22px;
}
.connection-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 7px rgba(134, 239, 172, .1), 0 0 22px rgba(134, 239, 172, .55);
  margin-top: 6px;
  flex: 0 0 auto;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.dashboard-main, .discount-panel { grid-column: span 3; }
.stats-split {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}
.answer-chart {
  width: min(240px, 100%);
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--teal) 0 var(--answered-pct), var(--rose) 0 100%);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 44px rgba(0,0,0,.24);
}
.answer-chart > div {
  width: 66%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #0e1523;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
}
.answer-chart strong { font-size: 34px; line-height: 1; }
.answer-chart span { color: var(--muted); font-size: 12px; font-weight: 800; }
.chart-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chart-legend div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.045);
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 4px 10px;
  align-content: center;
}
.chart-legend strong { font-size: 24px; line-height: 1; }
.chart-legend span:last-child { color: var(--muted); grid-column: 2; }
.dot { width: 10px; height: 10px; border-radius: 999px; align-self: center; }
.answered-dot { background: var(--teal); }
.unanswered-dot { background: var(--rose); }
.db-dot { background: var(--blue); }
.gpt-dot { background: var(--amber); }
.discount-counter {
  border: 1px solid rgba(45, 212, 191, .26);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ok);
  font-weight: 900;
  background: rgba(45, 212, 191, .08);
  white-space: nowrap;
}
.progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  margin: 14px 0;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 1180px); }
  .hero, .grid, .grid.two, .grid.four, .dashboard-layout, .stats-split, .chart-legend, .extension-hero { grid-template-columns: 1fr; }
  .dashboard-main, .discount-panel { grid-column: auto; }
  .hero { padding: 38px 0 18px; gap: 18px; }
  h1 { font-size: clamp(36px, 11vw, 48px); line-height: 1.02; }
  h2 { font-size: clamp(24px, 7vw, 32px); }
  .lead { font-size: 16px; }
  .nav { align-items: stretch; flex-direction: column; padding: 12px 0; gap: 12px; }
  .navlinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .navlinks a { justify-content: center; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
  .actions, .page-head, .profile-line, .demo-row, .demo-score, .connect-top { align-items: stretch; flex-direction: column; }
  .actions .btn, .logout-btn, .profile-line .btn { width: 100%; }
  .panel, .card, .auth-card { padding: 16px; }
  .download-card { padding: 16px; min-height: auto; }
  .connect-card { min-height: auto; }
  .connection-dot { display: none; }
  .hero-demo { min-height: auto; }
  .answer-chart { margin: 0 auto; max-width: 220px; }
  .table-head { align-items: stretch; flex-direction: column; }
  .table-search { max-width: none; }
  table { min-width: 680px; }
}

@media (max-width: 460px) {
  body { font-size: 14px; }
  .navlinks { grid-template-columns: 1fr; }
  .metric { font-size: 26px; }
  .demo-score strong, .answer-chart strong { font-size: 30px; }
  .section { padding: 24px 0; }
  .grid, .dashboard-layout { margin: 18px 0; gap: 12px; }
}
