
:root{
  --bg:#e8eef5;
  --sidebar:#f3f8fc;
  --card:#ffffff;
  --line:#c7d6e6;
  --text:#132130;
  --muted:#50657b;
  --blue:#226fe5;
  --blue-dark:#174fba;
  --blue-soft:#dcecff;
  --panel:#f8fbfe;
  --panel-strong:#eef5fb;
  --success:#16834a;
  --success-soft:#dbf4e5;
  --warning:#b95c16;
  --warning-soft:#fff0df;
  --shadow:0 14px 32px rgba(18, 44, 74, 0.11);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans KR",sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,#f0f5fa 0%, #e4ebf3 100%);
}
.shell{
  display:grid;
  grid-template-columns:224px 1fr;
  min-height:100vh;
}
.sidebar{
  background:var(--sidebar);
  border-right:1px solid var(--line);
  padding:24px 18px;
  overflow:auto;
}
.kicker{
  color:var(--blue);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.brand h1{
  margin:8px 0 10px;
  font-size:26px;
  line-height:1.15;
}
.brand p{
  margin:0 0 18px;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

.brand{margin-bottom:12px;}
.brand h1{margin:8px 0 0;font-size:22px;line-height:1.1;word-break:keep-all;}
.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 14px;}
.quick-action-btn{border:1px solid var(--line);background:#fff;border-radius:14px;padding:11px 10px;font-size:14px;font-weight:800;cursor:pointer;color:var(--text);}
.quick-action-btn:hover{background:var(--blue-soft);border-color:#74a8f8;color:var(--blue-dark);}
.quick-action-btn.active{background:var(--blue);border-color:var(--blue);color:#fff;}
.search input{padding:11px 14px;border-radius:14px;}
.progress-card{margin-top:12px;}
.lesson-item{position:relative;padding:12px 44px 12px 14px;}
.lesson-star{position:absolute;right:12px;top:50%;transform:translateY(-50%);border:none;background:transparent;font-size:18px;line-height:1;cursor:pointer;color:#b8c4d1;padding:2px 4px;border-radius:8px;}
.lesson-star.is-favorite{color:#f6b800;}
.lesson-star:hover{background:#eef4fa;}
.search input{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  font-size:14px;
}
.progress-card{
  margin-top:14px;
  padding:14px 16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
}
.progress-title{
  font-size:13px;
  color:var(--muted);
  margin-bottom:4px;
}
.progress-text{
  font-weight:800;
  font-size:18px;
}
.lesson-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:16px;
}
.mobile-lesson-drawer{
  display:contents;
}
.mobile-lesson-drawer > summary{
  display:none;
}
.lesson-item{
  width:100%;
  text-align:left;
  border:1px solid #cad9e9;
  background:#fff;
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  transition:all .15s ease;
}
.lesson-item:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow);
  border-color:#8db9f5;
}
.lesson-item.active{
  border-color:var(--blue);
  background:#e7f1ff;
  box-shadow:inset 4px 0 0 var(--blue);
}
.lesson-item.is-jump-highlight{
  border-color:#2f80ed;
  box-shadow:0 0 0 3px rgba(47,128,237,.18);
  background:#f0f6ff;
}
.lesson-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:0;
}
.lesson-code{
  color:var(--blue-dark);
  font-size:12px;
  font-weight:800;
  margin-bottom:4px;
}
.lesson-name{
  max-width:112px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:normal;
  line-height:1.35;
  word-break:keep-all;
  font-weight:700;
}
.badge{
  flex:0 0 auto;
  font-size:11px;
  font-weight:700;
  border-radius:999px;
  padding:4px 7px;
  background:#e8eef5;
  color:#42556a;
}
.lesson-star{
  top:50%;
  right:10px;
  transform:translateY(-50%);
}
.badge.done{
  background:var(--success-soft);
  color:var(--success);
}
.main{
  padding:16px;
}
.header{
  display:flex;
  margin-bottom:8px;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin-bottom:16px;
}
.eyebrow{
  color:var(--blue);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
}
.header h2{
  margin:4px 0 0;
  font-size:30px;
}
.lesson-title-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.header-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.ghost-btn,.primary-btn{
  border:none;
  border-radius:12px;
  padding:11px 16px;
  font-size:14px;
  cursor:pointer;
}
.ghost-btn{
  background:#f9fbfd;
  border:1px solid var(--line);
  color:var(--text);
}
.primary-btn{
  background:var(--blue);
  color:#fff;
  font-weight:900;
}
.primary-btn:hover{background:var(--blue-dark);}
.stats-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.stats-card{
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  padding:16px;
  min-height:118px;
}
.stats-card-wide{
  grid-column:span 2;
}
.stats-kicker{
  color:var(--blue-dark);
  font-size:12px;
  font-weight:900;
  margin-bottom:10px;
}
.stats-hero-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.stats-big{
  color:var(--text);
  font-size:30px;
  font-weight:900;
  line-height:1;
}
.stats-sub,.stats-empty{
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
  margin-top:6px;
}
.stats-line{
  color:var(--text);
  font-size:15px;
  font-weight:800;
  margin-top:8px;
}
.stats-actions{
  display:grid;
  gap:8px;
  margin-top:14px;
}
.stats-action-btn{
  border:1px solid #b8d4fb;
  border-radius:10px;
  background:#eaf3ff;
  color:var(--blue);
  cursor:pointer;
  font-size:13px;
  font-weight:900;
  padding:9px 10px;
}
.stats-action-btn:disabled{
  background:#f3f6fa;
  border-color:#dde6f0;
  color:#9aa8b8;
  cursor:not-allowed;
}
.stats-week-bars{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:8px;
  align-items:end;
  margin-top:18px;
}
.stats-day{
  display:grid;
  gap:5px;
  justify-items:center;
}
.stats-bar{
  display:flex;
  align-items:flex-end;
  width:100%;
  max-width:34px;
  height:86px;
  border-radius:999px;
  background:#e5eef9;
  overflow:hidden;
}
.stats-bar span{
  display:block;
  width:100%;
  min-height:8px;
  border-radius:999px;
  background:var(--blue);
}
.stats-day-label,.stats-day-count{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.stats-day-count{
  color:var(--text);
}
.stats-week-table{
  display:grid;
  gap:8px;
}
.stats-week-row{
  display:grid;
  grid-template-columns:58px 52px repeat(4,minmax(0,1fr));
  gap:8px;
  align-items:center;
  border:1px solid #dbe7f5;
  border-radius:10px;
  background:#fff;
  padding:9px 10px;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.stats-week-row strong{
  color:var(--text);
}
.stats-weak-list{
  display:grid;
  gap:8px;
}
.stats-weak-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  border:1px solid #dbe7f5;
  border-radius:10px;
  background:#fff;
  padding:10px;
}
.stats-weak-item strong{
  color:var(--text);
}
.stats-weak-item span{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.level-filter{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:12px 0;
}
.level-filter-btn{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:#4d5b6a;
  cursor:pointer;
  font-size:13px;
  font-weight:800;
  padding:10px 8px;
}
.level-filter-btn.active{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff;
}
.level-chip{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  background:#edf4ff;
  color:#2262c6;
  font-size:11px;
  font-weight:900;
}
.done-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
}
.header-done{
  border:1px solid var(--line);
  border-radius:999px;
  background:#f9fbfd;
  color:var(--text);
  cursor:pointer;
  font-size:13px;
  font-weight:900;
  padding:8px 11px;
  white-space:nowrap;
}
.header-done input{
  margin:0;
}
.small-note{
  color:var(--muted);
  font-size:13px;
}
.today-task-panel{
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  box-shadow:none;
  padding:8px 10px;
  margin-bottom:8px;
}
.today-task-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:6px;
}
.today-task-metrics{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-left:auto;
}
.today-task-metrics span{
  border:1px solid #dbe7f5;
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  padding:5px 8px;
  white-space:nowrap;
}
.today-task-metrics strong{
  color:var(--text);
}
.today-task-kicker{
  color:var(--blue);
  font-size:12px;
  font-weight:900;
  margin-bottom:2px;
}
.today-task-title{
  color:var(--text);
  font-size:15px;
  font-weight:900;
}
.today-task-stats,
.today-task-btn,
.today-task-link{
  border:1px solid #b8d4fb;
  border-radius:10px;
  background:#eaf3ff;
  color:var(--blue);
  cursor:pointer;
  font-size:12px;
  font-weight:900;
  padding:7px 9px;
}
.today-task-btn:disabled{
  background:#f3f6fa;
  border-color:#dde6f0;
  color:#9aa8b8;
  cursor:not-allowed;
}
.today-plan-list{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
}
.today-plan-item{
  display:grid;
  grid-template-columns:auto 1fr auto;
  grid-template-areas:
    "order main action"
    "order meta action";
  align-items:center;
  gap:2px 8px;
  min-width:0;
  border:1px solid #dbe7f5;
  border-radius:10px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  padding:7px 9px;
  text-align:left;
}
.today-plan-item.is-disabled{
  background:#f3f6fa;
  color:#9aa8b8;
  cursor:not-allowed;
}
.today-plan-order{
  grid-area:order;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:999px;
  background:#d9eaff;
  color:var(--blue-dark);
  font-size:12px;
  font-weight:900;
}
.today-plan-main{
  grid-area:main;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  font-weight:900;
}
.today-plan-meta{
  grid-area:meta;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
}
.today-plan-action{
  grid-area:action;
  color:var(--blue-dark);
  font-size:11px;
  font-weight:900;
}
.today-task-grid{
  display:grid;
  grid-template-columns:130px 130px 1fr;
  gap:8px;
}
.today-task-card{
  border:1px solid #dbe7f5;
  border-radius:10px;
  background:#fff;
  padding:9px;
}
.today-task-label{
  color:var(--muted);
  font-size:11px;
  font-weight:900;
  margin-bottom:4px;
}
.today-task-value{
  color:var(--text);
  font-size:20px;
  font-weight:900;
  line-height:1;
  margin-bottom:7px;
}
.today-task-next-list{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.today-task-link{
  width:100%;
  text-align:left;
  background:#fff;
  color:var(--text);
  border-color:#dbe7f5;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.today-task-empty{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.content-grid{
  display:grid;
  gap:12px;
  grid-template-columns:1.325fr 0.675fr;
  gap:18px;
}
.card{
  background:var(--card);
  border:1px solid #cbd9e8;
  border-radius:18px;
  padding:12px;
  box-shadow:var(--shadow);
}
.card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  gap:12px;
}
.card-head h3{
  margin:0;
  font-size:18px;
}
.pill{
  background:#dcecff;
  color:var(--blue-dark);
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
}
.pill.subtle{
  background:#e9eef4;
  color:#4e6278;
}
.page-wrap{
  background:#edf4fb;
  overflow:auto;
  min-height:720px;
  border:1px solid #dbe6f2;
  border-radius:18px;
  padding:14px;
  text-align:center;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
.page-wrap img{
  max-width:none;
  width:130%;
  transform-origin:top center;
  display:block;
  margin:0 auto;
  transition:transform .15s ease;
  border-radius:12px;
  box-shadow:0 8px 20px rgba(0,0,0,.08);
}
.audio-box{
  border:1px solid var(--line);
  border-radius:14px;
  padding:8px;
  background:var(--panel);
}
.audio-track-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-bottom:7px;
}
.audio-label{
  font-weight:700;
  margin-bottom:4px;
}
audio{
  width:100%;
}
.guide{
  background:#f6fbff;
  border:1px solid #d8eaff;
  border-radius:12px;
  padding:9px 12px;
  margin-top:8px;
  color:#35506f;
}
.compact-guide summary{
  cursor:pointer;
  font-weight:800;
}
.guide ol{
  margin:8px 0 0;
  padding-left:18px;
  line-height:1.5;
  font-size:13px;
}
.memo-section{
  margin-top:0;
}
.memo-section label{
  display:block;
  font-weight:700;
  margin-bottom:8px;
}
textarea{
  width:100%;
  min-height:126px;
  resize:vertical;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  font:inherit;
}
.memo-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
.save-status{
  font-size:13px;
  color:var(--muted);
}
@media (max-width: 1024px){
  .shell{grid-template-columns:1fr}
  .sidebar{border-right:none;border-bottom:1px solid var(--line)}
  .content-grid{grid-template-columns:1fr}
  .audio-track-grid{grid-template-columns:1fr}
  .main{padding:18px}
}


.page-tools{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.lesson-view-toggle-slot{
  display:flex;
  align-items:center;
  margin-right:4px;
}
.tool-btn{
  border:1px solid var(--line);
  background:#f9fbfd;
  color:var(--text);
  border-radius:10px;
  padding:7px 10px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  min-width:46px;
}
.tool-btn:hover{
  background:#f5f8fc;
}


.mode-tabs{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
  margin-top:14px;
}
.mode-tab{
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:10px 8px;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.mode-tab.active{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff;
}
.view-section{display:none;}
.view-section.active{display:block;}

.quiz-shell,.wrong-shell{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  box-shadow:var(--shadow);
}
.quiz-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.quiz-progress,.quiz-score,.wrong-summary{
  font-size:14px;
  font-weight:700;
  color:var(--text);
}
.quiz-card{
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  min-height:210px;
  background:var(--panel);
}
.quiz-split-layout{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);
  gap:16px;
  align-items:start;
}
.quiz-prompt-pane,
.quiz-choice-pane{
  min-width:0;
}
.quiz-prompt-pane{
  border:1px solid #dfe9f4;
  border-radius:14px;
  background:#fff;
  padding:14px;
}
.quiz-choice-pane{
  position:sticky;
  top:12px;
}
.quiz-empty{
  color:var(--muted);
  line-height:1.6;
}
.quiz-type{
  font-size:12px;
  font-weight:800;
  color:var(--blue);
  margin-bottom:8px;
}
.quiz-question{
  font-size:24px;
  font-weight:800;
  margin-bottom:12px;
}
.quiz-conversation-prompt{
  display:grid;
  gap:8px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
.quiz-conversation-title{
  font-size:14px;
  font-weight:900;
  color:var(--blue);
  margin-bottom:2px;
}
.quiz-conversation-row{
  display:grid;
  grid-template-columns:30px 1fr;
  gap:10px;
  align-items:start;
  font-size:19px;
  line-height:1.62;
  font-weight:650;
}
.quiz-conversation-speaker{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:999px;
  background:#e8f1ff;
  color:var(--blue);
  font-size:13px;
  font-weight:900;
  line-height:1;
}
.quiz-conversation-text{
  min-width:0;
  word-break:keep-all;
}
.quiz-sub{
  color:var(--muted);
  margin-bottom:12px;
  font-size:17px;
  line-height:1.6;
}
.choice-list{
  display:grid;
  gap:10px;
}
.choice-btn{
  text-align:left;
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:12px 14px;
  cursor:pointer;
  font-size:17px;
  line-height:1.55;
}
.choice-btn:hover{background:#f7fbff;}
.choice-btn.correct{
  background:#e6f8ec;
  border-color:#54b976;
}
.choice-btn.wrong{
  background:#fdecec;
  border-color:#e36f6f;
}
.quiz-feedback{
  margin-top:14px;
  font-size:17px;
  line-height:1.55;
  font-weight:700;
}
.quiz-progress-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.quiz-progressbar{height:10px;border-radius:999px;background:#eaf0f7;overflow:hidden;margin-bottom:16px;}
.quiz-progressbar span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#2f80ed,#69a7ff);transition:width .25s ease;}
.choice-btn{display:flex;align-items:center;justify-content:space-between;gap:14px;transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;}
.choice-btn:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(47,128,237,.08);}
.choice-btn:disabled{cursor:default;opacity:1;}
.choice-btn.is-picked{border-color:#8db5ee;background:#f6fbff;}
.choice-btn.is-judged:not(.correct):not(.wrong){opacity:.75;}
.choice-btn-label{flex:1 1 auto;}
.choice-btn-mark{width:28px;min-width:28px;height:28px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;font-size:15px;font-weight:800;color:transparent;background:#f2f5f9;border:1px solid #dce5ef;}
.choice-btn.correct .choice-btn-mark{color:#1f7a3e;background:#e7f8ec;border-color:#91d8a6;}
.choice-btn.wrong .choice-btn-mark{color:#c23d3d;background:#fdecec;border-color:#f0b4b4;}
.choice-btn.correct .choice-btn-mark::before{content:"✓";}
.choice-btn.wrong .choice-btn-mark::before{content:"✕";}
.feedback-badge{display:inline-flex;align-items:center;justify-content:center;min-width:52px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:800;margin-right:8px;}
.feedback-badge.is-correct{background:#e7f8ec;color:#1f7a3e;border:1px solid #91d8a6;}
.feedback-badge.is-wrong{background:#fdecec;color:#b64242;border:1px solid #f0b4b4;}
.quiz-result-hero{padding:8px 0 2px;}
.quiz-result-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px;}
.quiz-result-card{border:1px solid var(--line);background:#fff;border-radius:14px;padding:14px;}
.lesson-vocab-preview{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:14px;
}
.lesson-vocab-preview-item{
  padding:10px 12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fff;
}
.lesson-vocab-preview-item strong{
  display:block;
  font-size:17px;
}
.lesson-vocab-preview-item span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
}
.result-label{font-size:13px;color:var(--muted);margin-bottom:6px;}
.result-value{font-size:28px;font-weight:800;line-height:1.1;color:var(--text);}
.quiz-result-review{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbff;
  overflow:hidden;
}
.quiz-result-review summary{
  cursor:pointer;
  padding:11px 14px;
  font-weight:900;
  color:var(--text);
}
.quiz-result-list{
  display:grid;
  gap:8px;
  padding:0 12px 12px;
}
.quiz-result-row{
  padding:10px 12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fff;
}
.quiz-result-row summary{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(220px,0.9fr);
  gap:10px;
  cursor:pointer;
  font-weight:800;
}
.quiz-result-row span,
.quiz-result-row em{
  display:block;
  color:var(--muted);
  font-size:13px;
  font-style:normal;
  margin-top:2px;
}
.quiz-result-row-detail{
  margin-top:10px;
  padding-top:10px;
  border-top:1px dashed #d8e3ef;
}
.quiz-weak-list{display:grid;gap:10px;}
.quiz-weak-item{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:1px solid #e3ebf5;border-radius:12px;background:#fff;}
.quiz-translation-box{
  display:grid;
  gap:8px;
  margin-top:12px;
  padding:12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fff;
}
.quiz-translation-row{
  display:grid;
  grid-template-columns:28px 1fr;
  gap:10px;
  align-items:start;
  color:var(--text);
  line-height:1.6;
}
.quiz-translation-row strong{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:999px;
  background:#eef4fa;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  line-height:1;
}
.quiz-translation-row span{
  min-width:0;
  word-break:keep-all;
}
.quiz-grammar-detail-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.quiz-grammar-detail-card{
  padding:12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fff;
  line-height:1.65;
  word-break:keep-all;
}
.quiz-grammar-pattern{
  margin-top:6px;
  color:var(--muted);
}
@media (max-width: 900px){
  .quiz-grammar-detail-grid{
    grid-template-columns:1fr;
  }
}
.quiz-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.quiz-read-btn{
  min-width:92px;
}
.quiz-read-mode-wrap{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.quiz-auto-read-wrap{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-size:13px;
  font-weight:800;
}
.quiz-auto-read-wrap input{
  width:16px;
  height:16px;
  margin:0;
  accent-color:var(--blue);
}
.quiz-read-mode-select{
  border:0;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-weight:900;
  outline:none;
}
.wrong-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}
.wrong-item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px 12px;
  background:#fbfdff;
  min-width:0;
  position:relative;
}
.wrong-item-main{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,0.9fr);
  gap:10px;
  align-items:start;
}
.wrong-item-info,
.wrong-item-side{
  min-width:0;
}
.wrong-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:5px;
  align-items:flex-start;
  padding-right:72px;
}
.wrong-title{
  font-weight:800;
  line-height:1.25;
}
.wrong-meta-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:2px 10px;
}
.wrong-meta{
  color:var(--muted);
  font-size:13px;
  word-break:keep-all;
  line-height:1.35;
}
.wrong-insight{
  padding:9px 11px;
  border:1px solid #dbe6f3;
  border-radius:12px;
  background:#f8fbff;
  min-height:0;
}
.wrong-insight-body{
  display:grid;
  gap:3px;
}
.wrong-detail{
  margin-top:6px;
  border-top:1px dashed #d4e0ef;
  padding-top:6px;
}
.wrong-detail summary{
  cursor:pointer;
  color:var(--blue);
  font-size:12px;
  font-weight:900;
}
.wrong-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  margin-top:8px;
}
.wrong-action-btn{
  min-height:34px;
  padding:7px 10px;
  width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.badge-wrong{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 9px;
  border-radius:999px;
  background:#ffe9e9;
  color:#a83636;
  font-size:11px;
  font-weight:800;
  position:absolute;
  top:12px;
  right:14px;
}

.quiz-card audio{ width:100%; margin-bottom:12px; }
.quiz-question{ line-height:1.4; }

.quiz-dashboard{
  display:grid;
  grid-template-columns:1.2fr repeat(4,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.quiz-dash-card{
  min-height:126px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  padding:14px;
}
.quiz-dash-hero{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:linear-gradient(180deg,#ffffff 0%,#e8f2ff 100%);
}
.quiz-dash-kicker{
  color:var(--blue-dark);
  font-size:12px;
  font-weight:900;
  margin-bottom:8px;
}
.quiz-dash-title{
  color:var(--text);
  font-size:22px;
  font-weight:900;
  line-height:1.2;
}
.quiz-dash-sub,.quiz-dash-empty{
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
  margin-top:8px;
}
.quiz-dash-meter{
  height:9px;
  border-radius:999px;
  background:#dcecff;
  overflow:hidden;
  margin-top:14px;
}
.quiz-dash-meter span{
  display:block;
  height:100%;
  background:var(--blue);
  border-radius:999px;
}
.quiz-dash-list{
  display:grid;
  gap:7px;
}
.quiz-dash-action{
  width:100%;
  border:1px solid #b8d4fb;
  border-radius:10px;
  background:#dcecff;
  color:var(--blue-dark);
  cursor:pointer;
  font-size:13px;
  font-weight:900;
  padding:9px 10px;
  margin:10px 0 8px;
}
.quiz-dash-action:disabled{
  background:#f3f6fa;
  color:#9aa8b8;
  border-color:#dde6f0;
  cursor:not-allowed;
}
.quiz-dash-link{
  width:100%;
  border:1px solid #cfddec;
  border-radius:10px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-size:13px;
  font-weight:800;
  padding:8px 10px;
  text-align:left;
}
.quiz-dash-link.is-warning{
  border-color:#f2c48b;
  background:#fff8ef;
}
.quiz-dash-link span{
  display:block;
  margin-top:2px;
  color:#8a5b24;
  font-size:12px;
  font-weight:700;
}
.quiz-dash-chip{
  border:1px solid #dbe7f5;
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font-size:13px;
  font-weight:800;
  padding:8px 10px;
}
.quiz-dash-chip span{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  margin-top:3px;
}
.quiz-dash-chip em{
  display:block;
  margin-top:5px;
  color:#4e6480;
  font-size:12px;
  font-style:normal;
  font-weight:700;
  line-height:1.35;
}

@media (max-width: 1300px){
  .quiz-dashboard{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 760px){
  .quiz-dashboard{grid-template-columns:1fr;}
}

.wrong-summary{
  line-height:1.5;
}
.wrong-filter-bar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}
.wrong-filter-btn{
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-weight:800;
  min-height:34px;
  padding:7px 12px;
}
.wrong-filter-btn.is-active{
  border-color:var(--blue);
  background:var(--blue);
  color:#fff;
}
.wrong-filter-btn span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  margin-left:5px;
  padding:0 6px;
  border-radius:999px;
  background:#eef4fb;
  color:#48627f;
  font-size:12px;
}
.wrong-filter-btn.is-active span{
  background:#fff;
  color:var(--blue-dark);
}

@media (max-width: 1500px){
  .wrong-list{grid-template-columns:1fr;}
  .wrong-item-main{grid-template-columns:minmax(0,1fr) minmax(320px,0.9fr);}
}

@media (max-width: 900px){
  .wrong-item-main{grid-template-columns:1fr;}
  .wrong-meta-grid{grid-template-columns:1fr;}
  .wrong-actions{grid-template-columns:1fr;}
  .quiz-result-row summary{grid-template-columns:1fr;}
  .compare-focus-list{grid-template-columns:1fr;}
  .related-vocab-actions{grid-template-columns:1fr;}
  .lesson-vocab-preview{grid-template-columns:1fr;}
}

.mode-tabs-5{
  grid-template-columns: 1fr 1fr;
}
#examCard .choice-btn, #quizCard .choice-btn{
  text-align:left;
}
.exam-top-note{
  color: var(--muted);
}

.shadow-box{
  border:1px solid var(--line);
  border-radius:14px;
  padding:0;
  margin-bottom:8px;
  background:#fbfdff;
}
.shadow-box summary{
  cursor:pointer;
  font-weight:900;
  padding:10px 12px;
}
.shadow-box[open]{
  padding-bottom:10px;
}
.shadow-box[open] .shadow-actions,
.shadow-box[open] .record-status,
.shadow-box[open] audio{
  margin-left:10px;
  margin-right:10px;
}
.shadow-actions{
  display:flex;
  gap:8px;
  margin-bottom:8px;
}
.record-status{
  font-size:13px;
  color:var(--muted);
  line-height:1.5;
  margin-bottom:8px;
}
#myRecording{
  width:100%;
}

.audio-controls{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:6px 0 10px;
  font-size:13px;
}
.audio-controls select{
  padding:3px 6px;
}

.auto-settings{
  margin-top:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  font-size:13px;
}
.auto-settings label{
  display:flex;
  justify-content:space-between;
  margin-top:6px;
}
.auto-settings input, .auto-settings select{
  width:80px;
}

.auto-inline{
  display:flex;
  align-items:center;
  gap:8px;
  position:relative;
}
.auto-inline-settings{
  position:relative;
}
.auto-inline-settings summary{
  list-style:none;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-size:14px;
  font-weight:800;
  padding:11px 13px;
}
.auto-inline-settings summary::-webkit-details-marker{
  display:none;
}
.auto-inline-controls{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:20;
  display:grid;
  grid-template-columns:repeat(3,max-content);
  gap:8px;
  align-items:end;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:var(--shadow);
  padding:10px;
  font-size:13px;
}
.auto-inline-controls label{
  display:grid;
  gap:4px;
  color:var(--muted);
  font-weight:800;
}
.auto-inline input{
  width:50px;
}
.auto-inline select{
  min-width:72px;
}
.learning-settings{
  position:relative;
}
.learning-settings summary{
  list-style:none;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-size:14px;
  font-weight:800;
  padding:11px 13px;
}
.learning-settings summary::-webkit-details-marker{
  display:none;
}
.learning-settings-panel{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:30;
  display:grid;
  grid-template-columns:minmax(260px,1fr) minmax(210px,.8fr);
  gap:12px;
  width:min(560px, calc(100vw - 28px));
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow);
  padding:12px;
}
.learning-settings-group{
  display:grid;
  gap:8px;
  min-width:0;
}
.settings-title{
  font-weight:900;
  color:var(--text);
}
.learning-settings-group label{
  display:grid;
  grid-template-columns:86px 1fr;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.learning-settings-group input[type="range"]{
  width:100%;
}
.learning-settings-group .ghost-btn{
  width:100%;
  padding:9px 10px;
}
#stopAutoBtn[disabled]{
  opacity: .55;
  cursor: default;
}


.explanation-box{margin-top:14px;padding:12px 14px;border-radius:14px;background:#f6f8fb;border:1px solid #dfe6f1;color:#243041;line-height:1.55;}
.explanation-title{font-weight:700;margin-bottom:6px;}
.quiz-hint{margin-top:8px;font-size:13px;color:#5b6472;}
.auto-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:#eef5ff;color:#2757a5;font-size:12px;font-weight:700;}

.mode-tabs-6{
  grid-template-columns: 1fr 1fr;
}

.explanation-box{
  margin-top:12px;
  padding:12px 14px;
  border:1px solid #d8eaff;
  background:#f6fbff;
  border-radius:14px;
  line-height:1.6;
}
.quiz-explanation-details summary,
.exam-review-details summary{
  cursor:pointer;
  color:var(--blue);
  font-weight:900;
  list-style:none;
}
.quiz-explanation-details summary::-webkit-details-marker,
.exam-review-details summary::-webkit-details-marker{
  display:none;
}
.quiz-explanation-details summary::before,
.exam-review-details summary::before{
  content:"▸";
  display:inline-block;
  margin-right:6px;
  transform:rotate(0deg);
  transition:transform .18s ease;
}
.quiz-explanation-details[open] summary::before,
.exam-review-details[open] summary::before{
  transform:rotate(90deg);
}
.quiz-explanation-details-body{
  margin-top:10px;
}
.exam-review-details{
  margin-top:14px;
  padding:12px;
  border:1px solid #d8eaff;
  border-radius:14px;
  background:#f6fbff;
}
.exam-review-list{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.exam-review-item{
  padding:12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fff;
}
.explanation-title{
  font-weight:800;
  color:var(--blue);
  margin-bottom:6px;
}
.compare-explanation-list{
  display:grid;
  gap:6px;
  margin-top:10px;
}
.compare-explanation-lead{
  margin-bottom:10px;
}
.compare-explanation-tip{
  padding:10px 12px;
  border:1px solid #cfe0f5;
  border-radius:12px;
  background:#f8fbff;
  color:#42556f;
  font-weight:700;
}
.compare-focus-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}
.compare-focus-row{
  padding:8px 10px;
  border:1px solid #dfe9f4;
  border-radius:10px;
  background:#fff;
}
.compare-focus-row strong{
  display:block;
}
.compare-focus-row span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
}
.compare-explanation-card{
  padding:10px 12px;
  border:1px solid #dbe6f3;
  border-radius:12px;
  background:#fff;
}
.compare-explanation-card.is-answer{
  border-color:#8bc6a3;
  background:#effaf3;
}
.compare-explanation-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:4px;
}
.compare-explanation-head span{
  color:var(--blue);
  font-weight:800;
}
.compare-example{
  margin-top:6px;
  color:#52657e;
  font-size:14px;
}
.auto-badge{
  display:inline-flex;
  margin-left:8px;
  padding:4px 8px;
  border-radius:999px;
  background:#eaf3ff;
  color:#1f5fbf;
  font-size:11px;
}
.quiz-hint{
  margin-top:8px;
  font-size:13px;
  color:var(--muted);
}
.vocab-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
  align-items:center;
}
.vocab-toolbar input,
.vocab-toolbar select{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  font:inherit;
  background:#fff;
}
.vocab-list{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.vocab-item{
  border:1px solid var(--line);
  border-radius:16px;
  background:#fbfdff;
  padding:14px;
}
.vocab-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  margin-bottom:8px;
}
.vocab-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.vocab-word{
  font-size:20px;
  font-weight:800;
}
.vocab-reading{
  font-size:14px;
  color:var(--muted);
  font-weight:700;
  margin-left:6px;
}
.vocab-meaning{
  font-size:16px;
  font-weight:700;
  margin-bottom:8px;
}
.vocab-example{
  margin-bottom:4px;
}
.vocab-actions-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.vocab-mini-btn{
  padding:8px 12px;
  font-size:13px;
}
.vocab-quiz-wrap{
  margin-top:16px;
}

.study-side-tabs{
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  background:var(--panel);
  height:318px;
  overflow:hidden;
}
.study-side-tabbar{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:8px;
}
.study-side-tab{
  border:1px solid #dbe7f5;
  border-radius:10px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-size:13px;
  font-weight:900;
  padding:9px 10px;
}
.study-side-tab:focus{
  outline:none;
}
.study-side-tab:focus-visible{
  box-shadow:0 0 0 2px rgba(47,128,237,.22);
  border-color:#9fc4ff;
}
.study-side-tab.is-active{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff;
}
.tab-count{
  color:var(--muted);
  font-size:12px;
}
.study-side-panel{
  display:none;
  height:252px;
  overflow-y:scroll;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.study-side-panel.is-active{
  display:block;
}
.study-side-panel::-webkit-scrollbar{
  width:8px;
}
.study-side-panel::-webkit-scrollbar-thumb{
  background:#c5d5e6;
  border-radius:999px;
  border:2px solid transparent;
  background-clip:padding-box;
}
.study-side-panel::-webkit-scrollbar-track{
  background:#eef4fa;
  border-radius:999px;
}
.related-vocab-list{
  display:grid;
  gap:8px;
}
.related-vocab-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:2px;
}
.related-vocab-quiz-btn{
  min-height:38px;
  padding:8px 10px;
}
.related-vocab-chip{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  padding:10px 12px;
  cursor:pointer;
}
.related-vocab-chip:hover{background:#f7fbff;}
.related-vocab-main{display:block;font-weight:800;font-size:16px;margin-bottom:4px;}
.related-vocab-sub{display:block;color:var(--muted);font-size:13px;}
.related-vocab-state{display:inline-block;margin-top:8px;font-size:12px;font-weight:800;color:var(--blue-dark);background:#dcecff;border-radius:999px;padding:5px 9px;}
.vocab-subtools{margin-top:-4px;}
.vocab-tool-title{font-weight:800;color:#34516f;}
.vocab-auto-status{
  margin:8px 0 10px;
  color:var(--muted);
  line-height:1.6;
}
.masked-text{
  display:inline-block;
  padding:8px 10px;
  border-radius:10px;
  background:#eef3f8;
  color:#607489;
  font-size:13px;
  font-weight:700;
}
.is-masked{cursor:pointer;}
.vocab-item.is-focus{
  border-color:#9fc4ff;
  box-shadow:0 0 0 3px rgba(47,128,237,.12);
}


/* v23 compact vocab layout */
#vocabView .quiz-shell{
  padding: 12px 14px;
}
#vocabView .header{
  margin-bottom: 10px;
}
#vocabView .header h2{
  margin: 0;
  line-height: 1.05;
}
#vocabView .vocab-toolbar{
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  line-height: 1.1;
}
#vocabView .vocab-toolbar label{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}
#vocabView .vocab-toolbar input,
#vocabView .vocab-toolbar select{
  padding: 8px 10px;
  line-height: 1;
}
#vocabView .vocab-subtools{
  margin-top: 0;
}
#vocabView .vocab-tool-title{
  line-height: 1;
}
#vocabView .vocab-auto-status,
#vocabView #vocabSummary{
  margin: 4px 0 6px;
  line-height: 1.2;
}

#vocabView .vocab-auto-preview{
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--card);
  min-height: 112px;
  height: 112px;
  padding: 4px 0 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
#vocabView .vocab-auto-status{
  min-height: 72px;
  height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
#vocabView #vocabSummary{
  font-size: 13px;
}
#vocabView .vocab-list{
  margin-top: 6px;
  gap: 10px;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}
#vocabView .vocab-list::-webkit-scrollbar{
  width: 10px;
}
#vocabView .vocab-list::-webkit-scrollbar-thumb{
  background: #c6d6e6;
  border-radius: 999px;
  border: 2px solid #f6f9fc;
}
#vocabView .vocab-list::-webkit-scrollbar-track{
  background: #eef3f8;
  border-radius: 999px;
}
#vocabView .vocab-item{
  padding: 12px;
}
#vocabView .vocab-head{
  margin-bottom: 6px;
}
#vocabView .vocab-word{
  line-height: 1.05;
  margin-bottom: 2px;
}
#vocabView .vocab-meaning{
  margin-bottom: 4px;
  line-height: 1.15;
}
#vocabView .vocab-example,
#vocabView .vocab-example + div{
  line-height: 1.18;
  margin-bottom: 2px;
}
#vocabView .vocab-actions-row{
  margin-top: 8px;
}
#vocabView .vocab-mini-btn,
#vocabView .badge{
  padding-top: 7px;
  padding-bottom: 7px;
}
#vocabView .vocab-quiz-wrap{
  margin-top: 12px;
}


#vocabView .vocab-auto-preview{
  min-height: 248px;
  height: auto;
  gap: 6px;
}
#vocabView .vocab-auto-status{
  min-height: 0;
  height: auto;
  margin-bottom: 0;
}
.vocab-auto-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg,#fafdff 0%, #f4f8fd 100%);
  padding: 14px 16px;
  min-height: 126px;
  box-shadow: var(--shadow);
  transition: opacity .18s ease, transform .18s ease;
}
.vocab-auto-card.is-idle{
  opacity: .92;
}
.vocab-auto-card.is-running{
  opacity: 1;
}
.vocab-auto-card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.vocab-auto-chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:#eaf3ff;
  color:#2b6ed2;
  font-size:12px;
  font-weight:800;
}
.vocab-auto-word{
  font-size:26px;
  font-weight:800;
  line-height:1.15;
  margin-bottom:4px;
}
.vocab-auto-meaning{
  font-size:18px;
  font-weight:800;
  margin-bottom:8px;
}
.vocab-auto-example{
  font-size:18px;
  line-height:1.35;
  margin-bottom:4px;
}


/* v29 vocab auto card polish */
.section-mini-title{
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
  color:#5d7998;
  margin-bottom:6px;
}
#vocabView .vocab-auto-preview{
  margin-top:14px;
  margin-bottom:10px;
  padding:18px 18px 16px;
  border:1px solid #d9e6f4;
  border-radius:18px;
  background:linear-gradient(180deg,#fbfdff 0%, #f4f8fd 100%);
  box-shadow:0 8px 24px rgba(28,56,94,.06);
}
.vocab-auto-preview-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.vocab-auto-speed-group{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.vocab-speed-btn{
  min-width:72px;
  padding:8px 12px;
  font-size:13px;
}
.vocab-speed-btn.is-active{
  background:#2f7cf6;
  color:#fff;
  border-color:#2f7cf6;
}
#vocabView .vocab-auto-status{
  font-size:15px;
  line-height:1.4;
  color:#647c97;
}
.vocab-summary-row{
  margin:8px 0 10px;
}
.vocab-auto-card{
  padding:22px 22px 18px;
  min-height:170px;
  transform:translateY(0);
}
.vocab-auto-card.is-running{
  animation:vocabCardFade .28s ease;
}
@keyframes vocabCardFade{
  0%{opacity:.35; transform:translateY(4px);}
  100%{opacity:1; transform:translateY(0);}
}
.vocab-auto-card-head{
  margin-bottom:12px;
}
.vocab-auto-word{
  font-size:34px;
  margin-bottom:8px;
}
.vocab-auto-word .vocab-reading{
  font-size:18px;
  margin-left:8px;
}
.vocab-auto-meaning{
  font-size:24px;
  margin-bottom:12px;
}
.vocab-auto-example{
  font-size:21px;
  line-height:1.45;
  margin-bottom:8px;
}
#vocabView .vocab-list{
  margin-top:0;
}
@media (max-width: 980px){
  .vocab-auto-preview-head{
    flex-direction:column;
  }
  .vocab-auto-speed-group{
    width:100%;
  }
}


.vocab-auto-controls-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.vocab-audio-toggle{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--text);
  font-size:13px;
  font-weight:700;
}
.vocab-audio-toggle input{
  margin:0;
}
.vocab-auto-voice-hint{
  margin-top:10px;
  font-size:13px;
  color:var(--muted);
}
@media (max-width: 768px){
  .vocab-auto-preview-head{
    align-items:flex-start;
  }
  .vocab-auto-controls-wrap{
    justify-content:flex-start;
  }
}

.vocab-auto-detail-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px 12px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px dashed #d9e6f4;
}
.vocab-auto-detail-controls label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font-size:13px;
  color:var(--text);
  font-weight:700;
}
.vocab-auto-detail-controls select{
  border:1px solid var(--line);
  border-radius:8px;
  padding:4px 6px;
  background:#f8fbff;
  color:var(--text);
}
@media (max-width: 768px){
  .vocab-auto-detail-controls{
    flex-direction:column;
    align-items:flex-start;
  }
}


/* v32 immersive auto-study polish */
#vocabView .vocab-subtools{
  padding:10px 12px;
  border:1px solid #dbe7f3;
  border-radius:16px;
  background:#f8fbff;
}
#vocabView .vocab-auto-preview{
  position:relative;
  padding:16px 18px 18px;
}
#vocabView .vocab-auto-preview::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:18px;
  background:linear-gradient(135deg, rgba(47,128,237,.05), rgba(255,255,255,0));
  pointer-events:none;
}
.vocab-auto-preview-head,
.vocab-auto-card{
  position:relative;
  z-index:1;
}
.vocab-auto-controls-wrap{
  max-width:100%;
}
.vocab-auto-detail-controls{
  gap:8px 10px;
}
.vocab-auto-card{
  border:1px solid #d9e7f5;
  border-radius:20px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  box-shadow:0 16px 36px rgba(31,67,107,.08);
}
.vocab-auto-card.is-running{
  animation:vocabCardFadeZoom .34s ease;
}
@keyframes vocabCardFadeZoom{
  0%{opacity:.2; transform:translateY(8px) scale(.985);} 
  100%{opacity:1; transform:translateY(0) scale(1);} 
}
.vocab-auto-stage-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.vocab-auto-stage{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:6px 12px;
  border-radius:999px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.01em;
  color:#3e5874;
  background:#edf4fb;
}
.vocab-auto-stage.is-word{background:#e7f1ff; color:#2463bf;}
.vocab-auto-stage.is-example{background:#edf8ea; color:#2c7a48;}
.vocab-auto-stage.is-shadow{background:#fff6df; color:#9a6a00;}
.vocab-auto-stage.is-idle{background:#eef2f6; color:#708197;}
.vocab-auto-countdown{
  min-height:24px;
  font-size:13px;
  color:#6e8095;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.vocab-auto-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#ced9e6;
  opacity:.45;
  transform:scale(.9);
}
.vocab-auto-dot.is-on{
  background:#2f80ed;
  opacity:1;
  transform:scale(1.15);
  box-shadow:0 0 0 4px rgba(47,128,237,.12);
}
.vocab-auto-word,
.vocab-auto-example,
.vocab-auto-exampleKr,
.vocab-auto-meaning{
  transition:color .18s ease, transform .18s ease, opacity .18s ease;
}
.vocab-auto-word.is-speaking,
.vocab-auto-example.is-speaking{
  color:#1f63bf;
  transform:translateX(2px);
}
.vocab-auto-example.is-speaking{
  color:#1e7a47;
}
.vocab-auto-card.is-shadowing .vocab-auto-word,
.vocab-auto-card.is-shadowing .vocab-auto-example{
  opacity:.88;
}
.vocab-auto-card.is-shadowing .vocab-auto-exampleKr{
  color:#8a6b14;
}
.vocab-auto-voice-hint{
  margin-top:14px;
  padding-top:10px;
  border-top:1px dashed #d9e7f5;
}
@media (max-width: 980px){
  .vocab-auto-stage-row{align-items:flex-start; flex-direction:column;}
  .vocab-auto-countdown{justify-content:flex-start;}
}


/* v33 polish */
.vocab-auto-preview-head{
  gap: 12px 18px;
}
.vocab-auto-card{
  padding: 20px 26px;
}
.vocab-auto-card-head{
  margin-bottom: 10px;
}
.vocab-auto-stage-row{
  margin-bottom: 8px;
}
.vocab-auto-word{
  font-size: 32px;
  line-height: 1.18;
  margin-bottom: 4px;
}
.vocab-auto-word .vocab-reading{
  font-size: 17px;
  margin-left: 6px;
}
.vocab-auto-meaning{
  font-size: 21px;
  line-height: 1.25;
  margin-bottom: 10px;
  color:#245fbb;
}
.vocab-auto-example{
  font-size: 19px;
  line-height: 1.42;
  margin-bottom: 6px;
}
.vocab-auto-exampleKr{
  font-size: 14px;
  line-height: 1.4;
}
.vocab-auto-voice-hint{
  margin-top: 10px;
  padding-top: 8px;
  font-size: 13px;
}
.vocab-auto-stage{
  position: relative;
  gap: 6px;
}
.vocab-auto-stage.is-word,
.vocab-auto-stage.is-example,
.vocab-auto-stage.is-shadow{
  animation: vocabStagePulse 1.15s ease-in-out infinite;
}
@keyframes vocabStagePulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(47,128,237,0.00); transform: translateY(0); }
  50%{ box-shadow: 0 0 0 6px rgba(47,128,237,0.10); transform: translateY(-1px); }
}
.vocab-auto-stage.is-example{
  animation-name: vocabStagePulseExample;
}
@keyframes vocabStagePulseExample{
  0%,100%{ box-shadow: 0 0 0 0 rgba(44,122,72,0.00); transform: translateY(0); }
  50%{ box-shadow: 0 0 0 6px rgba(44,122,72,0.10); transform: translateY(-1px); }
}
.vocab-auto-stage.is-shadow{
  animation-name: vocabStagePulseShadow;
}
@keyframes vocabStagePulseShadow{
  0%,100%{ box-shadow: 0 0 0 0 rgba(154,106,0,0.00); transform: translateY(0); }
  50%{ box-shadow: 0 0 0 6px rgba(154,106,0,0.12); transform: translateY(-1px); }
}
.vocab-auto-countdown::before{
  content: '따라읽기';
  font-size: 12px;
  color:#7c8ea2;
  margin-right: 2px;
}
.vocab-auto-countdown:empty::before{
  content:'';
}
.vocab-auto-dot{
  width: 9px;
  height: 9px;
  transition: transform .18s ease, opacity .18s ease, background-color .18s ease;
}
.vocab-auto-dot.is-on{
  transform: scale(1.2);
}
@media (max-width: 980px){
  .vocab-auto-card{ padding:18px 18px; }
  .vocab-auto-word{ font-size:28px; }
  .vocab-auto-meaning{ font-size:19px; }
  .vocab-auto-example{ font-size:17px; }
}

/* v34 top controls merged into 2-line bar */
#vocabView .vocab-subtools.vocab-subtools-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:stretch;
  padding:12px 14px;
}
#vocabView .vocab-subtools-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
#vocabView .vocab-subtools-row-top{
  line-height:1;
}
#vocabView .vocab-subtools-row-bottom{
  justify-content:space-between;
  align-items:flex-start;
  gap:14px 18px;
  padding-top:10px;
  border-top:1px dashed #d9e6f4;
}
#vocabView .vocab-subtools-status-box{
  min-width:280px;
  max-width:460px;
  flex:1 1 280px;
}
#vocabView .vocab-subtools-control-box{
  flex:2 1 620px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-end;
}
#vocabView .vocab-subtools-status-box .section-mini-title{
  margin-bottom:4px;
}
#vocabView .vocab-subtools-status-box .vocab-auto-status{
  margin:0;
  min-height:0;
  height:auto;
  font-size:14px;
  line-height:1.35;
}
#vocabView .vocab-subtools-control-box .vocab-auto-controls-wrap,
#vocabView .vocab-subtools-control-box .vocab-auto-detail-controls{
  margin:0;
  padding:0;
  border-top:none;
  justify-content:flex-end;
}
#vocabView .vocab-subtools-control-box .vocab-auto-detail-controls label{
  padding:6px 10px;
}
#vocabView .vocab-subtools-control-box .vocab-auto-detail-controls select{
  padding:4px 6px;
}
#vocabView .vocab-auto-preview{
  margin-top:10px;
  padding-top:12px;
}
#vocabView .vocab-auto-preview-head{
  display:none;
}
@media (max-width: 1180px){
  #vocabView .vocab-subtools-row-bottom{
    flex-direction:column;
    align-items:stretch;
  }
  #vocabView .vocab-subtools-control-box{
    align-items:flex-start;
  }
  #vocabView .vocab-subtools-control-box .vocab-auto-controls-wrap,
  #vocabView .vocab-subtools-control-box .vocab-auto-detail-controls{
    justify-content:flex-start;
  }
}


/* v35 split layout: left controls + right study card + 2-column vocab list */
#vocabView .quiz-shell{
  padding: 12px 14px 14px;
}
#vocabView .vocab-top-split{
  display:grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(480px, 1.3fr);
  gap:14px;
  align-items:stretch;
  margin-top:8px;
}
#vocabView .vocab-top-left,
#vocabView .vocab-top-right{
  min-width:0;
}
#vocabView .vocab-side-tools{
  height:100%;
  margin-bottom:0;
  padding:14px 16px;
  border:1px solid #d9e6f4;
  border-radius:18px;
  background:linear-gradient(180deg,#fbfdff 0%, #f4f8fd 100%);
  box-shadow:0 8px 24px rgba(28,56,94,.06);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
#vocabView .vocab-subtools-row-top{
  align-items:center;
  gap:12px;
}
#vocabView .vocab-subtools-row-actions{
  display:flex;
  gap:10px;
  margin:8px 0 10px;
  flex-wrap:wrap;
}
#vocabView .vocab-subtools-row-bottom{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:auto;
  padding-top:10px;
  border-top:1px dashed #d7e2ee;
}
#vocabView .vocab-subtools-status-box{
  min-height:64px;
}
#vocabView .vocab-auto-status{
  margin:4px 0 0;
  min-height:0;
  height:auto;
  line-height:1.35;
  font-size:14px;
}
#vocabView .vocab-subtools-control-box{
  display:flex;
  flex-direction:column;
  gap:10px;
}
#vocabView .vocab-auto-controls-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
#vocabView .vocab-auto-detail-controls{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 10px;
}
#vocabView .vocab-auto-detail-controls label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:8px 10px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  font-size:13px;
  font-weight:700;
}
#vocabView .vocab-auto-detail-controls select{
  margin-left:auto;
  max-width:92px;
  padding:7px 8px;
}
#vocabView .vocab-auto-preview{
  position:relative;
  top:auto;
  z-index:auto;
  min-height:100%;
  height:100%;
  margin-top:0;
  margin-bottom:0;
  padding:0;
  border:none;
  background:transparent;
  box-shadow:none;
}
#vocabView .vocab-auto-card{
  min-height:100%;
  height:100%;
  padding:18px 20px 16px;
}
#vocabView .vocab-auto-card-head{
  margin-bottom:10px;
}
#vocabView .vocab-auto-stage-row{
  margin-bottom:10px;
}
#vocabView .vocab-auto-word{
  font-size:30px;
  margin-bottom:6px;
}
#vocabView .vocab-auto-word .vocab-reading{
  font-size:17px;
}
#vocabView .vocab-auto-meaning{
  font-size:21px;
  margin-bottom:10px;
}
#vocabView .vocab-auto-example{
  font-size:19px;
  line-height:1.4;
  margin-bottom:6px;
}
#vocabView #vocabSummary{
  margin:12px 0 8px;
}
#vocabView .vocab-list{
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start;
  gap:12px;
  max-height:calc(100vh - 355px);
  margin-top:8px;
}
#vocabView .vocab-item{
  height:100%;
  min-height:182px;
}
#vocabView .vocab-head{
  margin-bottom:8px;
}
#vocabView .vocab-word{
  font-size:24px;
  line-height:1.08;
}
#vocabView .vocab-reading{
  font-size:15px;
}
#vocabView .vocab-meaning{
  font-size:17px;
  margin-bottom:6px;
}
#vocabView .vocab-example,
#vocabView .vocab-example + div{
  line-height:1.28;
}
@media (max-width: 1180px){
  #vocabView .vocab-top-split{
    grid-template-columns:1fr;
  }
  #vocabView .vocab-list{
    grid-template-columns:1fr;
    max-height:none;
  }
}


/* v40 rebuilt layout: stable top split + separate bottom controls */
#vocabView .vocab-top-split{
  display:grid !important;
  grid-template-columns:minmax(280px,0.72fr) minmax(520px,1.28fr) !important;
  gap:14px !important;
  align-items:start !important;
  margin-top:8px !important;
  height:auto !important;
}
#vocabView .vocab-top-left,
#vocabView .vocab-top-right{
  min-width:0;
  align-self:start !important;
  height:auto !important;
}
#vocabView .vocab-side-tools{
  height:auto !important;
  min-height:0 !important;
  margin-bottom:0 !important;
  padding:14px 16px !important;
  border:1px solid #d9e6f4 !important;
  border-radius:18px !important;
  background:linear-gradient(180deg,#fbfdff 0%, #f4f8fd 100%) !important;
  box-shadow:0 8px 24px rgba(28,56,94,.06) !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  gap:10px !important;
}
#vocabView .vocab-subtools-row-top{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
#vocabView .vocab-subtools-row-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:0;
  padding-bottom:10px;
  border-bottom:1px dashed #d7e2ee;
}
#vocabView .vocab-subtools-row-bottom{
  display:block !important;
  margin-top:0 !important;
  padding-top:0 !important;
  border-top:none !important;
}
#vocabView .vocab-subtools-status-box{
  min-height:0 !important;
}
#vocabView .vocab-auto-status{
  margin:4px 0 0 !important;
  min-height:0 !important;
  height:auto !important;
  line-height:1.38 !important;
  font-size:14px !important;
}
#vocabView .vocab-top-right{
  display:block !important;
}
#vocabView .vocab-auto-preview{
  position:relative !important;
  top:auto !important;
  z-index:auto !important;
  margin:0 !important;
  padding:0 !important;
  border:none !important;
  background:transparent !important;
  box-shadow:none !important;
  height:auto !important;
  min-height:0 !important;
}
#vocabView .vocab-auto-card{
  height:auto !important;
  min-height:220px !important;
  padding:18px 22px 16px !important;
}
#vocabView .vocab-bottom-controls{
  margin:12px 0 12px !important;
  padding:12px 14px !important;
  border:1px solid #d9e6f4 !important;
  border-radius:16px !important;
  background:linear-gradient(180deg,#fbfdff 0%, #f4f8fd 100%) !important;
  box-shadow:0 8px 24px rgba(28,56,94,.05) !important;
}
#vocabView .vocab-subtools-control-box-bottom{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px 18px !important;
  flex-wrap:wrap !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-controls-wrap{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls label{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  padding:8px 10px !important;
  background:#fff !important;
  border:1px solid var(--line) !important;
  border-radius:12px !important;
  font-size:13px !important;
  font-weight:700 !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls select{
  margin-left:0 !important;
  max-width:none !important;
}
#vocabView #vocabSummary{
  margin:8px 0 8px !important;
}
#vocabView .vocab-list{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  align-items:start !important;
  gap:12px !important;
  margin-top:8px !important;
  max-height:calc(100vh - 430px) !important;
  overflow-y:auto !important;
}
#vocabView .vocab-item{
  min-height:182px !important;
}
@media (max-width: 1180px){
  #vocabView .vocab-top-split{
    grid-template-columns:1fr !important;
  }
  #vocabView .vocab-subtools-control-box-bottom{
    flex-direction:column !important;
    align-items:flex-start !important;
  }
  #vocabView .vocab-bottom-controls .vocab-auto-detail-controls{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    width:100% !important;
  }
  #vocabView .vocab-list{
    grid-template-columns:1fr !important;
    max-height:none !important;
  }
}


/* v41 micro-tuning: compact left panel, tighten bottom controls, rebalance top */
#vocabView .vocab-top-split{
  grid-template-columns:minmax(280px,0.65fr) minmax(520px,1.35fr) !important;
  gap:12px !important;
}
#vocabView .vocab-side-tools{
  padding:12px 14px !important;
  gap:8px !important;
}
#vocabView .vocab-subtools-row-top{
  gap:8px !important;
}
#vocabView .vocab-subtools-row-actions{
  margin:4px 0 6px !important;
  padding-bottom:8px !important;
}
#vocabView .vocab-subtools-status-box{
  margin-top:4px !important;
}
#vocabView .section-mini-title{
  margin-bottom:4px !important;
}
#vocabView .vocab-auto-status{
  line-height:1.32 !important;
}
#vocabView .vocab-bottom-controls{
  margin-top:8px !important;
  margin-bottom:6px !important;
  padding:10px 12px !important;
}
#vocabView .vocab-subtools-control-box-bottom{
  gap:10px 14px !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-controls-wrap{
  gap:8px !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls{
  gap:8px !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls label{
  padding:7px 9px !important;
}
#vocabView .vocab-auto-card{
  padding:16px 20px 14px !important;
}
#vocabView #vocabSummary{
  margin:6px 0 8px !important;
}
#vocabView .vocab-list{
  max-height:calc(100vh - 405px) !important;
}


/* v42: attach bottom controls directly to the lower-left of the left panel */
#vocabView .vocab-side-tools{
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
}
#vocabView .vocab-subtools-row-bottom{
  margin-bottom:0 !important;
}
#vocabView .vocab-bottom-controls{
  margin-top:auto !important;
  margin-bottom:0 !important;
  margin-left:0 !important;
  margin-right:0 !important;
  width:100% !important;
  padding:10px 12px !important;
  border:1px solid #d9e6f4 !important;
  border-radius:16px !important;
  background:linear-gradient(180deg,#fbfdff 0%, #f4f8fd 100%) !important;
  box-shadow:none !important;
}
#vocabView .vocab-subtools-control-box-bottom{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:flex-start !important;
  gap:10px !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-controls-wrap{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  align-items:center !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  width:100% !important;
  gap:8px !important;
}
#vocabView .vocab-bottom-controls .vocab-auto-detail-controls label{
  width:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  padding:7px 9px !important;
}
#vocabView .vocab-top-split{
  align-items:start !important;
}
#vocabView .vocab-list{
  max-height:calc(100vh - 360px) !important;
}
@media (max-width: 1180px){
  #vocabView .vocab-bottom-controls{
    margin-top:10px !important;
  }
}


/* v43: force 50:50 split between left and right panels */
#vocabView .vocab-top-split{
  display:grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap:12px !important;
}

/* ensure both sides stretch evenly */
#vocabView .vocab-side-tools,
#vocabView .vocab-auto-card{
  width:100% !important;
  min-width:0 !important;
}


/* v44: make left controls single-row to reduce left panel height */
#vocabView .vocab-side-tools{
  gap:6px !important;
}

#vocabView .vocab-subtools-row-top{
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  gap:12px !important;
  overflow-x:auto;
}

#vocabView .vocab-subtools-row-top label{
  display:flex !important;
  align-items:center !important;
  gap:4px !important;
  white-space:nowrap !important;
  flex:0 0 auto;
}

#vocabView .vocab-tool-title{
  white-space:nowrap !important;
  flex:0 0 auto;
}

#vocabView .vocab-subtools-row-actions{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  margin:0 !important;
  padding-top:2px !important;
  padding-bottom:6px !important;
}

#vocabView .vocab-subtools-status-box{
  margin-top:2px !important;
}

#vocabView .vocab-auto-status{
  margin-top:2px !important;
  line-height:1.28 !important;
}

#vocabView .vocab-side-tools .ghost-btn,
#vocabView .vocab-side-tools .primary-btn{
  padding:9px 14px !important;
}

@media (max-width: 1180px){
  #vocabView .vocab-subtools-row-top{
    flex-wrap:wrap !important;
    overflow-x:visible;
  }
}


/* v45 compact mode labels */
#vocabView .vocab-tool-title{
  white-space:nowrap !important;
  margin-right:6px !important;
  font-weight:700 !important;
}
#vocabView .vocab-subtools-row-top{
  display:flex !important;
  align-items:center !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  overflow-x:visible !important;
}
#vocabView .vocab-subtools-row-top label{
  display:flex !important;
  align-items:center !important;
  gap:4px !important;
  margin-right:4px !important;
  white-space:nowrap !important;
}
#vocabView .vocab-subtools-row-actions{
  padding-top:0 !important;
}
#vocabView .vocab-side-tools .primary-btn,
#vocabView .vocab-side-tools .ghost-btn{
  padding:8px 12px !important;
}


/* v46: place start/stop buttons inline with mode controls */
#vocabView .vocab-subtools-row-top{
  display:flex !important;
  align-items:center !important;
  flex-wrap:wrap !important;
  gap:8px !important;
}
#vocabView .vocab-subtools-row-top .primary-btn,
#vocabView .vocab-subtools-row-top .ghost-btn{
  padding:8px 12px !important;
  margin-left:4px !important;
}
#vocabView .vocab-subtools-row-actions{
  display:none !important;
}

/* ===== v-scroll panel fix ===== */
html, body {
  height: 100%;
  overflow: hidden;
}

.shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.lesson-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#studyView.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.main > .view-section.active:not(#studyView) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 36px;
}

#studyView .header {
  flex: 0 0 auto;
}

#studyView .content-grid {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

#studyView .content-grid > .card {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#studyView .content-grid > .card .card-head {
  flex: 0 0 auto;
}

#studyView .page-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#studyView .content-grid > .card:last-child {
  overflow-y: auto;
}

#studyView .content-grid > .card:last-child::-webkit-scrollbar,
.main > .view-section.active:not(#studyView)::-webkit-scrollbar,
.lesson-list::-webkit-scrollbar,
#studyView .page-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#studyView .content-grid > .card:last-child::-webkit-scrollbar-thumb,
.main > .view-section.active:not(#studyView)::-webkit-scrollbar-thumb,
.lesson-list::-webkit-scrollbar-thumb,
#studyView .page-wrap::-webkit-scrollbar-thumb {
  background: #c5d5e6;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#studyView .content-grid > .card:last-child::-webkit-scrollbar-track,
.main > .view-section.active:not(#studyView)::-webkit-scrollbar-track,
.lesson-list::-webkit-scrollbar-track,
#studyView .page-wrap::-webkit-scrollbar-track {
  background: #eef4fa;
  border-radius: 999px;
}

@media (max-width: 1024px){
  html, body {
    overflow: auto;
  }

  .shell,
  .sidebar,
  .main {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .lesson-list,
  #studyView .content-grid > .card:last-child,
  #studyView .page-wrap {
    overflow: visible;
    max-height: none;
  }

  #studyView.active {
    display: block;
  }
}


.modal-open{overflow:hidden;}
.modal-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15, 23, 42, 0.56);
  z-index:1200;
}
.modal-overlay.is-open{display:flex;}
.modal-panel{
  width:min(760px, 100%);
  max-height:min(86vh, 920px);
  overflow:auto;
  border-radius:20px;
  border:1px solid rgba(191, 204, 221, 0.95);
  background:#fff;
  box-shadow:0 18px 48px rgba(15,23,42,.22);
  padding:18px;
}
.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.modal-eyebrow{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef5ff;
  color:#2b65c7;
  font-size:12px;
  font-weight:800;
  margin-bottom:8px;
}
.modal-head h3{margin:0 0 4px;font-size:24px;line-height:1.15;}
.modal-subcopy{color:var(--muted);font-size:14px;line-height:1.45;}
.modal-close-btn{white-space:nowrap;}
.vocab-quiz-modal-panel .quiz-card{margin:0; box-shadow:none;}
.vocab-quiz-modal-card{min-height:260px;}
.vocab-quiz-modal-panel{width:min(780px, 100%);}
.vocab-quiz-modal-panel .quiz-card{background:#fbfdff;}
@media (max-width: 720px){
  .modal-overlay{padding:12px;}
  .modal-panel{width:100%; max-height:92vh; border-radius:16px; padding:14px;}
  .modal-head{flex-direction:column; align-items:stretch;}
  .modal-close-btn{width:100%;}
  .quiz-result-grid{grid-template-columns:1fr;}
  .choice-btn{padding:12px;}
}


/* v20260405 vocab quiz modal compact two-column refinement */
.vocab-quiz-modal-panel{
  width:min(1080px, 96vw);
  height:min(82vh, 760px);
  max-height:min(82vh, 760px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.vocab-quiz-modal-panel .modal-head{
  flex:0 0 auto;
  align-items:center;
  margin-bottom:10px;
}
.vocab-quiz-modal-panel .modal-head h3,
.vocab-quiz-modal-panel .modal-head .modal-subcopy{
  display:none;
}
.vocab-quiz-modal-panel .modal-eyebrow{
  margin-bottom:0;
  font-size:13px;
}
.vocab-quiz-modal-card{
  flex:1 1 auto;
  min-height:0;
  height:100%;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.vocab-quiz-fixed-shell{
  height:100%;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.vocab-quiz-topline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.vocab-quiz-body-grid{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(360px, 44%);
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
}
.vocab-quiz-left-pane,
.vocab-quiz-right-pane{
  min-height:0;
  overflow:auto;
}
.vocab-quiz-left-pane{
  display:grid;
  grid-template-rows:auto auto 1fr;
  border-right:1px solid var(--line);
}
.vocab-quiz-right-pane{
  padding:22px;
}
.vocab-quiz-word-box,
.vocab-quiz-example-box,
.vocab-quiz-feedback-panel{
  padding:22px;
}
.vocab-quiz-example-box{
  border-top:1px solid var(--line);
}
.vocab-quiz-feedback-panel{
  border-top:1px solid var(--line);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:14px;
}
.vocab-quiz-feedback-title{
  font-size:13px;
  font-weight:800;
  color:#2b65c7;
}
.vocab-quiz-reading{
  font-size:22px;
  font-weight:800;
  color:#385275;
  margin-top:6px;
}
.vocab-quiz-example-jp{
  font-size:18px;
  line-height:1.75;
  color:#1d3557;
}
.vocab-quiz-example-kr{
  margin-top:10px;
  font-size:14px;
}
.vocab-quiz-choice-list{
  margin-top:14px;
}
.vocab-quiz-feedback-card{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px 16px;
  background:#f8fbff;
}
.vocab-quiz-feedback-card.is-correct{
  border-color:#86d4a3;
  background:#edf9f1;
}
.vocab-quiz-feedback-card.is-wrong{
  border-color:#f0a9a9;
  background:#fff3f3;
}
.vocab-quiz-answer-line{
  margin-top:10px;
  font-size:15px;
  color:#23364d;
}
#vocabQuizFeedback.is-empty{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  color:#6c7f95;
  background:#fbfdff;
}
.vocab-quiz-next-left{
  align-self:flex-start;
}
@media (max-width: 900px){
  .vocab-quiz-modal-panel{
    width:min(96vw, 96vw);
    height:min(92vh, 920px);
    max-height:min(92vh, 920px);
  }
  .vocab-quiz-body-grid{
    grid-template-columns:1fr;
  }
  .vocab-quiz-left-pane{
    border-right:none;
    border-bottom:1px solid var(--line);
    grid-template-rows:auto auto auto;
  }
}

.vocab-quiz-feedback-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vocab-quiz-answer-inline {
  white-space: nowrap;
}


.header-actions { flex-wrap: wrap; gap: 10px; }
.header-actions input[type="file"] { display:none; }
@media (max-width: 1100px) {
  .header-actions { gap: 8px; }
}


.ocr-conversation{display:flex;flex-direction:column;gap:14px}
.ocr-conversation-line{display:grid;grid-template-columns:36px 1fr;gap:10px;align-items:start}
.ocr-conversation-speaker{font-weight:800;font-size:24px;line-height:1.2;color:var(--text)}
.ocr-conversation-body{display:flex;flex-direction:column;gap:6px}
.ocr-conversation-jp{font-size:28px;line-height:1.55;font-weight:700;letter-spacing:-0.02em}
.ocr-conversation-kr{font-size:17px;line-height:1.6;color:var(--muted);padding-left:2px}
.ocr-choice-list{margin:12px 0 0 22px;padding:0}
.ocr-choice-list li{margin:10px 0;font-size:22px;line-height:1.55;font-weight:650}
.ocr-answer{margin-top:14px;font-size:18px;font-weight:800;color:var(--blue)}
@media (max-width: 900px){
  .ocr-conversation-speaker{font-size:20px}
  .ocr-conversation-jp{font-size:22px}
  .ocr-conversation-kr{font-size:15px}
  .ocr-choice-list li{font-size:18px}
}


/* study text view stabilization */
#studyView .ocr-panel{
  scrollbar-gutter: stable both-edges;
}
#studyView .ocr-study-grid{
  align-items:stretch;
}
#studyView .ocr-card,
#studyView .ocr-block{
  box-shadow:none;
}
#studyView .ocr-conversation{display:flex;flex-direction:column;gap:10px}
#studyView .ocr-conversation-line{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:10px;
  align-items:start;
  padding:12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fbfdff;
}
#studyView .ocr-conversation-speaker{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:999px;
  background:#e8f1ff;
  color:var(--blue);
  font-weight:900;
  font-size:15px;
  line-height:1;
}
#studyView .ocr-conversation-body{display:flex;flex-direction:column;gap:4px;min-width:0}
#studyView .ocr-conversation-jp{font-size:18px;line-height:1.68;font-weight:700;letter-spacing:0;word-break:keep-all}
#studyView .ocr-conversation-kr{font-size:16px;line-height:1.65;color:var(--muted);padding-left:0;word-break:keep-all}
#studyView .ocr-choice-list{
  margin:12px 0 0;
  padding:0;
  list-style:none;
  counter-reset:ocr-choice;
  display:flex;
  flex-direction:column;
  gap:8px;
}
#studyView .ocr-choice-list li{
  counter-increment:ocr-choice;
  display:grid;
  grid-template-columns:30px 1fr;
  gap:10px;
  align-items:start;
  margin:0;
  padding:10px 12px;
  border:1px solid #dfe9f4;
  border-radius:12px;
  background:#fbfdff;
  font-size:17px;
  line-height:1.65;
  font-weight:600;
  word-break:keep-all;
}
#studyView .ocr-choice-list li::before{
  content:counter(ocr-choice);
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:999px;
  background:#eef4fa;
  color:var(--muted);
  font-size:13px;
  font-weight:900;
  line-height:1;
}
#studyView .ocr-answer{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  margin-top:12px;
  padding:8px 12px;
  border:1px solid #bcd6ff;
  border-radius:999px;
  background:#e8f1ff;
  font-size:16px;
  line-height:1.5;
  font-weight:900;
  color:var(--blue);
  word-break:keep-all;
}
@media (max-width: 900px){
  .quiz-split-layout{
    grid-template-columns:1fr;
  }
  .quiz-choice-pane{
    position:static;
  }
  #studyView .ocr-conversation-speaker{font-size:17px}
  #studyView .ocr-conversation-jp,
  #studyView .ocr-conversation-kr,
  #studyView .ocr-choice-list li,
  #studyView .ocr-answer{font-size:16px;line-height:1.68}
}


.summary-modal-panel{
  width:min(96vw, 1440px);
  height:min(90vh, 980px);
  max-height:min(90vh, 980px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.summary-modal-head{
  flex:0 0 auto;
  align-items:center;
  margin-bottom:12px;
}
.summary-modal-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.summary-filter-bar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:-2px 0 12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbff;
}
.summary-filter-label{font-weight:700;color:var(--text-strong);}
.summary-range-input{
  width:78px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font:inherit;
  font-weight:700;
  text-align:center;
}
.summary-select,
.summary-search-input{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font:inherit;
  font-weight:700;
}
.summary-search-input{
  min-width:220px;
  flex:1 1 240px;
}
.summary-check{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font-weight:700;
}
.summary-highlight{
  background:#fff2a8;
  border-radius:4px;
  padding:0 2px;
}
.summary-range-sep{font-weight:800;color:var(--text-dim);}
.summary-table-shell{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}
.summary-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-size:14px;
  background:#fff;
}
.summary-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f4f8fd;
}
.summary-table th,
.summary-table td{
  border:1px solid #d8e1eb;
  padding:8px 10px;
  vertical-align:top;
  line-height:1.55;
  word-break:keep-all;
}
.summary-table th:nth-child(1),
.summary-table td:nth-child(1){
  text-align:center;
  white-space:nowrap;
  font-weight:800;
}
.summary-table td:nth-child(2){font-weight:700;}
.summary-table td:nth-child(5){line-height:1.7;}
.summary-click-row{
  cursor:pointer;
}
.summary-click-row:hover td{
  background:#f4f8ff;
}
.summary-jump-hint{
  display:inline-flex;
  margin-left:8px;
  padding:3px 7px;
  border-radius:999px;
  background:#eaf3ff;
  color:var(--blue);
  font-size:11px;
  font-weight:800;
  vertical-align:middle;
  opacity:.75;
}
.summary-click-row:hover .summary-jump-hint{
  opacity:1;
}
.summary-example-line + .summary-example-line{margin-top:6px;padding-top:6px;border-top:1px dashed #d8e1eb;}
@media (max-width: 900px){
  .summary-modal-panel{width:min(98vw, 98vw);height:min(94vh, 94vh);max-height:min(94vh, 94vh);padding:14px;}
  .summary-modal-head{align-items:flex-start;}
  .summary-modal-actions{width:100%;}
  .summary-modal-actions .primary-btn,
  .summary-modal-actions .ghost-btn{flex:1 1 auto;}
  .summary-filter-bar{padding:10px;}
  .summary-filter-label{width:100%;}
  .summary-range-input{flex:1 1 96px;width:auto;}
  .summary-table{font-size:13px;}
  .summary-table th,
  .summary-table td{padding:7px 8px;}
}

@media print{
  html, body{
    background:#fff !important;
    overflow:visible !important;
    height:auto !important;
  }
  body > *{
    display:none !important;
  }
  #summaryTableModal{
    display:block !important;
    position:static !important;
    inset:auto !important;
    width:100% !important;
    min-height:0 !important;
    height:auto !important;
    padding:0 !important;
    background:#fff !important;
  }
  #summaryTableModal .summary-modal-panel{
    display:block !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:visible !important;
    box-shadow:none !important;
    border:none !important;
    border-radius:0 !important;
    padding:0 !important;
  }
  #summaryTableModal .summary-modal-head{
    display:block !important;
    margin:0 0 12px !important;
  }
  #summaryTableModal .summary-modal-head > div:first-child,
  #summaryTableModal #summaryTableModalTitle,
  #summaryTableModal #summaryRangeLabel{
    display:block !important;
  }
  #summaryTableModal .summary-filter-bar,
  #summaryTableModal .summary-modal-actions,
  #summaryTableModal .no-print{
    display:none !important;
  }
  #summaryTableModal .summary-table-shell{
    display:block !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:visible !important;
    border:none !important;
    border-radius:0 !important;
  }
  #summaryTableModal .summary-table{
    display:table !important;
    width:100% !important;
    font-size:12px;
    table-layout:fixed;
    border-collapse:collapse;
    page-break-inside:auto;
    break-inside:auto;
  }
  #summaryTableModal .summary-table colgroup{display:table-column-group !important;}
  #summaryTableModal .summary-table col{display:table-column !important;}
  #summaryTableModal .summary-table thead{
    display:table-header-group !important;
  }
  #summaryTableModal .summary-table tbody{
    display:table-row-group !important;
  }
  #summaryTableModal .summary-table tr{
    display:table-row !important;
    page-break-inside:avoid;
    break-inside:avoid;
    page-break-after:auto;
  }
  #summaryTableModal .summary-table th,
  #summaryTableModal .summary-table td{
    display:table-cell !important;
    white-space:normal !important;
    overflow:visible !important;
    word-break:break-word;
  }
  #summaryTableModal .summary-table thead th{
    position:static !important;
    background:#fff !important;
  }
}


.summary-group-row td{background:#eef4ff !important;font-weight:800;color:#22427c;border-top:2px solid #b8cae8;}
.summary-group-count{font-weight:700;color:#5a6f94;}
@media print{
  .summary-group-row td{background:#f3f6fb !important;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
}


/* v9 width + grouping fix */
.summary-table{
  table-layout: fixed !important;
}
.summary-table colgroup{
  display: table-column-group;
}
.summary-table col{
  display: table-column;
}
.summary-table th,
.summary-table td{
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.summary-table td:nth-child(3),
.summary-table th:nth-child(3){
  width: 270px;
}
.summary-table td:nth-child(4),
.summary-table th:nth-child(4){
  width: 180px;
}
.summary-table td:nth-child(5),
.summary-table th:nth-child(5){
  width: auto;
}
.summary-table td:nth-child(5){
  line-height: 1.7;
  word-break: break-all !important;
}
.summary-group-row td{
  text-align: left !important;
  padding-left: 12px !important;
  background:#eef4ff !important;
  font-weight:800;
  color:#22427c;
}

@media (max-width:1100px){
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .stats-card-wide{grid-column:span 2;}
}
@media (max-width:720px){
  .stats-grid{grid-template-columns:1fr;}
  .stats-card-wide{grid-column:span 1;}
  .stats-hero-row{grid-template-columns:1fr;}
  .stats-week-row{grid-template-columns:1fr 1fr;}
  .stats-weak-item{display:grid;}
  .today-task-head{align-items:flex-start;flex-direction:column;}
  .today-task-metrics{margin-left:0;}
  .today-plan-list{grid-template-columns:1fr;}
  .today-task-grid{grid-template-columns:1fr;}
  .today-task-next-list{grid-template-columns:1fr;}
  .auto-inline-controls{right:auto;left:0;grid-template-columns:1fr;}
  .learning-settings-panel{right:auto;left:0;grid-template-columns:1fr;width:min(92vw, 360px);}
  .header-actions > .ghost-btn,
  .header-actions > .primary-btn,
  .header-actions > .auto-inline,
  .header-actions > .learning-settings{flex:1 1 140px;}
  .header-actions .ghost-btn,
  .header-actions .primary-btn,
  .learning-settings summary{width:100%;}
}

/* Mobile study layout: keep the navigator short so the lesson screen starts quickly. */
@media (max-width:720px){
  html,
  body{
    height:100%;
    overflow:hidden;
  }

  body{
    background:#edf4fb;
  }

  .shell{
    height:100dvh;
    min-height:100dvh;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0,1fr);
    overflow:hidden;
  }

  .sidebar{
    height:auto;
    max-height:48dvh;
    min-height:0;
    overflow:hidden;
    padding:12px;
    border-right:none;
    border-bottom:1px solid var(--line);
    box-shadow:0 8px 22px rgba(28,55,84,.08);
  }

  .brand{
    margin-bottom:8px;
  }

  .kicker{
    font-size:10px;
    letter-spacing:.05em;
  }

  .brand h1{
    margin-top:4px;
    font-size:20px;
    line-height:1.12;
  }

  .quick-actions{
    gap:7px;
    margin-bottom:8px;
  }

  .quick-action-btn{
    min-height:42px;
    padding:8px 10px;
    border-radius:13px;
    font-size:14px;
  }

  .level-filter{
    gap:7px;
    margin-bottom:8px;
  }

  .level-filter-btn{
    min-height:38px;
    padding:8px 10px;
    border-radius:12px;
  }

  .search input{
    height:42px;
    padding:9px 12px;
    border-radius:12px;
    font-size:14px;
  }

  .progress-card{
    display:none;
  }

  .mode-tabs-6{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    margin:8px 0;
  }

  .mode-tab{
    min-height:36px;
    padding:8px 6px;
    border-radius:12px;
    font-size:13px;
  }

  .lesson-list{
    flex:1 1 auto;
    min-height:0;
    max-height:190px;
    overflow-y:auto;
    gap:7px;
    margin-top:8px;
    padding-right:2px;
  }

  .mobile-lesson-drawer{
    display:block;
    min-height:0;
  }

  .mobile-lesson-drawer > summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:38px;
    padding:9px 12px;
    margin-top:8px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    color:var(--blue-dark);
    font-size:13px;
    font-weight:900;
    cursor:pointer;
    list-style:none;
  }

  .mobile-lesson-drawer > summary::-webkit-details-marker{
    display:none;
  }

  .mobile-lesson-drawer > summary::after{
    content:"접기";
    color:var(--muted);
    font-size:12px;
    font-weight:800;
  }

  body.mobile-lessons-collapsed .mobile-lesson-drawer > summary::after{
    content:"열기";
  }

body.mobile-lessons-collapsed .mobile-lesson-drawer .lesson-list{
    display:none;
  }

  .lesson-item{
    min-height:54px;
    padding:8px 42px 8px 12px;
    border-radius:14px;
  }

  .lesson-row{
    align-items:center;
  }

  .lesson-code{
    margin-bottom:2px;
    font-size:12px;
  }

  .lesson-name{
    max-width:none;
    font-size:14px;
    line-height:1.25;
  }

  .badge{
    padding:4px 7px;
    font-size:11px;
  }

  .lesson-star{
    right:9px;
  }

  .main{
    height:auto;
    min-height:0;
    overflow-y:auto;
    padding:10px;
  }

  #studyView.active{
    display:block;
  }

  .header{
    display:block;
    align-items:flex-start;
    gap:10px;
    margin-bottom:10px;
  }

  .header h2{
    font-size:24px;
  }

  .lesson-title-wrap{
    justify-content:space-between;
    gap:8px;
    margin-bottom:8px;
  }

  .header-done{
    min-height:34px;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
  }

  .header-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    align-items:stretch;
  }

  .header-actions > .ghost-btn,
  .header-actions > .primary-btn,
  .header-actions > .auto-inline,
  .header-actions > .learning-settings{
    flex:0 0 auto;
  }

  .ghost-btn,
  .primary-btn{
    min-height:40px;
    padding:9px 12px;
    border-radius:11px;
    font-size:13px;
  }

  .header-actions .ghost-btn,
  .header-actions .primary-btn,
  .learning-settings summary{
    width:auto;
  }

  .learning-settings summary,
  .auto-inline-settings summary{
    min-height:40px;
    padding:9px 10px;
    text-align:center;
  }

  .auto-inline{
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(84px,.55fr) minmax(82px,.55fr);
    gap:7px;
    align-items:stretch;
  }

  .auto-inline .primary-btn,
  .auto-inline .ghost-btn{
    width:100%;
  }

  .auto-inline-settings{
    min-width:0;
  }

  .auto-inline-settings summary{
    writing-mode:horizontal-tb;
    white-space:normal;
    line-height:1.2;
  }

  .today-task-panel{
    margin-bottom:10px;
  }

  .content-grid{
    gap:10px;
  }

  #studyView .content-grid > .card,
  #studyView .content-grid > .card:last-child,
  #studyView .page-wrap{
    height:auto;
    min-height:0;
    overflow:visible;
  }

  .card{
    border-radius:14px;
    padding:12px;
  }

  .card-head{
    gap:8px;
    margin-bottom:10px;
  }

  .card-head h3{
    font-size:17px;
  }

  .page-tools{
    gap:6px;
  }

  .tool-btn{
    min-width:40px;
    padding:7px 9px;
  }

  .page-wrap{
    max-height:58vh;
    overflow:auto !important;
    border-radius:12px;
  }
}

/* Driving listen mode */
.drive-mode-open{
  overflow:hidden;
}
.drive-mode-overlay{
  position:fixed;
  inset:0;
  z-index:1400;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(9, 20, 36, .72);
}
.drive-mode-overlay.is-open{
  display:flex;
}
.drive-mode-panel{
  width:min(720px, 100%);
  max-height:94vh;
  overflow:auto;
  border:1px solid rgba(181, 204, 231, .95);
  border-radius:24px;
  background:linear-gradient(180deg,#f8fbff 0%,#edf5ff 100%);
  box-shadow:0 24px 70px rgba(0,0,0,.32);
  padding:22px;
}
.drive-mode-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}
.drive-mode-kicker{
  color:var(--blue-dark);
  font-size:13px;
  font-weight:900;
}
.drive-mode-top h2{
  margin:4px 0 0;
  font-size:36px;
  line-height:1.1;
}
.drive-close-btn{
  min-width:86px;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}
.drive-mode-options{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.drive-scope-btn{
  min-height:48px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}
.drive-scope-btn.is-active{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff;
}
.drive-jump-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) 92px;
  gap:10px;
  align-items:center;
  margin-bottom:14px;
  padding:10px;
  border:1px solid #bfd3ea;
  border-radius:16px;
  background:#fff;
}
.drive-jump-row label{
  color:var(--muted);
  font-size:15px;
  font-weight:900;
  white-space:nowrap;
}
.drive-jump-row input{
  width:100%;
  min-height:46px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px 12px;
  color:var(--text);
  font:inherit;
  font-size:20px;
  font-weight:900;
}
.drive-jump-btn{
  min-height:46px;
  border:1px solid var(--blue);
  border-radius:12px;
  background:#eef5ff;
  color:var(--blue-dark);
  font-size:16px;
  font-weight:950;
  cursor:pointer;
}
.drive-content-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
.drive-play-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
.drive-content-options label{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  border:1px solid #bfd3ea;
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-size:15px;
  font-weight:900;
}
.drive-play-options label{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:8px;
  align-items:center;
  min-height:44px;
  border:1px solid #bfd3ea;
  border-radius:14px;
  background:#fff;
  color:var(--text);
  padding:8px 10px;
  font-size:15px;
  font-weight:900;
}
.drive-content-options input{
  width:18px;
  height:18px;
  accent-color:var(--blue);
}
.drive-play-options select{
  width:100%;
  min-height:32px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fbff;
  color:var(--text);
  font:inherit;
  font-size:14px;
  font-weight:900;
}
.drive-status-card{
  border:1px solid #bfd3ea;
  border-radius:22px;
  background:#fff;
  padding:20px;
  margin-bottom:16px;
}
.drive-status{
  color:var(--blue-dark);
  font-size:14px;
  font-weight:900;
  margin-bottom:12px;
}
.drive-lesson-title{
  font-size:42px;
  line-height:1.12;
  font-weight:950;
  word-break:keep-all;
}
.drive-lesson-meaning{
  margin-top:10px;
  font-size:26px;
  line-height:1.35;
  font-weight:900;
}
.drive-lesson-pattern{
  margin-top:12px;
  padding:12px 14px;
  border-radius:16px;
  background:#eef6ff;
  color:#254869;
  font-size:18px;
  line-height:1.45;
  font-weight:800;
}
.drive-lesson-example{
  margin-top:12px;
  color:#344a62;
  font-size:18px;
  line-height:1.6;
  max-width:100%;
  min-width:0;
  overflow:hidden;
}
.drive-now-label{
  display:inline-flex;
  align-items:center;
  margin-bottom:8px;
  padding:5px 10px;
  border-radius:999px;
  background:#e7f0ff;
  color:var(--blue-dark);
  font-size:14px;
  font-weight:950;
}
.drive-now-jp{
  color:var(--text);
  font-size:22px;
  line-height:1.55;
  font-weight:900;
  max-width:100%;
  white-space:normal;
  word-break:normal;
  overflow-wrap:anywhere;
}
.drive-now-kr{
  margin-top:6px;
  color:#53687e;
  font-size:20px;
  line-height:1.55;
  font-weight:800;
  max-width:100%;
  white-space:normal;
  word-break:keep-all;
  overflow-wrap:anywhere;
}
.drive-progress{
  margin-top:14px;
  display:inline-flex;
  padding:7px 12px;
  border-radius:999px;
  background:#e6f0ff;
  color:var(--blue-dark);
  font-size:14px;
  font-weight:900;
}
.drive-controls{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.drive-controls-secondary{
  margin-top:12px;
}
.drive-voice-test-btn{
  width:100%;
  min-height:48px;
  margin-top:12px;
  border:1px solid #8db9f5;
  border-radius:14px;
  background:#eef5ff;
  color:var(--blue-dark);
  font-size:16px;
  font-weight:950;
  cursor:pointer;
}
.drive-main-btn,
.drive-sub-btn{
  min-height:74px;
  border-radius:18px;
  border:1px solid var(--line);
  font-size:24px;
  font-weight:950;
  cursor:pointer;
}
.drive-main-btn{
  background:var(--blue);
  color:#fff;
  border-color:var(--blue);
}
.drive-main-btn:disabled{
  opacity:.55;
  cursor:default;
}
.drive-sub-btn{
  background:#fff;
  color:var(--text);
}
.drive-sub-btn:disabled{
  color:#9aabba;
  background:#eef3f8;
  cursor:default;
}
.drive-note{
  margin-top:14px;
  color:var(--muted);
  font-size:14px;
  font-weight:800;
  text-align:center;
}

@media (max-width:720px){
  .drive-mode-overlay{
    align-items:stretch;
    padding:8px;
  }
  .drive-mode-panel{
    max-height:none;
    height:100%;
    border-radius:20px;
    padding:16px;
  }
  .drive-mode-top h2{
    font-size:30px;
  }
  .drive-mode-options{
    gap:8px;
  }
  .drive-scope-btn{
    min-height:44px;
    font-size:14px;
  }
  .drive-jump-row{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .drive-jump-row label{
    grid-column:1 / -1;
  }
  .drive-jump-row input,
  .drive-jump-btn{
    min-height:44px;
  }
  .drive-content-options{
    gap:8px;
  }
  .drive-play-options{
    gap:8px;
  }
  .drive-content-options label{
    min-height:42px;
    font-size:14px;
  }
  .drive-play-options label{
    min-height:42px;
    font-size:14px;
  }
  .drive-status-card{
    padding:16px;
    border-radius:18px;
  }
  .drive-lesson-title{
    font-size:34px;
  }
  .drive-lesson-meaning{
    font-size:22px;
  }
  .drive-lesson-pattern,
  .drive-lesson-example{
    font-size:16px;
  }
  .drive-now-jp{
    font-size:20px;
  }
  .drive-now-kr{
    font-size:18px;
  }
  .drive-main-btn,
  .drive-sub-btn{
    min-height:68px;
    font-size:22px;
  }
}
