:root{--bg:#f6f8fb;--paper:#fff;--ink:#172033;--muted:#667085;--line:#e5e9f2;--brand:#2563eb;--brand2:#0f172a;--soft:#eef4ff;--radius:22px;--shadow:0 18px 50px rgba(15,23,42,.08)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}a{color:inherit;text-decoration:none}.site-header{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:16px clamp(18px,4vw,56px);background:rgba(255,255,255,.86);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}.brand{display:flex;gap:12px;align-items:center}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--brand2);color:#fff;font-weight:900}.brand small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.top-nav{display:flex;gap:18px;color:#344054;font-size:14px}.top-nav a:hover{color:var(--brand)}main{max-width:1180px;margin:0 auto;padding:28px 18px 60px}.hero{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);gap:24px;align-items:stretch;padding:46px 0}.hero-copy,.hero-panel,.app-card,.ad-slot,.tool-shell,.worksheet-preview{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.hero-copy{padding:48px}.eyebrow{margin:0 0 10px;color:var(--brand);font-weight:800;letter-spacing:.08em;text-transform:uppercase;font-size:12px}.hero h1{margin:0;font-size:clamp(34px,5vw,58px);line-height:1.08;letter-spacing:-.04em}.hero p{color:var(--muted);line-height:1.75}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}.btn,.card-link{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:14px;padding:12px 18px;background:#fff;font-weight:800}.btn.primary,.card-link{background:var(--brand);color:#fff;border-color:var(--brand)}.hero-panel{padding:28px;background:linear-gradient(150deg,#111827,#1d4ed8);color:#fff}.hero-panel ul{padding-left:20px;line-height:2}.category-strip{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin:18px 0}.category-card{padding:18px;background:#fff;border:1px solid var(--line);border-radius:18px}.category-card strong,.category-card span{display:block}.category-card span{margin-top:8px;color:var(--muted);font-size:13px;line-height:1.45}.content-section{padding-top:20px}.section-title{margin:32px 0 18px}.section-title h2{font-size:32px;margin:0}.content-group{margin:28px 0}.content-group h3{font-size:24px}.app-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.app-card{padding:22px;display:flex;flex-direction:column;justify-content:space-between;min-height:250px}.app-card h4{font-size:22px;margin:14px 0 8px}.app-card p{color:var(--muted);line-height:1.65}.badge{display:inline-block;padding:7px 10px;background:var(--soft);border-radius:999px;color:#1d4ed8;font-size:12px;font-weight:800}.tag-row{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0}.tag-row span{font-size:12px;background:#f2f4f7;border-radius:999px;padding:6px 9px;color:#475467}.placeholder{background:#fbfcff;box-shadow:none}.ad-slot{margin:18px 0;padding:14px;min-height:92px;display:grid;place-items:center}.fallback-tip{text-align:center}.fallback-tip span{display:block;font-size:12px;color:var(--brand);font-weight:900;margin-bottom:8px}.fallback-tip strong{font-size:18px}.site-footer{max-width:1180px;margin:0 auto;padding:30px 18px 54px;display:flex;justify-content:space-between;border-top:1px solid var(--line);color:var(--muted)}.footer-links{display:flex;gap:14px}.tool-hero{padding:28px 0}.tool-hero h1{font-size:38px;margin:0 0 10px}.tool-layout{display:grid;grid-template-columns:340px minmax(0,1fr);gap:18px}.tool-shell{padding:22px}.control-group{margin-bottom:16px}.control-group label{display:block;font-weight:800;margin-bottom:8px}.control-group input,.control-group select,.control-group textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:11px 12px;font:inherit;background:#fff}.worksheet-preview{padding:28px;min-height:640px}.worksheet-head{display:flex;justify-content:space-between;border-bottom:2px solid #111827;padding-bottom:12px;margin-bottom:18px}.worksheet-title{font-size:24px;font-weight:900}.question-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.q-card{border:1px solid #d0d5dd;border-radius:14px;padding:14px;min-height:86px;background:#fff}.q-card strong{margin-right:8px}.answer-line{display:block;border-bottom:1px solid #111827;height:28px;margin-top:12px}.word-card{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:center;border-bottom:1px solid var(--line);padding:12px 0}.print-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.notice-box{background:#fff7ed;border:1px solid #fed7aa;border-radius:18px;padding:18px;color:#7c2d12}.diagnostic-table{width:100%;border-collapse:collapse;background:#fff;border-radius:18px;overflow:hidden}.diagnostic-table th,.diagnostic-table td{border-bottom:1px solid var(--line);padding:12px;text-align:left}.diagnostic-table th{background:#f8fafc}@media(max-width:900px){.hero,.tool-layout{grid-template-columns:1fr}.category-strip,.app-grid{grid-template-columns:1fr 1fr}.hero-copy{padding:30px}.top-nav{display:none}}@media(max-width:560px){.category-strip,.app-grid,.question-grid{grid-template-columns:1fr}.site-footer{display:block}.worksheet-preview{padding:18px}.hero h1{font-size:34px}}@media print{.site-header,.site-footer,.tool-shell,.ad-slot,.tool-hero,.print-actions{display:none!important}body{background:#fff}.tool-layout{display:block}main{max-width:none;padding:0}.worksheet-preview{box-shadow:none;border:0;border-radius:0;min-height:auto;padding:8mm}.q-card{break-inside:avoid}.answer-line{height:24px}}

/* v0.2.0 기관명 설정, A4 섹션 조판, 바로가기 UI */
.institution-box{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:8px}.institution-box label{font-size:12px;font-weight:900;color:#475467}.institution-box input{width:130px;border:1px solid var(--line);border-radius:10px;padding:8px 9px;font:inherit;background:#fff}.mini-btn{border:0;border-radius:10px;background:var(--brand2);color:#fff;font-size:12px;font-weight:900;padding:8px 10px;cursor:pointer}.mini-btn.ghost{background:#fff;color:#1d2939;border:1px solid var(--line)}
.option-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.check-row{display:flex;align-items:center;gap:8px;font-weight:800}.check-row input{width:auto}.teacher-note{min-height:110px;resize:vertical}.print-book{display:flex;flex-direction:column;gap:18px;align-items:center}.print-page{width:210mm;min-height:297mm;background:#fff;color:#111827;border:1px solid #d0d5dd;box-shadow:0 12px 40px rgba(15,23,42,.08);padding:12mm 13mm;display:flex;flex-direction:column;position:relative}.page-kicker{font-size:11px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#1d4ed8;margin:0 0 3mm}.page-header{display:flex;justify-content:space-between;gap:10mm;border-bottom:2px solid #111827;padding-bottom:4mm;margin-bottom:5mm}.page-title{font-size:22px;font-weight:900;letter-spacing:-.02em}.page-meta{font-size:12px;line-height:1.8;color:#344054;text-align:right}.section-guide{border:1px solid #d0d5dd;background:#f8fafc;border-radius:12px;padding:4mm 5mm;margin-bottom:5mm;font-size:13px;line-height:1.6}.page-content{flex:1;display:flex;flex-direction:column}.balanced-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--row-gap,4mm) 6mm;align-content:space-between;flex:1}.balanced-grid.one-col{grid-template-columns:1fr}.print-q{border:1px solid #d0d5dd;border-radius:10px;padding:4mm;break-inside:avoid;display:flex;flex-direction:column;justify-content:space-between;min-height:30mm}.print-q.concept{min-height:34mm}.q-stem{font-size:15px;line-height:1.55;font-weight:750}.q-number{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:#111827;color:#fff;font-size:12px;margin-right:6px}.answer-box{border-bottom:1px solid #111827;min-height:11mm;margin-top:5mm}.work-box{border:1px dashed #98a2b3;min-height:15mm;margin-top:4mm;border-radius:8px;background:linear-gradient(#fff,#fff),repeating-linear-gradient(0deg,transparent,transparent 7mm,#f2f4f7 7.2mm);}.fast-answer-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:3mm;margin-bottom:5mm}.fast-cell{border:1px solid #98a2b3;border-radius:8px;min-height:18mm;padding:3mm;font-size:13px}.rubric{display:grid;grid-template-columns:1fr 1fr;gap:5mm;margin:4mm 0}.rubric-card{border:1px solid #d0d5dd;border-radius:12px;padding:5mm;min-height:40mm}.rubric-card h3{margin:0 0 3mm;font-size:16px}.teacher-advice{border:2px solid #111827;border-radius:14px;padding:5mm;min-height:78mm}.memo-lines{flex:1;border-radius:12px;border:1px solid #d0d5dd;background:repeating-linear-gradient(#fff 0,#fff 9mm,#e5e7eb 9.2mm);}.page-footer{display:flex;justify-content:space-between;border-top:1px solid #d0d5dd;margin-top:5mm;padding-top:3mm;color:#667085;font-size:11px}.duplex-badge{display:inline-block;border:1px solid #d0d5dd;border-radius:999px;padding:2mm 3mm;background:#f8fafc;font-weight:800}.no-print{display:block}
@media(max-width:1050px){.institution-box{display:none}.print-page{width:100%;min-height:auto}.balanced-grid{grid-template-columns:1fr}.option-row{grid-template-columns:1fr}}
@page{size:A4;margin:0}
@media print{.site-header,.site-footer,.tool-shell,.ad-slot,.tool-hero,.print-actions,.no-print{display:none!important}body{background:#fff}.worksheet-preview{padding:0!important;border:0!important;box-shadow:none!important}.print-book{display:block}.print-page{width:210mm;height:297mm;min-height:297mm;border:0;box-shadow:none;margin:0;page-break-after:always;break-after:page;overflow:hidden}.print-page:last-child{page-break-after:auto;break-after:auto}.balanced-grid{break-inside:avoid}.page-footer{position:absolute;left:13mm;right:13mm;bottom:8mm}.page-content{padding-bottom:10mm}}

/* v0.2.2 광고 배치 표준: 콘텐츠 흐름을 끊지 않는 고밀도 분산형 */
.ad-slot{position:relative;overflow:hidden}.ad-label{position:absolute;top:8px;left:10px;font-size:10px;font-weight:900;color:#98a2b3;background:#fff;border:1px solid #eaecf0;border-radius:999px;padding:2px 7px}.ad-leaderboard{min-height:112px}.ad-wide{min-height:118px}.ad-infeed{min-height:106px;margin:26px 0}.ad-compact{min-height:86px;box-shadow:none;background:#fbfcff}.ad-rail{display:block;position:sticky;top:92px;align-self:start}.ad-rail .ad-slot{min-height:280px;width:160px;padding:12px}.with-ad-rail{grid-template-columns:160px 340px minmax(0,1fr) 160px}.with-ad-rail .worksheet-preview{min-width:0}.tool-layout.with-ad-rail{align-items:start}@media(max-width:1280px){.with-ad-rail{grid-template-columns:340px minmax(0,1fr)}.with-ad-rail .ad-rail{display:none}}@media(max-width:900px){.with-ad-rail{grid-template-columns:1fr}.ad-leaderboard,.ad-wide,.ad-infeed{min-height:92px}.ad-compact{display:none}}@media print{.ad-rail,.ad-slot,.ad-label{display:none!important}}

/* v0.2.3 A4 page-first worksheet layout patch
   - 페이지 단위로 문항을 먼저 분배한다.
   - 각 페이지 안에서는 1열을 모두 채운 뒤 2열을 채운다.
   - 문항 번호와 빠른답안 번호가 항상 1:1 대응되도록 한다.
*/
.page-columns{display:grid;grid-template-columns:1fr 1fr;column-gap:6mm;flex:1;min-height:0}.question-column{display:flex;flex-direction:column;gap:var(--col-gap,4mm);min-width:0}.question-page .page-content{min-height:0}.question-page .print-q{min-height:0;padding:3.6mm 4mm}.question-page .print-q.concept{min-height:32mm}.question-page .print-q.calc{min-height:35mm}.question-page .work-box{min-height:13mm}.question-page .answer-box{min-height:9mm}.answer-page .fast-answer-grid{grid-template-columns:repeat(4,1fr);gap:2.5mm}.answer-page .fast-cell{min-height:15mm;padding:2.6mm;font-size:12px;line-height:1.35}.answer-page .rubric-card{min-height:32mm}.advice-page .teacher-advice{min-height:82mm}.write-line{margin-top:10mm}.memo-lines.compact{margin-top:6mm;min-height:96mm;flex:0 0 auto}
@media(max-width:1050px){.page-columns{grid-template-columns:1fr}.question-column{gap:4mm}}
@media print{.page-columns{break-inside:avoid}.question-column{break-inside:avoid}.question-page .print-q{break-inside:avoid;page-break-inside:avoid}.answer-page .fast-cell{break-inside:avoid}.advice-page .teacher-advice{break-inside:avoid}.memo-lines.compact{min-height:96mm}}

/* v0.2.4 97점 조판 패치
   - 개념 단답형과 기초 연산 문항번호를 분리한다.
   - 개념 단답형은 1열, 기초 연산은 2열 고정이다.
   - 미리보기 광고는 2페이지당 1개이며 인쇄/PDF에서는 완전히 제거한다.
*/
.single-question-column{display:flex;flex-direction:column;gap:var(--single-gap,4mm);flex:1;min-height:0}.concept-page .print-q{min-height:22mm}.concept-page .q-stem{font-size:14px}.concept-page .answer-box{min-height:8mm}.calc-page .page-columns{grid-template-columns:1fr 1fr;column-gap:7mm}.calc-page .question-column{gap:var(--col-gap,4mm)}.calc-page .print-q{min-height:34mm}.q-number{width:auto;min-width:42px;height:22px;border-radius:999px;padding:0 8px;white-space:nowrap}.answer-section{border:1px solid #d0d5dd;border-radius:12px;padding:3mm;margin-bottom:3mm}.answer-section h3{margin:0 0 2mm;font-size:14px}.concept-key{grid-template-columns:repeat(4,1fr)}.calc-key{grid-template-columns:repeat(6,1fr)}.answer-page .fast-cell{min-height:12mm;padding:2mm;font-size:11.5px}.answer-page .rubric{margin-top:3mm}.answer-page .rubric-card{min-height:28mm;padding:4mm}.advice-grid{display:grid;grid-template-columns:1fr 1fr;gap:4mm;margin-top:5mm}.advice-grid>div{border:1px solid #d0d5dd;border-radius:10px;padding:4mm;min-height:34mm;background:#fbfcff}.advice-grid p{margin:3mm 0 0;color:#344054}.ad-preview{width:min(760px,100%);margin:22px auto;min-height:96px;border-style:dashed;box-shadow:none}.screen-only-ad{display:grid}.print-book>.ad-preview{align-self:center}.ad-preview .fallback-tip strong{font-size:16px}
@media(max-width:1050px){.calc-page .page-columns{grid-template-columns:1fr}.advice-grid{grid-template-columns:1fr}.calc-key{grid-template-columns:repeat(4,1fr)}}
@media print{.screen-only-ad,.ad-preview,.preview-ad{display:none!important}.concept-page .single-question-column{break-inside:avoid}.calc-page .page-columns{grid-template-columns:1fr 1fr!important}.answer-section{break-inside:avoid}.advice-grid{grid-template-columns:1fr 1fr}.q-number{background:#111827!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}}

/* v0.2.5 — first-page nameplate and 97-point print polish */
.first-page-header{
  align-items:stretch;
  gap:9mm;
  border-bottom:0;
  padding-bottom:0;
  margin-bottom:5mm;
}
.first-page-header .section-title-block{
  flex:1;
  border-bottom:2px solid #111827;
  padding-bottom:4mm;
}
.student-nameplate{
  width:72mm;
  border:1.5px solid #111827;
  border-radius:18px;
  padding:5mm;
  background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
  box-shadow:0 10px 24px rgba(15,23,42,.10);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:42mm;
  break-inside:avoid;
}
.nameplate-school{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  border-radius:999px;
  background:#111827;
  color:#fff;
  font-size:12px;
  font-weight:900;
  letter-spacing:-.01em;
  padding:2mm 4mm;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}
.nameplate-name span{
  display:block;
  color:#667085;
  font-size:11px;
  font-weight:800;
  margin-bottom:1.5mm;
}
.nameplate-name strong{
  display:block;
  font-size:22px;
  line-height:1.1;
  font-weight:950;
  letter-spacing:-.03em;
  color:#111827;
  border-bottom:1px solid #111827;
  padding-bottom:2mm;
  min-height:10mm;
}
.nameplate-subrow{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:2mm;
  color:#344054;
  font-size:11px;
  font-weight:750;
}
.compact-page-header{
  align-items:flex-start;
  border-bottom:1.5px solid #111827;
  padding-bottom:3.5mm;
  margin-bottom:5mm;
}
.compact-page-header .section-guide{
  margin-bottom:0;
}
.compact-page-chip{
  white-space:nowrap;
  border:1px solid #d0d5dd;
  border-radius:999px;
  padding:2mm 3mm;
  background:#f8fafc;
  color:#344054;
  font-size:11px;
  font-weight:900;
}
.concept-page .single-question-column{
  padding-top:1mm;
}
.concept-page .print-q{
  min-height:23mm;
}
.calc-page .page-content{
  padding-top:1mm;
}
.calc-page .question-column{
  justify-content:flex-start;
}
@media print{
  .first-page-header .section-title-block,
  .compact-page-header{border-color:#111827!important;}
  .student-nameplate{box-shadow:none;}
  .nameplate-school{background:#111827!important;color:#fff!important;}
  .compact-page-chip{background:#f8fafc!important;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
}
@media(max-width:1050px){
  .first-page-header{flex-direction:column;}
  .student-nameplate{width:100%;}
}

/* v0.2.6 — preview/print unification and final A4 clipping fix
   - 미리보기와 인쇄 결과가 같은 A4 DOM/CSS를 사용하도록 반응형 변형을 제한한다.
   - 인쇄물에서 SECTION 1/2/3 같은 개발자식 라벨을 제거한다.
   - 첫 페이지 학생명 명찰의 밑줄을 제거하고, 1페이지 잘림을 방지한다.
   - 마지막 지도조언 페이지의 박스 중첩을 방지한다.
*/
.worksheet-preview .print-page{
  width:210mm;
  height:297mm;
  min-height:297mm;
  max-height:297mm;
  overflow:hidden;
  box-sizing:border-box;
}
.worksheet-preview .calc-page .page-columns,
.calc-page .page-columns{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  column-gap:7mm!important;
}
.worksheet-preview .advice-grid,
.advice-grid{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:3.2mm!important;
}
.page-kicker{display:none!important;}
.first-page-header{
  align-items:stretch;
  gap:7mm;
  margin-bottom:4mm!important;
  padding-bottom:0!important;
  min-height:0;
}
.first-page-header .section-title-block{
  padding-bottom:3mm!important;
}
.first-page-header .section-guide,
.compact-page-header .section-guide,
.answer-page .section-guide,
.advice-page .section-guide{
  padding:3mm 4mm!important;
  margin-bottom:0!important;
  font-size:12px!important;
  line-height:1.45!important;
}
.student-nameplate{
  width:70mm!important;
  min-height:34mm!important;
  padding:4mm!important;
  border-radius:14px!important;
  box-shadow:0 6px 18px rgba(15,23,42,.08);
}
.nameplate-school{
  font-size:11px!important;
  padding:1.6mm 3.4mm!important;
}
.nameplate-name span{
  margin-bottom:1mm!important;
}
.nameplate-name strong{
  border-bottom:0!important;
  padding-bottom:0!important;
  min-height:0!important;
  font-size:19px!important;
  line-height:1.15!important;
}
.nameplate-subrow{
  font-size:10.5px!important;
  gap:1.5mm!important;
}
.concept-page .single-question-column{
  gap:var(--single-gap,2.7mm)!important;
  padding-top:0!important;
}
.concept-page .print-q{
  min-height:18.2mm!important;
  padding:2.6mm 3.4mm!important;
}
.concept-page .q-stem{
  font-size:13px!important;
  line-height:1.38!important;
}
.concept-page .answer-box{
  min-height:6mm!important;
  margin-top:2.4mm!important;
}
.compact-page-header{
  margin-bottom:4mm!important;
  padding-bottom:3mm!important;
}
.calc-page .print-q{
  min-height:32mm!important;
}
.answer-page .page-header,
.advice-page .page-header{
  margin-bottom:4mm!important;
  padding-bottom:3mm!important;
}
.answer-page .page-content,
.advice-page .page-content{
  min-height:0;
  overflow:hidden;
}
.answer-page .fast-answer-grid{
  gap:2mm!important;
}
.answer-page .concept-key{
  grid-template-columns:repeat(2,1fr)!important;
}
.answer-page .calc-key{
  grid-template-columns:repeat(4,1fr)!important;
}
.answer-page .fast-cell{
  min-height:auto!important;
  padding:2mm 2.4mm!important;
  font-size:12px!important;
  line-height:1.2!important;
  display:flex!important;
  align-items:center!important;
  gap:2mm!important;
}
.answer-page .fast-cell strong{
  display:inline-flex;
  min-width:8mm;
  height:6mm;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#111827;
  color:#fff;
  font-size:10.5px;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}
.answer-page .answer-section{
  padding:3mm!important;
  margin-bottom:2.4mm!important;
}
.answer-page .rubric{
  gap:3mm!important;
  margin-top:2.4mm!important;
}
.answer-page .rubric-card{
  min-height:24mm!important;
  padding:3mm!important;
}
.advice-page .teacher-advice{
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  border:1.5px solid #111827!important;
  border-radius:12px!important;
  padding:4mm!important;
  overflow:hidden;
}
.advice-page .teacher-advice>p{
  margin:0 0 3mm!important;
  line-height:1.45!important;
  font-size:12px!important;
}
.advice-page .advice-grid>div{
  min-height:28mm!important;
  padding:3.2mm!important;
}
.advice-page .advice-grid p{
  margin:2mm 0 0!important;
  line-height:1.25!important;
}
.advice-page .memo-lines.compact{display:none!important;}
@media print{
  .worksheet-preview .print-page,
  .print-page{
    width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    max-height:297mm!important;
    overflow:hidden!important;
  }
  .page-kicker{display:none!important;}
  .nameplate-name strong{border-bottom:0!important;}
  .calc-page .page-columns{grid-template-columns:1fr 1fr!important;}
  .advice-grid{grid-template-columns:1fr 1fr!important;}
  .page-content{padding-bottom:13mm!important;}
}


/* v0.2.7 — simplified worksheet print polish
   - 문항 카드 내부의 밑줄/점선 박스 제거: 카드 전체가 풀이·답안 공간 역할을 한다.
   - 첫 페이지 헤더를 일반적인 학습지형으로 단순화한다.
   - 빠른답안 번호 뒤의 마침표를 제거하고 표처럼 읽히게 한다.
*/
.first-clean-header{
  display:block;
  border-bottom:1.4px solid #111827;
  padding-bottom:5mm;
  margin-bottom:5mm;
}
.first-title-area{display:block;text-align:left}
.institution-line{
  display:inline-flex;
  align-items:center;
  min-height:8mm;
  padding:1.6mm 4mm;
  border:1px solid #d0d5dd;
  border-radius:999px;
  background:#f8fafc;
  color:#344054;
  font-size:12px;
  font-weight:800;
  margin-bottom:3mm;
}
.first-clean-header .page-title{font-size:25px;line-height:1.15;margin:0 0 2mm;letter-spacing:-.02em}
.first-clean-header .section-guide{font-size:13px;line-height:1.45;color:#667085;margin:0}
.first-info-row{
  display:grid;
  grid-template-columns:1.4fr 1fr .85fr;
  gap:3mm;
  margin-top:4mm;
}
.first-info-row>div{
  border:1px solid #d0d5dd;
  border-radius:10px;
  background:#fff;
  padding:2.6mm 3mm;
  min-height:12mm;
}
.first-info-row span{display:block;color:#667085;font-size:10.5px;font-weight:800;margin-bottom:1mm}
.first-info-row strong{display:block;color:#111827;font-size:14px;font-weight:900;min-height:4mm}
.print-q{position:relative;overflow:hidden}
.print-q .answer-box,.print-q .work-box{display:none!important}
.question-page .print-q.concept{min-height:24mm;padding:3.2mm 4mm}
.question-page .print-q.calc{min-height:36mm;padding:4mm 4.4mm}
.concept-page .print-q{min-height:24mm}
.calc-page .print-q{min-height:36mm}
.q-stem{line-height:1.55}
.fast-cell{display:flex!important;align-items:center;gap:2.4mm;min-height:9mm!important;padding:1.7mm 2.2mm!important;border-radius:6px!important}
.fast-cell strong{min-width:6.5mm;text-align:center;font-weight:900;color:#111827}
.fast-cell span{font-weight:700;color:#111827}
.answer-page .fast-answer-grid{gap:1.8mm!important}
.answer-page .answer-section{padding:3mm!important;margin-bottom:3mm!important}
.answer-page .rubric-card{min-height:26mm!important}
@media print{
  .first-clean-header{break-inside:avoid;page-break-inside:avoid}
  .first-info-row>div,.institution-line,.print-q,.fast-cell{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .print-q .answer-box,.print-q .work-box{display:none!important}
}

/* v0.2.8 — custom question count, separate operation ranges, and full-page distribution
   - 문항수는 사용자가 직접 입력한다.
   - 덧셈/뺄셈 범위를 독립 옵션으로 둔다.
   - 기초연산 페이지는 남는 세로 공간을 문항 사이에 균등하게 분산한다.
*/
.range-row input[type="number"],
#calcCount{
  font-weight:800;
}
.calc-page .page-content{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
}
.calc-page .page-columns{
  height:100%!important;
  min-height:218mm!important;
  align-content:stretch!important;
}
.calc-page .question-column{
  height:100%!important;
  min-height:218mm!important;
  justify-content:flex-start!important;
}
.calc-page .page-columns[data-item-count="6"] .print-q,
.calc-page .page-columns[data-item-count="7"] .print-q,
.calc-page .page-columns[data-item-count="8"] .print-q{
  min-height:34mm!important;
}
.calc-page .page-columns[data-item-count="9"] .print-q,
.calc-page .page-columns[data-item-count="10"] .print-q{
  min-height:29mm!important;
}
.calc-page .page-columns[data-item-count="11"] .print-q,
.calc-page .page-columns[data-item-count="12"] .print-q{
  min-height:25mm!important;
  padding:3mm 3.6mm!important;
}
.calc-page .page-columns[data-item-count="11"] .q-stem,
.calc-page .page-columns[data-item-count="12"] .q-stem{
  font-size:14px!important;
  line-height:1.42!important;
}
.answer-page .calc-key{
  grid-template-columns:repeat(4,1fr)!important;
}
.answer-page .calc-answer h3,
.answer-page .concept-answer h3{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.teacher-advice>p::after{
  content:"";
}
@media print{
  .calc-page .page-columns,
  .calc-page .question-column{
    min-height:218mm!important;
  }
  .answer-page .calc-key{grid-template-columns:repeat(4,1fr)!important;}
}

/* v0.2.9 — precise operation constraints and cleaner arithmetic pages
   - 덧셈/뺄셈은 문제에 출력되는 수 범위와 정답 범위를 분리한다.
   - 자리올림/자리내림 조건 옵션을 추가한다.
   - 기초연산 페이지는 문항 외곽 박스를 제거하고 페이지 전체 간격 분산은 유지한다.
   - 첫 페이지 학생명/작성일/점수는 placeholder 없이 공란으로 둔다.
*/
.range-panel{
  border:1px solid #e4e7ec;
  border-radius:14px;
  padding:12px;
  margin:10px 0;
  background:#fbfcff;
}
.range-panel h3{
  margin:0 0 10px;
  font-size:14px;
  font-weight:900;
  letter-spacing:-.01em;
  color:#111827;
}
.range-panel .control-group{margin-bottom:8px}
.calc-page .print-q{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:3mm 1mm!important;
  min-height:34mm!important;
}
.calc-page .q-stem{
  font-size:16px!important;
  line-height:1.45!important;
  padding-bottom:2.2mm;
  border-bottom:1px solid #e5e7eb;
}
.calc-page .q-number{
  background:#111827!important;
  color:#fff!important;
  box-shadow:none!important;
}
.first-info-row>div{
  min-height:11mm;
}
.first-info-row strong:empty::after{
  content:"";
  display:block;
  min-height:5mm;
}
@media print{
  .calc-page .print-q{
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .calc-page .q-stem{border-bottom:1px solid #e5e7eb!important;}
}

/* v0.3.1 — stable worksheet generation and user-facing print header
   - 문제는 '새 학습지 만들기'를 눌렀을 때만 새로 생성한다.
   - 첫 페이지에 학습지 제목을 명확하게 출력한다.
   - 미리보기 사이 광고/학습팁 옵션과 화면 노출을 제거한다.
*/
.worksheet-main-title{
  font-size:27px;
  line-height:1.12;
  font-weight:950;
  letter-spacing:-.035em;
  color:#111827;
  margin:0 0 3mm;
}
.first-section-line{
  display:flex;
  align-items:center;
  gap:3mm;
  color:#475467;
  font-size:12.5px;
  line-height:1.45;
}
.first-section-line strong{
  display:inline-flex;
  align-items:center;
  white-space:nowrap;
  border:1px solid #d0d5dd;
  border-radius:999px;
  padding:1.2mm 3mm;
  background:#f8fafc;
  color:#111827;
  font-size:12px;
  font-weight:900;
}
.first-section-line span{display:inline-block}
.compact-page-header .compact-page-chip{display:none!important}
@media print{
  .worksheet-main-title{font-size:27px!important;}
  .first-section-line strong{background:#f8fafc!important;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
}
