:root{
  --bg:#0b0824;
  --bg2:#161243;
  --card:#20195b;
  --card2:#2a2272;
  --card3:#332986;
  --line:#5246a8;
  --line2:#7b69dc;
  --text:#f7f4ff;
  --muted:#b7afd9;
  --gold:#ffc928;
  --lime:#9af02b;
  --lime2:#b9ff35;
  --danger:#ff557a;
  --cyan:#75dcff;
  --shadow: 0 18px 48px rgba(0,0,0,.34);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Apple SD Gothic Neo","Noto Sans KR",sans-serif;
  background:
    radial-gradient(circle at 50% -10%,rgba(109,73,255,.45),transparent 38%),
    radial-gradient(circle at 10% 75%,rgba(69,240,160,.08),transparent 25%),
    linear-gradient(180deg,var(--bg2),var(--bg));
}
button,input{font-family:inherit}
button{border:0;cursor:pointer;color:inherit}
.app-shell{
  width:100%;
  max-width:520px;
  min-height:100vh;
  margin:0 auto;
  position:relative;
  overflow-x:hidden;
  padding-bottom:92px;
}
.screen{
  padding:14px 20px 104px;
  min-height:100vh;
}
.hidden{display:none!important}
.tiny{
  font-size:12px;
  color:var(--muted);
  min-height:18px;
}

/* 공통 */
.card{
  width:100%;
  background:linear-gradient(180deg,rgba(35,28,97,.98),rgba(29,23,82,.98));
  border:1px solid var(--line);
  border-radius:20px;
  padding:18px;
  margin:12px 0;
  box-shadow:0 8px 28px rgba(0,0,0,.17);
}
.card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.primary{
  width:100%;
  min-height:54px;
  border-radius:15px;
  background:linear-gradient(180deg,var(--lime2),#87e416);
  color:#111423;
  font-weight:1000;
  font-size:17px;
  box-shadow:0 12px 26px rgba(154,240,43,.22);
}
.secondary{
  min-height:54px;
  border-radius:15px;
  background:#2c2574;
  border:1px solid var(--line);
  font-weight:1000;
  font-size:16px;
}
.ghost{
  width:100%;
  min-height:48px;
  border-radius:14px;
  background:transparent;
  border:1px solid var(--line);
  color:#ded8ff;
  font-weight:900;
  margin-top:10px;
}
.two-buttons{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}
.full{width:100%;margin:8px 0}

/* 모달 */
.modal{
  position:fixed;
  inset:0;
  z-index:30;
  display:none;
  place-items:center;
  padding:22px;
  background:rgba(7,5,22,.72);
  backdrop-filter:blur(6px);
}
.modal.active{display:grid}
.modal-card{
  width:min(440px,100%);
  background:linear-gradient(180deg,#241d64,#1d1752);
  border:1px solid var(--line2);
  border-radius:26px;
  padding:28px 22px;
  box-shadow:var(--shadow);
}
.start-card,.reward-card,.dialog-card{text-align:center}
.logo-orb{
  width:88px;height:88px;
  border-radius:50%;
  margin:0 auto 14px;
  display:grid;place-items:center;
  font-family:Georgia,serif;
  font-weight:1000;
  font-size:48px;
  color:#f7ffe8;
  background:radial-gradient(circle,#83bd22,#397100);
  border:4px double #d7ff66;
  box-shadow:0 0 28px rgba(154,240,43,.45);
}
.modal-card h1,.modal-card h2{margin:0 0 10px}
.sub{color:var(--muted);font-weight:800;line-height:1.55}
.field-label{
  display:block;
  text-align:left;
  color:#ded8ff;
  font-weight:900;
  margin:18px 0 7px;
}
.text-input{
  width:100%;
  height:56px;
  border-radius:14px;
  border:2px solid #315783;
  background:#f8f8ff;
  color:#111;
  font-size:18px;
  font-weight:800;
  padding:0 14px;
  outline:none;
}
.streak-badge{
  display:inline-flex;
  padding:13px 20px;
  border-radius:16px;
  background:#30277a;
  color:var(--gold);
  font-size:18px;
  margin:5px 0 18px;
}
.days{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}
.day{
  min-height:68px;
  border-radius:12px;
  background:#221b60;
  border:1px solid #463c93;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:2px;
  font-weight:1000;
}
.day span,.day small{font-size:10px;color:var(--muted)}
.day b{font-size:17px}
.day.today{border-color:var(--gold);box-shadow:0 0 22px rgba(255,201,40,.22)}
.day.done{background:#253060;border-color:#6ccf72}
.today-reward{font-weight:1000}
.today-reward strong{color:var(--gold)}
.gift{
  font-size:74px;
  background:transparent;
  filter:drop-shadow(0 12px 20px rgba(0,0,0,.38));
  animation:float 1.8s ease-in-out infinite;
}
@keyframes float{50%{transform:translateY(-8px)}}
.dialog-icon{font-size:58px}

/* 홈 */
.topbar{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:center;
  margin-bottom:18px;
}
.profile{
  display:flex;
  align-items:center;
  gap:9px;
  text-align:left;
  background:transparent;
  padding:0;
}
.profile strong{display:block;font-size:14px}
.profile small{color:var(--gold);font-weight:1000}
.avatar{
  width:45px;height:45px;border-radius:50%;
  display:grid;place-items:center;
  font-size:26px;
  background:linear-gradient(135deg,#762dff,#18113e);
  border:2px solid #824eff;
  box-shadow:0 0 18px rgba(130,78,255,.42);
}
.xp-wrap{display:flex;flex-direction:column;align-items:center;gap:3px}
.xp-track,.quiz-progress{
  width:100%;
  height:11px;
  border-radius:999px;
  background:#342b78;
  border:1px solid #5145a6;
  overflow:hidden;
}
.xp-fill,.quiz-progress span{
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ffe56c,#ffb000);
  transition:width .35s ease;
}
.xp-wrap small{font-size:11px;color:var(--muted);font-weight:900}
.flame{
  padding:8px 10px;
  border-radius:999px;
  background:#211a5c;
  border:1px solid var(--line);
  color:var(--gold);
  font-weight:1000;
}
.mission-card h3{margin:0;font-size:14px}
.mini-claim{
  min-width:70px;
  border-radius:12px;
  padding:9px 10px;
  background:linear-gradient(180deg,#ffcf3a,#f59b1c);
  color:#25150a;
  font-weight:1000;
}
.mission-line{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin:11px 0 5px;
  font-weight:900;
  font-size:14px;
}
.mission-line b{color:#e4e0ff}
.progress,.mini-progress{
  height:8px;
  background:#372d7f;
  border-radius:999px;
  overflow:hidden;
}
.progress div,.mini-progress span{
  display:block;
  width:0%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ffcf3a,#ffb000);
  transition:width .35s ease;
}
.egg-card,.map-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:center;
  text-align:left;
}
.egg-avatar{
  width:55px;height:55px;border-radius:17px;
  display:grid;place-items:center;
  background:#2d2474;
  font-size:34px;
}
.egg-card strong,.map-card strong{display:block}
.egg-card small,.map-card small{
  color:var(--muted);
  display:block;
  margin-top:4px;
  font-size:12px;
}
.mini-progress{margin:7px 0 2px;border:1px solid #5346a6}
.arrow{font-size:12px;color:var(--muted);white-space:nowrap}
.map-card>span:first-child{font-size:30px}
.treasure-card{
  text-align:center;
  font-weight:1000;
  color:#e9eaff;
}
.semester-tabs{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  margin:20px 0 12px;
}
.term{
  padding:13px 14px;
  border-radius:15px;
  background:#221b60;
  border:1px solid var(--line);
  color:#cfc8f3;
  font-weight:1000;
}
.term.active{
  color:var(--gold);
  border-color:#d7a70b;
  background:rgba(67,50,40,.98);
}
.unit-list{display:flex;flex-direction:column;gap:10px}
.unit{
  width:100%;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:8px;
  text-align:left;
  padding:16px;
  border-radius:14px;
  background:#211a5c;
  border:1px solid var(--line);
  font-weight:1000;
}
.unit.active{border-color:var(--gold);background:#2c2360}
.unit small{color:#ded8ff;font-weight:900}
.stars-mini{color:var(--gold)}
.lesson-path{
  position:relative;
  display:grid;
  justify-items:center;
  gap:38px;
  padding:28px 0 42px;
}
.lesson-path::before{
  content:"";
  position:absolute;
  top:40px;bottom:48px;left:50%;
  width:4px;
  transform:translateX(-50%);
  border-radius:999px;
  background:linear-gradient(#9af02b,#403389,#231c62);
  opacity:.48;
}
.lesson-node{
  position:relative;
  z-index:1;
  width:70px;height:70px;
  border-radius:50%;
  display:grid;place-items:center;
  background:linear-gradient(135deg,#8937ff,#5c20d3);
  box-shadow:0 10px 28px rgba(126,71,255,.32);
  font-size:28px;
}
.lesson-node.done{background:linear-gradient(135deg,#b9ff35,#4c9b00);color:#172208}
.lesson-node.locked{opacity:.36;filter:grayscale(1);background:#39364f}
.lesson-node.boss{border:2px solid #d7a70b}
.lesson-label{
  position:absolute;
  top:76px;
  font-size:12px;
  font-weight:1000;
  color:#dcd7ff;
  width:130px;
  text-align:center;
}
.lesson-stars{
  position:absolute;
  top:61px;
  color:var(--gold);
  font-size:12px;
  letter-spacing:2px;
}

/* 퀴즈 */
.quiz-top{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  margin-bottom:34px;
}
.close{
  background:transparent;
  color:#a8a0cc;
  font-size:34px;
  line-height:1;
}
.quiz-progress{height:13px}
.quiz-progress span{background:var(--lime)}
.goal{color:#dcd7ff;font-weight:1000;white-space:nowrap;font-size:14px}
.quiz-card{padding:8px 0}
.heart-row{text-align:right;margin-bottom:20px;letter-spacing:3px}
.question-text{
  text-align:center;
  font-size:20px;
  line-height:1.55;
  font-weight:1000;
  margin:8px 0 26px;
}
.visual-area{
  display:grid;
  place-items:center;
  min-height:42px;
  margin-bottom:18px;
}
.number-line{
  width:210px;
  height:42px;
  position:relative;
}
.number-line .line{
  position:absolute;left:0;right:0;top:18px;height:2px;background:#c5c0e8;
}
.number-line .tick{
  position:absolute;
  top:23px;
  width:1px;height:7px;
  background:#c5c0e8;
}
.number-line .num{
  position:absolute;
  top:32px;
  transform:translateX(-50%);
  color:#d8d3ff;
  font-size:10px;
  font-weight:900;
}
.number-line .dot{
  position:absolute;
  top:13px;
  width:11px;height:11px;
  border-radius:50%;
  background:var(--gold);
  transform:translateX(-50%);
}
.answer-area.choice-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.choice{
  min-height:76px;
  border-radius:14px;
  background:#2b2473;
  border:1px solid #443990;
  font-size:22px;
  font-weight:1000;
}
.choice.selected{border-color:var(--cyan);background:#23365d;color:#88e3ff}
.choice.correct{border-color:var(--lime);background:#285716;color:#c5ff5c}
.choice.wrong{border-color:var(--danger);background:#5e1f39;color:#ff92a9}
.answer-area.input-mode{
  display:grid;
  place-items:center;
}
.answer-box{
  width:100%;
  min-height:100px;
  border-radius:20px;
  background:#20195b;
  border:1px solid var(--line);
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  font-size:27px;
  font-weight:1000;
}
.answer-box input{
  width:96px;height:60px;
  border-radius:12px;
  border:2px dashed var(--gold);
  background:#28206d;
  color:#fff;
  text-align:center;
  font-size:28px;
  font-weight:1000;
  outline:none;
}
.answer-area.compare-mode{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
}
.compare-btn{
  min-height:74px;
  border-radius:15px;
  background:#2b2473;
  border:1px solid #443990;
  font-size:28px;
  font-weight:1000;
}
.check-btn{
  position:fixed;
  left:50%;
  bottom:max(24px,env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(460px,calc(100% - 40px));
  min-height:56px;
  border-radius:15px;
  background:#304d22;
  color:#121422;
  font-weight:1000;
  font-size:17px;
}
.check-btn:enabled{background:linear-gradient(180deg,var(--lime2),#87e416)}
.feedback-sheet{
  position:fixed;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:min(520px,100%);
  background:#113800;
  border-radius:22px 22px 0 0;
  padding:24px 26px max(28px,env(safe-area-inset-bottom));
  box-shadow:0 -22px 44px rgba(0,0,0,.35);
  z-index:12;
}
.feedback-sheet.wrong{background:#3c1020}
.feedback-sheet h2{margin:0 0 8px;color:var(--lime2)}
.feedback-sheet.wrong h2{color:#ff95aa}
.feedback-sheet p{margin:0 0 16px;line-height:1.55;font-weight:800}

/* 완료 */
.complete-screen{text-align:center;padding-top:34px}
.confetti{font-size:56px}
.complete-screen h1{margin:4px 0 12px;color:var(--lime2)}
.stars{font-size:42px;letter-spacing:6px;filter:drop-shadow(0 8px 12px rgba(0,0,0,.35))}
.xp-pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  margin:20px auto 8px;
  padding:14px 26px;
  border-radius:14px;
  background:#2b2472;
  color:var(--gold);
  font-size:20px;
}
.xp-pill small{color:#cfc8f3;font-size:12px}
.complete-score{color:#ded8ff;font-weight:1000}
.complete-score strong{color:var(--gold)}
.reward-stack{display:grid;gap:14px;margin-top:18px}
.reward-item{
  border-radius:18px;
  background:#20195b;
  border:1px solid var(--line);
  padding:16px;
}
.reward-item .icon{font-size:40px}
.reward-item h3{margin:6px 0;color:var(--gold)}
.cards3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.mystery-card{
  height:92px;border-radius:12px;
  background:linear-gradient(145deg,#14123b,#22205a);
  border:1px solid #6ea6ff;
  color:#8ecaff;font-size:22px;
  box-shadow:0 0 18px rgba(90,150,255,.25);
}
.complete-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:22px;
}

/* 페이지 */
.page-screen h1{margin:8px 0 6px}
.page-sub{color:var(--muted);font-weight:800;margin:0 0 22px;line-height:1.45}
.backBtn{
  background:transparent;
  color:#c9c3ea;
  font-size:26px;
  margin-left:-6px;
}
.dungeon-banner{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:center;
}
.dungeon-banner span{font-size:32px}
.dungeon-banner small,.locked-castle small{display:block;color:var(--muted);margin-top:4px}
.grade-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin:12px 0 22px;
}
.grade-grid button{
  min-height:62px;
  border-radius:13px;
  background:#20195b;
  border:1px solid var(--line);
  font-weight:1000;
  display:grid;
  place-items:center;
}
.grade-grid span{font-size:11px}
.grade-grid .active{border-color:var(--gold);color:var(--gold);background:#342535}
.locked-castle{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
}
.badge-grid{
  border-radius:18px;
  background:#20195b;
  border:1px solid var(--line);
  padding:16px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:14px;
}
.badge-cell{
  display:grid;
  place-items:center;
  gap:4px;
  min-height:62px;
  font-size:24px;
  opacity:.35;
  filter:grayscale(1);
}
.badge-cell.on{opacity:1;filter:none}
.badge-cell small{font-size:9px;color:#cfc8f3;font-weight:900;text-align:center}
.medal-card{display:flex;align-items:center;gap:14px}
.medal-orb{
  width:58px;height:58px;border-radius:50%;
  display:grid;place-items:center;
  font-family:Georgia,serif;font-weight:1000;font-size:26px;
  background:radial-gradient(circle,#73ab1f,#397100);
  border:3px double #d7ff66;
  box-shadow:0 0 20px rgba(154,240,43,.45);
}
.medal-card small{display:block;color:var(--muted);margin-top:4px}
.treasure-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px 10px;
}
.t-card{
  min-height:126px;
  border-radius:12px;
  background:
    radial-gradient(circle at 50% 20%,rgba(255,255,255,.10),transparent 28%),
    linear-gradient(145deg,#070711,#15152c);
  border:1px solid #37365d;
  display:grid;place-items:center;
  color:#a78346;
  font-size:22px;
  position:relative;
}
.t-card.open{
  background:linear-gradient(145deg,#15134c,#39217f);
  border-color:var(--gold);
  box-shadow:0 0 18px rgba(255,201,40,.28);
}
.t-card small{
  position:absolute;
  bottom:-19px;
  color:#cfc8f3;
  font-size:10px;
  font-weight:900;
}
.egg-talk{
  display:grid;
  align-content:end;
  min-height:100vh;
  background:
    radial-gradient(circle at 50% 38%,rgba(255,218,113,.18),transparent 24%),
    radial-gradient(circle at 14% 72%,rgba(87,222,90,.12),transparent 24%),
    linear-gradient(180deg,#181347,#0d0a25);
}
.egg-back{position:absolute;top:14px;left:20px}
.egg-glow{
  text-align:center;
  font-size:112px;
  margin-bottom:95px;
  filter:drop-shadow(0 0 28px rgba(255,222,118,.55));
}
.talk-box{
  margin:0 -20px -104px;
  padding:24px 24px 34px;
  background:#20195b;
  border:1px solid var(--line);
  border-radius:24px 24px 0 0;
}
.talk-box p{font-size:20px;line-height:1.55;font-weight:1000}
.talkChoice{
  width:100%;
  padding:18px;
  margin-top:12px;
  border-radius:14px;
  background:#30287c;
  text-align:left;
  font-size:17px;
  font-weight:1000;
}
.profile-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:16px;
  align-items:center;
}
.avatar.big{width:76px;height:76px;font-size:42px}
.profile-card h2{margin:0}
.profile-card p{margin:4px 0 0;color:var(--gold);font-weight:1000}
.profile-stats{display:grid;gap:8px;color:#ded8ff}
.treasure-link{
  display:grid;
  grid-template-columns:1fr auto;
  gap:6px;
  text-align:left;
  font-size:18px;
  font-weight:1000;
}
.treasure-link small{grid-column:1/3;color:var(--muted);font-size:13px}

/* 하단 탭 */
.bottom-nav{
  position:fixed;
  left:50%;bottom:0;
  transform:translateX(-50%);
  width:min(520px,100%);
  display:grid;
  grid-template-columns:repeat(4,1fr);
  padding:10px 14px max(10px,env(safe-area-inset-bottom));
  background:rgba(9,7,25,.94);
  border-top:1px solid #30276c;
  backdrop-filter:blur(12px);
  z-index:20;
}
.nav-item{
  display:grid;
  place-items:center;
  gap:2px;
  background:transparent;
  color:#9d95ce;
  font-size:20px;
}
.nav-item span{font-size:11px;font-weight:1000}
.nav-item.active{color:var(--gold)}

@media (max-width:390px){
  .screen{padding-left:14px;padding-right:14px}
  .modal{padding:14px}
  .days{gap:5px}
  .day{min-height:62px}
  .grade-grid{grid-template-columns:repeat(3,1fr)}
  .badge-grid{grid-template-columns:repeat(4,1fr)}
  .question-text{font-size:18px}
}


/* ===== V5 보강: 8문항 목표, 긴 레슨길, 자체 교사 코드창 ===== */
.goal{
  color:#dcd7ff;
}
.goal span{
  color:#8ee6ff;
}
.quiz-card{
  margin-top:20px;
}
.question-text{
  max-width:480px;
  margin-left:auto;
  margin-right:auto;
}
.answer-box{
  max-width:480px;
  margin:0 auto;
}
.answer-box input:focus{
  box-shadow:0 0 0 4px rgba(255,201,40,.14);
}
.lesson-path{
  gap:54px;
  padding:34px 0 64px;
}
.lesson-node{
  width:76px;
  height:76px;
}
.lesson-node.locked{
  width:66px;
  height:66px;
}
.lesson-node.challenge{
  background:linear-gradient(135deg,#4026a8,#7353ff);
  border:2px solid #e0aa19;
}
.lesson-node.optional{
  background:linear-gradient(135deg,#1c6f9e,#4031b3);
}
.lesson-label{
  top:82px;
}
.lesson-stars{
  top:68px;
}
.teacher-card{
  text-align:left;
}
.teacher-card .primary,
.teacher-card .secondary{
  min-height:52px;
}
.teacher-message-ok{
  color:#9af02b!important;
}
.teacher-message-bad{
  color:#ff95aa!important;
}


/* ===== V6: 1학년부터 6학년까지 확장 선택 UI ===== */
.grade-section{
  margin:20px 0 12px;
}
.grade-title-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  color:#ded8ff;
  font-weight:1000;
}
.small-link{
  background:#2c2574;
  border:1px solid #5145a6;
  border-radius:999px;
  padding:8px 12px;
  color:#dcd7ff;
  font-weight:1000;
  font-size:12px;
}
.grade-chip-strip{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:2px 2px 8px;
  scrollbar-width:thin;
}
.grade-chip{
  flex:0 0 auto;
  min-width:104px;
  padding:12px 14px;
  border-radius:15px;
  background:#221b60;
  border:1px solid #5145a6;
  color:#cfc8f3;
  font-weight:1000;
  white-space:nowrap;
}
.grade-chip.active{
  color:#ffc928;
  border-color:#d7a70b;
  background:rgba(67,50,40,.98);
}
.curriculum-note{
  margin:8px 0 14px;
  color:#b7afd9;
  font-size:12px;
  line-height:1.45;
}


/* ===== V7: 학년·학기 선택 화면 개선 ===== */
/* 가로 스크롤을 없애고 전체 학년이 한눈에 보이도록 2열 그리드로 변경 */
.grade-chip-strip{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  overflow:visible;
  padding:2px 0 8px;
}

.grade-chip{
  width:100%;
  min-width:0;
  min-height:46px;
  padding:11px 8px;
  border-radius:14px;
  text-align:center;
  white-space:normal;
  line-height:1.2;
  font-size:14px;
}

/* 던전 화면도 4열에서 2열로 바꿔 글자가 잘리지 않게 함 */
.grade-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:9px;
}

.grade-grid button{
  min-height:54px;
  padding:10px 6px;
  line-height:1.2;
}

.grade-grid button span{
  font-size:13px;
  white-space:normal;
}

/* 화면이 넓은 경우에는 3열로 자연스럽게 확장 */
@media (min-width:470px){
  .grade-chip-strip{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .grade-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
}

/* 아주 좁은 화면에서는 1열로 내려 글자 잘림 방지 */
@media (max-width:330px){
  .grade-chip-strip,
  .grade-grid{
    grid-template-columns:1fr;
  }
}


/* ===== V8: PPT 진도표 기준 단원 반영 ===== */
.unit span{
  word-break:keep-all;
}
.grade-chip::after{
  content:"";
}
.curriculum-source{
  color:#b7afd9;
  font-size:12px;
  line-height:1.45;
}


/* ===== V9: 확인 버튼 겹침 수정 ===== */
/* 문제 풀이와 완료 화면에서는 하단 메뉴를 숨겨 확인/계속하기 버튼과 겹치지 않게 함 */
body[data-screen="quizScreen"] .bottom-nav,
body[data-screen="completeScreen"] .bottom-nav,
body[data-screen="eggScreen"] .bottom-nav {
  display:none;
}

/* 문제 화면은 하단 확인 버튼 공간을 충분히 확보 */
body[data-screen="quizScreen"] .screen {
  padding-bottom:140px;
}

/* 확인 버튼을 하단 중앙에 두되, 브라우저 하단 안전 영역과 겹치지 않게 여백 확보 */
body[data-screen="quizScreen"] .check-btn {
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 18;
}

/* 피드백이 올라올 때 확인 버튼은 숨겨지고 피드백 버튼이 안정적으로 보이게 함 */
.feedback-sheet {
  z-index: 25;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

/* 완료 화면의 버튼은 고정 메뉴와 겹치지 않도록 일반 흐름 안에서 표시 */
.complete-actions {
  position: static;
  margin-bottom: 20px;
}

/* 모바일 브라우저 주소창/하단바 때문에 버튼이 눌리기 어려운 경우를 줄임 */
.quiz-card {
  margin-bottom: 24px;
}

.answer-area {
  margin-bottom: 28px;
}


/* ===== V10: 힌트 버튼/힌트 문구 추가 ===== */
.hint-btn{
  position:fixed;
  left:50%;
  bottom:max(92px, calc(env(safe-area-inset-bottom) + 92px));
  transform:translateX(-50%);
  min-height:34px;
  padding:6px 14px;
  border-radius:999px;
  background:#433ea4;
  border:1px solid #756ef0;
  color:#fff5c0;
  font-weight:1000;
  font-size:12px;
  box-shadow:0 8px 18px rgba(0,0,0,.22);
  z-index:18;
}
.hint-btn.hidden{
  display:none;
}
.hint-bubble{
  position:fixed;
  left:50%;
  bottom:max(138px, calc(env(safe-area-inset-bottom) + 138px));
  transform:translateX(-50%);
  width:min(460px,calc(100% - 32px));
  background:rgba(73,61,180,.96);
  border:1px solid #8d84ff;
  border-radius:16px;
  padding:14px 16px;
  color:#f2efff;
  box-shadow:0 16px 34px rgba(0,0,0,.28);
  z-index:19;
}
.hint-bubble strong{
  display:block;
  margin-bottom:6px;
  color:#ffe77a;
  font-size:13px;
}
.hint-bubble p{
  margin:0;
  line-height:1.5;
  font-size:14px;
  font-weight:800;
}
body[data-screen="quizScreen"] .screen{
  padding-bottom:200px;
}
body[data-screen="quizScreen"] .check-btn{
  bottom:max(24px, env(safe-area-inset-bottom));
}
body[data-screen="quizScreen"] .feedback-sheet{
  z-index:25;
}
body[data-screen="quizScreen"] .feedback-sheet:not(.hidden) ~ .hint-btn,
body[data-screen="quizScreen"] .feedback-sheet:not(.hidden) ~ .hint-bubble{
  display:none;
}


/* ===== V11: 문항별 맞춤 힌트 개선 ===== */
.hint-bubble{
  background:linear-gradient(180deg,rgba(82,70,192,.98),rgba(61,51,158,.98));
}
.hint-bubble p{
  font-size:15px;
  line-height:1.62;
}
.hint-btn{
  min-width:112px;
}


/* ===== V18: 그림형 힌트 가독성 개선 ===== */
#hintText{
  white-space:pre-line;
  letter-spacing:-0.01em;
}
.hint-bubble{
  max-height:42vh;
  overflow:auto;
}


/* ===== V20: 그림형 힌트 추가 가독성 ===== */
#hintText{
  white-space:pre-line;
}
.hint-bubble p{
  line-height:1.7;
}


/* ===== V21: 그림형 힌트 유지 ===== */
#hintText{
  white-space:pre-line;
}
.hint-bubble p{
  line-height:1.7;
}


/* ===== V22: 5학년 그림형 힌트 유지 ===== */
#hintText{
  white-space:pre-line;
}
.hint-bubble p{
  line-height:1.7;
}


/* ===== V23: 5학년 2학기 그림형 힌트 유지 ===== */
#hintText{
  white-space:pre-line;
}
.hint-bubble p{
  line-height:1.7;
}


/* ===== V24: 6학년 1학기 그림형 힌트 유지 ===== */
#hintText{
  white-space:pre-line;
}
.hint-bubble p{
  line-height:1.7;
}


/* ===== V25: 6학년 2학기 그림형 힌트 유지 ===== */
#hintText{
  white-space:pre-line;
}
.hint-bubble p{
  line-height:1.7;
}


/* ===== V26: 최종 힌트/오답 피드백 가독성 개선 ===== */
.hint-bubble{
  background:linear-gradient(180deg,rgba(67,56,202,.98),rgba(39,34,121,.98));
  border:1px solid rgba(199,210,254,.55);
  padding:16px;
  max-height:46vh;
}
.hint-bubble strong{
  font-size:14px;
  letter-spacing:-0.01em;
}
#hintText{
  white-space:normal;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.hint-line{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.08);
  color:#f8f7ff;
  font-size:14px;
  line-height:1.45;
}
.hint-line.first{
  background:rgba(255,231,122,.14);
  border-color:rgba(255,231,122,.35);
}
.hint-line.math{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  letter-spacing:-0.02em;
}
.hint-mark{
  width:20px;
  flex:0 0 20px;
  text-align:center;
}
.hint-body{
  flex:1;
}
#feedbackText{
  white-space:pre-line;
}
.feedback-sheet.wrong{
  background:linear-gradient(180deg,#4a1024,#310b18);
}
.feedback-sheet.wrong p{
  line-height:1.62;
}


/* ===== V27: 도형 문제 도형 힌트 시각화 ===== */
.hint-visual-area{
  margin-top:12px;
  display:block;
}
.hint-visual-area.hidden{
  display:none;
}
.hint-figure-card{
  padding:12px;
  border-radius:14px;
  background:rgba(10,14,46,.32);
  border:1px solid rgba(255,255,255,.12);
}
.hint-figure-title{
  color:#ffe77a;
  font-weight:1000;
  font-size:13px;
  margin-bottom:8px;
}
.hint-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:8px;
}
.hint-chip{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.12);
  color:#eef2ff;
  font-size:12px;
  font-weight:900;
}
.hint-figure-svg{
  display:grid;
  place-items:center;
  border-radius:12px;
  padding:8px;
  background:rgba(255,255,255,.05);
}
.hint-svg{
  width:100%;
  max-width:260px;
  height:auto;
}
.hint-figure-note{
  margin-top:8px;
  color:#eef2ff;
  font-size:13px;
  line-height:1.5;
  font-weight:800;
}


/* ===== V28: 문항별 맞춤 도형 힌트 ===== */
.hint-figure-card{background:linear-gradient(180deg,rgba(13,20,60,.42),rgba(15,17,43,.32));}
.hint-figure-svg{min-height:150px;}
.hint-chip{box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);}


/* ===== V29: 정교한 문항별 도형 힌트 ===== */
.hint-figure-svg{overflow:hidden;}
.hint-figure-note{white-space:pre-line;}


/* ===== V30: hintDiagram data-driven ===== */
.hint-figure-card{box-shadow:0 8px 24px rgba(0,0,0,.12);}


/* ===== V33: 참고 앱 기반 게임형 디자인 고도화 ===== */
:root{
  --v33-bg1:#151146;
  --v33-bg2:#22136b;
  --v33-card:rgba(32,27,93,.78);
  --v33-card2:rgba(53,39,139,.72);
  --v33-line:rgba(190,180,255,.24);
  --v33-gold:#ffe26d;
  --v33-cyan:#7dd3fc;
  --v33-pink:#f0abfc;
  --v33-lime:#bef264;
}

/* 전체 배경: 참고 앱처럼 깊이감 있는 모험 화면 */
body{
  background:
    radial-gradient(circle at 20% 10%, rgba(125,211,252,.22), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(240,171,252,.18), transparent 26%),
    radial-gradient(circle at 50% 95%, rgba(190,242,100,.13), transparent 32%),
    linear-gradient(180deg,var(--v33-bg2),var(--v33-bg1) 55%,#0f1238);
}
.app{
  background:
    linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.01)),
    radial-gradient(circle at 50% 0%,rgba(255,226,109,.08),transparent 34%);
  border-left:1px solid rgba(255,255,255,.08);
  border-right:1px solid rgba(255,255,255,.08);
}

/* 상단 상태 영역: 게임 HUD 느낌 */
.topbar,
.header-card,
.home-hero,
.card{
  backdrop-filter:blur(14px);
}
.header-card,
.home-hero,
.card{
  background:linear-gradient(180deg,rgba(50,43,141,.82),rgba(29,25,86,.78));
  border:1px solid var(--v33-line);
  box-shadow:0 16px 38px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
}
.topbar{
  border-radius:0 0 26px 26px;
}

/* 홈 화면: 캐릭터와 미션 카드가 더 게임처럼 보이게 */
.hero-egg,
.egg-glow{
  filter:drop-shadow(0 18px 30px rgba(255,226,109,.22));
  animation:v33Float 3.4s ease-in-out infinite;
}
@keyframes v33Float{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-7px)}
}
.xp-bar,
.mission-bar,
.quiz-progress{
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:inset 0 1px 3px rgba(0,0,0,.35);
}
.xp-bar span,
.mission-bar span,
.quiz-progress span{
  background:linear-gradient(90deg,var(--v33-lime),var(--v33-cyan));
  box-shadow:0 0 16px rgba(125,211,252,.42);
}

/* 학년 선택 칩: 더 선명한 버튼 */
.grade-chip,
.term{
  background:linear-gradient(180deg,rgba(61,52,164,.88),rgba(34,28,103,.88));
  border:1px solid rgba(199,210,254,.22);
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}
.grade-chip.active,
.term.active{
  color:#271d04;
  background:linear-gradient(180deg,#fff3a6,#facc15);
  border-color:#fff7cc;
  box-shadow:0 10px 24px rgba(250,204,21,.28);
}

/* 단원 카드: 던전 입구 느낌 */
.unit{
  border-radius:20px;
  background:
    linear-gradient(135deg,rgba(73,63,199,.88),rgba(36,29,111,.9)),
    radial-gradient(circle at 10% 15%,rgba(255,255,255,.12),transparent 24%);
  border:1px solid rgba(205,198,255,.26);
  box-shadow:0 12px 26px rgba(0,0,0,.20);
}
.unit.active{
  background:
    linear-gradient(135deg,rgba(93,75,230,.96),rgba(56,42,157,.96)),
    radial-gradient(circle at 80% 0%,rgba(255,226,109,.20),transparent 28%);
  border-color:rgba(255,226,109,.58);
  box-shadow:0 16px 34px rgba(0,0,0,.26),0 0 0 1px rgba(255,226,109,.16);
}

/* 레슨 길: 보드게임 말판 느낌 */
.lesson-path{
  padding:34px 0 52px;
}
.lesson-path::before{
  width:8px;
  background:linear-gradient(180deg,var(--v33-gold),var(--v33-cyan),rgba(190,242,100,.35));
  box-shadow:0 0 18px rgba(125,211,252,.24);
}
.lesson-node{
  width:78px;
  height:78px;
  border:2px solid rgba(255,255,255,.18);
  background:
    radial-gradient(circle at 32% 22%,rgba(255,255,255,.25),transparent 32%),
    linear-gradient(135deg,#8b5cf6,#4c1d95);
  box-shadow:0 14px 30px rgba(76,29,149,.38);
}
.lesson-node.done{
  background:
    radial-gradient(circle at 32% 22%,rgba(255,255,255,.32),transparent 34%),
    linear-gradient(135deg,#d9ff66,#65a30d);
  color:#152108;
}
.lesson-node.challenge{
  background:
    radial-gradient(circle at 30% 20%,rgba(255,255,255,.26),transparent 34%),
    linear-gradient(135deg,#facc15,#fb923c);
}
.lesson-label{
  color:#f4f2ff;
  text-shadow:0 2px 8px rgba(0,0,0,.45);
}

/* 문제 카드: 집중도 높이기 */
.quiz-card{
  margin-top:8px;
  padding:22px 18px;
  border-radius:26px;
  background:
    radial-gradient(circle at 12% 0%,rgba(125,211,252,.14),transparent 28%),
    linear-gradient(180deg,rgba(38,31,121,.86),rgba(23,20,72,.9));
  border:1px solid rgba(199,210,254,.22);
  box-shadow:0 18px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.07);
}
.question-text{
  font-size:21px;
  color:#ffffff;
  text-shadow:0 3px 12px rgba(0,0,0,.32);
}

/* 보기 버튼 */
.choice,
.compare-btn{
  background:
    linear-gradient(180deg,rgba(58,49,159,.92),rgba(37,31,111,.94));
  border:1px solid rgba(199,210,254,.22);
  box-shadow:0 10px 20px rgba(0,0,0,.20);
}
.choice:hover,
.compare-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(125,211,252,.58);
}
.choice.selected,
.compare-btn.selected{
  background:linear-gradient(180deg,rgba(14,116,144,.82),rgba(30,64,175,.86));
  box-shadow:0 0 0 2px rgba(125,211,252,.26);
}
.choice.correct,
.compare-btn.correct{
  background:linear-gradient(180deg,#84cc16,#3f6212);
  color:#f7fee7;
}
.choice.wrong,
.compare-btn.wrong{
  background:linear-gradient(180deg,#f43f5e,#881337);
  color:#fff1f2;
}

/* 힌트: 도형 그림이 더 크게 보이도록 */
.hint-bubble{
  width:min(500px,calc(100% - 24px));
  max-height:58vh;
  border-radius:22px;
  background:
    radial-gradient(circle at 18% 0%,rgba(125,211,252,.16),transparent 30%),
    linear-gradient(180deg,rgba(45,39,139,.98),rgba(23,20,75,.98));
  border:1px solid rgba(199,210,254,.46);
  box-shadow:0 24px 50px rgba(0,0,0,.36);
}
.hint-line{
  background:rgba(255,255,255,.075);
  border-color:rgba(255,255,255,.10);
}
.hint-figure-card{
  border-radius:18px;
  background:linear-gradient(180deg,rgba(10,18,60,.52),rgba(10,12,40,.42));
  border:1px solid rgba(255,255,255,.14);
}
.hint-figure-svg{
  min-height:178px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.035));
}
.hint-svg{
  max-width:320px;
}
.hint-chip{
  background:rgba(125,211,252,.12);
  border-color:rgba(125,211,252,.25);
}

/* 오답 피드백: 경고 느낌은 유지하되 읽기 좋게 */
.feedback-sheet{
  border-radius:26px 26px 0 0;
  border-top:1px solid rgba(255,255,255,.16);
  box-shadow:0 -18px 42px rgba(0,0,0,.32);
}
.feedback-sheet.wrong{
  background:
    radial-gradient(circle at 20% 0%,rgba(251,113,133,.18),transparent 28%),
    linear-gradient(180deg,#531328,#250914);
}

/* 보상 화면 */
.complete-screen .confetti,
.starResult,
.stars{
  filter:drop-shadow(0 8px 18px rgba(250,204,21,.25));
}
.reward-item{
  background:linear-gradient(180deg,rgba(65,56,186,.82),rgba(31,28,96,.86));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 14px 30px rgba(0,0,0,.22);
}

/* 하단 탭: 앱 느낌 강화 */
.bottom-nav{
  background:rgba(18,16,60,.82);
  backdrop-filter:blur(18px);
  border-top:1px solid rgba(255,255,255,.12);
}
.nav-item.active{
  color:#fff3a6;
  text-shadow:0 0 12px rgba(250,204,21,.35);
}

/* 모바일에서 힌트와 문제 영역 여백 */
@media (max-width:480px){
  .quiz-card{
    padding:20px 14px;
  }
  .question-text{
    font-size:20px;
  }
  .hint-bubble{
    bottom:max(126px, calc(env(safe-area-inset-bottom) + 126px));
  }
  .hint-figure-svg{
    min-height:160px;
  }
}


/* ===== V34: 참고 앱형 마우스 반응 + 클릭/정답 사운드 UI ===== */
button,
[role="button"],
.unit,
.lesson-node,
.choice,
.compare-btn,
.grade-chip,
.term,
.nav-item,
.treasure-link,
.mystery-card,
.day,
.talkChoice,
#profileShortcut,
#openAllGrades,
#eggTalkBtn,
#dungeonBtn,
#treasureBtn,
#profileTreasureBtn{
  cursor:pointer;
  transition:
    transform .16s ease,
    filter .16s ease,
    box-shadow .16s ease,
    border-color .16s ease,
    background .16s ease,
    opacity .16s ease;
}

button:disabled,
.choice:disabled,
.compare-btn:disabled{
  cursor:not-allowed;
  opacity:.55;
}

.lesson-node.locked,
.lesson-node.locked *,
.unit.locked,
.locked{
  cursor:not-allowed;
}

@media (hover:hover){
  button:not(:disabled):hover,
  .unit:hover,
  .lesson-node:not(.locked):hover,
  .choice:hover,
  .compare-btn:hover,
  .grade-chip:hover,
  .term:hover,
  .nav-item:hover,
  .treasure-link:hover,
  .mystery-card:hover,
  .talkChoice:hover,
  #profileShortcut:hover,
  #openAllGrades:hover,
  #eggTalkBtn:hover,
  #dungeonBtn:hover,
  #treasureBtn:hover,
  #profileTreasureBtn:hover{
    filter:brightness(1.18) saturate(1.12);
    transform:translateY(-2px) scale(1.015);
    box-shadow:0 16px 34px rgba(0,0,0,.26), 0 0 0 1px rgba(255,255,255,.14), 0 0 22px rgba(125,211,252,.14);
  }

  .lesson-node:not(.locked):hover{
    transform:translateY(-3px) scale(1.08);
    filter:brightness(1.22) saturate(1.18);
  }

  .nav-item:hover{
    color:#fff3a6;
    text-shadow:0 0 14px rgba(250,204,21,.42);
  }

  .choice:hover,
  .compare-btn:hover{
    border-color:rgba(125,211,252,.72);
  }
}

button:not(:disabled):active,
.unit:active,
.lesson-node:not(.locked):active,
.choice:active,
.compare-btn:active,
.grade-chip:active,
.term:active,
.nav-item:active{
  transform:translateY(1px) scale(.985);
  filter:brightness(1.05);
}

/* 키보드 접근성: 포커스도 클릭 가능 영역처럼 보이게 */
button:focus-visible,
.choice:focus-visible,
.compare-btn:focus-visible,
.grade-chip:focus-visible,
.term:focus-visible,
.nav-item:focus-visible{
  outline:3px solid rgba(125,211,252,.72);
  outline-offset:3px;
}


/* ===== V35: 학생 사용성 1차 정리 ===== */

/* 상단 소리 버튼 */
.sound-toggle{
  min-width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.10);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:20px;
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}
.sound-toggle.muted{
  opacity:.72;
  filter:grayscale(.35);
}

/* 처음 쓰는 학생용 안내 카드 */
.guide-card{
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:start;
  margin-top:14px;
  border-color:rgba(125,211,252,.35);
  background:
    radial-gradient(circle at 10% 0%,rgba(125,211,252,.16),transparent 28%),
    linear-gradient(180deg,rgba(52,44,145,.86),rgba(27,24,88,.82));
}
.guide-icon{
  width:46px;
  height:46px;
  border-radius:16px;
  display:grid;
  place-items:center;
  font-size:26px;
  background:rgba(125,211,252,.14);
  border:1px solid rgba(125,211,252,.22);
}
.guide-card strong{
  display:block;
  margin-bottom:6px;
  color:#fff8c7;
}
.guide-card ol{
  margin:0;
  padding-left:18px;
  color:#eef2ff;
  font-size:13px;
  line-height:1.6;
}
.guide-close{
  width:32px;
  height:32px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:20px;
}

/* 문제 화면 안내 문구 */
.quiz-helper{
  margin:0 0 10px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(125,211,252,.10);
  border:1px solid rgba(125,211,252,.20);
  color:#dff7ff;
  font-size:13px;
  font-weight:800;
  line-height:1.45;
}
.quiz-helper.ready{
  background:rgba(190,242,100,.12);
  border-color:rgba(190,242,100,.28);
  color:#ecfccb;
}
.quiz-helper.correct{
  background:rgba(132,204,22,.16);
  border-color:rgba(190,242,100,.34);
  color:#f7fee7;
}
.quiz-helper.wrong{
  background:rgba(251,113,133,.14);
  border-color:rgba(251,113,133,.30);
  color:#ffe4e6;
}

/* 확인 버튼을 더 명확하게 */
.check-btn{
  min-height:56px;
  font-size:17px;
  font-weight:1000;
  letter-spacing:-.02em;
}
.check-btn:disabled{
  cursor:not-allowed;
  filter:grayscale(.25);
}

/* 보기 선택 상태를 더 분명하게 */
.choice.selected,
.compare-btn.selected{
  transform:translateY(-2px) scale(1.02);
  border-color:rgba(255,226,109,.85);
  box-shadow:0 0 0 3px rgba(255,226,109,.22),0 14px 26px rgba(0,0,0,.22);
}

/* 학생이 누르는 영역을 조금 더 크게 */
.choice,
.compare-btn,
.grade-chip,
.unit,
.lesson-node{
  -webkit-tap-highlight-color:rgba(255,226,109,.22);
}

/* 작은 화면에서 상단이 너무 빽빽하지 않게 */
@media (max-width:480px){
  .topbar{
    gap:8px;
  }
  .sound-toggle{
    min-width:38px;
    height:38px;
    font-size:18px;
  }
  .guide-card{
    grid-template-columns:auto 1fr;
  }
  .guide-close{
    position:absolute;
    right:10px;
    top:10px;
  }
}


/* ===== V36: 모바일 / 태블릿 화면 최적화 ===== */

/* 모바일 브라우저 주소창 변화에 대응 */
html{
  height:100%;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  min-height:100vh;
  min-height:100dvh;
  overscroll-behavior-y:none;
}
.app{
  min-height:100vh;
  min-height:100dvh;
  padding-bottom:calc(88px + env(safe-area-inset-bottom));
}

/* iPhone/Android 하단 안전 영역 */
.bottom-nav{
  padding-bottom:calc(8px + env(safe-area-inset-bottom));
}
.hint-bubble{
  bottom:calc(112px + env(safe-area-inset-bottom));
}

/* 터치 기본값: 손가락으로 누르기 편하게 */
button,
.choice,
.compare-btn,
.grade-chip,
.term,
.unit,
.lesson-node,
.nav-item{
  touch-action:manipulation;
  -webkit-user-select:none;
  user-select:none;
}

/* 작은 모바일 화면 */
@media (max-width:480px){
  .app{
    width:100%;
    max-width:none;
    border-left:0;
    border-right:0;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:30;
    min-height:58px;
    padding:10px 12px;
    border-radius:0 0 20px 20px;
  }

  .brand{
    min-width:0;
  }

  .brand-title,
  .app-title,
  h1{
    font-size:clamp(18px,5vw,23px);
    line-height:1.15;
  }

  .topbar .coin,
  .topbar .flame{
    font-size:13px;
    padding:7px 9px;
  }

  .sound-toggle{
    min-width:38px;
    height:38px;
    flex:0 0 auto;
  }

  main,
  .screen{
    padding-left:12px;
    padding-right:12px;
  }

  .home-hero,
  .header-card,
  .card,
  .quiz-card{
    border-radius:20px;
  }

  .home-hero{
    padding:16px 14px;
  }

  .hero-title{
    font-size:clamp(23px,7vw,32px);
    line-height:1.08;
  }

  .hero-subtitle,
  .subtitle,
  .guide-card ol{
    font-size:13px;
  }

  .guide-card{
    margin-top:10px;
    padding:13px;
    gap:10px;
  }

  .guide-icon{
    width:40px;
    height:40px;
    font-size:22px;
    border-radius:13px;
  }

  .grade-section,
  .unit-section,
  .lesson-section{
    margin-top:14px;
  }

  .grade-grid,
  .term-grid,
  .unit-grid,
  .lesson-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }

  .grade-chip,
  .term{
    min-height:48px;
    font-size:15px;
  }

  .unit{
    min-height:96px;
    padding:13px 12px;
  }

  .unit-title{
    font-size:15px;
    line-height:1.28;
  }

  .unit-meta,
  .lesson-label{
    font-size:12px;
  }

  .lesson-path{
    padding:24px 0 42px;
  }

  .lesson-node{
    width:66px;
    height:66px;
    font-size:20px;
  }

  .quiz-card{
    padding:17px 13px;
    margin-top:4px;
  }

  .question-text{
    font-size:clamp(19px,5.6vw,22px);
    line-height:1.38;
    word-break:keep-all;
    overflow-wrap:anywhere;
  }

  .quiz-helper{
    font-size:12.5px;
    padding:9px 10px;
  }

  .choice,
  .compare-btn{
    min-height:54px;
    padding:13px 12px;
    font-size:16px;
    line-height:1.35;
    word-break:keep-all;
  }

  .answer-input{
    min-height:54px;
    font-size:20px;
  }

  .check-btn{
    min-height:56px;
    font-size:16px;
    border-radius:18px;
  }

  .hint-bubble{
    width:calc(100% - 20px);
    max-height:62vh;
    bottom:calc(102px + env(safe-area-inset-bottom));
    padding:14px;
  }

  .hint-figure-svg{
    min-height:150px;
    padding:6px;
  }

  .hint-svg{
    max-width:285px;
  }

  .hint-figure-note,
  .hint-line{
    font-size:12.5px;
  }

  .feedback-sheet{
    max-height:72vh;
    overflow-y:auto;
    padding-bottom:calc(18px + env(safe-area-inset-bottom));
  }

  .bottom-nav{
    height:auto;
    min-height:70px;
  }

  .nav-item{
    min-width:58px;
    min-height:54px;
    font-size:11.5px;
  }
}

/* 아주 작은 화면: 360px 이하 */
@media (max-width:360px){
  .topbar{
    padding-left:8px;
    padding-right:8px;
    gap:6px;
  }

  .topbar .coin,
  .topbar .flame{
    display:none;
  }

  .grade-grid,
  .term-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .unit-grid{
    grid-template-columns:1fr;
  }

  .lesson-node{
    width:60px;
    height:60px;
  }

  .question-text{
    font-size:18px;
  }

  .choice,
  .compare-btn{
    font-size:15px;
  }
}

/* 태블릿 세로/가로: 화면을 더 넓게 활용 */
@media (min-width:700px){
  .app{
    max-width:900px;
  }

  main,
  .screen{
    max-width:860px;
    margin-left:auto;
    margin-right:auto;
  }

  .home-hero{
    display:grid;
    grid-template-columns:1.1fr .9fr;
    align-items:center;
    gap:18px;
  }

  .grade-grid,
  .term-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
  }

  .unit-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
  }

  .unit{
    min-height:118px;
  }

  .lesson-path{
    max-width:720px;
    margin-left:auto;
    margin-right:auto;
  }

  .quiz-card{
    max-width:760px;
    margin-left:auto;
    margin-right:auto;
    padding:28px 26px;
  }

  .question-text{
    font-size:25px;
  }

  .choices{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }

  .choice,
  .compare-btn{
    min-height:62px;
    font-size:18px;
  }

  .hint-bubble{
    max-width:620px;
  }

  .hint-svg{
    max-width:390px;
  }

  .hint-figure-svg{
    min-height:210px;
  }
}

/* 태블릿 가로 또는 넓은 화면: 너무 길어 보이지 않게 */
@media (min-width:980px){
  .app{
    max-width:1040px;
  }

  main,
  .screen{
    max-width:980px;
  }

  .unit-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .quiz-card{
    max-width:840px;
  }
}

/* 가로 모드가 낮은 화면일 때 */
@media (orientation:landscape) and (max-height:520px){
  .topbar{
    min-height:50px;
    padding-top:6px;
    padding-bottom:6px;
  }

  .home-hero{
    padding:12px;
  }

  .quiz-card{
    padding:14px;
  }

  .question-text{
    font-size:19px;
    margin-bottom:10px;
  }

  .choice,
  .compare-btn{
    min-height:46px;
    padding:9px 11px;
  }

  .hint-bubble{
    max-height:72vh;
    bottom:calc(82px + env(safe-area-inset-bottom));
  }

  .bottom-nav{
    min-height:58px;
  }

  .nav-item{
    min-height:46px;
  }
}

/* 터치 기기에서는 hover로 튀는 느낌을 줄이고, 누를 때만 반응 */
@media (hover:none){
  button:not(:disabled):hover,
  .unit:hover,
  .lesson-node:not(.locked):hover,
  .choice:hover,
  .compare-btn:hover,
  .grade-chip:hover,
  .term:hover,
  .nav-item:hover{
    transform:none;
    filter:none;
    box-shadow:inherit;
  }

  button:not(:disabled):active,
  .unit:active,
  .lesson-node:not(.locked):active,
  .choice:active,
  .compare-btn:active,
  .grade-chip:active,
  .term:active,
  .nav-item:active{
    transform:scale(.98);
    filter:brightness(1.12);
  }
}

/* 움직임 줄이기 설정을 쓰는 기기 배려 */
@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}


/* ===== V38: 문제 오류 점검 후 비교 문항 표시 보정 ===== */
.compare-expression{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
  width:100%;
  margin:6px 0 14px;
  padding:12px;
  border-radius:18px;
  background:rgba(125,211,252,.10);
  border:1px solid rgba(125,211,252,.22);
}
.compare-side{
  min-height:46px;
  display:grid;
  place-items:center;
  text-align:center;
  padding:9px 10px;
  border-radius:14px;
  background:rgba(255,255,255,.08);
  color:#f8fbff;
  font-size:16px;
  font-weight:900;
  line-height:1.35;
  word-break:keep-all;
  overflow-wrap:anywhere;
}
.compare-box{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:rgba(255,226,109,.17);
  border:1px solid rgba(255,226,109,.34);
  color:#fff3a6;
  font-size:24px;
  font-weight:1000;
}
@media (max-width:480px){
  .compare-expression{
    gap:7px;
    padding:10px;
  }
  .compare-side{
    min-height:42px;
    font-size:14px;
    padding:8px 7px;
  }
  .compare-box{
    width:32px;
    height:32px;
    font-size:20px;
  }
}


/* ===== V39: 보물 카드 글씨 가림 현상 수정 ===== */
.treasure-grid{
  gap:20px 10px;
  align-items:stretch;
}

.t-card{
  min-height:144px;
  padding:16px 10px 14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  overflow:hidden;
}

.t-card small{
  position:static;
  display:block;
  margin-top:auto;
  color:#cfc8f3;
  font-size:11px;
  font-weight:900;
  line-height:1.25;
  text-align:center;
  white-space:normal;
  word-break:keep-all;
  overflow-wrap:anywhere;
}

@media (max-width:480px){
  .treasure-grid{
    gap:18px 8px;
  }
  .t-card{
    min-height:136px;
    padding:14px 8px 12px;
    gap:10px;
  }
  .t-card small{
    font-size:10px;
    line-height:1.2;
  }
}


/* ===== V41: Pi Browser 상태 카드 ===== */
.pi-status-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  margin-top:14px;
  border-color:rgba(255,226,109,.30);
  background:
    radial-gradient(circle at 8% 0%,rgba(255,226,109,.16),transparent 28%),
    linear-gradient(180deg,rgba(56,46,150,.86),rgba(26,22,83,.84));
}
.pi-logo{
  width:46px;
  height:46px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:rgba(255,226,109,.14);
  border:1px solid rgba(255,226,109,.28);
  color:#fff3a6;
  font-size:30px;
  font-weight:1000;
  font-family:Georgia,serif;
}
.pi-status-card strong{
  display:block;
  color:#fff3a6;
  margin-bottom:4px;
}
.pi-status-card p{
  margin:0;
  color:#e9e6ff;
  font-size:13px;
  line-height:1.45;
  font-weight:800;
}
.pi-login-btn{
  min-height:42px;
  padding:0 14px;
  border-radius:14px;
  background:linear-gradient(180deg,#fff3a6,#facc15);
  color:#2d2105;
  font-weight:1000;
  white-space:nowrap;
  border:1px solid rgba(255,255,255,.25);
}
.pi-login-btn.disabled,
.pi-login-btn:disabled{
  cursor:not-allowed;
  filter:grayscale(.3);
  opacity:.72;
}
@media (max-width:520px){
  .pi-status-card{
    grid-template-columns:auto 1fr;
  }
  .pi-login-btn{
    grid-column:1/3;
    width:100%;
  }
}


/* ===== V42: 작은 휴대폰용 세로 간격 압축 ===== */
/* 학년·학기 선택과 단원 카드가 화면을 너무 많이 차지하지 않도록 모바일에서만 압축 */

@media (max-width:520px){
  /* 화면 기본 여백 축소 */
  main,
  .screen{
    padding-left:10px;
    padding-right:10px;
  }

  .grade-section,
  .unit-section,
  .lesson-section{
    margin-top:8px !important;
  }

  .card{
    padding:12px !important;
    border-radius:18px !important;
  }

  .card-head{
    margin-bottom:8px !important;
  }

  .card-head h2,
  .section-title,
  .grade-section h2,
  .unit-section h2,
  .lesson-section h2{
    font-size:15px !important;
    line-height:1.2 !important;
    margin:0 0 8px !important;
  }

  /* 학년·학기 선택 버튼: 세로 높이 축소 */
  .grade-grid,
  .term-grid{
    gap:7px !important;
  }

  .grade-chip,
  .term{
    min-height:38px !important;
    height:auto !important;
    padding:8px 9px !important;
    border-radius:12px !important;
    font-size:13.5px !important;
    line-height:1.15 !important;
  }

  .semester-tabs{
    margin:10px 0 8px !important;
    gap:7px !important;
  }

  /* 단원 카드: 기존 96px 안팎에서 58~64px 정도로 축소 */
  .unit-list{
    gap:8px !important;
  }

  .unit{
    min-height:58px !important;
    padding:10px 12px !important;
    border-radius:16px !important;
    gap:6px !important;
    line-height:1.2 !important;
  }

  .unit-title,
  .unit strong{
    font-size:13.5px !important;
    line-height:1.2 !important;
  }

  .unit small,
  .unit-meta,
  .stars-mini{
    font-size:11px !important;
    line-height:1.1 !important;
  }

  /* 단원 카드 안 진행률/별표가 차지하는 공간 최소화 */
  .mini-progress{
    margin:4px 0 0 !important;
    height:7px !important;
  }

  .arrow{
    font-size:11px !important;
  }

  /* 홈 안내 카드도 작게 */
  .pi-status-card,
  .guide-card{
    margin-top:8px !important;
    padding:10px !important;
    gap:8px !important;
  }

  .pi-logo,
  .guide-icon{
    width:36px !important;
    height:36px !important;
    border-radius:12px !important;
    font-size:21px !important;
  }

  .pi-status-card p,
  .guide-card ol{
    font-size:11.5px !important;
    line-height:1.35 !important;
  }

  .pi-login-btn{
    min-height:36px !important;
    padding:0 10px !important;
    border-radius:11px !important;
    font-size:12.5px !important;
  }

  /* 하단 탭 때문에 마지막 단원이 가려지지 않게 */
  .app{
    padding-bottom:calc(76px + env(safe-area-inset-bottom)) !important;
  }
}

/* 더 작은 휴대폰에서는 한 번 더 압축 */
@media (max-width:380px){
  main,
  .screen{
    padding-left:8px !important;
    padding-right:8px !important;
  }

  .grade-grid,
  .term-grid{
    gap:6px !important;
  }

  .grade-chip,
  .term{
    min-height:35px !important;
    padding:7px 8px !important;
    font-size:12.5px !important;
    border-radius:11px !important;
  }

  .unit{
    min-height:52px !important;
    padding:8px 10px !important;
  }

  .unit-title,
  .unit strong{
    font-size:13px !important;
  }

  .unit small,
  .unit-meta,
  .stars-mini{
    font-size:10.5px !important;
  }
}

/* 태블릿에서는 너무 납작해지지 않도록 기존 넓은 레이아웃 유지 */
@media (min-width:700px){
  .unit{
    min-height:100px;
  }
}


/* ===== V43: Pi 프리미엄 오답노트 ===== */
.wrong-note-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  text-align:left;
  margin-top:10px;
  border-color:rgba(255,85,122,.32);
  background:
    radial-gradient(circle at 8% 0%,rgba(255,85,122,.16),transparent 30%),
    linear-gradient(180deg,rgba(48,39,124,.88),rgba(31,25,91,.86));
}
.wrong-note-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.08);
  font-size:22px;
}
.premium-pill{
  width:30px;
  height:30px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,#fff3a6,#facc15);
  color:#2d2105;
  font-weight:1000;
  font-family:Georgia,serif;
}
.premium-card{
  display:grid;
  gap:12px;
  margin-bottom:14px;
}
.premium-head{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:12px;
  align-items:center;
}
.premium-head p{
  margin:4px 0 0;
  color:#e5e0ff;
  font-size:13px;
  line-height:1.45;
}
.premium-mark{
  width:48px;
  height:48px;
  border-radius:17px;
  display:grid;
  place-items:center;
  background:rgba(255,226,109,.16);
  color:#fff3a6;
  border:1px solid rgba(255,226,109,.32);
  font-size:30px;
  font-family:Georgia,serif;
  font-weight:1000;
}
.premium-mark.locked{
  background:rgba(255,85,122,.13);
  border-color:rgba(255,85,122,.32);
}
.premium-list{
  margin:0;
  padding-left:20px;
  color:#eeeaff;
  font-weight:800;
  line-height:1.55;
  font-size:13px;
}
.premium-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.pi-pay-btn{
  width:100%;
}
.wrong-type-summary{
  margin:12px 0;
}
.wrong-type-summary h3{
  margin:8px 0;
}
.wrong-type-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.wrong-type-grid div{
  padding:10px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
}
.wrong-type-grid strong{
  display:block;
  font-size:12px;
  line-height:1.25;
}
.wrong-type-grid small{
  color:#ffc928;
  font-weight:1000;
}
.wrong-note-list{
  display:grid;
  gap:10px;
}
.wrong-note-item{
  display:grid;
  gap:8px;
}
.wrong-note-item strong{
  line-height:1.35;
}
.wrong-note-item p{
  margin:0;
  color:#e9e5ff;
  font-size:13px;
  line-height:1.45;
}
.wrong-note-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.wrong-note-meta span{
  padding:4px 7px;
  border-radius:999px;
  background:rgba(117,220,255,.10);
  color:#bdefff;
  font-size:10px;
  font-weight:900;
}
.wrong-note-tip{
  padding:9px;
  border-radius:12px;
  background:rgba(154,240,43,.08);
  border:1px solid rgba(154,240,43,.18);
}
.locked-preview{
  filter:blur(.2px);
  opacity:.68;
}
.locked-more{
  text-align:center;
  color:#ffc928;
  font-weight:900;
  font-size:13px;
}
.empty-wrong-note p{
  margin:6px 0 0;
  color:#cfc8f3;
}
.wrong-profile-link{
  border-color:rgba(255,85,122,.25);
}
@media (max-width:520px){
  .wrong-note-card{
    min-height:54px;
    padding:10px 12px!important;
  }
  .wrong-note-icon{
    width:34px;
    height:34px;
    border-radius:11px;
    font-size:18px;
  }
  .premium-pill{
    width:26px;
    height:26px;
    font-size:14px;
  }
  .premium-actions{
    grid-template-columns:1fr;
  }
  .premium-head p,
  .premium-list,
  .wrong-note-item p{
    font-size:12px;
  }
  .wrong-type-grid{
    grid-template-columns:1fr;
  }
}


/* ===== V46: 비교 문항 도형 표시 줄바꿈 오류 수정 ===== */
/* 8 □ 6 같은 비교 표시가 버튼 3개 중 첫 칸을 차지해
   <, =, > 버튼이 2줄로 밀리는 문제를 수정합니다. */
.answer-area.compare-mode{
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
}
.answer-area.compare-mode .compare-expression{
  grid-column:1 / -1;
}
.answer-area.compare-mode .compare-btn{
  width:100%;
}
@media (max-width:420px){
  .answer-area.compare-mode{
    gap:8px;
  }
  .answer-area.compare-mode .compare-btn{
    min-height:62px;
    font-size:24px;
    border-radius:14px;
  }
}


/* ===== V47: 1달러 표시 결제 버튼 ===== */
.pi-pay-btn{
  background:linear-gradient(180deg,#eaff9b,#9af02b);
  color:#132106;
}
.payment-message{
  word-break:keep-all;
}


/* ===== V48: 글로벌 언어 선택 UI ===== */
.language-select{
  width:100%;
  min-height:46px;
  cursor:pointer;
}
.language-select.small{
  max-width:210px;
  min-height:42px;
}
.language-card{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
}
.language-card small,
.language-notice small{
  display:block;
  color:var(--muted);
  margin-top:4px;
  line-height:1.35;
}
.language-notice{
  border-color:rgba(117,220,255,.24);
  background:
    radial-gradient(circle at 10% 0%,rgba(117,220,255,.12),transparent 30%),
    linear-gradient(180deg,rgba(35,28,97,.86),rgba(24,20,74,.82));
}
.translate-btn{
  margin-top:8px;
  background:rgba(117,220,255,.12);
  border:1px solid rgba(117,220,255,.24);
}
html[dir="rtl"] body{
  direction:rtl;
}
html[dir="rtl"] .bottom-nav,
html[dir="rtl"] .answer-area,
html[dir="rtl"] .quiz-progress,
html[dir="rtl"] .xp-track{
  direction:ltr;
}
@media (max-width:520px){
  .language-card{
    grid-template-columns:1fr;
  }
  .language-select.small{
    max-width:100%;
  }
}


/* ===== V49: 결제 입금 확인 카드 ===== */
.payment-trace-card{
  display:grid;
  gap:12px;
  border-color:rgba(255,201,40,.28);
  background:
    radial-gradient(circle at 10% 0%,rgba(255,201,40,.14),transparent 30%),
    linear-gradient(180deg,rgba(35,28,97,.88),rgba(24,20,74,.84));
}
.payment-trace-empty p{
  margin:6px 0;
  color:#e9e5ff;
  line-height:1.45;
}
.payment-trace-empty small{
  color:var(--muted);
}
.payment-trace-head{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:12px;
  align-items:center;
}
.payment-trace-head small{
  display:block;
  color:var(--muted);
  margin-top:3px;
}
.payment-trace-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.payment-trace-grid div{
  padding:9px;
  border-radius:13px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  min-width:0;
}
.payment-trace-grid span{
  display:block;
  color:#bfb8e6;
  font-size:11px;
  font-weight:800;
  margin-bottom:4px;
}
.payment-trace-grid b{
  display:block;
  color:#fff7c2;
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.payment-trace-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
@media (max-width:520px){
  .payment-trace-grid,
  .payment-trace-actions{
    grid-template-columns:1fr;
  }
}


/* ===== V50: 사용자용 결제 확인 흐름 ===== */
.payment-confirm-card{
  max-width:430px;
}
.payment-confirm-info{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px 12px;
  padding:12px;
  margin:12px 0;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  text-align:left;
}
.payment-confirm-info span{
  color:#bfb8e6;
  font-size:12px;
  font-weight:900;
}
.payment-confirm-info b{
  color:#fff7c2;
  font-size:13px;
  text-align:right;
}
#paymentConfirmModal .two-buttons{
  margin-top:12px;
}
#paymentConfirmModal .secondary,
#paymentConfirmModal .primary{
  min-height:48px;
}
.payment-trace-card.hidden,
#paymentTraceTitle.hidden{
  display:none!important;
}


/* ===== V51: 약점 분석 리포트 ===== */
.weakness-report-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  background:
    radial-gradient(circle at 10% 0%,rgba(125,211,252,.16),transparent 34%),
    linear-gradient(180deg,rgba(42,37,112,.9),rgba(28,22,82,.86));
  border-color:rgba(125,211,252,.28);
}
.weakness-profile-link{
  border-color:rgba(125,211,252,.22);
}
.weakness-report-content{
  display:grid;
  gap:12px;
}
.weakness-score-card{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:center;
}
.weakness-score{
  width:78px;
  height:78px;
  border-radius:24px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,#7dd3fc,#a7f3d0);
  color:#111827;
  font-size:24px;
  font-weight:1000;
}
.weakness-score-card p,
.weakness-main-card p{
  margin:6px 0 0;
  color:#d9d3ff;
  line-height:1.45;
}
.weakness-main-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px;
  margin-top:10px;
}
.weakness-main-grid div{
  padding:10px;
  border-radius:14px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.10);
}
.weakness-main-grid span{
  display:block;
  color:#bfb8e6;
  font-size:11px;
  font-weight:900;
  margin-bottom:4px;
}
.weakness-main-grid strong{
  color:#fff7c2;
  font-size:13px;
}
.weakness-bar-row{
  position:relative;
  min-height:38px;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  margin:8px 0;
  border-radius:13px;
  background:rgba(255,255,255,.06);
  overflow:hidden;
}
.weakness-bar-row i{
  position:absolute;
  left:0;bottom:0;height:4px;
  background:linear-gradient(90deg,#7dd3fc,#bef264);
  border-radius:999px;
}
.weakness-bar-row span,
.weakness-bar-row b{
  position:relative;
  z-index:1;
}
.weakness-bar-row span{
  color:#f8fbff;
  font-size:13px;
  font-weight:900;
}
.weakness-bar-row b{
  color:#fff7c2;
  font-size:12px;
}
.weakness-practice-prompt{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:12px;
  align-items:center;
  border-color:rgba(190,242,100,.32);
  background:
    radial-gradient(circle at 0% 0%,rgba(190,242,100,.14),transparent 36%),
    linear-gradient(180deg,rgba(35,28,97,.9),rgba(24,20,74,.84));
}
.weakness-practice-prompt .two-buttons{
  grid-column:1/-1;
}
.prompt-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:16px;
  background:rgba(255,255,255,.10);
  font-size:26px;
}
.report-preview-locked p{
  color:#d9d3ff;
  line-height:1.45;
}
@media (max-width:560px){
  .weakness-main-grid{
    grid-template-columns:1fr;
  }
  .weakness-score-card,
  .weakness-practice-prompt{
    grid-template-columns:1fr;
  }
}


/* ===== V52: 약점 리포트 결제 전 안내 강화 ===== */
.weakness-benefit-box{
  margin:12px 0;
  padding:12px;
  border-radius:16px;
  background:rgba(125,211,252,.10);
  border:1px solid rgba(125,211,252,.22);
}
.weakness-benefit-box strong{
  display:block;
  color:#fff7c2;
  margin-bottom:8px;
}
.weakness-benefit-box ul{
  margin:0;
  padding-left:18px;
  display:grid;
  gap:5px 16px;
  grid-template-columns:1fr 1fr;
}
.weakness-benefit-box li{
  color:#f8fbff;
  font-size:13px;
  line-height:1.35;
}
.payment-benefit-span{
  grid-column:1/-1;
}
.payment-confirm-info .payment-benefit-span{
  text-align:left;
}
.weakness-preview-card{
  border-color:rgba(125,211,252,.30);
}
.weakness-preview-card > strong{
  display:block;
  margin-bottom:10px;
}
.weakness-preview-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.weakness-preview-grid div{
  padding:10px;
  border-radius:14px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.10);
}
.weakness-preview-grid span{
  display:block;
  color:#bfb8e6;
  font-size:11px;
  font-weight:900;
  margin-bottom:4px;
}
.weakness-preview-grid b{
  color:#fff7c2;
  font-size:13px;
}
@media (max-width:520px){
  .weakness-benefit-box ul,
  .weakness-preview-grid{
    grid-template-columns:1fr;
  }
}


/* ===== V53: 약점 문제 추가 연습 안내 강조 ===== */
.weakness-benefit-box li:last-child{
  color:#bef264;
  font-weight:1000;
}
.weakness-preview-grid div:last-child{
  border-color:rgba(190,242,100,.32);
  background:rgba(190,242,100,.10);
}


/* ===== V54: 듀오링고식 보상 화면 ===== */
.duo-reward-hero{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:center;
  padding:18px;
  border-radius:24px;
  background:
    radial-gradient(circle at 10% 0%,rgba(190,242,100,.22),transparent 32%),
    linear-gradient(180deg,rgba(40,34,112,.94),rgba(22,19,67,.92));
  border:1px solid rgba(190,242,100,.32);
  box-shadow:0 18px 40px rgba(0,0,0,.28);
  text-align:left;
}
.reward-mascot{
  width:86px;
  height:86px;
  display:grid;
  place-items:center;
  border-radius:28px;
  background:linear-gradient(180deg,#bef264,#7dd3fc);
  color:#111827;
  font-size:48px;
  box-shadow:0 14px 28px rgba(125,211,252,.25);
  animation:rewardBounce .9s ease both;
}
.reward-hero-text strong{
  display:block;
  font-size:23px;
  color:#fff7c2;
  margin-bottom:6px;
}
.reward-hero-text p{
  margin:0;
  color:#e8e4ff;
  line-height:1.45;
  font-weight:900;
}
@keyframes rewardBounce{
  0%{transform:translateY(18px) scale(.85);opacity:.1}
  55%{transform:translateY(-8px) scale(1.06);opacity:1}
  100%{transform:translateY(0) scale(1)}
}
.reward-progress-card{
  padding:16px;
  border-radius:20px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
}
.reward-progress-label{
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#fff7c2;
  font-weight:1000;
  margin-bottom:10px;
}
.reward-progress-track{
  position:relative;
  height:22px;
  border-radius:999px;
  background:rgba(255,255,255,.13);
  overflow:hidden;
}
.reward-progress-track i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#84cc16,#bef264,#7dd3fc);
  box-shadow:0 0 22px rgba(190,242,100,.35);
}
.reward-progress-track em{
  position:absolute;
  left:calc(var(--spark-left, 72%) - 10px);
  top:-8px;
  font-style:normal;
  filter:drop-shadow(0 0 8px rgba(255,255,180,.8));
}
.reward-progress-card small{
  display:block;
  color:#cfc8f3;
  margin-top:8px;
}
.reward-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
}
.reward-tile{
  padding:14px 10px;
  border-radius:18px;
  background:#20195b;
  border:1px solid rgba(255,255,255,.12);
  min-height:112px;
  display:grid;
  align-content:center;
  gap:5px;
}
.reward-tile span{
  font-size:30px;
}
.reward-tile strong{
  color:#fff7c2;
  font-size:18px;
}
.reward-tile small{
  color:#cfc8f3;
  font-weight:800;
}
.reward-tile.xp{background:linear-gradient(180deg,rgba(125,211,252,.14),rgba(32,25,91,.96))}
.reward-tile.shard{background:linear-gradient(180deg,rgba(167,139,250,.17),rgba(32,25,91,.96))}
.reward-tile.accuracy{background:linear-gradient(180deg,rgba(52,211,153,.15),rgba(32,25,91,.96))}
.reward-tile.combo{background:linear-gradient(180deg,rgba(251,191,36,.17),rgba(32,25,91,.96))}
.reward-item.levelup{
  border-color:rgba(251,191,36,.42);
  background:linear-gradient(180deg,rgba(251,191,36,.13),rgba(32,25,91,.96));
}
.reward-item.treasure-pop{
  border-color:rgba(125,211,252,.36);
}
.reward-item.badge-pop{
  border-color:rgba(190,242,100,.32);
}
.reward-item.next-quest{
  border-color:rgba(167,139,250,.32);
}
.profile-stats{
  grid-template-columns:repeat(2,auto);
}
@media (max-width:620px){
  .duo-reward-hero{
    grid-template-columns:1fr;
    text-align:center;
  }
  .reward-mascot{
    margin:auto;
  }
  .reward-grid{
    grid-template-columns:repeat(2,1fr);
  }
}


/* ===== V55: Korean + English language pack polish ===== */
.language-select{
  cursor:pointer;
}
html[lang="en"] .question-text,
html[lang="en"] .hint-bubble,
html[lang="en"] .feedback-sheet{
  word-break:normal;
}
html[lang="en"] .lesson-label,
html[lang="en"] .unit span{
  line-height:1.2;
}
.translate-btn{
  background:rgba(125,211,252,.12);
  border-color:rgba(125,211,252,.25);
}


/* ===== V56: runtime translated question polish ===== */
html[dir="rtl"] body{
  direction:rtl;
}
html[dir="rtl"] .answer-area,
html[dir="rtl"] .quiz-progress,
html[dir="rtl"] .bottom-nav,
html[dir="rtl"] .xp-track{
  direction:ltr;
}
html:not([lang="ko"]) .question-text{
  line-height:1.35;
}


/* ===== V57: full UI translation layout safeguards ===== */
html:not([lang="ko"]) button,
html:not([lang="ko"]) .card,
html:not([lang="ko"]) .reward-item,
html:not([lang="ko"]) .premium-box{
  word-break:normal;
}
html:not([lang="ko"]) .mission-line span,
html:not([lang="ko"]) .unit span,
html:not([lang="ko"]) .lesson-label,
html:not([lang="ko"]) .reward-hero-text p{
  line-height:1.28;
}
html[dir="rtl"] .app-shell{
  direction:rtl;
}
html[dir="rtl"] .bottom-nav,
html[dir="rtl"] .answer-area,
html[dir="rtl"] .reward-grid,
html[dir="rtl"] .grade-grid{
  direction:ltr;
}


/* ===== V58: language quality audit screen ===== */
.language-audit-link{
  border-color:rgba(125,211,252,.26);
}
.translation-audit-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.translation-audit-card strong{
  display:block;
  color:#fff7c2;
}
.translation-audit-card small{
  display:block;
  color:#cfc8f3;
  margin-top:4px;
}
.small-btn{
  padding:10px 14px;
  border-radius:14px;
  width:auto;
  min-width:120px;
}
.translation-audit-result{
  text-align:left;
}
.audit-good{
  color:#bef264;
  font-weight:1000;
}
.audit-warn{
  color:#fde68a;
  font-weight:1000;
}
.audit-list{
  margin:10px 0 0;
  padding-left:20px;
  display:grid;
  gap:6px;
}
.audit-list li{
  color:#f8fbff;
  line-height:1.35;
}
.audit-sample{
  display:grid;
  gap:6px;
  margin-top:10px;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.audit-sample b{
  color:#fff7c2;
}
.audit-sample p{
  margin:0 0 6px;
  color:#f8fbff;
}
.translation-loading-card{
  width:100%;
  padding:18px;
  border-radius:18px;
  background:rgba(125,211,252,.10);
  border:1px solid rgba(125,211,252,.26);
  color:#fff7c2;
  font-weight:1000;
  text-align:center;
}
@media (max-width:560px){
  .translation-audit-card{
    align-items:stretch;
    flex-direction:column;
  }
  .small-btn{
    width:100%;
  }
}


/* ===== V59: translation review history ===== */
.audit-history{
  display:grid;
  gap:8px;
  margin-top:14px;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.audit-history > strong{
  color:#fff7c2;
}
.audit-history div{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 0;
  border-top:1px solid rgba(255,255,255,.08);
}
.audit-history b{
  color:#bef264;
}
.audit-history span{
  color:#d9d3ff;
  font-size:12px;
  font-weight:800;
  text-align:right;
}
html[lang="zh"] .question-text,
html[lang="ja"] .question-text{
  line-height:1.42;
}


/* ===== V60: Korean curriculum and guardian notice ===== */
.curriculum-notice{
  margin:12px 0;
  padding:12px;
  border-radius:16px;
  background:rgba(125,211,252,.10);
  border:1px solid rgba(125,211,252,.25);
  text-align:left;
}
.curriculum-notice strong{
  display:block;
  color:#fff7c2;
  margin-bottom:6px;
  font-size:14px;
}
.curriculum-notice small{
  display:block;
  color:#e8e4ff;
  line-height:1.35;
  font-weight:800;
}
.small-guardian-btn{
  margin-top:8px;
}
.guardian-profile-link{
  border-color:rgba(190,242,100,.28);
}
.guardian-card{
  max-width:520px;
}
.logo-orb.small{
  width:58px;
  height:58px;
  font-size:34px;
}
.guardian-list{
  display:grid;
  gap:10px;
  text-align:left;
  margin:16px 0;
}
.guardian-list div{
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
}
.guardian-list strong{
  display:block;
  color:#fff7c2;
  margin-bottom:5px;
}
.guardian-list p{
  margin:0;
  color:#f8fbff;
  font-size:13px;
  line-height:1.45;
}
html:not([lang="ko"]) .curriculum-notice small,
html:not([lang="ko"]) .guardian-list p{
  line-height:1.4;
}


/* ===== V61: policy, terms and refund notice ===== */
.policy-profile-link{
  border-color:rgba(251,191,36,.28);
}
.policy-card{
  max-width:620px;
  max-height:min(86vh,760px);
  overflow:auto;
}
.policy-tabs{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:14px 0;
}
.policy-tabs button{
  padding:10px 8px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:#d9d3ff;
  font-weight:1000;
}
.policy-tabs button.active{
  background:linear-gradient(180deg,#7dd3fc,#8b5cf6);
  color:#100d2a;
}
.policy-content{
  text-align:left;
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
}
.policy-content h3{
  margin:0 0 10px;
  color:#fff7c2;
}
.policy-content ol{
  margin:0;
  padding-left:22px;
  display:grid;
  gap:8px;
}
.policy-content li{
  color:#f8fbff;
  line-height:1.45;
  font-size:13px;
}
.policy-actions{
  margin-top:14px;
}
html[dir="rtl"] .policy-content{
  text-align:right;
}
@media (max-width:520px){
  .policy-tabs{
    grid-template-columns:1fr;
  }
}


/* ===== V62: curriculum map screen ===== */
.curriculum-profile-link{
  border-color:rgba(125,211,252,.30);
}
.curriculum-map-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:left;
}
.curriculum-map-summary strong{
  display:block;
  color:#fff7c2;
  margin-bottom:4px;
}
.curriculum-map-summary small{
  display:block;
  color:#e8e4ff;
  line-height:1.35;
}
.curriculum-grade-filter{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:4px 0 10px;
  scrollbar-width:thin;
}
.curriculum-grade-filter button{
  flex:0 0 auto;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.07);
  color:#e8e4ff;
  font-weight:1000;
}
.curriculum-grade-filter button.active{
  background:linear-gradient(180deg,#7dd3fc,#8b5cf6);
  color:#100d2a;
  border-color:transparent;
}
.curriculum-map-stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:10px 0 14px;
}
.curriculum-map-stats div{
  padding:14px 10px;
  border-radius:18px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  text-align:center;
}
.curriculum-map-stats strong{
  display:block;
  color:#fff7c2;
  font-size:22px;
}
.curriculum-map-stats small{
  display:block;
  color:#d9d3ff;
  font-weight:900;
  margin-top:4px;
}
.curriculum-map-list{
  display:grid;
  gap:14px;
}
.curriculum-grade-card{
  text-align:left;
}
.curriculum-grade-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:12px;
}
.curriculum-grade-head strong{
  color:#fff7c2;
  font-size:18px;
}
.curriculum-grade-head small{
  color:#bef264;
  font-weight:1000;
}
.curriculum-unit-stack{
  display:grid;
  gap:8px;
}
.curriculum-unit-detail{
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  background:rgba(255,255,255,.055);
  overflow:hidden;
}
.curriculum-unit-detail summary{
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  font-weight:1000;
  color:#f8fbff;
}
.curriculum-unit-detail summary small{
  color:#a7f3d0;
  font-weight:900;
}
.curriculum-unit-detail ol{
  margin:0;
  padding:0 12px 12px 34px;
  display:grid;
  gap:7px;
}
.curriculum-unit-detail li{
  color:#f8fbff;
  line-height:1.35;
}
.curriculum-unit-detail li small{
  display:block;
  color:#cfc8f3;
  margin-top:2px;
}
.curriculum-map-note{
  margin-top:14px;
  text-align:left;
}
.curriculum-map-note strong{
  color:#fff7c2;
}
.curriculum-map-note p{
  color:#f8fbff;
  line-height:1.45;
}
@media (max-width:640px){
  .curriculum-map-summary{
    align-items:stretch;
    flex-direction:column;
  }
  .curriculum-map-stats{
    grid-template-columns:repeat(2,1fr);
  }
  .curriculum-unit-detail summary{
    flex-direction:column;
  }
}


/* ===== V63: Duolingo-like simple UX cleanup ===== */
#curriculumNoticeStart,
#guardianNoticeStartBtn,
#policyNoticeStartBtn,
#curriculumMapStartBtn,
#guardianNoticeProfileBtn,
#policyNoticeProfileBtn,
#curriculumMapProfileBtn{
  display:none !important;
}
.simple-notice-link{
  width:auto;
  margin:10px auto 0;
  padding:8px 12px;
  border:0;
  background:transparent;
  color:#cfc8f3;
  font-size:12px;
  font-weight:900;
  text-decoration:underline;
  box-shadow:none;
}
.simple-notice-link:hover{
  color:#fff7c2;
}
.start-modal .sub{
  max-width:280px;
  margin-left:auto;
  margin-right:auto;
}


/* ===== V64: mobile and safe interaction stability ===== */
button, .choice, .compare-btn, .tab-btn{
  touch-action:manipulation;
}
.choice, .compare-btn, button{
  -webkit-tap-highlight-color:transparent;
}
@media (max-width:420px){
  .question-text{
    font-size:clamp(20px,6vw,28px);
    line-height:1.28;
  }
  .choice{
    min-height:52px;
  }
  .reward-grid{
    grid-template-columns:1fr;
  }
  .modal-card{
    max-height:88vh;
    overflow:auto;
  }
}


/* ===== V65: Pi payment production check ===== */
.dev-check-link{
  opacity:.74;
}
.payment-check-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:left;
}
.payment-check-actions strong,
.payment-production-note strong,
.payment-check-summary strong,
.payment-check-next strong,
.payment-check-empty strong{
  color:#fff7c2;
}
.payment-check-actions small,
.payment-check-summary p,
.payment-check-empty p,
.payment-production-note p{
  color:#f8fbff;
  line-height:1.4;
}
.payment-check-result{
  display:grid;
  gap:12px;
}
.payment-check-summary.ok{
  border-color:rgba(190,242,100,.45);
}
.payment-check-summary.warn{
  border-color:rgba(251,191,36,.45);
}
.payment-check-list{
  display:grid;
  gap:8px;
}
.payment-check-row{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:10px;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.065);
  border:1px solid rgba(255,255,255,.12);
  text-align:left;
}
.payment-check-row span{
  font-size:22px;
}
.payment-check-row b{
  color:#fff;
}
.payment-check-row small{
  display:block;
  margin-top:3px;
  color:#d9d3ff;
  line-height:1.35;
}
.payment-check-row.ok{
  border-color:rgba(190,242,100,.28);
}
.payment-check-row.warn{
  border-color:rgba(251,191,36,.34);
}
.payment-check-row.info{
  border-color:rgba(125,211,252,.30);
}
.payment-check-next{
  text-align:left;
}
.payment-check-next ol{
  margin:10px 0 0;
  padding-left:22px;
  display:grid;
  gap:7px;
}
.payment-check-next li{
  color:#f8fbff;
  line-height:1.4;
}
@media (max-width:560px){
  .payment-check-actions{
    flex-direction:column;
    align-items:stretch;
  }
}


/* ===== V66: deploy checklist ===== */
.deploy-check-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  text-align:left;
}
.deploy-check-actions strong,
.deploy-final-note strong,
.deploy-progress-card strong,
.deploy-group-card h3,
.deploy-auto-card strong{
  color:#fff7c2;
}
.deploy-check-actions small,
.deploy-final-note p,
.deploy-auto-card p{
  color:#f8fbff;
  line-height:1.4;
}
.deploy-action-buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.deploy-checklist-box,
.deploy-auto-result{
  display:grid;
  gap:12px;
}
.deploy-progress-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.deploy-progress-head small{
  color:#bef264;
  font-weight:1000;
}
.deploy-progress-track{
  height:14px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.11);
  margin-top:10px;
}
.deploy-progress-track i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#7dd3fc,#bef264);
}
.deploy-group-card{
  text-align:left;
}
.deploy-item-list{
  display:grid;
  gap:8px;
}
.deploy-check-item{
  display:grid;
  grid-template-columns:28px 1fr;
  gap:10px;
  align-items:start;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
}
.deploy-check-item.done{
  border-color:rgba(190,242,100,.35);
}
.deploy-check-item input{
  width:20px;
  height:20px;
  accent-color:#bef264;
}
.deploy-check-item b{
  display:block;
  color:#fff;
}
.deploy-check-item small{
  display:block;
  color:#d9d3ff;
  line-height:1.35;
  margin-top:3px;
}
.deploy-auto-list{
  display:grid;
  gap:8px;
}
.deploy-auto-row{
  display:grid;
  grid-template-columns:32px 1fr;
  gap:10px;
  padding:12px;
  border-radius:16px;
  text-align:left;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
}
.deploy-auto-row.ok{
  border-color:rgba(190,242,100,.32);
}
.deploy-auto-row.warn{
  border-color:rgba(251,191,36,.38);
}
.deploy-auto-row b{
  color:#fff;
}
.deploy-auto-row small{
  display:block;
  color:#d9d3ff;
  margin-top:3px;
}
.deploy-auto-card.ok{
  border-color:rgba(190,242,100,.42);
}
.deploy-auto-card.warn{
  border-color:rgba(251,191,36,.42);
}
@media (max-width:560px){
  .deploy-check-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .deploy-action-buttons{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* ===== V68: runtime diagnostics ===== */
.runtime-diagnostics-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  text-align:left;
}
.runtime-diagnostics-actions strong,
.runtime-diagnostics-note strong,
.runtime-empty-card strong,
.runtime-report-card strong,
.runtime-error-list strong{
  color:#fff7c2;
}
.runtime-diagnostics-actions small,
.runtime-diagnostics-note p,
.runtime-empty-card p,
.runtime-report-card p{
  color:#f8fbff;
  line-height:1.4;
}
.runtime-diagnostics-buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.runtime-diagnostics-summary,
.runtime-diagnostics-result{
  display:grid;
  gap:12px;
}
.runtime-summary-card{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  text-align:center;
}
.runtime-summary-card div{
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.runtime-summary-card strong{
  display:block;
  color:#fff7c2;
  font-size:20px;
}
.runtime-summary-card small{
  display:block;
  color:#d9d3ff;
  font-weight:900;
  margin-top:3px;
}
.runtime-report-card.ok{
  border-color:rgba(190,242,100,.42);
}
.runtime-report-card.warn{
  border-color:rgba(251,191,36,.42);
}
.runtime-check-list,
.runtime-error-list{
  display:grid;
  gap:8px;
}
.runtime-check-row{
  display:grid;
  grid-template-columns:32px 1fr;
  gap:10px;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  text-align:left;
}
.runtime-check-row.ok{
  border-color:rgba(190,242,100,.32);
}
.runtime-check-row.warn{
  border-color:rgba(251,191,36,.38);
}
.runtime-check-row b,
.runtime-error-row b{
  display:block;
  color:#fff;
}
.runtime-check-row small,
.runtime-error-row small{
  display:block;
  color:#d9d3ff;
  line-height:1.35;
  margin-top:3px;
  word-break:break-word;
}
.runtime-error-row{
  padding:10px;
  border-radius:14px;
  background:rgba(239,68,68,.10);
  border:1px solid rgba(239,68,68,.22);
  text-align:left;
}
@media (max-width:560px){
  .runtime-diagnostics-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .runtime-diagnostics-buttons{
    display:grid;
    grid-template-columns:1fr;
  }
  .runtime-summary-card{
    grid-template-columns:1fr;
  }
}
