:root{
  --bg:#f4f6fb; --panel:#ffffff; --ink:#151a27; --muted:#667085; --line:#e5e9f2;
  --accent:#5b5bd6; --accent2:#7c3aed; --soft:#eef0ff; --ok:#178a57; --bad:#cc3d56;
  --warn:#b7791f; --code:#101523; --codeInk:#e8ecf6; --shadow:0 12px 34px rgba(31,38,66,.08);
}
*{box-sizing:border-box} html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,Pretendard,"Noto Sans KR",system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--ink)}
button,input,select,textarea{font:inherit}
code,pre,textarea.code-editor{font-family:"Cascadia Code","SFMono-Regular",Consolas,monospace}
.app-shell{min-height:100vh;display:grid;grid-template-columns:280px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;background:#101423;color:#e9ecf5;padding:22px 18px;display:flex;flex-direction:column;z-index:20}
.brand{display:flex;gap:12px;align-items:center;padding:4px 5px 22px}
.brand-mark{width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,#7c3aed,#4f46e5);display:grid;place-items:center;font-weight:800}
.brand strong{display:block;font-size:16px}.brand span{display:block;color:#9aa4bd;font-size:12px;margin-top:2px}
.sidebar-actions{padding:14px 0 18px;border-top:1px solid #242a3e;border-bottom:1px solid #242a3e}
.import-button{display:flex;align-items:center;justify-content:center;background:#272d46;border:1px solid #343b57;border-radius:10px;padding:10px 12px;cursor:pointer;font-weight:700;color:#f2f4ff}
.import-button:hover{background:#313854}
.sidebar-actions p{font-size:11px;line-height:1.6;color:#8f99b1;margin:8px 2px 0}
.sidebar-actions code{color:#c3c9ff}
.lesson-label{text-transform:uppercase;letter-spacing:.12em;font-size:10px;color:#75809a;margin:20px 8px 8px}
.lesson-list{display:flex;flex-direction:column;gap:6px;overflow:auto}
.lesson-item{display:block;width:100%;border:0;background:transparent;color:#b7bfd3;text-align:left;border-radius:10px;padding:11px 12px;cursor:pointer}
.lesson-item:hover{background:#1a2032;color:#fff}.lesson-item.active{background:#252c47;color:#fff}
.lesson-item .lid{display:inline-flex;min-width:44px;color:#9ea7ff;font-weight:800;font-size:12px}
.lesson-item .ltitle{font-size:13px;line-height:1.4}.lesson-item small{display:block;color:#7f89a0;font-size:10px;margin:5px 0 0 46px}
.sidebar-footer{margin-top:auto;padding:16px 8px 2px;border-top:1px solid #242a3e;color:#8e98b1;font-size:11px}
.main{min-width:0;padding:0 36px 60px}
.topbar{height:86px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);position:sticky;top:0;background:rgba(244,246,251,.92);backdrop-filter:blur(12px);z-index:10}
.lesson-head{min-width:0}.lesson-head h1{font-size:19px;margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kicker{font-size:11px;color:var(--accent);font-weight:800;letter-spacing:.08em}
.ghost-button,.icon-button{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:9px;padding:9px 12px;cursor:pointer}.ghost-button:hover{border-color:#c8cee0}.icon-button{padding:8px 10px}
.mobile-only{display:none}
.hero{margin:28px 0 20px;background:linear-gradient(135deg,#1a2140 0%,#313b73 58%,#51328c 100%);color:#fff;border-radius:22px;padding:28px 30px;display:grid;grid-template-columns:1fr 360px;gap:28px;align-items:center;box-shadow:var(--shadow)}
.hero h2{font-size:26px;margin:10px 0 8px}.hero p{margin:0;color:#cfd5e8;line-height:1.7;font-size:14px}.hero-badges{display:flex;gap:8px}
.monthly-exam-guide{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 20px;padding:15px 18px;border:1px solid #dcdff0;border-radius:15px;background:#fff;box-shadow:0 4px 16px rgba(30,36,60,.035)}.monthly-exam-guide[hidden]{display:none}.monthly-exam-guide strong,.monthly-exam-guide span{display:block}.monthly-exam-guide strong{font-size:14px}.monthly-exam-guide span{margin-top:4px;color:var(--muted);font-size:11px}.monthly-route{display:flex;flex-wrap:wrap;gap:7px}.monthly-route a{border:1px solid #d9ddef;border-radius:9px;padding:8px 10px;background:#f7f8fc;color:#505a73;font-size:11px;font-weight:800}.monthly-route a:hover,.monthly-route a.active{border-color:#8279e8;background:#efedff;color:#5146c6}.monthly-route a.reference-link{background:#202840;color:#fff;border-color:#202840}
.badge{font-size:11px;font-weight:800;border-radius:999px;padding:5px 9px;background:#fff;color:#272c4d}.badge.subtle{background:rgba(255,255,255,.12);color:#dde3ff;border:1px solid rgba(255,255,255,.14)}
.progress-card{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.13);border-radius:16px;padding:17px 18px}.progress-meta{display:flex;justify-content:space-between;font-size:12px}.progress-meta strong{font-size:14px}
.progress-track{height:8px;background:rgba(255,255,255,.12);border-radius:99px;overflow:hidden;margin:12px 0 9px}.progress-bar{height:100%;width:0;background:linear-gradient(90deg,#a5b4fc,#d8b4fe);transition:.25s}.progress-card small{color:#c4cbe0;font-size:11px}
.tabs{display:flex;gap:8px;border-bottom:1px solid var(--line);margin-bottom:20px}.tab{border:0;background:transparent;padding:13px 16px 12px;color:var(--muted);font-weight:700;cursor:pointer;border-bottom:2px solid transparent}.tab.active{color:var(--accent);border-bottom-color:var(--accent)}.tab span{font-size:10px;background:#e8eaf2;padding:2px 6px;border-radius:999px;margin-left:3px}
.pane{display:none}.pane.active{display:block}.pane-toolbar{display:flex;align-items:end;justify-content:space-between;gap:16px;margin:18px 0}.pane-toolbar h3{margin:0;font-size:17px}.pane-toolbar p{margin:5px 0 0;color:var(--muted);font-size:12px}.search,.select{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 11px;min-width:190px;color:var(--ink)}
.notes-root{display:flex;flex-direction:column;gap:14px}.study-cell{background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 4px 16px rgba(30,36,60,.035)}
.study-cell.markdown{padding:20px 22px}.cell-meta{display:flex;justify-content:space-between;align-items:center;color:#98a1b2;font-size:10px;margin-bottom:10px}.section-chip{background:#f1f3f8;color:#667085;border-radius:999px;padding:4px 8px}
.md h1,.md h2,.md h3{line-height:1.35}.md h1{font-size:23px}.md h2{font-size:20px}.md h3{font-size:17px}.md p,.md li{font-size:13px;line-height:1.8;color:#394150}.md ul,.md ol{padding-left:22px}.md code{background:#f1f3f8;color:#7c3aed;padding:2px 5px;border-radius:5px}.md .callout{background:#fff7ed;border-left:4px solid #f59e0b;padding:11px 13px;border-radius:7px;color:#7c2d12}
.study-cell.code .cell-meta{padding:12px 16px;margin:0;background:#171d2c;color:#8f99ad}.problem-link{border:0;background:#313a5b;color:#cdd4ff;border-radius:7px;padding:5px 8px;cursor:pointer;margin-left:5px;font-size:10px}
.code-wrap{background:var(--code);overflow:auto}.code-lines{margin:0;padding:16px 0;color:var(--codeInk);font-size:12px;line-height:1.65;counter-reset:line}.code-line{display:block;padding:0 18px 0 56px;position:relative;white-space:pre}.code-line::before{counter-increment:line;content:counter(line);position:absolute;left:0;width:38px;text-align:right;color:#566079;border-right:1px solid #222b3f;padding-right:10px}.code-line.problem-line{background:rgba(124,58,237,.11)}
.kw{color:#c4b5fd}.str{color:#86efac}.com{color:#7d879c}.num{color:#fbbf24}.fn{color:#93c5fd}
.problems-root{display:flex;flex-direction:column;gap:16px}.problem-card{background:#fff;border:1px solid var(--line);border-radius:17px;overflow:hidden;box-shadow:0 5px 18px rgba(30,36,60,.04)}.problem-card.correct{border-color:#b7e4cd}.problem-card.wrong{border-color:#f1c1ca}
.monthly-practice-layout.has-reference{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,38%);gap:18px;align-items:start}.monthly-reference-panel{position:sticky;top:96px;max-height:calc(100vh - 118px);overflow:auto;border:1px solid #d8ddee;border-radius:17px;background:#fff;box-shadow:0 8px 26px rgba(30,36,60,.07)}.monthly-reference-panel[hidden]{display:none}.reference-panel-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 15px;border-bottom:1px solid #e4e7ef;background:rgba(255,255,255,.96);backdrop-filter:blur(8px)}.reference-panel-head span,.reference-panel-head strong{display:block}.reference-panel-head span{color:#6a63d9;font-size:8px;font-weight:900;letter-spacing:.12em}.reference-panel-head strong{margin-top:3px;font-size:13px}.reference-panel-head button{border:1px solid #d8ddec;border-radius:8px;background:#f7f8fc;padding:6px 8px;color:#596174;font-size:9px;font-weight:850;cursor:pointer}.monthly-reference-body{padding:13px}.reference-current{padding:10px 11px;margin-bottom:11px;border-radius:10px;background:#f0efff}.reference-current small,.reference-current strong{display:block}.reference-current small{color:#746de0;font-size:8px;font-weight:900}.reference-current strong{margin-top:3px;font-size:11px;line-height:1.45}.reference-note{padding:11px;margin:9px 0;border:1px solid #e5e8f0;border-radius:10px;color:#444c60;font-size:10px;line-height:1.65}.reference-note h1,.reference-note h2,.reference-note h3{margin:3px 0 7px;font-size:12px}.reference-code{margin:9px 0;border-radius:11px;overflow:hidden;background:#141a29}.reference-code>span{display:block;padding:8px 10px;border-bottom:1px solid #283047;color:#909bb4;font-size:8px;font-weight:900;letter-spacing:.08em}.reference-code pre{max-height:330px;margin:0;padding:11px;overflow:auto;color:#e7ecf7;font:10px/1.6 "Cascadia Code",Consolas,monospace;white-space:pre}.reference-empty{padding:14px;border:1px dashed #cfd5e5;border-radius:11px;background:#fafbfe;color:#667085;font-size:10px;line-height:1.6}.reference-empty strong{color:#343b50}.reference-empty p{margin:6px 0 0}.reference-full-link{display:block;margin-top:11px;padding:10px;border-radius:9px;background:#252d46;color:#fff;text-align:center;font-size:10px;font-weight:850}.monthly-reference-panel.collapsed{max-height:none}.monthly-reference-panel.collapsed .monthly-reference-body{display:none}
.problem-head{padding:17px 20px;display:flex;gap:14px;justify-content:space-between;border-bottom:1px solid var(--line)}.problem-no{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:12px;background:var(--soft);color:var(--accent);font-weight:900;flex:none}.problem-title{flex:1}.problem-title h4{margin:1px 0 5px;font-size:15px}.problem-title p{margin:0;color:var(--muted);font-size:12px;line-height:1.6;white-space:pre-line}.status-pill{font-size:10px;border-radius:999px;padding:5px 8px;height:max-content;background:#f1f3f8;color:#7a8497}.status-pill.correct{background:#e9f8f1;color:var(--ok)}.status-pill.wrong{background:#fff0f2;color:var(--bad)}
.editor-caption{padding:13px 18px 8px;font-size:11px;color:#7f8899;font-weight:700}.code-editor{display:block;width:calc(100% - 36px);min-height:160px;margin:0 18px 14px;border:1px solid #232c42;background:#111725;color:#eef2ff;border-radius:12px;padding:14px 15px;line-height:1.6;resize:vertical;font-size:12px;tab-size:4;outline:none}.code-editor:focus{border-color:#6d75e6;box-shadow:0 0 0 3px rgba(91,91,214,.12)}
.problem-actions{display:flex;flex-wrap:wrap;gap:8px;padding:0 18px 16px}.action{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px 11px;cursor:pointer;font-size:11px;font-weight:700}.action.primary{background:var(--accent);border-color:var(--accent);color:#fff}.action:hover{filter:brightness(.98)}
.feedback{margin:0 18px 16px;border-radius:11px;padding:11px 13px;font-size:12px;line-height:1.65;display:none}.feedback.show{display:block;white-space:pre-line}.feedback.ok{background:#eaf8f2;color:#146b46}.feedback.bad{background:#fff0f2;color:#9b2d42}.feedback.info{background:#f3f1ff;color:#5b3da7}
.answer-box{display:none;margin:0 18px 18px;background:#f7f8fb;border:1px solid var(--line);border-radius:12px;overflow:hidden}.answer-box.show{display:block}.answer-box h5{margin:0;padding:10px 13px;background:#eef0f6;font-size:11px}.answer-box pre{margin:0;padding:13px;overflow:auto;font-size:12px;line-height:1.6}.answer-box p{margin:0;padding:0 13px 13px;color:#566074;font-size:11px;line-height:1.6}
.official-output{margin:0 22px 20px;border:1px solid #b9dfca;background:#f6fcf8;border-radius:13px;overflow:hidden}.official-output-head{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;padding:11px 14px;background:#e7f7ee;border-bottom:1px solid #cbe8d7}.official-output-head span{font-size:9px;font-weight:900;letter-spacing:.12em;color:#268251}.official-output-head strong{font-size:12px;color:#245d3d}.official-output-head small{margin-left:auto;color:#63806f;font-size:10px}.official-output-body{padding:12px 14px}.official-output-body pre{margin:0 0 9px;padding:12px 13px;overflow:auto;border:1px solid #d9e7df;background:#fff;border-radius:9px;font-size:12px;line-height:1.6;white-space:pre}.official-output-body pre:last-child{margin-bottom:0}.official-output-body .output-error{color:#a83249;background:#fff7f8}.official-output-body figure{margin:0 0 10px}.official-output-body figure:last-child{margin-bottom:0}.official-output-body img{display:block;max-width:100%;height:auto;border-radius:8px}.output-empty{margin:0;color:#63766a;font-size:12px}
.code-editor.inline-answer-visible{border-color:#7b83e8;background:#111827;color:#f3f5ff}
.validation-summary{padding:2px 1px;color:#40584a;font-size:12px;line-height:1.65}.validation-summary>strong{display:block;margin-bottom:7px;color:#2c6042}.validation-summary p{margin:3px 0}
.empty{padding:38px;text-align:center;background:#fff;border:1px dashed #d8dce8;border-radius:16px;color:#7c8598}.wrong-root{display:flex;flex-direction:column;gap:14px}.wrong-card{background:#fff;border:1px solid #f0c6ce;border-radius:15px;padding:18px}.wrong-card h4{margin:0 0 8px}.wrong-card p{font-size:12px;color:var(--muted);line-height:1.6}.wrong-card pre{background:#111725;color:#eaf0ff;padding:12px;border-radius:10px;overflow:auto;font-size:11px}.wrong-card .jump{border:0;background:#fff0f2;color:#a7354b;border-radius:8px;padding:7px 9px;cursor:pointer;font-weight:700;font-size:11px}
.toast{position:fixed;right:24px;bottom:24px;background:#111827;color:#fff;border-radius:10px;padding:11px 14px;font-size:12px;box-shadow:var(--shadow);opacity:0;transform:translateY(8px);pointer-events:none;transition:.2s;z-index:50}.toast.show{opacity:1;transform:none}
@media(max-width:900px){.app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:0;transform:translateX(-100%);transition:.2s;width:280px}.sidebar.open{transform:none}.main{padding:0 18px 40px}.mobile-only{display:inline-block}.hero{grid-template-columns:1fr}.topbar{height:76px}.hero{padding:22px}.progress-card{max-width:none}.top-actions{display:none}}
@media(max-width:620px){.hero h2{font-size:21px}.pane-toolbar{align-items:stretch;flex-direction:column}.search,.select{width:100%}.problem-head{align-items:flex-start}.status-pill{white-space:nowrap}.main{padding:0 12px 32px}.tabs{overflow:auto}.tab{white-space:nowrap}}
@media(max-width:720px){.monthly-exam-guide{align-items:flex-start;flex-direction:column}.monthly-route{width:100%}.monthly-route a{flex:1;text-align:center;min-width:120px}}
@media(max-width:1180px){.monthly-practice-layout.has-reference{grid-template-columns:1fr}.monthly-reference-panel{position:relative;top:0;grid-row:1;max-height:52vh}.monthly-reference-panel.collapsed{max-height:none}}
.lesson-row{display:flex;align-items:center;gap:6px;margin-bottom:4px}
.variant-pill{font-size:9px;font-weight:800;padding:2px 6px;border-radius:999px;background:#2a324d;color:#aeb7d3}
.variant-pill.practice{background:#193b35;color:#85e0c1}.variant-pill.assignment{background:#49331c;color:#f1c07a}
.variant-badge.practice{background:#dff7ee;color:#146b50}.variant-badge.assignment{background:#fff1db;color:#975b0c}
.status-pill.done{background:#edf1ff;color:#4b55b7}.problem-card.done{border-color:#cbd2ff}
.md-code{padding:14px;border-radius:10px;color:var(--codeInk);overflow:auto}
.empty.dark{background:#171d2c;border-color:#30384f;color:#9ba5bb}

.mode-links{display:grid;gap:4px;padding:11px 0;border-top:1px solid #242a3e;border-bottom:1px solid #242a3e}.mode-links a{font-size:11px;color:#919bb3;padding:8px 10px;border-radius:8px;text-decoration:none}.mode-links a:hover,.mode-links a.active{background:#242b42;color:#fff}.ghost-link{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:9px;padding:9px 12px;text-decoration:none;font-size:12px;font-weight:700}.ghost-link:hover{border-color:#c8cee0}
/* Confusion / review notebook */
.mode-links{display:flex;flex-direction:column;gap:4px;margin:0 0 14px}.mode-links a{font-size:11px;color:#9ba5bb;padding:8px 10px;border-radius:8px}.mode-links a:hover,.mode-links a.active{background:#1d2438;color:#fff}.top-actions{display:flex;align-items:center;gap:7px}.ghost-link{font-size:10px;font-weight:800;color:#5e677a;padding:8px 9px;border-radius:8px}.ghost-link:hover{background:#fff}.action.confuse.saved{background:#f1efff;border-color:#d8d1ff;color:#5c49c7}.review-page-link{font-size:10px;font-weight:800;color:#6554d8;padding:8px 10px;border:1px solid #ded9fa;border-radius:9px;background:#f5f3ff}


/* ===== Deployment QA hardening (2026-08-18) ===== */
html,body{max-width:100%;overflow-x:clip}
.main,.topbar,.lesson-head,.top-actions,.hero>div,.problem-title,.pane-toolbar>div{min-width:0}
.problem-title,.problem-title p,.feedback,.answer-box p,.wrong-card p{overflow-wrap:anywhere;word-break:break-word}
.code-wrap,.answer-box pre,.wrong-card pre{max-width:100%;-webkit-overflow-scrolling:touch}
.code-editor{max-width:100%;overflow:auto}
.sidebar{height:100dvh;max-height:100dvh}
body.mobile-nav-open{overflow:hidden;touch-action:none}
body.mobile-nav-open::after{content:"";position:fixed;inset:0;background:rgba(7,11,22,.48);z-index:19}
.sidebar{z-index:20}
@media(max-width:900px){
  /* This rule must stay after .top-actions{display:flex}; it fixes the mobile header regression. */
  .top-actions{display:none!important}
  .topbar{gap:10px;padding:0 2px}
  .lesson-head{flex:1;min-width:0}
  .lesson-head h1{max-width:100%;font-size:17px}
  .icon-button.mobile-only{display:inline-grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;font-size:19px;touch-action:manipulation}
  .sidebar{width:min(82vw,300px);padding-bottom:max(18px,env(safe-area-inset-bottom))}
  .lesson-item,.mode-links a,.import-button{min-height:44px}
  .hero{margin-top:18px}
}
@media(max-width:620px){
  .main{padding-left:12px;padding-right:12px;padding-bottom:max(34px,env(safe-area-inset-bottom))}
  .hero{border-radius:18px;padding:20px 18px}
  .hero-badges{flex-wrap:wrap}
  .hero h2{overflow-wrap:anywhere}
  .tabs{gap:0;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tab{min-height:44px;padding:12px 14px}
  .pane-toolbar{gap:10px}
  .search,.select{min-height:46px;font-size:16px}
  .problem-head{display:grid;grid-template-columns:40px minmax(0,1fr);gap:10px 12px;padding:16px 14px}
  .problem-no{grid-row:1/3;width:40px;height:40px}
  .problem-title{grid-column:2;min-width:0}
  .status-pill{grid-column:2;justify-self:start;white-space:normal;line-height:1.35}
  .editor-caption{padding:13px 12px 8px}
  .code-editor{width:calc(100% - 24px);margin:0 12px 14px;min-height:220px;padding:14px 13px;font-size:16px;line-height:1.55;border-radius:11px;-webkit-overflow-scrolling:touch}
  .problem-actions{padding:0 12px 15px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .problem-actions .action{min-width:0;min-height:44px;padding:10px 8px;white-space:normal;line-height:1.3;touch-action:manipulation}
  .feedback,.answer-box{margin-left:12px;margin-right:12px}
  .official-output{margin-left:12px;margin-right:12px}.official-output-head small{width:100%;margin-left:0}.official-output-body{padding:10px}.official-output-body pre{font-size:12px}
  .answer-box pre{font-size:12px;white-space:pre;overflow-x:auto}
  .wrong-card{padding:15px 13px}
  .wrong-card .jump{min-height:44px;padding:10px 12px}
  .toast{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));text-align:center}
}

/* Fixed, collapsible navigation for the practice workspace. */
.practice-sidebar-toggle{display:grid;place-items:center;position:absolute;top:23px;right:-14px;width:28px;height:28px;border:1px solid var(--line);border-radius:50%;background:#fff;color:#596174;box-shadow:0 5px 14px rgba(5,9,20,.22);cursor:pointer;font-weight:900;z-index:2}
@media(min-width:901px){
  .app-shell{display:block}
  .sidebar{position:fixed;inset:0 auto 0 0;width:280px;transition:width .2s ease,padding .2s ease}
  .main{margin-left:280px;transition:margin-left .2s ease}
  body.practice-sidebar-collapsed .sidebar{width:72px;padding-left:15px;padding-right:15px}
  body.practice-sidebar-collapsed .main{margin-left:72px}
  body.practice-sidebar-collapsed .brand{justify-content:center;padding-left:0;padding-right:0}
  body.practice-sidebar-collapsed .brand>div:last-child,
  body.practice-sidebar-collapsed .mode-links,
  body.practice-sidebar-collapsed .sidebar-actions,
  body.practice-sidebar-collapsed .lesson-label,
  body.practice-sidebar-collapsed .lesson-list,
  body.practice-sidebar-collapsed .sidebar-footer{display:none}
}
@media(max-width:900px){
  .practice-sidebar-toggle{display:none}
}
@media(max-width:380px){
  .problem-actions{grid-template-columns:1fr}
  .hero{padding-left:16px;padding-right:16px}
}


/* ===== Practice readability & context UX (2026-08-18 v2) ===== */
.problems-root{gap:24px}
.problem-card{border-radius:20px;box-shadow:0 10px 30px rgba(30,36,60,.055)}
.problem-head{padding:21px 24px 18px;align-items:flex-start;background:linear-gradient(180deg,#fff 0%,#fbfcff 100%)}
.problem-no{width:44px;height:44px;border-radius:13px;font-size:15px}
.problem-title h4{margin:1px 0 7px;font-size:19px;line-height:1.45;letter-spacing:-.015em;color:#151a27}
.problem-subtitle{display:block;color:#7b8495;font-size:12px;line-height:1.5}
.status-pill{font-size:11px;padding:6px 10px;font-weight:800}

.requirements-box{margin:20px 22px 16px;border:1px solid #dce2ef;border-radius:15px;background:#fbfcff;overflow:hidden}
.requirements-heading{display:flex;align-items:center;gap:11px;padding:13px 17px;border-bottom:1px solid #e5e9f2;background:#f2f5fb}
.requirements-heading span{font-size:10px;letter-spacing:.14em;color:#6670c7;font-weight:900}
.requirements-heading strong{font-size:14px;color:#242a3b}
.requirements-text{padding:16px 18px 17px;color:#283143;font-size:15px;line-height:1.78;letter-spacing:-.008em}
.req-paragraph{margin:0 0 9px;color:#30394b;font-size:15px;line-height:1.78}
.req-paragraph:last-child{margin-bottom:0}
.req-paragraph.lead{color:#20283a;font-weight:650}
.req-section-label{display:inline-flex;margin:4px 0 10px;padding:5px 9px;border-radius:7px;background:#e9edff;color:#494fb5;font-size:12px;font-weight:900}
.req-note{margin:10px 0 2px;padding:10px 12px;border-left:4px solid #7c6fe5;background:#f4f2ff;color:#473f82;border-radius:7px;font-size:14px;line-height:1.65}
.req-line{display:grid;grid-template-columns:26px minmax(0,1fr);gap:7px;align-items:start;margin:7px 0}
.req-line>span{display:grid;place-items:center;min-width:22px;height:22px;margin-top:2px;border-radius:7px;background:#eef1f8;color:#566074;font-size:11px;font-weight:900}
.req-line.numbered>span{background:#e9edff;color:#4e55bc}
.req-line p{margin:0;color:#30394b;font-size:15px;line-height:1.72}

.problem-context{margin:0 22px 18px;padding:16px 17px;border:1px solid #dce9e4;border-radius:15px;background:#f8fcfa}
.context-heading{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.context-heading>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.context-kicker{font-size:10px;letter-spacing:.1em;color:#16805a;font-weight:900}
.context-heading strong{font-size:15px;line-height:1.45;color:#17352b}
.source-badge{flex:none;padding:5px 8px;border-radius:999px;background:#e4f5ed;color:#13734f;font-size:10px;font-weight:850}
.context-guide{margin:10px 0;color:#455d54;font-size:13px;line-height:1.65}
.context-chips{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 2px}
.context-chip{padding:5px 8px;border:1px solid #d8e5df;border-radius:8px;background:#fff;color:#43584f;font:600 11px/1.2 "Cascadia Code","SFMono-Regular",Consolas,monospace}
.context-chip.matched{border-color:#a7d9c7;background:#eaf8f2;color:#126b4a}
.context-details{margin-top:12px;border-top:1px solid #dce9e4;padding-top:10px}
.context-details summary{cursor:pointer;color:#245846;font-size:12px;font-weight:850;list-style:none;min-height:36px;display:flex;align-items:center;gap:7px;user-select:none}
.context-details summary::-webkit-details-marker{display:none}
.context-details summary::before{content:"＋";display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#e3f2ec;color:#17684b;font-weight:900}
.context-details[open] summary::before{content:"−"}
.context-details summary span{color:#788a83;font-weight:600}
.context-details pre{margin:9px 0 7px;max-height:460px;overflow:auto;padding:15px 16px;border-radius:11px;background:#121b18;color:#e5f4ee;font-size:12px;line-height:1.62;white-space:pre;-webkit-overflow-scrolling:touch}
.context-details small{display:block;color:#70827b;font-size:10px;line-height:1.5}

.editor-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 22px 9px;padding-top:2px}
.editor-toolbar>div{display:flex;flex-direction:column;gap:3px}
.editor-kicker{font-size:9px;letter-spacing:.13em;font-weight:900;color:#6d75e6}
.editor-toolbar strong{font-size:13px;color:#333b4e}
.expand-editor{border:1px solid #d9dded;background:#fff;color:#4c55b9;border-radius:9px;padding:8px 11px;min-height:38px;cursor:pointer;font-size:11px;font-weight:850}
.expand-editor:hover{background:#f4f5ff;border-color:#c8cdf3}
.answer-inline-toggle{border:1px solid #cfd4ee;background:#f7f8ff;color:#4c55b9;border-radius:9px;padding:8px 11px;min-height:38px;cursor:pointer;font-size:11px;font-weight:850;white-space:nowrap}.answer-inline-toggle:hover,.answer-inline-toggle.active{background:#e8ebff;border-color:#aeb5eb;color:#343da2}
.code-editor{width:calc(100% - 44px);margin:0 22px 17px;min-height:320px;padding:18px 19px;font-size:14px;line-height:1.62;border-radius:13px;resize:vertical;white-space:pre;overflow-wrap:normal;tab-size:4}
.code-editor:focus{border-color:#7881f2;box-shadow:0 0 0 4px rgba(91,91,214,.12)}
.problem-actions{padding:0 22px 19px}
.action{font-size:12px;padding:9px 12px;min-height:40px}
.feedback{margin-left:22px;margin-right:22px;font-size:13px}
.answer-box{margin-left:22px;margin-right:22px;margin-bottom:22px}
.answer-box h5{font-size:12px;padding:12px 14px}
.answer-box pre{font-size:13px;line-height:1.65;padding:15px}
.answer-box p{font-size:12px;line-height:1.7;padding:0 14px 14px}

body.editor-focus-open{overflow:hidden}
.problem-card.focus-mode{position:fixed;inset:14px;z-index:80;overflow:auto;border-radius:18px;box-shadow:0 30px 90px rgba(8,12,25,.32);background:#fff}
.problem-card.focus-mode .code-editor{min-height:68vh;resize:none}
.problem-card.focus-mode .expand-editor{position:sticky;top:8px;z-index:3;background:#20263b;color:#fff;border-color:#20263b}
.problem-card.focus-mode::before{content:"집중 풀이 모드 · Esc로 닫기";position:sticky;top:0;z-index:2;display:block;padding:8px 22px;background:#171d2c;color:#dce2f7;font-size:10px;font-weight:800;letter-spacing:.04em}

@media(min-width:1200px){
  .main{padding-left:44px;padding-right:44px}
  .problem-head{padding-left:28px;padding-right:28px}
  .requirements-box,.problem-context{margin-left:28px;margin-right:28px}
  .editor-toolbar{margin-left:28px;margin-right:28px}
  .code-editor{width:calc(100% - 56px);margin-left:28px;margin-right:28px;font-size:14px}
  .problem-actions{padding-left:28px;padding-right:28px}
}
@media(max-width:620px){
  .problem-head{padding:17px 14px 15px}
  .problem-title h4{font-size:17px}
  .problem-subtitle{font-size:11px}
  .requirements-box{margin:14px 12px 14px;border-radius:13px}
  .requirements-heading{padding:11px 13px}
  .requirements-heading strong{font-size:14px}
  .requirements-text{padding:14px 13px 15px;font-size:15px;line-height:1.72}
  .req-paragraph,.req-line p{font-size:15px;line-height:1.7}
  .problem-context{margin:0 12px 14px;padding:14px 13px;border-radius:13px}
  .context-heading{gap:8px}
  .context-heading strong{font-size:14px}
  .source-badge{display:none}
  .context-details summary{font-size:12px;line-height:1.4}
  .context-details summary span{display:none}
  .context-details pre{max-height:50vh;font-size:12px}
  .editor-toolbar{margin:0 12px 8px}
  .editor-toolbar strong{font-size:12px}
  .expand-editor{min-height:44px;padding:9px 10px}
  .code-editor{width:calc(100% - 24px);margin:0 12px 15px;min-height:340px;padding:15px 14px;font-size:16px;line-height:1.55;white-space:pre;overflow-wrap:normal}
  .problem-actions{padding-left:12px;padding-right:12px}
  .feedback,.answer-box{margin-left:12px;margin-right:12px}
  .problem-card.focus-mode{inset:0;border:0;border-radius:0}
  .problem-card.focus-mode::before{padding-left:14px;padding-right:14px}
  .problem-card.focus-mode .code-editor{min-height:60vh;height:60vh!important}
}
.requirements-text code{background:#eceffd;color:#4f55b8;border:1px solid #dfe3f7;border-radius:6px;padding:2px 5px;font:650 .9em/1.4 "Cascadia Code","SFMono-Regular",Consolas,monospace}
.context-name-groups{display:grid;gap:9px;margin-top:11px}.context-name-group>span{display:block;margin-bottom:6px;color:#70827b;font-size:10px;font-weight:850}.context-name-group .context-chips{margin:0}

.context-prerequisite{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:start;margin:10px 0;padding:10px 11px;border-radius:9px;background:#fff8e8;border:1px solid #f0dfb3;color:#72551a;font-size:12px;line-height:1.6}.context-prerequisite strong{padding:2px 6px;border-radius:6px;background:#ffe9ad;color:#76530c;font-size:10px;white-space:nowrap}.context-prerequisite code{font-family:"Cascadia Code","SFMono-Regular",Consolas,monospace;color:#664b13;font-weight:800}
@media(max-width:620px){.context-prerequisite{grid-template-columns:1fr;gap:5px;font-size:12px}.context-prerequisite strong{width:max-content}}

/* Jupyter-like local autocomplete */
.editor-toolbar>div:first-child{min-width:0}
.editor-shortcut{margin-top:2px;color:#7b8395;font-size:10px;font-weight:650;line-height:1.4}
.editor-tools{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.autocomplete-trigger{border:1px solid #d7dcef;background:#f7f8ff;color:#4d55b7;border-radius:9px;padding:8px 10px;min-height:38px;cursor:pointer;font-size:11px;font-weight:850;white-space:nowrap}
.autocomplete-trigger:hover{background:#eef0ff;border-color:#c8cdf3}
.autocomplete-popup{position:fixed;z-index:220;max-width:calc(100vw - 16px);border:1px solid #cfd5e7;background:#fff;border-radius:12px;box-shadow:0 16px 42px rgba(20,27,46,.22);overflow:hidden;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.autocomplete-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;background:#f5f6fb;border-bottom:1px solid #e3e6ef}
.autocomplete-head strong{font-size:11px;color:#30374b;letter-spacing:.02em}
.autocomplete-head span{font-size:9px;color:#7a8296;white-space:nowrap}
.autocomplete-list{max-height:260px;overflow:auto;padding:5px;-webkit-overflow-scrolling:touch}
.autocomplete-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:0;background:transparent;border-radius:8px;padding:7px 8px;text-align:left;cursor:pointer;color:#283044}
.autocomplete-item:hover,.autocomplete-item.active{background:#ecefff;color:#2f3aa6}
.autocomplete-item code{font:700 12px/1.3 "Cascadia Code","SFMono-Regular",Consolas,monospace;color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.autocomplete-item span{flex:0 0 auto;color:#828ba0;font-size:9px;font-weight:750}
.autocomplete-item.active span{color:#6873c7}
.problem-card.focus-mode .autocomplete-trigger{background:#f2f3ff}

@media(max-width:620px){
  .editor-toolbar{align-items:flex-start}
  .editor-toolbar>div:first-child{max-width:55%}
  .editor-shortcut{font-size:9px;line-height:1.35}
  .editor-tools{gap:5px}
  .autocomplete-trigger,.answer-inline-toggle,.expand-editor{padding-left:8px;padding-right:8px;font-size:10px}
  .autocomplete-head span{display:none}
  .autocomplete-list{max-height:220px}
  .autocomplete-item{min-height:40px;padding:9px 8px}
  .autocomplete-item code{font-size:13px}
}
@media(max-width:380px){
  .editor-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
  .editor-toolbar>div:first-child{max-width:none}
  .editor-tools{width:100%}
  .editor-tools button{flex:1}
}
