:root{
  --bg:#f6f6fb;
  --ink:#1e1e2a;
  --muted:#6c6c7f;
  --purple:#8b89b4;
  --purple2:#6f6d99;
  --border:#cfe2c0;
  --card:#ffffff;
  --shadow:0 8px 24px rgba(0,0,0,.08);
  --radius:16px;
  --radius2:12px;
  --pad:16px;
  --greenbtn:#7f9a54;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

#app{
  max-width:1280px;
  margin:0 auto;
  padding:12px 12px 60px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:5;
  padding:12px;
  border-radius:var(--radius);
  background:linear-gradient(135deg, rgba(111,109,153,.25), rgba(127,154,84,.18));
  border:1px solid rgba(0,0,0,.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  display:flex;
  align-items:center;
  gap:12px;
}

.iconbtn{
  width:44px;height:44px;
  border-radius:999px;
  border:0;
  background:rgba(255,255,255,.22);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.iconbtn:disabled{
  opacity:.35;
  cursor:not-allowed;
}
.iconbtn img{width:20px;height:20px; filter: invert(0); opacity:.9}

.weekpill{
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  border:1px solid rgba(0,0,0,.06);
  font-weight:700;
  font-size:13px;
}

.spacer{flex:1}

.topnav{
  display:flex;
  align-items:center;
  gap:10px;
  padding-right:6px;
}
.counter{
  min-width:120px;
  text-align:center;
  font-weight:800;
  letter-spacing:.5px;
}

.subbar{
  margin-top:10px;
  padding:10px 14px;
  border-radius:var(--radius2);
  background:var(--card);
  border:1px solid rgba(0,0,0,.06);
  box-shadow: var(--shadow);
  font-weight:800;
}

.hero{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 920px){
  .hero{ grid-template-columns:1fr; }
}

.hero-card{
  background:var(--card);
  border:1px solid rgba(0,0,0,.06);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.kicker{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:var(--muted);
  font-weight:800;
}
.title{
  font-size:22px;
  font-weight:900;
  margin-top:4px;
}
.muted{ color:var(--muted); line-height:1.5; }
.small{ font-size:13px; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 920px){
  .grid2{ grid-template-columns:1fr; }
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:44px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  background:var(--card);
  color:var(--ink);
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  user-select:none;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  transition: transform .06s ease;
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.btn.primary{
  background: linear-gradient(135deg, rgba(127,154,84,.95), rgba(111,109,153,.85));
  color:#fff;
  border-color: rgba(0,0,0,.0);
}
.btn.secondary{
  background: rgba(111,109,153,.13);
}
.btn.ghost{
  background: transparent;
  box-shadow:none;
}

.input{
  width:100%;
  height:44px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  outline:none;
  background:var(--card);
  box-shadow: var(--shadow);
  font-weight:700;
}

.list{
  display:grid;
  gap:10px;
}

.card{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px;
  border-radius:var(--radius);
  background:var(--card);
  border:1px solid rgba(0,0,0,.06);
  box-shadow: var(--shadow);
}

.card-title{ font-weight:900; }
.card-meta{ color:var(--muted); font-size:13px; margin-top:3px; }
.card-actions{ display:flex; gap:10px; }

.panel{
  background:var(--card);
  border:1px solid rgba(0,0,0,.06);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-head{
  padding:14px 14px;
  border-bottom:1px solid rgba(0,0,0,.06);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.panel-title{ font-weight:900; }
.panel-body{ padding:14px 14px; }

.p{
  margin:0 0 10px;
  line-height:1.72;
  color:#222;
}

.qstem{
  font-weight:800;
  margin:10px 0 12px;
  line-height:1.5;
}

.choices{
  display:grid;
  gap:10px;
}
.choice{
  text-align:left;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(111,109,153,.08);
  padding:12px 12px;
  cursor:pointer;
  display:flex;
  gap:10px;
  align-items:flex-start;
  box-shadow: 0 8px 18px rgba(0,0,0,.05);
}
.choice .letter{
  width:30px;height:30px;
  border-radius:10px;
  background: rgba(127,154,84,.25);
  display:grid;
  place-items:center;
  font-weight:900;
}
.choice .text{ flex:1; line-height:1.4; }
.choice.selected{
  outline:2px solid rgba(127,154,84,.55);
  background: rgba(127,154,84,.16);
}
.choice.correct{
  outline:2px solid rgba(127,154,84,.8);
}
.choice.wrong{
  outline:2px solid rgba(220,80,80,.75);
}

.row{ display:flex; align-items:center; gap:10px; }
.badge{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background: rgba(0,0,0,.06);
  font-weight:900;
  font-size:13px;
}

.audioBarWrap{
  position:fixed;
  left:0;right:0;bottom:0;
  padding:10px;
  z-index:50;
}
.audioBarWrap.hidden{ display:none; }
.audioBar{
  max-width:1280px;
  margin:0 auto;
  background: var(--card);
  border:1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:12px;
}
.bar{
  height:8px;
  background: rgba(0,0,0,.08);
  border-radius: 999px;
  overflow:hidden;
  flex:1;
}
.bar > i{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(127,154,84,.95), rgba(111,109,153,.85));
}
.time{
  min-width:90px;
  text-align:right;
  font-weight:900;
  color:var(--muted);
}

/* Loading overlay - 원래 톤 유지(과한 연출 제거) */
.loading-overlay{
  position:fixed;
  inset:0;
  background:rgba(246,246,251,.92);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:99998;
}
.loading-overlay.hidden{ display:none; }

.loading-card{
  width:min(520px, 92vw);
  background:var(--card);
  border:1px solid rgba(0,0,0,.08);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:18px 18px;
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.spinner{
  width:28px;height:28px;
  border-radius:999px;
  border:3px solid rgba(0,0,0,.15);
  border-top-color: rgba(0,0,0,.55);
  animation: spin 0.9s linear infinite;
  margin-top:2px;
  flex: 0 0 auto;
}
@keyframes spin{ to{ transform: rotate(360deg);} }

.loading-texts{ display:flex; flex-direction:column; gap:6px; }
.loading-title{ font-weight:800; font-size:16px; }
.loading-sub{ color:var(--muted); font-size:13px; line-height:1.35; }
.loading-long{
  margin-top:6px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(0,0,0,.04);
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
.loading-long.hidden{ display:none; }

/* Review UI */
.review-block{ margin-top:12px; }
.review-title{ font-weight:900; margin-bottom:8px; }
.review-row{
  display:flex; gap:12px; align-items:center;
  padding:10px 12px; border-radius:12px;
  border:1px solid rgba(0,0,0,.08);
  background: rgba(111,109,153,.06);
  margin-bottom:8px;
}
.review-row.ok{ outline:2px solid rgba(127,154,84,.55); }
.review-row.no{ outline:2px solid rgba(220,80,80,.35); }
.review-left{ width:64px; font-weight:900; color:var(--muted); }
.review-mid{ flex:1; }
