:root{
  --bg1:#060913;
  --bg2:#0a1022;
  --bg3:#101735;
  --bg4:#121a3d;

  --card: rgba(12, 18, 40, 0.84);
  --card-2: rgba(16, 23, 50, 0.78);
  --card-3: rgba(20, 28, 60, 0.72);

  --stroke: rgba(255,255,255,.08);
  --stroke-strong: rgba(255,255,255,.14);

  --text: rgba(255,255,255,.95);
  --muted: rgba(255,255,255,.68);
  --muted2: rgba(255,255,255,.50);

  --ok:#2ee59d;
  --warn:#ffd36a;
  --err:#ff6b7a;

  --accent:#7c5cff;
  --accent-2:#5a8cff;
  --accent-soft: rgba(124,92,255,.16);
  --green-soft: rgba(46,229,157,.14);
  --blue-soft: rgba(90,140,255,.14);
  --amber-soft: rgba(255,211,106,.12);

  --shadow-lg: 0 24px 80px rgba(0,0,0,.42);
  --shadow-md: 0 14px 40px rgba(0,0,0,.28);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(124,92,255,.16), transparent 62%),
    radial-gradient(820px 460px at 88% 0%, rgba(90,140,255,.10), transparent 64%),
    radial-gradient(720px 420px at 50% 100%, rgba(46,229,157,.05), transparent 70%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 34%, var(--bg3) 68%, var(--bg4) 100%);
  background-attachment: fixed;
}

.bg{
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.02), transparent 14%),
    radial-gradient(900px 340px at 50% 0%, rgba(255,255,255,.035), transparent 70%);
  opacity:.9;
}

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:42px 18px 64px;
}

/* HERO */
.hero{
  position:relative;
  margin-bottom:24px;
  padding:10px 4px 0;
}

.brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 12px;
  border:1px solid var(--stroke);
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
  letter-spacing:.16em;
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

h1{
  margin:16px 0 10px;
  max-width:900px;
  font-size: clamp(38px, 6vw, 64px);
  line-height:1.02;
  letter-spacing:-0.045em;
  font-weight:800;
}

.sub{
  margin:0;
  max-width:760px;
  color:var(--muted);
  font-size:16px;
  line-height:1.6;
}

/* MAIN CARDS */
.card{
  position:relative;
  margin-top:20px;
  background:
    linear-gradient(180deg, rgba(17,23,52,.90), rgba(12,17,42,.88));
  border:1px solid var(--stroke);
  border-radius:28px;
  padding:20px;
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(16px);
  overflow:hidden;
}

.card::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  pointer-events:none;
}

.card2{
  margin-top:16px;
  padding:18px;
  border-radius:22px;
  background: linear-gradient(180deg, rgba(20,27,58,.78), rgba(16,22,48,.76));
  border:1px solid rgba(255,255,255,.07);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 10px 24px rgba(0,0,0,.16);
}

.card2Head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.card2Title{
  font-weight:750;
  letter-spacing:.01em;
  font-size:16px;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  color:rgba(255,255,255,.9);
  white-space:nowrap;
}

/* FORMS */
.form{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.field{flex:1}

label{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-bottom:8px;
  font-weight:500;
}

input{
  width:100%;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:14px 15px;
  outline:none;
  transition:.22s ease;
  min-height:50px;
}

input::placeholder{
  color: rgba(255,255,255,.32);
}

input:focus{
  border-color: rgba(124,92,255,.54);
  background: rgba(255,255,255,.055);
  box-shadow: 0 0 0 4px rgba(124,92,255,.14);
}

.hint{
  margin:8px 0 0;
  color:var(--muted2);
  font-size:12px;
  line-height:1.5;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width:156px;
  min-height:50px;
  padding:13px 16px;
  border-radius:16px;
  border:1px solid rgba(124,92,255,.40);
  background: linear-gradient(180deg, rgba(132,101,255,.98), rgba(102,78,224,.92));
  color:white;
  cursor:pointer;
  user-select:none;
  box-shadow:
    0 10px 28px rgba(106,82,233,.24),
    inset 0 1px 0 rgba(255,255,255,.16);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:
    0 16px 34px rgba(106,82,233,.28),
    inset 0 1px 0 rgba(255,255,255,.18);
}

.btn:disabled{
  opacity:.62;
  cursor:not-allowed;
  transform:none;
}

.spinner{
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.95);
  display:none;
  animation: spin .8s linear infinite;
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

/* STATUS */
.status{
  margin-top:14px;
  padding:14px 15px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(6,10,26,.42);
}

.status.ok{border-color: rgba(46,229,157,.20)}
.status.warn{border-color: rgba(255,211,106,.24)}
.status.err{border-color: rgba(255,107,122,.24)}

#acct{
  margin-top:10px;
  background: rgba(124,92,255,.08);
  border-color: rgba(124,92,255,.22);
}

/* METRICS */
.grid{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}

.compactGrid{
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}

.metric{
  border:1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  border-radius:20px;
  padding:16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.metric.big{
  grid-column:1 / -1;
  padding:18px;
}

.metricHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
  gap:12px;
}

.metricHead span{
  color:var(--muted);
  font-size:14px;
}

.metricHead strong{
  font-size:16px;
  font-weight:750;
  white-space:nowrap;
}

.bar{
  height:12px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
}

.fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(46,229,157,.96), rgba(124,92,255,.96));
  transition: width .45s ease;
}

/* TEXT LISTS */
.smallText{
  opacity:.94;
  font-size:13px;
  margin-top:4px;
  color:var(--muted);
  line-height:1.5;
}

.miniTitle{
  margin-top:13px;
  font-weight:700;
  font-size:13px;
  color: rgba(255,255,255,.92);
}

.miniList{
  margin:8px 0 0 0;
  padding-left:18px;
}

.miniList li{
  margin:8px 0;
  line-height:1.55;
  color: rgba(255,255,255,.86);
}

.recoList{
  margin:0;
  padding-left:18px;
}

.recoItem{
  margin:10px 0;
  line-height:1.45;
}

.badge{
  display:inline-block;
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  margin-right:8px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.badge.high{border-color: rgba(255,70,70,.30);}
.badge.medium{border-color: rgba(255,180,70,.30);}
.badge.low{border-color: rgba(120,200,255,.30);}

/* PDF */
.pdf{
  margin-top:16px;
  border:1px solid rgba(46,229,157,.18);
  background: rgba(46,229,157,.05);
  border-radius:20px;
  padding:15px;
}

.pdfInner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.pdfTitle{
  font-weight:750;
}

.pdfPath{
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}

.pdfBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 13px;
  border-radius:13px;
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
  text-decoration:none;
  background: rgba(255,255,255,.04);
}

.pdfBtn:hover{
  background: rgba(255,255,255,.08);
}

/* RAW */
.raw{
  margin-top:14px;
}

.raw summary{
  cursor:pointer;
  color:var(--muted);
}

pre{
  margin-top:10px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.24);
  overflow:auto;
  max-height:320px;
}

/* ENGINE TABS + ICONS */
.engineTabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
  margin-bottom:12px;
}

.engineTab{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:var(--text);
  border-radius:999px;
  padding:8px 14px;
  cursor:pointer;
  transition:.2s ease;
  font-size:13px;
}

.engineTab:hover{
  background: rgba(255,255,255,.08);
}

.engineTab.active{
  border-color: rgba(124,92,255,.46);
  background: linear-gradient(180deg, rgba(124,92,255,.95), rgba(124,92,255,.68));
  color:#fff;
  box-shadow: 0 8px 24px rgba(124,92,255,.16);
}

.engineIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color:#fff;
  flex-shrink:0;
}

.engine-chatgpt{
  background: rgba(46,229,157,.18);
  color:#7ff4c6;
}

.engine-perplexity{
  background: rgba(43,203,255,.18);
  color:#78ddff;
}

.engine-gemini{
  background: rgba(86,126,255,.18);
  color:#8eb0ff;
}

.engine-claude{
  background: rgba(255,140,53,.18);
  color:#ffb06c;
}

#crossEngineRanking li{
  display:flex;
  align-items:center;
  gap:8px;
}

/* SECTION THEMES */
#citableWrap{
  border-color: rgba(124,92,255,.16);
  background: rgba(124,92,255,.045);
}

#queryGenWrap{
  border-color: rgba(124,92,255,.16);
  background: rgba(124,92,255,.04);
}

#visibilityWrap{
  border-color: rgba(46,229,157,.14);
  background: rgba(46,229,157,.04);
}

#crossEngineWrap{
  border-color: rgba(90,140,255,.16);
  background: rgba(90,140,255,.045);
}

#trackerWrap{
  border-color: rgba(255,211,106,.16);
  background: rgba(255,211,106,.045);
}

/* PAYWALL */
#paywall .grid{
  margin-top:12px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}

#paywall .metric{
  position:relative;
  overflow:hidden;
}

#paywall .metric::before{
  content:"";
  position:absolute;
  inset:-40% -30%;
  background: radial-gradient(closest-side, rgba(124,92,255,.16), transparent 60%);
  transform: rotate(10deg);
  pointer-events:none;
}

#paywall .metricHead strong{
  font-size:20px;
}

#paywall .smallText{
  color:var(--muted);
  opacity:1;
}

#refreshTracker{
  min-width:auto;
  padding:8px 14px;
  box-shadow:none;
}

/* HIDDEN */
.hidden{
  display:none !important;
}

/* FOOTER */
.foot{
  margin-top:18px;
  color:var(--muted2);
  font-size:12px;
  text-align:center;
}

/* MOBILE */
@media (max-width:720px){
  .wrap{
    padding:28px 14px 46px;
  }

  h1{
    font-size:40px;
    line-height:1.05;
  }

  .sub{
    font-size:15px;
  }

  .form{
    flex-direction:column;
  }

  .btn{
    width:100%;
  }

  .grid,
  .compactGrid,
  #paywall .grid{
    grid-template-columns:1fr;
  }

  #saveEmail{
    width:100%;
  }

  .card{
    padding:16px;
    border-radius:22px;
  }

  .card2{
    padding:15px;
    border-radius:18px;
  }

  .metric{
    padding:14px;
    border-radius:18px;
  }

  .pdfInner{
    flex-direction:column;
    align-items:flex-start;
  }

  .engineTabs{
    gap:8px;
  }

  .engineTab{
    width:100%;
    justify-content:flex-start;
  }
}