*{box-sizing:border-box}body,html{margin:0;padding:0;background:#f5f7fb;color:#111827;font-family:Arial,Apple SD Gothic Neo,Noto Sans KR,sans-serif}button,input,select,textarea{font:inherit}.page{min-height:100vh;padding:40px 20px}.shell{max-width:980px;margin:0 auto}.header{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:24px}.eyebrow{margin:0 0 8px;font-size:13px;font-weight:700;color:#2563eb}h1{margin:0;font-size:34px;letter-spacing:-.03em}.sub{margin:10px 0 0;color:#6b7280;line-height:1.5}.userBox{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:8px 10px}.userBox span{font-size:14px;font-weight:700}.userBox a{font-size:13px;color:#2563eb;text-decoration:none}.userBox button{border:0;background:transparent;color:#6b7280;cursor:pointer}.composer button,.primary,.secondary{border:0;border-radius:12px;padding:12px 16px;cursor:pointer}.primary{background:#2563eb;color:#fff;font-weight:700}.secondary{background:#eef2ff;color:#1e40af;font-weight:700}.primary:disabled,.secondary:disabled{opacity:.45;cursor:not-allowed}.lessonCard{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:18px;display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:18px}.label{margin:0 0 8px;font-size:13px;font-weight:700;color:#6b7280}.select{min-width:360px;border:1px solid #d1d5db;border-radius:12px;padding:12px 14px;background:#fff}.statusNote{margin:8px 0 0;font-size:12px;color:#9ca3af}.actions{display:flex;gap:10px}.chat{background:#fff;border:1px solid #e5e7eb;border-radius:20px;min-height:560px;display:flex;flex-direction:column;overflow:hidden}.chatTop{display:flex;justify-content:space-between;gap:16px;padding:22px;border-bottom:1px solid #eef0f3}.chatTop h2{margin:0;font-size:24px}.badge{align-self:center;background:#ecfdf5;color:#047857;border-radius:999px;padding:8px 12px;font-size:12px;font-weight:700}.assistantBubble{max-width:620px;line-height:1.6}.composer{display:flex;gap:10px;padding:16px;border-top:1px solid #eef0f3}.composer input{flex:1 1;border:1px solid #d1d5db;border-radius:14px;padding:14px 16px;outline:none}.composer button{background:#111827;color:#fff;padding-inline:20px}.loginPage{min-height:100vh;display:grid;place-items:center;padding:20px}.loginCard{width:min(100%,440px);background:#fff;border:1px solid #e5e7eb;border-radius:22px;padding:32px;box-shadow:0 18px 50px rgba(17,24,39,.08)}.loginCard h1{font-size:30px}.loginForm{display:flex;flex-direction:column;gap:10px;margin-top:28px}.loginForm label{font-size:13px;font-weight:700;color:#374151}.loginForm input{border:1px solid #d1d5db;border-radius:12px;padding:14px 15px;text-transform:uppercase;outline:none}.loginForm button{margin-top:4px;border:0;border-radius:12px;padding:14px;background:#2563eb;color:#fff;font-weight:700;cursor:pointer}.loginForm button:disabled{opacity:.5;cursor:default}.error{margin:0;color:#dc2626;font-size:13px}.adminPage{min-height:100vh;padding:40px 20px;background:#f5f7fb}.adminShell{max-width:820px;margin:0 auto}.adminTop{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:24px}.backLink{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:10px 14px;color:#374151;text-decoration:none}.adminCard,.adminForm{background:#fff;border:1px solid #e5e7eb;border-radius:20px;padding:24px}.adminForm{display:grid;grid-gap:18px;gap:18px}.adminForm label{display:grid;grid-gap:8px;gap:8px}.adminForm label>span{font-size:13px;font-weight:700;color:#374151}.adminForm input,.adminForm select{width:100%;border:1px solid #d1d5db;border-radius:12px;padding:12px 14px;background:#fff}.fileBox small{color:#6b7280}.fileList{border:1px solid #e5e7eb;border-radius:14px;overflow:hidden}.fileListTitle{padding:12px 14px;font-size:13px;font-weight:800;background:#f9fafb;border-bottom:1px solid #e5e7eb}.fileRow{justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid #f0f1f3}.fileRow,.fileRow>div{display:flex;align-items:center}.fileRow>div{gap:10px;min-width:0}.fileRow strong{color:#2563eb}.fileRow span,.fileRow strong{font-size:13px;white-space:nowrap}.fileRow span{overflow:hidden;text-overflow:ellipsis}.fileRow small{font-size:11px;color:#9ca3af;white-space:nowrap}.fileRow button{border:0;background:#f3f4f6;color:#6b7280;border-radius:8px;padding:6px 9px;cursor:pointer}.totalChars{padding:11px 14px;font-size:12px;color:#6b7280;background:#fafafa}.publishBtn{border:0;border-radius:14px;padding:15px 18px;background:#2563eb;color:#fff;font-weight:800;cursor:pointer}.publishBtn:disabled{opacity:.5;cursor:not-allowed}.adminStatus{background:#eef2ff;color:#1e40af;border-radius:12px;padding:13px 15px;line-height:1.5}.errorStatus{background:#fef2f2;color:#b91c1c}.progressBox{border:1px solid #dbeafe;background:#eff6ff;border-radius:14px;padding:14px}.progressMeta{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px}.progressMeta strong{color:#1d4ed8}.progressMeta span{font-size:12px;color:#475569;text-align:right}.progressTrack{height:9px;border-radius:999px;background:#dbeafe;overflow:hidden}.progressBar{height:100%;background:#2563eb;border-radius:999px;transition:width .25s ease}.progressBox small{display:block;margin-top:7px;color:#64748b}.adminCard{max-width:540px;margin:80px auto}.adminCard a{color:#2563eb}@media(max-width:720px){.adminPage,.page{padding:20px 12px}.adminTop,.header,.lessonCard{flex-direction:column;align-items:stretch}h1{font-size:28px}.select{min-width:0}.actions,.select{width:100%}.actions button{flex:1 1}.chat{min-height:65vh}.badge{display:none}.userBox{justify-content:space-between}.fileRow>div{display:grid;grid-gap:4px;gap:4px}}.summaryOverlay{position:fixed;inset:0;z-index:1000;background:rgba(15,23,42,.5);display:grid;place-items:center;padding:24px}.summaryPanel{width:min(100%,980px);height:min(92vh,1000px);background:#fff;border-radius:22px;box-shadow:0 30px 90px rgba(15,23,42,.25);overflow:hidden;display:flex;flex-direction:column}.summaryToolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 20px;border-bottom:1px solid #e5e7eb;background:#fff}.summaryToolbar .eyebrow{margin-bottom:4px}.summaryToolbar strong{font-size:16px}.summaryActions{display:flex;gap:8px}.summaryActions button{border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}.pdfButton{background:#2563eb;color:#fff}.pdfButton:disabled{opacity:.45;cursor:not-allowed}.closeButton{background:#f3f4f6;color:#374151}.summaryDocument{overflow:auto;flex:1 1;padding:48px 56px 70px;background:#fff}.summaryPrintHeader{padding-bottom:24px;margin-bottom:32px;border-bottom:1px solid #e5e7eb}.summaryPrintHeader p{margin:0 0 8px;color:#2563eb;font-size:13px;font-weight:800}.summaryPrintHeader h1{margin:0;font-size:30px;line-height:1.35;letter-spacing:-.03em}.summaryPrintHeader span{display:block;margin-top:10px;color:#6b7280;font-size:13px}.summaryState{padding:80px 20px;text-align:center;color:#6b7280}.errorState{color:#b91c1c}.markdownBody{color:#1f2937;font-size:16px;line-height:1.85;word-break:keep-all}.markdownBody h1{font-size:28px;line-height:1.4;margin:38px 0 18px;color:#111827}.markdownBody h2{font-size:22px;line-height:1.45;margin:34px 0 14px;color:#111827}.markdownBody h3{font-size:18px;line-height:1.5;margin:28px 0 10px;color:#111827}.markdownBody p{margin:10px 0}.markdownBody ol,.markdownBody ul{padding-left:24px;margin:10px 0 18px}.markdownBody li{margin:7px 0}.markdownBody strong{color:#111827}.markdownBody blockquote{margin:18px 0;padding:14px 16px;background:#f8fafc;border-left:4px solid #cbd5e1;color:#475569}.markdownBody code{background:#f3f4f6;border-radius:5px;padding:2px 5px;font-size:.92em}.markdownBody hr{border:0;border-top:1px solid #e5e7eb;margin:30px 0}@media(max-width:720px){.summaryOverlay{padding:0}.summaryPanel{height:100vh;border-radius:0}.summaryToolbar{padding:13px 14px}.summaryToolbar strong{font-size:14px}.summaryDocument{padding:30px 20px 50px}.summaryPrintHeader h1{font-size:24px}.markdownBody{font-size:15px;line-height:1.75}.summaryActions button{padding:9px 11px;font-size:13px}}@media print{@page{size:A4;margin:18mm 16mm}body{background:#fff!important}.noPrint,.page{display:none!important}.summaryOverlay{position:static!important;display:block!important;background:#fff!important;padding:0!important}.summaryPanel{width:auto!important;max-height:none!important;border-radius:0!important;box-shadow:none!important}.summaryDocument,.summaryPanel{height:auto!important;overflow:visible!important}.summaryDocument{padding:0!important}.markdownBody h1,.markdownBody h2,.markdownBody h3,.summaryPrintHeader{page-break-after:avoid;break-after:avoid}.markdownBody li,.markdownBody p{orphans:3;widows:3}}.quizAdminBox{margin-top:4px;padding:16px;border:1px solid #e5e7eb;border-radius:14px;background:#fafafa;display:grid;grid-gap:12px;gap:12px}.quizAdminBox strong{font-size:15px}.quizAdminBox p{margin:5px 0 0;color:#6b7280;font-size:13px;line-height:1.5}.quizGenerateBtn{justify-self:start;border:0;border-radius:12px;padding:11px 14px;background:#111827;color:#fff;font-weight:800;cursor:pointer}.quizGenerateBtn:disabled{opacity:.45;cursor:not-allowed}.quizOverlay{position:fixed;inset:0;z-index:1100;background:rgba(15,23,42,.5);display:grid;place-items:center;padding:24px}.quizPanel{width:min(100%,760px);max-height:92vh;background:#fff;border-radius:22px;box-shadow:0 30px 90px rgba(15,23,42,.25);overflow:hidden;display:flex;flex-direction:column}.quizToolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 20px;border-bottom:1px solid #e5e7eb}.quizToolbar .eyebrow{margin-bottom:4px}.quizBody{overflow:auto;padding:30px}.quizContent{max-width:650px;margin:0 auto}.quizProgress{display:flex;align-items:center;gap:12px;margin-bottom:28px}.quizProgress>span{font-size:13px;font-weight:800;color:#2563eb;white-space:nowrap}.quizProgressTrack{height:7px;flex:1 1;background:#e5e7eb;border-radius:999px;overflow:hidden}.quizProgressBar{height:100%;background:#2563eb;border-radius:999px}.quizQuestion{margin:0 0 22px;font-size:23px;line-height:1.55;letter-spacing:-.02em}.quizOptions{display:grid;grid-gap:10px;gap:10px}.quizOption{width:100%;display:flex;align-items:flex-start;gap:12px;text-align:left;border:1px solid #dbe1e8;background:#fff;border-radius:14px;padding:14px 15px;color:#1f2937;line-height:1.55;cursor:pointer}.quizOption:hover:not(:disabled){border-color:#93c5fd;background:#f8fbff}.quizOption.selected{border-color:#2563eb;background:#eff6ff}.quizOption.correct{border-color:#16a34a;background:#f0fdf4}.quizOption.wrong{border-color:#dc2626;background:#fef2f2}.quizOption:disabled{cursor:default}.quizOptionKey{display:grid;place-items:center;flex:0 0 26px;height:26px;border-radius:999px;background:#f3f4f6;font-size:12px;font-weight:800}.quizOption.selected .quizOptionKey{background:#2563eb;color:#fff}.quizOption.correct .quizOptionKey{background:#16a34a;color:#fff}.quizOption.wrong .quizOptionKey{background:#dc2626;color:#fff}.quizFeedback{margin-top:18px;border-radius:14px;padding:14px 16px;line-height:1.6}.quizFeedback strong{display:block;margin-bottom:5px}.quizFeedback p{margin:4px 0}.correctBox{background:#f0fdf4;color:#166534}.wrongBox{background:#fef2f2;color:#991b1b}.correctAnswerText{font-weight:800}.quizFooter{display:flex;justify-content:flex-end;margin-top:20px}.quizFooter .primary{min-width:120px}.quizResult{text-align:center;padding:46px 20px 36px}.quizResultLabel{margin:0;color:#6b7280;font-size:14px;font-weight:700}.quizResult h2{margin:10px 0 8px;font-size:52px;letter-spacing:-.04em}.quizResult>p:not(.quizResultLabel){margin:0 auto 24px;color:#6b7280;line-height:1.6;max-width:460px}@media(max-width:720px){.quizOverlay{padding:0}.quizPanel{width:100%;height:100vh;max-height:none;border-radius:0}.quizBody{padding:22px 16px 36px}.quizQuestion{font-size:20px}}.messages{flex:1 1;padding:24px;overflow-y:auto;display:flex;flex-direction:column;gap:14px;min-height:360px}.messageRow{display:flex;width:100%}.assistantRow{justify-content:flex-start}.userRow{justify-content:flex-end}.userBubble{max-width:72%;background:#2563eb;color:#fff;border-radius:16px 16px 4px 16px;padding:13px 15px;line-height:1.65;white-space:pre-wrap}.assistantBubble{max-width:78%;background:#f3f4f6;border-radius:16px 16px 16px 4px;padding:14px 16px;line-height:1.68;color:#374151}.messageText{white-space:pre-wrap}.thinkingBubble{color:#6b7280;font-size:14px}.chatSources{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;padding-top:10px;border-top:1px solid #e5e7eb}.chatSources span{font-size:11px;font-weight:700;color:#475569;background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:5px 8px}.chatError{align-self:center;background:#fef2f2;color:#b91c1c;border-radius:10px;padding:9px 12px;font-size:13px}.composer button:disabled{opacity:.45;cursor:not-allowed}@media(max-width:720px){.assistantBubble,.userBubble{max-width:88%}}.adminUsageBox{margin-top:24px;padding:18px;border:1px solid #e5e7eb;border-radius:16px;background:#fff}.adminUsageHead{display:flex;align-items:center;justify-content:space-between;gap:16px}.adminUsageHead button{border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:9px 12px;cursor:pointer}.usageSummary{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.usageSummary span{background:#f3f4f6;border-radius:999px;padding:7px 10px;font-size:13px;font-weight:700}.usageList{margin-top:12px;border-top:1px solid #f1f5f9}.usageRow{display:flex;justify-content:space-between;gap:12px;padding:10px 2px;border-bottom:1px solid #f1f5f9}.answerSourceBadge{display:inline-flex;align-items:center;margin-bottom:9px;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800}.answerSourceBadge.lecture{background:#e0f2fe;color:#075985}.answerSourceBadge.web{background:#ecfdf5;color:#047857}.answerSourceBadge.not_found{background:#f3f4f6;color:#6b7280}.webSources{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;padding-top:10px;border-top:1px solid #e5e7eb}.webSources a{max-width:100%;font-size:11px;font-weight:700;color:#047857;background:#fff;border:1px solid #a7f3d0;border-radius:999px;padding:5px 8px;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.webSources a:hover{text-decoration:underline}.usageControls{display:flex;align-items:center;gap:8px}.usageControls input{border:1px solid #d1d5db;border-radius:10px;padding:8px 10px;background:#fff}.usageError{margin-top:12px;padding:10px 12px;border-radius:10px;background:#fef2f2;color:#b91c1c;font-size:13px}.usageSection{margin-top:18px}.usageSectionTitle{margin-bottom:9px;font-size:13px;font-weight:800;color:#374151}.sevenDayGrid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-gap:7px;gap:7px}.sevenDayItem{display:grid;justify-items:center;grid-gap:2px;gap:2px;padding:10px 4px;border-radius:12px;background:#f8fafc;border:1px solid #eef2f7}.sevenDayItem small{font-size:10px;color:#6b7280}.sevenDayItem strong{font-size:20px;color:#111827}.sevenDayItem span{font-size:10px;color:#94a3b8}.usageStudentButton{width:100%;border:0;background:transparent;text-align:left;cursor:pointer;font:inherit;color:inherit}.usageStudentButton:hover{background:#f8fafc}.usageStudentButton.selected{background:#eff6ff}.usageEmpty{padding:16px 4px;color:#94a3b8;font-size:13px}.questionLogSection{border-top:1px solid #e5e7eb;padding-top:16px}.questionLogItem{border:1px solid #e5e7eb;border-radius:12px;background:#fafafa;margin-bottom:8px;overflow:hidden}.questionLogItem summary{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;cursor:pointer;list-style:none}.questionLogItem summary::-webkit-details-marker{display:none}.questionLogItem summary span{flex:0 0 auto;font-size:11px;color:#64748b;padding-top:2px}.questionLogItem summary strong{font-size:13px;line-height:1.5;color:#1f2937}.questionLogAnswer{border-top:1px solid #e5e7eb;padding:12px 14px;background:#fff;white-space:pre-wrap;font-size:13px;line-height:1.65;color:#475569}@media(max-width:720px){.adminUsageHead{align-items:stretch;flex-direction:column}.usageControls{width:100%}.usageControls input{flex:1 1;min-width:0}.sevenDayGrid{grid-template-columns:repeat(4,minmax(0,1fr))}}