:root{--bg:#f5f6fa;--panel:#fff;--ink:#171a26;--muted:#697286;--line:#e4e8f0;--purple:#5c50e6;--soft:#efedff;--code:#111725;--green:#187457;--shadow:0 10px 30px rgba(30,36,62,.07)}*{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)}a{text-decoration:none;color:inherit}button,input{font:inherit}code,pre{font-family:"Cascadia Code","SFMono-Regular",Consolas,monospace}.study-shell{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:100vh}.study-sidebar{position:sticky;top:0;height:100vh;background:#111522;color:#e8ebf4;padding:21px 17px;display:flex;flex-direction:column;z-index:20}.study-brand{display:flex;gap:11px;align-items:center;padding:3px 4px 18px}.brand-mark{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#6758e9,#386ee8);display:grid;place-items:center;font-weight:900}.study-brand strong,.study-brand small{display:block}.study-brand strong{font-size:15px}.study-brand small{font-size:10px;color:#8f99b1;margin-top:2px}.side-nav{display:grid;gap:4px;padding:12px 0;border-top:1px solid #272c3d;border-bottom:1px solid #272c3d}.side-nav a{font-size:11px;color:#9da6bb;padding:8px 10px;border-radius:8px}.side-nav a:hover,.side-nav a.active{background:#22283c;color:#fff}.import-wrap{padding:14px 0;border-bottom:1px solid #272c3d}.import-study{display:block;text-align:center;background:#292f47;border:1px solid #363d58;border-radius:9px;padding:9px 10px;font-size:11px;font-weight:800;cursor:pointer}.import-wrap small{display:block;color:#808aa1;font-size:9px;line-height:1.55;margin:7px 2px 0}.import-wrap code{color:#bbbdf6}.side-label{font-size:9px;font-weight:900;letter-spacing:.15em;color:#69758f;margin:17px 8px 8px}.study-list{display:flex;flex-direction:column;gap:5px;overflow:auto}.study-item{position:relative;width:100%;border:0;background:transparent;color:#adb5c7;text-align:left;border-radius:10px;padding:10px 34px 10px 11px;cursor:pointer}.study-item:hover{background:#1a2030;color:#fff}.study-item.active{background:#272e49;color:#fff}.sid{display:inline-flex;color:#a9a8ff;font-size:11px;font-weight:900;min-width:40px}.stitle{font-size:11px;line-height:1.4}.done-dot{position:absolute;right:10px;top:11px;width:18px;height:18px;border:1px solid #3a425c;border-radius:50%;display:grid;place-items:center;font-size:9px}.done-dot.done{background:#1d745d;border-color:#1d745d;color:#fff}.study-total{margin-top:auto;border-top:1px solid #272c3d;padding:14px 7px 0;color:#8b95aa;font-size:10px}.study-main{min-width:0;padding:0 36px 60px}.study-topbar{height:82px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:rgba(245,246,250,.93);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);z-index:10}.top-kicker{display:block;color:var(--purple);font-size:9px;font-weight:900;letter-spacing:.14em}.study-topbar h1{font-size:18px;margin:4px 0 0}.top-links{display:flex;gap:8px}.top-links a,.menu-button{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px 10px;font-size:10px;font-weight:800}.menu-button{display:none;cursor:pointer}.study-hero{margin:27px 0 18px;background:linear-gradient(135deg,#22263a,#3e3978 60%,#58409a);color:#fff;border-radius:20px;padding:26px 28px;display:flex;align-items:center;justify-content:space-between;gap:24px;box-shadow:var(--shadow)}.lesson-id{font-size:10px;font-weight:900;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.13);border-radius:999px;padding:5px 8px}.study-hero h2{font-size:25px;margin:11px 0 7px;letter-spacing:-.02em}.study-hero p{font-size:12px;line-height:1.7;color:#ccd2e6;margin:0}.hero-stats{display:flex;gap:7px;margin-top:13px}.hero-stats span{font-size:9px;font-weight:800;background:rgba(255,255,255,.09);border-radius:6px;padding:5px 7px;color:#dbe0f1}.complete-button{flex:none;border:1px solid rgba(255,255,255,.23);background:#fff;color:#292c43;border-radius:11px;padding:11px 14px;font-size:11px;font-weight:900;cursor:pointer}.complete-button.done{background:#daf4e9;color:#176348;border-color:#daf4e9}.study-controls{display:flex;justify-content:space-between;gap:12px;margin-bottom:18px}.search-wrap{flex:1}.search-wrap input{width:100%;border:1px solid var(--line);background:#fff;border-radius:11px;padding:11px 13px;font-size:11px;outline:none}.search-wrap input:focus{border-color:#aba6f2;box-shadow:0 0 0 3px rgba(92,80,230,.08)}.soft-button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 13px;font-size:10px;font-weight:800;cursor:pointer}.study-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:18px;align-items:start}.toc-card{position:sticky;top:101px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 12px;max-height:calc(100vh - 125px);overflow:auto}.toc-title{font-size:10px;font-weight:900;color:#7c8495;margin:0 6px 8px}.toc-card nav{display:flex;flex-direction:column;gap:1px}.toc-card a{font-size:10px;color:#5e6678;line-height:1.4;padding:6px 7px;border-radius:7px}.toc-card a:hover{background:#f0efff;color:#5044cc}.toc-card .toc-l2{padding-left:14px;font-size:9.5px}.toc-card .toc-l3{padding-left:20px;color:#8a92a2;font-size:9px}.toc-empty{font-size:10px;color:#9aa2b1;padding:7px}.study-content{display:flex;flex-direction:column;gap:13px;min-width:0}.content-card{scroll-margin-top:105px}.markdown-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px 23px;box-shadow:0 4px 14px rgba(30,36,60,.025)}.cell-label{font-size:8px;font-weight:900;letter-spacing:.12em;color:#a1a9b8;margin-bottom:8px}.notebook-md{font-size:13px;color:#343b49;line-height:1.83;overflow-wrap:anywhere}.notebook-md h1,.notebook-md h2,.notebook-md h3{color:#171b27;line-height:1.42;letter-spacing:-.02em}.notebook-md h1{font-size:23px;margin:6px 0 14px}.notebook-md h2{font-size:19px;margin:8px 0 12px}.notebook-md h3{font-size:16px;margin:7px 0 10px}.notebook-md p{margin:7px 0}.notebook-md ul,.notebook-md ol{padding-left:22px}.notebook-md li{margin:4px 0}.notebook-md code{background:#f0eff8;color:#6348c6;border-radius:5px;padding:2px 5px;font-size:11px}.notebook-md pre{background:#111725;color:#e8edf8;border-radius:10px;padding:13px;overflow:auto;line-height:1.6}.notebook-md img{display:block;max-width:100%;height:auto;margin:16px auto;border-radius:8px}.notebook-md table{width:100%;border-collapse:collapse;margin:13px 0;font-size:11px}.notebook-md th,.notebook-md td{border:1px solid #e0e4ed;padding:7px 8px;text-align:left}.notebook-md th{background:#f5f6fa}.notebook-md blockquote{margin:12px 0;border-left:4px solid #c5c2f7;padding:8px 12px;background:#f7f6ff;color:#555d70}.notebook-md a{color:#4e5bd5;text-decoration:underline}.code-card{background:#fff;border:1px solid var(--line);border-radius:15px;overflow:hidden}.code-card summary{list-style:none;display:flex;align-items:center;justify-content:space-between;padding:11px 15px;background:#1a2030;color:#aeb8ce;font-size:9px;font-weight:900;letter-spacing:.06em;cursor:pointer}.code-card summary::-webkit-details-marker{display:none}.code-card summary b{font-size:8px;color:#69758f}.study-code{background:var(--code);overflow:auto}.study-code pre{margin:0;padding:14px 0;color:#e8edf8;font-size:11px;line-height:1.65;counter-reset:line}.code-line{display:block;position:relative;padding:0 18px 0 52px;white-space:pre}.code-line:before{counter-increment:line;content:counter(line);position:absolute;left:0;width:35px;text-align:right;color:#4f5a71;border-right:1px solid #242d42;padding-right:9px}.kw{color:#c4b5fd}.str{color:#86efac}.com{color:#77839a}.num{color:#fbbf24}.fn{color:#93c5fd}.outputs{border-top:1px solid #e3e7ef;background:#fafbfc;padding:12px 14px}.output-title{font-size:8px;font-weight:900;color:#8b94a4;letter-spacing:.12em;margin-bottom:8px}.output-text{margin:7px 0;background:#f1f3f6;border-radius:8px;padding:10px;overflow:auto;font-size:10px;line-height:1.5;white-space:pre-wrap}.output-text.error{background:#fff0f2;color:#9b2d42}.output-image img{max-width:100%;height:auto;border-radius:7px;border:1px solid #e2e6ee;margin:7px 0}.empty-study{background:#fff;border:1px dashed #d6dbe6;border-radius:15px;padding:40px;text-align:center;color:#8d95a5;font-size:12px}.toast{position:fixed;right:22px;bottom:22px;background:#141824;color:#fff;border-radius:10px;padding:10px 13px;font-size:10px;opacity:0;transform:translateY(8px);transition:.2s;pointer-events:none;z-index:50}.toast.show{opacity:1;transform:none}@media(max-width:1000px){.study-layout{grid-template-columns:190px minmax(0,1fr)}.study-main{padding:0 22px 45px}}@media(max-width:900px){.study-shell{grid-template-columns:1fr}.study-sidebar{position:fixed;left:0;transform:translateX(-100%);transition:.2s;width:280px}.study-sidebar.open{transform:none}.menu-button{display:inline-block}.study-topbar>div:first-of-type{flex:1;margin-left:10px}.study-layout{grid-template-columns:1fr}.toc-card{position:relative;top:0;max-height:none}.top-links{display:none}.study-main{padding:0 16px 40px}}@media(max-width:620px){.study-hero{align-items:flex-start;flex-direction:column;padding:22px}.study-hero h2{font-size:21px}.complete-button{width:100%}.study-controls{flex-direction:column}.soft-button{padding:10px}.markdown-card{padding:17px}.notebook-md{font-size:12px}.study-main{padding:0 11px 32px}}
/* Rendering hardening: keep long notebook code inside its card even when it contains HTML-like text. */
.code-card details,.study-code,.study-code pre,.study-code code{min-width:0;max-width:100%}
.study-code{overflow-x:auto;overflow-y:hidden}
.study-code pre{width:max-content;min-width:100%}
.code-line{width:100%}
/* Confusion / review notebook */
.cell-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.cell-label-row .cell-label{margin-bottom:0}.confuse-button{border:1px solid #e0e3eb;background:#fff;border-radius:8px;padding:6px 8px;font-size:9px;font-weight:900;color:#697286;cursor:pointer;white-space:nowrap}.confuse-button:hover{border-color:#c9c1f8;color:#5947c8}.confuse-button.saved{background:#f0edff;border-color:#d6d0fb;color:#5947c8}.code-reviewbar{display:flex;justify-content:flex-end;padding:7px 10px;background:#f7f8fb;border-bottom:1px solid #e4e8f0}.top-links{align-items:center}


/* ===== Deployment QA hardening (2026-08-18) ===== */
html,body{max-width:100%;overflow-x:clip}
.study-main,.study-topbar>div,.study-hero>div,.study-layout,.study-content,.content-card,.notebook-md{min-width:0}
.study-topbar h1,.study-hero h2,.notebook-md,.toc-card a{overflow-wrap:anywhere;word-break:break-word}
.table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:8px}
.table-scroll table{width:max-content;min-width:100%;max-width:none}
.table-scroll th,.table-scroll td{white-space:normal;min-width:110px}
.notebook-md pre,.study-code,.output-text,.output-image{max-width:100%}
.output-text{overflow-wrap:anywhere;word-break:break-word}
.study-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}
.study-sidebar{z-index:20}
@media(max-width:900px){
  .study-topbar{gap:8px}
  .study-topbar>div:first-of-type{min-width:0}
  .study-topbar h1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .menu-button{display:inline-grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;font-size:19px;touch-action:manipulation}
  .study-sidebar{width:min(82vw,300px);padding-bottom:max(18px,env(safe-area-inset-bottom))}
  .study-item,.side-nav a,.import-study{min-height:44px}
  .toc-card{max-height:min(240px,34vh);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
}
@media(max-width:620px){
  .study-main{padding-left:11px;padding-right:11px;padding-bottom:max(34px,env(safe-area-inset-bottom))}
  .study-hero{gap:16px;border-radius:18px;padding:20px 18px}
  .hero-stats{flex-wrap:wrap}
  .complete-button{min-height:46px}
  .study-controls input{min-height:46px;font-size:16px}
  .soft-button{min-height:46px;font-size:13px}
  .markdown-card{padding:16px 14px}
  .cell-label-row{align-items:flex-start;flex-wrap:wrap}
  .confuse-button{min-height:40px;padding:8px 10px;font-size:11px;touch-action:manipulation}
  .code-card summary{min-height:44px;padding:12px 13px}
  .study-code pre{font-size:12px}
  .code-line{padding-left:46px;padding-right:12px}
  .notebook-md table{font-size:12px}
  .toast{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));text-align:center}
}

/* Fixed, independently collapsible study navigation. The TOC stays in the
   layout flow so it never covers the hero, controls, or lesson content. */
.monthly-study-guide{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 18px;padding:15px 18px;border:1px solid #dcdff0;border-radius:15px;background:#fff;box-shadow:0 4px 16px rgba(30,36,60,.035)}.monthly-study-guide[hidden]{display:none}.monthly-study-guide strong,.monthly-study-guide span{display:block}.monthly-study-guide strong{font-size:13px}.monthly-study-guide span{margin-top:4px;color:var(--muted);font-size:10px}.monthly-route{display:flex;flex-wrap:wrap;gap:7px}.monthly-route a{border:1px solid #d9ddef;border-radius:9px;padding:8px 10px;background:#efedff;color:#5146c6;font-size:10px;font-weight:900}.monthly-route a:hover{border-color:#8279e8;background:#e5e1ff}
@media(max-width:720px){.monthly-study-guide{align-items:flex-start;flex-direction:column}.monthly-route{width:100%}.monthly-route a{flex:1;text-align:center;min-width:120px}}
.sidebar-toggle,.toc-toggle{display:grid;place-items:center;border:1px solid var(--line);background:#fff;color:#596174;cursor:pointer;font-weight:900}
.sidebar-toggle{position:absolute;top:22px;right:-14px;width:28px;height:28px;border-radius:50%;z-index:2;box-shadow:0 5px 14px rgba(5,9,20,.22)}
.toc-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.toc-title{margin:0 6px 8px}
.toc-toggle{width:25px;height:25px;flex:none;border-radius:7px;margin:0 0 8px;font-size:15px}
@media(min-width:901px){
  .study-shell{display:block}
  .study-sidebar{position:fixed;inset:0 auto 0 0;width:280px;transition:width .2s ease,padding .2s ease}
  .study-main{margin-left:280px;transition:margin-left .2s ease}
  .study-layout{grid-template-columns:220px minmax(0,1fr);overflow:visible}
  .toc-card{position:-webkit-sticky;position:sticky;top:101px;left:auto;width:auto;align-self:start;height:max-content;transition:padding .2s ease}
  body.sidebar-collapsed .study-sidebar{width:72px;padding-left:16px;padding-right:16px}
  body.sidebar-collapsed .study-main{margin-left:72px}
  body.sidebar-collapsed .study-brand{justify-content:center;padding-left:0;padding-right:0}
  body.sidebar-collapsed .study-brand>span:last-child,
  body.sidebar-collapsed .side-nav,
  body.sidebar-collapsed .import-wrap,
  body.sidebar-collapsed .side-label,
  body.sidebar-collapsed .study-list,
  body.sidebar-collapsed .study-total{display:none}
  body.toc-collapsed .study-layout{grid-template-columns:46px minmax(0,1fr)}
  body.toc-collapsed .toc-card{padding:10px}
  body.toc-collapsed .toc-title,
  body.toc-collapsed .toc-links{display:none}
  body.toc-collapsed .toc-head{justify-content:center}
  body.toc-collapsed .toc-toggle{margin:0}
}
@media(min-width:901px) and (max-width:1000px){
  .study-layout{grid-template-columns:190px minmax(0,1fr)}
  body.toc-collapsed .study-layout{grid-template-columns:46px minmax(0,1fr)}
}
@media(max-width:900px){
  .sidebar-toggle{display:none}
  .toc-card{position:relative;top:0;width:auto}
  body.toc-collapsed .toc-links{display:none}
  body.toc-collapsed .toc-card{max-height:none}
}
