
:root{
  --bg:#07111f;
  --bg2:#0b1627;
  --card:#132238;
  --card2:#172b47;
  --text:#f8fafc;
  --muted:#aeb8c8;
  --line:#334155;
  --gold:#fbbf24;
  --green:#22c55e;
  --blue:#38bdf8;
  --danger:#ef4444;
}
*{box-sizing:border-box}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at top left,rgba(56,189,248,.14),transparent 32%),
    radial-gradient(circle at top right,rgba(251,191,36,.10),transparent 30%),
    linear-gradient(180deg,#030712,#07111f 55%,#020617);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.app-shell{
  width:min(820px,100%);
  margin:0 auto;
  padding:16px 16px 42px;
}
.app-header{
  position:sticky;
  top:0;
  z-index:20;
  margin:0 -16px 14px;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:linear-gradient(180deg,rgba(3,7,18,.94),rgba(3,7,18,.58));
  border-bottom:1px solid rgba(148,163,184,.10);
  backdrop-filter:blur(16px);
}
.brand{display:flex;align-items:center;gap:10px}
.brand-mark{
  width:42px;height:42px;border-radius:16px;
  display:grid;place-items:center;
  background:rgba(251,191,36,.14);
  border:1px solid rgba(251,191,36,.26);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.brand-mark.large{width:54px;height:54px;border-radius:20px;font-size:24px;margin-bottom:10px}
.brand-name{font-size:23px;font-weight:950;letter-spacing:-.05em}
.brand-sub{font-size:12px;color:#fde68a;font-weight:850}
.icon-btn{
  width:44px;height:44px;border-radius:16px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-weight:900;
}
.menu{
  position:absolute;
  right:16px;top:66px;
  width:230px;
  padding:8px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:22px;
  background:rgba(15,23,42,.98);
  box-shadow:0 24px 80px rgba(0,0,0,.36);
}
.menu button{
  width:100%;
  border:0;
  background:transparent;
  color:#e5e7eb;
  text-align:left;
  border-radius:14px;
  padding:12px;
  font-weight:850;
}
.menu button:hover{background:rgba(255,255,255,.07)}
.hidden{display:none!important}
.screen{animation:fadeIn .16s ease-out}
@keyframes fadeIn{from{opacity:.65;transform:translateY(4px)}to{opacity:1;transform:none}}
.hero-card,.feature-card,.details-card,.quiz-card{
  border:1px solid rgba(148,163,184,.16);
  border-radius:28px;
  background:linear-gradient(180deg,rgba(19,34,56,.90),rgba(15,29,49,.70));
  box-shadow:0 20px 60px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.045);
  padding:20px;
  margin-top:14px;
}
.hero-card{
  background:
    radial-gradient(circle at 100% 0%,rgba(251,191,36,.14),transparent 36%),
    linear-gradient(180deg,rgba(23,43,71,.94),rgba(19,34,56,.74));
  border-color:rgba(251,191,36,.20);
}
.eyebrow{
  color:#93c5fd;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.09em;
}
h1,h2,h3{letter-spacing:-.045em}
h1{font-size:34px;line-height:1.02;margin:8px 0 8px}
h2{font-size:22px;margin:4px 0 8px}
h3{font-size:20px;margin:4px 0 8px}
p{color:var(--muted);line-height:1.45;margin:8px 0}
.primary-btn,.secondary-btn,.danger-btn{
  width:100%;
  min-height:52px;
  border-radius:18px;
  padding:12px 14px;
  font-weight:950;
  margin-top:12px;
}
.primary-btn{
  border:0;
  color:#07111f;
  background:linear-gradient(135deg,#fbbf24,#22c55e);
}
.secondary-btn{
  border:1px solid rgba(148,163,184,.18);
  color:#f8fafc;
  background:rgba(255,255,255,.055);
}
.danger-btn{
  border:1px solid rgba(239,68,68,.34);
  color:#fecaca;
  background:rgba(239,68,68,.10);
}
.mini-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:12px;
}
.mini-stats div{
  padding:12px 10px;
  border-radius:18px;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(148,163,184,.12);
  text-align:center;
}
.mini-stats span{display:block;font-size:22px;font-weight:950;color:#fde68a}
.mini-stats small{display:block;color:#cbd5e1;font-size:11px;font-weight:850;margin-top:2px}
.details-card{padding:0;overflow:hidden;background:rgba(15,29,49,.58)}
.details-card summary{
  list-style:none;
  padding:15px 18px;
  font-weight:950;
  color:#dbeafe;
}
.details-card summary::-webkit-details-marker{display:none}
.details-content{padding:0 18px 18px}
.target-row,.quick-actions,.button-row,.plan-row{
  display:grid;
  gap:8px;
  margin-top:10px;
}
.target-row{grid-template-columns:repeat(3,1fr)}
.quick-actions{grid-template-columns:repeat(4,1fr)}
.button-row{grid-template-columns:1fr 1fr}
.plan-row{grid-template-columns:repeat(3,1fr)}
.targetBtn,.quick-actions button,.planBtn{
  border:1px solid rgba(148,163,184,.16);
  border-radius:16px;
  background:rgba(255,255,255,.055);
  color:#f8fafc;
  font-weight:900;
  padding:11px 8px;
}
.targetBtn.active,.planBtn.active{
  border-color:rgba(251,191,36,.50);
  color:#fde68a;
  background:rgba(251,191,36,.10);
}
.bar{
  height:10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
  margin-top:10px;
}
.bar i{
  display:block;
  height:100%;
  width:0;
  background:linear-gradient(90deg,#fbbf24,#22c55e,#38bdf8);
}
.gate{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:8px;
  padding:9px 10px;
  border-radius:14px;
  background:rgba(255,255,255,.045);
  color:#cbd5e1;
}
.gate.ok{background:rgba(34,197,94,.10);color:#bbf7d0}
.screen-head{
  margin-top:12px;
  padding:4px 2px 0;
}
.screen-head h1{margin-bottom:6px}
.feature-grid{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.feature-card.recommended{border-color:rgba(251,191,36,.28)}
.feature-card.soft{background:rgba(15,29,49,.54)}
.pill{
  display:inline-block;
  font-size:11px;
  font-weight:950;
  color:#fde68a;
  padding:5px 8px;
  border-radius:999px;
  background:rgba(251,191,36,.10);
  border:1px solid rgba(251,191,36,.25);
  margin-bottom:8px;
}
select,input,textarea{
  width:100%;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(2,6,23,.45);
  color:#f8fafc;
  border-radius:16px;
  padding:13px;
  margin-top:8px;
}
textarea{min-height:110px;resize:vertical}
.answer-card{
  color:#bbf7d0;
  background:rgba(34,197,94,.08);
  border:1px solid rgba(34,197,94,.18);
  padding:12px;
  border-radius:16px;
}
.quiz-card{margin-top:14px}
.quiz-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding-bottom:12px;
  border-bottom:1px solid rgba(148,163,184,.14);
  margin-bottom:16px;
}
#timer{
  height:36px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(251,191,36,.12);
  border:1px solid rgba(251,191,36,.24);
  color:#fde68a;
}
.choice{
  width:100%;
  text-align:left;
  margin-top:10px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:18px;
  padding:14px;
  color:#f8fafc;
  background:rgba(2,6,23,.46);
  line-height:1.35;
}
.choice.correct{border-color:rgba(34,197,94,.62);background:rgba(34,197,94,.14)}
.choice.wrong{border-color:rgba(239,68,68,.62);background:rgba(239,68,68,.14)}
#explain{
  margin-top:14px;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(148,163,184,.12);
}
.modal{
  position:fixed;
  inset:0;
  z-index:50;
  display:grid;
  place-items:center;
  padding:16px;
  background:rgba(2,6,23,.78);
}
.modal-card{
  width:min(560px,100%);
  border:1px solid rgba(148,163,184,.18);
  border-radius:30px;
  background:#0f1d31;
  padding:22px;
  box-shadow:0 32px 90px rgba(0,0,0,.45);
}
label{
  display:block;
  margin-top:14px;
  color:#dbeafe;
  font-weight:850;
}
.toast{
  position:fixed;
  top:20px;
  left:50%;
  transform:translateX(-50%);
  z-index:80;
  padding:12px 14px;
  border-radius:16px;
  background:#111827;
  color:#f8fafc;
  border:1px solid rgba(148,163,184,.18);
  box-shadow:0 18px 50px rgba(0,0,0,.3);
}
@media(min-width:700px){
  .feature-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
  .app-shell{padding:14px 14px 34px}
  h1{font-size:29px}
  .mini-stats{grid-template-columns:1fr 1fr 1fr}
  .mini-stats span{font-size:18px}
  .quick-actions{grid-template-columns:repeat(4,1fr);gap:6px}
  .quick-actions button{font-size:12px;padding:10px 5px}
  .plan-row{grid-template-columns:1fr}
  .button-row{grid-template-columns:1fr}
}


/* v1.5 UX polish */
.primary-btn{
  box-shadow:0 8px 24px rgba(34,197,94,.22);
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.primary-btn:active{transform:scale(.985)}
.secondary-btn:active,.quick-actions button:active,.planBtn:active,.targetBtn:active{transform:scale(.985)}
.menu button.active{
  background:rgba(251,191,36,.14);
  color:#fde68a;
}
.feature-card{
  margin-bottom:2px;
}
.insight-card{
  background:linear-gradient(180deg,rgba(56,189,248,.10),rgba(19,34,56,.66));
  border-color:rgba(56,189,248,.22);
}
.wide-card{
  grid-column:1/-1;
}
#distanceToPass{
  color:#fde68a;
  font-weight:900;
}
.momentum-line{
  color:#bbf7d0;
  font-weight:850;
}
#pointsToast{
  color:#fde68a;
}
.trap-note{
  color:#fecaca;
  font-weight:850;
}
.feature-card h2{
  line-height:1.1;
}
.quick-actions button{
  transition:transform .12s ease, background .12s ease;
}
@media(max-width:600px){
  .wide-card{grid-column:auto}
}


/* v1.6 readability + controls */
.hero-card{
  position:relative;
  overflow:hidden;
}
.hero-card:before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 90% 10%, rgba(56,189,248,.10), transparent 28%),
    radial-gradient(circle at 10% 95%, rgba(34,197,94,.08), transparent 26%);
  pointer-events:none;
}
.hero-card>*{position:relative}
.home-insight{
  margin-top:10px;
  padding:10px 12px;
  border-radius:16px;
  background:rgba(2,6,23,.24);
  border:1px solid rgba(148,163,184,.12);
  color:#dbeafe;
  font-size:14px;
  line-height:1.35;
}
.quiz-card{
  padding:18px;
  max-width:100%;
}
.quiz-card h1#question{
  font-size:clamp(22px,5.7vw,34px);
  line-height:1.12;
  letter-spacing:-.035em;
  margin-top:14px;
  overflow-wrap:anywhere;
}
#passage{
  font-size:16px;
  line-height:1.48;
  color:#cbd5e1;
  background:rgba(2,6,23,.24);
  border:1px solid rgba(148,163,184,.10);
  padding:12px;
  border-radius:16px;
}
.choice{
  font-size:17px;
  line-height:1.28;
  padding:15px 16px;
}
#explain{
  font-size:16px;
  line-height:1.48;
  color:#d1d5db;
}
.spark-pop{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:8px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(251,191,36,.14);
  border:1px solid rgba(251,191,36,.34);
  color:#fde68a;
  font-weight:950;
}
.quiz-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}
.tiny-btn{
  width:auto;
  min-height:38px;
  border-radius:999px;
  padding:8px 12px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.05);
  color:#cbd5e1;
  font-weight:850;
}
.tiny-btn:active{transform:scale(.98)}
.menu{
  max-height:70vh;
  overflow:auto;
}
.menu:before{
  content:"Navigate";
  display:block;
  padding:8px 12px 6px;
  color:#93c5fd;
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.details-card summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.details-card summary:after{
  content:"⌄";
  color:#93c5fd;
  font-weight:950;
}
.details-card[open] summary:after{
  content:"⌃";
}
@media(max-width:600px){
  .quiz-card{
    margin-left:0;
    margin-right:0;
    padding:16px;
    border-radius:24px;
  }
  .quiz-card h1#question{
    font-size:clamp(23px,8.2vw,32px);
    line-height:1.12;
  }
  .choice{
    font-size:16px;
    padding:14px;
  }
  #explain{
    font-size:15px;
  }
  .mini-stats div{
    padding:10px 6px;
  }
}


/* v1.7 learning loop */
.mistake-card{
  margin-top:14px;
  padding:14px;
  border-radius:20px;
  background:rgba(251,191,36,.08);
  border:1px solid rgba(251,191,36,.20);
}
.mistake-card strong{
  display:block;
  color:#fde68a;
  font-size:15px;
  margin-bottom:4px;
}
.mistake-card p{
  margin:4px 0 8px;
}
.session-momentum{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.session-momentum span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(34,197,94,.10);
  border:1px solid rgba(34,197,94,.20);
  color:#bbf7d0;
  font-weight:900;
  font-size:13px;
}
#passExplain{
  border-color:rgba(56,189,248,.22);
  background:linear-gradient(180deg,rgba(56,189,248,.09),rgba(19,34,56,.58));
}

/* v1.8 runtime UX fix */
button{touch-action:manipulation}
button:disabled{opacity:.55}
.modal.hidden{display:none!important}
#onboarding.hidden{display:none!important}

/* loading */
.loading{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(2,6,23,.85);
  z-index:999;
}
.loading.hidden{display:none}
.loading-box{
  text-align:center;
  color:#fde68a;
}
.bolt{
  font-size:48px;
  animation:pulse 1s infinite;
}
@keyframes pulse{
  0%{transform:scale(1)}
  50%{transform:scale(1.2)}
  100%{transform:scale(1)}
}


/* v2.2 reading upgrade */
.reading-card{
  border-color:rgba(56,189,248,.24);
  background:linear-gradient(180deg,rgba(56,189,248,.09),rgba(19,34,56,.70));
}
.trap-word{
  display:inline-block;
  padding:1px 7px;
  margin:0 1px;
  border-radius:999px;
  background:rgba(251,191,36,.18);
  border:1px solid rgba(251,191,36,.38);
  color:#fde68a;
  font-weight:950;
  letter-spacing:.02em;
}
.reading-hint{
  margin-top:10px;
  padding:10px 12px;
  border-radius:16px;
  background:rgba(56,189,248,.08);
  border:1px solid rgba(56,189,248,.18);
  color:#dbeafe;
  font-size:14px;
  line-height:1.35;
}
#passage strong{
  color:#fde68a;
}

/* v2.3 flagged review */
.flagged-list{
  display:grid;
  gap:8px;
  margin-top:10px;
}
.flagged-item{
  padding:10px;
  border-radius:14px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(148,163,184,.12);
  color:#dbeafe;
  font-size:14px;
  line-height:1.35;
}
.flagged-item small{
  display:block;
  color:#93c5fd;
  font-weight:850;
  margin-bottom:4px;
}

/* v2.4 mini action buttons */
.small-actions{
  display:flex;
  gap:8px;
  align-items:center;
}
.mini-btn{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.25);
  background:rgba(255,255,255,.06);
  color:#fde68a;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.mini-btn:hover{
  background:rgba(251,191,36,.15);
  transform:scale(1.05);
}


/* v2.5 guided system */
.guided-path{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:14px;
}
.path-step{
  display:flex;
  gap:8px;
  align-items:center;
  padding:10px;
  border-radius:18px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(148,163,184,.12);
}
.path-step span{
  width:26px;
  height:26px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-weight:950;
  color:#07111f;
  background:#64748b;
}
.path-step strong{
  display:block;
  font-size:13px;
}
.path-step small{
  display:block;
  color:#aeb8c8;
  font-size:11px;
  margin-top:2px;
}
.path-step.active{
  border-color:rgba(251,191,36,.45);
  background:rgba(251,191,36,.10);
}
.path-step.active span{
  background:#fbbf24;
}
.path-step.done span{
  background:#22c55e;
}
.coach-card{
  margin-top:14px;
  padding:14px;
  border-radius:20px;
  background:linear-gradient(180deg,rgba(56,189,248,.10),rgba(19,34,56,.62));
  border:1px solid rgba(56,189,248,.22);
}
.coach-card p{
  margin:6px 0 0;
  color:#dbeafe;
}
.more-training{
  margin-top:14px;
}
@media(max-width:600px){
  .guided-path{grid-template-columns:1fr}
}

/* v2.6 streak system */
.streak-card{
  margin-top:12px;
  padding:12px;
  border-radius:18px;
  background:rgba(251,191,36,.12);
  border:1px solid rgba(251,191,36,.4);
  color:#fde68a;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:14px;
}

/* v2.7 ai coach */
.ai-reason{
  margin-top:8px!important;
  padding:9px 10px;
  border-radius:14px;
  background:rgba(2,6,23,.22);
  border:1px solid rgba(148,163,184,.12);
  color:#cbd5e1!important;
  font-size:13px;
}
