:root {
  --ink:#183c40; --accent:#15534f; --muted:#526969; --rule:#d8e2db;
  --pale:#edf4ef; --paper:#fff; --gold:#eab64c;
  font-family:'Noto Sans KR','Malgun Gothic',sans-serif;
  color:var(--ink); background:#f4f7f4; font-synthesis:none;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;line-height:1.65;word-break:keep-all;overflow-wrap:anywhere}
.wrap{width:min(100% - 40px,1040px);margin-inline:auto}
a{color:var(--accent);text-underline-offset:.22em}
button,input{font:inherit}
button,summary{cursor:pointer}
button{border:1px solid transparent;border-radius:9px;padding:.62rem 1.06rem;min-height:44px;font-weight:600;line-height:1.45}
button:disabled{opacity:.5;cursor:default}
button:not(:disabled):hover{filter:brightness(.95)}
:focus-visible{outline:3px solid #99670d;outline-offset:3px}
.site-header{background:#103640;color:#fff}
.header-inner,.brand,.actions,.identity-controls,.section-heading,.progress-head,.resume-panel,.tool-links{display:flex;align-items:center;gap:.65rem}
.header-inner{min-height:70px;justify-content:space-between}
.brand{color:#fff;text-decoration:none;font-weight:600;line-height:1.25}
.brand img{display:block;object-fit:contain}
.brand small{display:block;font:italic .8rem/1.3 Georgia,serif;letter-spacing:.04em;color:#e0eae6;margin-top:3px}
.home{color:#fff;font-size:.92rem}
.intro,.narrow{padding-top:clamp(30px,5vw,58px)}
.narrow{max-width:760px;margin-inline:auto}
h1,h2,h3,h4,p{margin:0}
h1,h2,h3,h4{line-height:1.35;letter-spacing:-.045em}
h1{font-size:clamp(2rem,5vw,3rem);margin:.3rem 0 .7rem}
h2{font-size:clamp(1.45rem,3vw,1.8rem)}
h3{font-size:1.42rem}
h4{font-size:1.12rem}
.kicker{font-size:.88rem;font-weight:600;color:var(--accent)}
.intro>p:last-child,.subtitle,.section-heading p,.practice-card>p{color:var(--muted)}
.panel,.practice-card{background:var(--paper);border:1px solid var(--rule);border-radius:17px}
.identity{padding:clamp(16px,2.8vw,26px);margin-top:24px;display:flex;justify-content:space-between;align-items:center;gap:24px}
.identity label{font-weight:600;display:block;margin-bottom:6px}
.identity-controls{flex-wrap:wrap}
.identity input,.numeric-input{height:46px;max-width:100%;border:1px solid #9bb3a9;border-radius:8px;padding:8px 12px;background:#fff;color:var(--ink)}
.identity input{width:min(235px,100%);min-width:0}
.small{color:var(--muted);font-size:.875rem;line-height:1.65}
.identity .small{margin-top:8px}
.quick{display:grid;text-align:center;justify-items:center;gap:8px;flex:none;font-size:.9rem}
.quick button{font-size:1rem}
.primary{background:var(--accent);color:white}
.secondary{background:#edf3ee;border-color:#cfddd2;color:var(--ink)}
.resume-panel{justify-content:space-between;flex-wrap:wrap;border-left:4px solid var(--gold);background:#fffae9;padding:14px 18px;margin-top:12px}
.workshop{margin-top:16px;scroll-margin-top:12px}
.workshop summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px clamp(16px,3vw,26px);border-radius:inherit;list-style:none}
.workshop summary::-webkit-details-marker{display:none}
.workshop summary strong{display:block;font-size:1.18rem}
.workshop-description{display:block;color:var(--muted);font-size:.95rem}
.workshop-toggle-text{flex:none;padding:7px 12px;border-radius:8px;background:var(--pale);color:var(--accent);font-size:.9rem;font-weight:600}
.workshop:not([open]) .workshop-toggle-text span:last-child,.workshop[open] .workshop-toggle-text span:first-child{display:none}
.workshop iframe{display:block;width:100%;height:32rem;border:0}
.workshop-next{display:flex;justify-content:center;padding:14px}
.section-heading{justify-content:space-between;flex-wrap:wrap;gap:4px 16px;margin:34px 0 14px}
.section-heading p{font-size:.92rem}
.study-layout{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr);gap:16px;align-items:start}
.units{display:grid;gap:5px}
.units button{background:transparent;border-color:var(--rule);color:var(--ink);text-align:left;padding:.75rem .9rem;font-size:.98rem}
.units button[aria-pressed=true]{background:var(--accent);color:#fff;border-color:var(--accent)}
.lesson,.question-panel,.result-panel{padding:clamp(20px,4vw,36px)}
.lesson h3{font-size:clamp(1.45rem,3vw,1.9rem)}
.subtitle{margin:6px 0 16px}
.lesson-actions{margin-bottom:16px}
figure{margin:16px 0 24px;padding:12px;border:1px solid var(--rule);border-radius:12px;text-align:center;background:#f6faf7}
#figure-image{max-width:310px;margin:auto}
#figure-image svg{display:block;width:100%;height:auto}
figcaption{color:var(--muted);font-size:.88rem;margin:6px 0 2px}
.concepts{margin:6px 0 24px}
.concepts dt{font-weight:600;margin:14px 0 3px}
.concepts dd{margin:0;color:#314c4c;line-height:1.8}
.worked{border-radius:12px;padding:18px;background:var(--pale)}
.worked h4{color:var(--accent)}
.worked p{margin:8px 0}
.worked summary{font-weight:600;color:var(--accent);padding:7px 0;text-underline-offset:.22em}
.worked ol,.record ol,.record ul{padding-inline-start:1.4rem}
.worked li+li,.record li+li{margin-top:.65rem}
#example-answer{font-weight:600}
.pitfall{border-left:3px solid var(--gold);padding:1px 0 1px 13px;margin:20px 0}
.pitfall strong{display:block;color:#745014}
.tool-links{flex-wrap:wrap;margin-bottom:18px}
.tool-links:empty{display:none}
.tool-links a{font-size:.92rem}
.practice-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.practice-card{padding:24px;display:grid;justify-items:start;align-content:start;grid-template-rows:auto 1fr auto;gap:10px}
.practice-card h3{font-size:1.2rem}
.actions{flex-wrap:wrap;margin-top:18px}
.question-panel,.result-panel{margin-top:20px}
.progress-head{justify-content:space-between;font-size:.94rem}
progress{width:100%;height:8px;display:block;accent-color:var(--accent);margin:10px 0 22px;border:0;border-radius:8px;overflow:hidden;background:var(--pale)}
progress::-webkit-progress-bar{background:var(--pale)}
progress::-webkit-progress-value,progress::-moz-progress-bar{background:var(--accent)}
fieldset{padding:0;margin:0;border:0;min-width:0}
legend{font-size:clamp(1.18rem,3vw,1.5rem);font-weight:600;line-height:1.55;padding:0}
#options{margin:18px 0;display:grid;gap:9px}
.choice{display:flex;align-items:center;gap:12px;cursor:pointer;padding:12px 14px;border-radius:10px;border:1px solid #cbd9cf}
.choice input{accent-color:var(--accent);width:18px;height:18px;flex:none}
.choice:has(:checked){background:var(--pale);border-color:var(--accent)}
.numeric-input{width:100%;font-variant-numeric:tabular-nums}
.text-button{margin:12px 0;background:transparent;text-decoration:underline;text-underline-offset:.22em;color:var(--muted)}
.result-score{font-size:clamp(2.7rem,7vw,4.2rem);line-height:1.2;letter-spacing:-.065em;font-weight:600;color:var(--accent)}
#save-status{margin-top:12px;color:var(--muted)}
.record-heading{margin:26px 0 12px}
.record{padding:16px;border:1px solid var(--rule);border-radius:10px;background:white;margin:12px 0}
.record summary{font-weight:600}
footer{border-top:1px solid var(--rule);margin-top:38px;padding:20px 0 36px;font-size:.875rem;color:var(--muted)}
#status:not(:empty){padding:12px;border:1px solid var(--rule);border-radius:8px;background:var(--paper);margin:14px 0}
@media(max-width:700px){
  .identity{align-items:start;flex-direction:column;gap:12px}
  .quick{display:flex;flex-wrap:wrap;gap:12px}
  .study-layout{grid-template-columns:1fr}
  .units{grid-template-columns:repeat(auto-fit,minmax(126px,1fr))}
  .units button{text-align:center;line-height:1.4;padding:7px 6px}
  .section-heading{align-items:baseline}
}
@media(max-width:480px){
  .wrap{width:calc(100% - 28px)}
  .header-inner{min-height:58px}
  .brand img{width:42px;height:auto}
  .identity-controls{flex-wrap:nowrap;gap:6px}
  .identity-controls input{width:0;flex:1}
  .identity-controls button{white-space:nowrap}
  .practice-grid{grid-template-columns:1fr}
  .practice-card{padding:18px}
  .study-layout{gap:10px}
  .actions button{flex:1 1 auto}
}
