/* STUDY MATE AI — 화이트 바탕 · 딥 네이비 · 완료 그린 · 진행 블루 · 지연 오렌지 · AI 퍼플 */
:root {
  --bg: #f5f7fb; --card: #fff; --ink: #141a33; --ink2: #4a5272; --mute: #7d849e; --line: #e4e8f2; --line2: #d4daea;
  --navy: #1e2a5a; --navy2: #2c3c7d; --green: #2f9e44; --blue: #1c7ed6; --orange: #f08c00; --red: #e03131; --purple: #7048e8;
  --r: 16px; --shadow: 0 1px 0 rgba(20, 26, 51, .04), 0 10px 30px -18px rgba(20, 26, 51, .35);
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; }
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
html.lock, html.lock body { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--mute); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; padding: 6px 10px; border-radius: 8px; }
.muted { color: var(--mute); } .small { font-size: 12.5px; } .warn-t { color: var(--orange); }

/* 틀 */
.side { position: fixed; inset: 0 auto 0 0; width: 252px; background: linear-gradient(180deg, #141c40, #1e2a5a); color: #dfe4ff; display: flex; flex-direction: column; padding: 18px 12px; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-size: 16px; letter-spacing: -.01em; color: #fff; }
.brand .mk { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; background: linear-gradient(135deg, #9775fa, #4dabf7); color: #fff; box-shadow: 0 6px 16px -6px rgba(151, 117, 250, .9); }
.brand b { font-weight: 900; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; color: #c5ccef; transition: background .15s; }
.side nav a .ic { width: 28px; text-align: center; font-size: 17px; }
.side nav a b { display: block; font-size: 14px; font-weight: 700; color: #eef1ff; }
.side nav a small { font-size: 11.5px; color: #8f99c9; }
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a.on { background: rgba(151, 117, 250, .22); box-shadow: inset 3px 0 0 #9775fa; }
.side-f { margin-top: auto; padding: 14px 10px 4px; font-size: 12px; color: #8f99c9; }
.side-f a:hover { color: #fff; }
.mainw { margin-left: 252px; min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 26px; background: rgba(245, 247, 251, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 54px; }
.top .brand.sm, .menu-btn { display: none; }
.ddays { margin-left: auto; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ddp { white-space: nowrap; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink2); }
.ddp b { color: var(--navy); margin-left: 3px; } .ddp.hot b { color: var(--red); }
.sample-bar { margin: 10px 26px 0; padding: 8px 14px; border-radius: 12px; background: #fff4e6; color: #a34d00; font-size: 13px; }
.sample-bar a { font-weight: 700; text-decoration: underline; }
main { padding: 22px 26px 90px; max-width: 1180px; outline: none; }
.phead { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.phead h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.phead p { margin: 2px 0 0; color: var(--mute); font-size: 14px; }
.phead > a, .phead .ha { margin-left: auto; display: flex; gap: 6px; }
.tabbar, .fab { display: none; }
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 56px; height: 56px; border-radius: 50%; place-items: center; font-weight: 900; color: #fff; background: linear-gradient(135deg, #9775fa, #5f3dc4); box-shadow: 0 14px 30px -10px rgba(112, 72, 232, .8); display: grid; transition: transform .2s; }
.fab:hover { transform: scale(1.06); }

/* 카드 · 단추 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 16.5px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.card h2 small { font-weight: 500; color: var(--mute); font-size: 13px; }
.card h3 { font-size: 14px; margin: 16px 0 8px; color: var(--ink2); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 14px; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(30, 42, 90, .7); }
.btn.primary { background: linear-gradient(135deg, #2c3c7d, #1e2a5a); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line2); }
.btn.red { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.big { padding: 12px 20px; font-size: 15.5px; border-radius: 14px; }
.btn.ai-btn { background: linear-gradient(135deg, #9775fa, #7048e8); border-color: #7048e8; }
.more { margin-left: auto; font-size: 13px; color: var(--blue); font-weight: 700; display: inline-block; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line2); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--ink2); }
.chip.good { background: #ebfbee; border-color: #b2f2bb; color: var(--green); font-weight: 700; }
.empty { text-align: center; padding: 26px 10px; color: var(--mute); }
.empty p { margin: 0 0 10px; }

/* 대시보드 */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 20px 24px; border-radius: 20px; margin-bottom: 16px; color: #fff;
  background: radial-gradient(420px 200px at 100% 0%, rgba(151, 117, 250, .45), transparent 70%), radial-gradient(360px 220px at 0% 100%, rgba(77, 171, 247, .35), transparent 70%), linear-gradient(135deg, #172253, #1e2a5a 60%, #263577); box-shadow: 0 20px 40px -24px rgba(20, 26, 51, .8); }
.hero.slim { grid-template-columns: auto minmax(0, 1fr); }
.hero .ring circle:first-child { stroke: rgba(255, 255, 255, .15); }
.hero .ring-t b { color: #fff; } .hero .ring-t span { color: #c5ccef; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.kpi span { display: block; font-size: 12px; color: #c5ccef; }
.kpi b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kgrid .kpi { background: #fff; border-color: var(--line); box-shadow: var(--shadow); } .kgrid .kpi span { color: var(--mute); } .kgrid .kpi b { color: var(--navy); }
.ring { position: relative; } .ring svg { width: 100%; height: 100%; display: block; }
.ring .rg { stroke-dashoffset: var(--c); transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
.ring.in .rg { stroke-dashoffset: var(--off); }
.ring-t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-t b { font-size: 26px; font-weight: 900; letter-spacing: -.03em; color: var(--navy); }
.ring-t span { font-size: 11.5px; color: var(--mute); }
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gcard { display: block; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: linear-gradient(180deg, #fff, #f8f9ff); transition: transform .15s, box-shadow .15s; }
.gcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gc-h { display: flex; align-items: center; gap: 8px; } .gc-h .ic { font-size: 20px; } .gc-h b { font-size: 15.5px; }
.dd { margin-left: auto; font-weight: 900; font-size: 14px; color: var(--navy); background: #edf2ff; border-radius: 8px; padding: 2px 8px; }
.dd.hot { color: #fff; background: var(--red); }
.gc-lv { font-size: 13px; color: var(--ink2); margin: 6px 0 8px; }
.pbar { position: relative; display: block; height: 9px; border-radius: 999px; background: #edf0f7; overflow: visible; }
.pbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4dabf7, #1c7ed6); transition: width 1s; }
.pbar em { position: absolute; top: -3px; width: 2px; height: 15px; background: var(--navy); border-radius: 2px; }
.gc-f { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); margin-top: 6px; }
.gc-ph { margin-top: 6px; font-size: 12px; color: var(--purple); font-weight: 700; }
.st { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 1px 9px; background: #f1f3f5; color: var(--ink2); }
.st.good { background: #ebfbee; color: var(--green); } .st.warn { background: #fff4e6; color: #d9480f; } .st.bad { background: #ffe3e3; color: var(--red); }
.legend { font-size: 12px; color: var(--mute); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
.legend .lp { background: #dbe4ff; } .legend .la { background: var(--green); }

/* 과제 */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; transition: background .2s; }
.task.done { background: #f4fbf5; border-color: #d3f9d8; }
.task.done .tb b { text-decoration: line-through; color: var(--mute); }
.task.run { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28, 126, 214, .15); }
.tt { font-size: 11.5px; font-weight: 800; border-radius: 8px; padding: 3px 8px; color: #fff; background: var(--mute); white-space: nowrap; }
.tt.blue { background: var(--blue); } .tt.green { background: var(--green); } .tt.orange { background: var(--orange); } .tt.purple { background: var(--purple); } .tt.navy { background: var(--navy); } .tt.red { background: var(--red); }
.tb { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tb b { font-size: 14.5px; letter-spacing: -.01em; }
.tb span { font-size: 12.5px; color: var(--mute); }
.tb small { font-size: 13px; color: var(--ink2); }
.tb em { font-style: normal; font-size: 12px; color: var(--green); font-weight: 700; }
.ta { display: flex; gap: 6px; align-items: center; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line); margin-bottom: 14px; width: max-content; max-width: 100%; overflow-x: auto; }
.seg a, .seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--ink2); white-space: nowrap; }
.seg [aria-selected="true"] { background: var(--navy); color: #fff; }
.dh { font-size: 14px; margin: 16px 0 8px; } .dh small { color: var(--mute); font-weight: 500; }
.coach { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.coach li { padding: 10px 12px; border-radius: 12px; font-size: 14px; background: #f3f0ff; border-left: 4px solid var(--purple); }
.coach li.warn { background: #fff4e6; border-left-color: var(--orange); } .coach li.bad { background: #fff5f5; border-left-color: var(--red); } .coach li.good { background: #ebfbee; border-left-color: var(--green); }
.coach a:hover { text-decoration: underline; }
.aib { display: inline-grid; place-items: center; min-width: 26px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #9775fa, #7048e8); padding: 0 5px; }
.card.ai { background: linear-gradient(180deg, #fbfaff, #fff); border-color: #e5dbff; }

/* 환영 */
.welcome { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.w-k { display: inline-block; font-weight: 900; letter-spacing: .14em; font-size: 12px; color: var(--purple); background: #f3f0ff; padding: 4px 12px; border-radius: 999px; }
.welcome h1 { font-size: clamp(26px, 4.4vw, 40px); letter-spacing: -.04em; line-height: 1.25; margin: 14px 0 10px; }
.welcome > p { color: var(--ink2); font-size: 16px; }
.w-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0 26px; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; font-size: 12.5px; display: grid; gap: 4px; }
.steps b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; color: #fff; background: linear-gradient(135deg, #4dabf7, #7048e8); font-size: 12px; }

/* 폼 */
.form label { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink2); margin-bottom: 10px; }
.form input:not([type=radio]):not([type=checkbox]):not([type=range]), .form select, .form textarea { border: 1px solid var(--line2); border-radius: 11px; padding: 9px 11px; background: #fff; font-weight: 400; color: var(--ink); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid #a5b4fc; border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fa { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.wstep { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.wstep h2 b { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--navy); color: #fff; font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.fpick input, .days input, .seg2 input, .u input, .mode input, .lv5 input { position: absolute; opacity: 0; pointer-events: none; }
.fpick span { display: grid; place-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--line2); border-radius: 12px; font-size: 22px; cursor: pointer; background: #fff; }
.fpick span b { font-size: 13px; }
.fpick input:checked + span, .days input:checked + span, .seg2 input:checked + span, .u input:checked + span, .mode input:checked + span, .lv5 input:checked + span { border-color: var(--navy); background: #edf2ff; box-shadow: inset 0 0 0 1px var(--navy); }
.days, .seg2, .lv5 { display: flex; gap: 6px; flex-wrap: wrap; }
.days span, .seg2 span, .lv5 span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; background: #fff; font-weight: 600; font-size: 13px; }
.dd-out { font-size: 14px; color: var(--ink2); margin: 0 0 10px; }
output { font-weight: 800; color: var(--navy); }
.fe { padding: 10px 12px; border-radius: 12px; font-size: 13.5px; margin: 10px 0 0; }
.fe.ok { background: #ebfbee; color: #2b8a3e; } .fe.no { background: #fff4e6; color: #c2410c; }
.u { border: 0; padding: 0; margin: 0 0 10px; display: flex; gap: 6px; } .u legend { font-size: 13.5px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.u span { display: grid; place-items: center; width: 52px; padding: 6px 0; border: 1px solid var(--line2); border-radius: 12px; font-size: 20px; cursor: pointer; } .u small { font-size: 11px; color: var(--mute); }
.mlist { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; } .mlist label { display: flex; gap: 6px; font-weight: 400; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mode span { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line2); border-radius: 14px; cursor: pointer; height: 100%; } .mode small { color: var(--mute); font-weight: 400; }
.tg { display: flex !important; grid-template-columns: none; gap: 8px; align-items: center; font-weight: 500 !important; }
.sl { margin-bottom: 12px !important; }

/* 로드맵 · 자료 */
.gantt { display: grid; gap: 8px; }
.gr { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.gl2 { font-size: 13.5px; font-weight: 700; } .gl2 small { display: block; font-weight: 500; color: var(--mute); font-size: 11.5px; }
.gt { position: relative; height: 18px; border-radius: 8px; background: #f1f3f9; }
.gt i { position: absolute; top: 0; bottom: 0; border-radius: 8px; opacity: .85; }
.gt em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--red); border-radius: 2px; }
.gx { grid-column: 2; font-size: 12px; color: var(--mute); }
.mats { display: grid; gap: 10px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.mrow.big { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mrow b { font-size: 14px; } .mrow small { display: block; color: var(--mute); }
.mrow .pbar i { background: linear-gradient(90deg, #69db7c, #2f9e44); }
.ma { display: flex; gap: 4px; }
.tblw { overflow-x: auto; } .tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.tbl th { text-align: left; color: var(--mute); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line2); } .tbl td { padding: 8px; border-bottom: 1px solid var(--line); }
.status.good { border-left: 5px solid var(--green); } .status.warn { border-left: 5px solid var(--orange); } .status.bad { border-left: 5px solid var(--red); }
.status ul { margin: 0; padding-left: 18px; font-size: 14px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.opt { text-align: left; border: 1px solid #e5dbff; background: #fbfaff; border-radius: 14px; padding: 12px; display: grid; gap: 3px; transition: transform .15s; }
.opt:hover { transform: translateY(-2px); border-color: var(--purple); }
.opt b { color: var(--purple); } .opt span { font-size: 12.5px; color: var(--ink2); }
.revs { margin: 0; padding-left: 18px; font-size: 13.5px; } .revs small { color: var(--mute); display: block; }
.danger { display: flex; gap: 8px; justify-content: flex-end; margin: 8px 0 20px; }

/* 캘린더 */
.calh { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; } .calh b { font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.cw { text-align: center; font-size: 12px; font-weight: 800; color: var(--mute); } .cw.sun { color: var(--red); } .cw.sat { color: var(--blue); }
.cal .cd { position: relative; min-height: 84px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 7px; text-align: left; display: flex; flex-direction: column; gap: 2px; background: color-mix(in srgb, #4dabf7 calc(var(--h, 0) * 32%), #fff); transition: transform .15s; }
.cal .cd.past { background: color-mix(in srgb, #51cf66 calc(var(--h, 0) * 38%), #fff); }
.cal .cd:hover { transform: translateY(-2px); }
.cal .cd.out { border-style: dashed; background: transparent; min-height: 40px; }
.cal .cd.today { border: 2px solid var(--navy); }
.cal .cd b { font-size: 14px; } .cal .cd.sun b { color: var(--red); } .cal .cd.sat b { color: var(--blue); }
.cal .cd span { font-size: 11.5px; color: var(--ink2); font-weight: 600; }
.cal .dl { font-style: normal; font-size: 10.5px; color: #fff; background: var(--red); border-radius: 5px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { position: absolute; right: 7px; top: 8px; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend .dot { position: static; }
.dot.g { background: var(--green); } .dot.o { background: var(--orange); } .dot.r { background: var(--red); }

/* 채팅 */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msgs { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 86%; }
.msg .mt { padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; }
.msg.assistant .mt { background: #f3f0ff; border-top-left-radius: 4px; }
.msg.user { margin-left: auto; } .msg.user .mt { background: var(--navy); color: #fff; border-top-right-radius: 4px; }
.typing { gap: 4px; padding: 12px; } .typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); animation: blink 1s infinite; } .typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }
.quick { display: flex; gap: 6px; flex-wrap: wrap; } .quick .chip { cursor: pointer; } .quick .chip:hover { border-color: var(--purple); color: var(--purple); }
.ask { display: flex; gap: 8px; } .ask textarea { flex: 1; border: 1px solid var(--line2); border-radius: 14px; padding: 10px 12px; resize: vertical; }
.cfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 복습 · 오답 */
.rtl { display: grid; gap: 6px; } .rd { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.rd span { display: flex; flex-wrap: wrap; gap: 4px; } .rd i { font-style: normal; background: #ebfbee; border-radius: 8px; padding: 2px 8px; } .rd small { color: var(--mute); }
.mis { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mis li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; border-left: 4px solid var(--red); }
.mis li.res { border-left-color: var(--green); opacity: .7; }
.mis li span:not(.ma) { grid-column: 1; font-size: 12.5px; color: var(--mute); } .mis .ma { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

/* 분석 */
.ga { padding: 10px 0; border-bottom: 1px dashed var(--line); } .ga-h { display: flex; justify-content: space-between; margin-bottom: 6px; } .ga small { color: var(--mute); display: block; margin-top: 4px; }
.aicard { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #f3f0ff; } .aicard p { margin: 4px 0 0; font-size: 14px; }

/* 그래프 */
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: #eef1f7; } .chart .ax { font-size: 10.5px; fill: var(--mute); }
.chart .bp { fill: #dbe4ff; } .chart .ba { fill: #a5d8ff; transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.chart .ba.ok { fill: var(--green); } .chart .ba.mid { fill: var(--orange); }
.chart.in .ba { transform: scaleY(1); }
.chart .ln { stroke-dasharray: 2000; stroke-dashoffset: 2000; transition: stroke-dashoffset 1.6s ease; } .chart.in .ln { stroke-dashoffset: 0; }
.radar { max-width: 300px; margin: 0 auto; } .rgrid { fill: none; stroke: #e4e8f2; } .rl { font-size: 11.5px; font-weight: 700; fill: var(--ink2); } .rv { fill: var(--purple); }
.rpoly { fill-opacity: .22; stroke-width: 2; transform-origin: center; transform-box: fill-box; transform: scale(.2); opacity: 0; transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.radar.in .rpoly { transform: scale(1); opacity: 1; }
.donut { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; position: relative; }
.dn { width: 150px; height: 150px; transform: rotate(-40deg) scale(.8); opacity: 0; transition: transform 1s, opacity .6s; } .donut.in .dn { transform: none; opacity: 1; }
.dc { position: absolute; left: 0; top: 0; width: 150px; height: 150px; display: grid; place-content: center; text-align: center; } .dc b { font-size: 18px; font-weight: 900; } .dc span { font-size: 11px; color: var(--mute); }
.lg { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; } .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; } .lg b { float: right; }
.hb { display: grid; gap: 6px; } .hbr { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.hbr .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hbr .t { height: 10px; border-radius: 999px; background: #edf0f7; overflow: hidden; } .hbr .t i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.hb.in .hbr .t i { width: var(--w); } .hbr .v { font-size: 12px; color: var(--mute); white-space: nowrap; }
.gt .bar-in { transform: scaleX(0); transform-origin: left; transition: transform .9s cubic-bezier(.2, .8, .2, 1); } .gt .bar-in.in { transform: scaleX(1); }

/* 문제 */
.q { font-size: 18px; line-height: 1.5; } .qopts { display: grid; gap: 8px; }
.qo { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; font-size: 14.5px; transition: background .2s; }
.qo:hover { border-color: var(--navy); } .qo.ok { background: #ebfbee; border-color: var(--green); } .qo.no { background: #fff5f5; border-color: var(--red); }
.qrev { padding-left: 18px; display: grid; gap: 8px; } .qrev li { font-size: 14px; } .qrev li span { display: block; color: var(--green); font-size: 13px; } .qrev li.no b { color: var(--red); } .qrev small { color: var(--mute); display: block; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 4px solid #e5dbff; border-top-color: var(--purple); animation: rot 1s linear infinite; margin: 20px auto; } @keyframes rot { to { transform: rotate(360deg); } }

/* 창 · 알림 */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(14, 18, 40, .55); backdrop-filter: blur(4px); }
.modal.on { display: flex; }
.mbox { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 22px 22px 18px; box-shadow: 0 30px 80px -30px rgba(14, 18, 40, .8); animation: pop .2s ease; }
.mbox.wide { width: min(760px, 100%); }
.mbox h2 { margin: 0 32px 6px 0; font-size: 19px; }
.mx { position: absolute; right: 12px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f1f3f9; font-size: 20px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 90; display: grid; gap: 6px; width: min(460px, calc(100% - 24px)); pointer-events: none; }
.toast > div { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 12px 30px -12px rgba(14, 18, 40, .7); animation: pop .2s ease; }

@media (max-width: 1024px) {
  .side { transform: translateX(-100%); transition: transform .25s; width: 280px; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(14, 18, 40, .45); }
  .mainw { margin-left: 0; }
  .top { padding: 8px 14px; } .top .brand.sm { display: flex; padding: 0; color: var(--navy); font-size: 14px; } .menu-btn { display: block; border: 0; background: transparent; font-size: 22px; }
  .brand.sm .mk { width: 28px; height: 28px; font-size: 14px; }
  main { padding: 16px 14px 110px; }
  .sample-bar { margin: 8px 14px 0; }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: grid; place-items: center; gap: 1px; border: 0; background: transparent; font-size: 19px; color: var(--mute); }
  .tabbar small { font-size: 10.5px; font-weight: 700; } .tabbar .on { color: var(--navy); }
  .fab { bottom: calc(74px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } .hero .kpis { width: 100%; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .phead { flex-wrap: wrap; } .phead h1 { font-size: 22px; } .phead > a, .phead .ha { margin-left: 0; }
  .row2, .row3, .modes { grid-template-columns: minmax(0, 1fr); }
  .task { grid-template-columns: auto minmax(0, 1fr); } .ta { grid-column: 1 / -1; justify-content: flex-end; }
  .gr { grid-template-columns: minmax(0, 1fr); } .gx { grid-column: 1; }
  .mrow, .mrow.big { grid-template-columns: minmax(0, 1fr); }
  .cal { gap: 3px; } .cal .cd { min-height: 58px; padding: 4px; border-radius: 9px; } .cal .cd span { font-size: 10px; } .cal .dl { display: none; }
  .donut { grid-template-columns: minmax(0, 1fr); justify-items: center; } .dc { left: 50%; transform: translateX(-50%); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { .hero .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi b { font-size: 19px; } }
