/* 진성 시간표 — 스타일 */
:root {
  --ink: #15233b; --ink2: #47546b; --mute: #7a869b; --line: #e3e7ef; --line2: #eef1f6;
  --bg: #f4f6fa; --panel: #ffffff; --soft: #f8f9fc;
  --brand: #0f766e; --brand2: #0b5f59; --brand-soft: #e3f4f1;
  --accent: #f2a03d; --accent-soft: #fff4e5;
  --err: #d63b3b; --err-soft: #fdecec; --warn: #b7791f; --warn-soft: #fff6e0; --ok: #1f8a4c; --ok-soft: #e7f6ec;
  --info: #2f6fed; --info-soft: #e8f0fe;
  --g1: #3b82f6; --g2: #8b5cf6; --g3: #f08a24;
  --lab: #0f766e;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(21, 35, 59, .06), 0 4px 16px rgba(21, 35, 59, .06);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .7em; }
.lead { color: var(--ink2); font-size: 15px; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--line2); padding: 1px 6px; border-radius: 6px; }

/* ---------- 레이아웃 ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: #101c30; color: #c9d3e3; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 12px 24px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #14b8a6, #0f766e 60%, #f2a03d); display: grid; place-items: center; font-weight: 900; color: #fff; font-size: 15px; }
.logo b { font-size: 17px; letter-spacing: -.02em; }
.logo small { display: block; font-size: 11px; color: #8fa0bb; font-weight: 500; }
.nav-sec { margin: 14px 0 4px; padding: 0 10px; font-size: 11px; color: #7f8fa9; font-weight: 700; letter-spacing: .06em; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: #c9d3e3; text-decoration: none; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(20, 184, 166, .18); color: #fff; font-weight: 650; }
.nav a .n { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .1); border-radius: 99px; padding: 0 7px; }
.nav a .n.err { background: var(--err); color: #fff; }
.nav .sub a { padding-left: 26px; font-size: 13.5px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(244, 246, 250, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.top .crumb { font-size: 13px; color: var(--mute); }
.top .grow { flex: 1; }
.menu-btn { display: none; }
.content { padding: 24px 28px 40px; flex: 1; max-width: 1400px; width: 100%; }
.foot { padding: 18px 28px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.foot .by { font-weight: 800; color: var(--ink); letter-spacing: .08em; }

/* 단일 화면(교사용·학생용) */
.solo { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.solo-top { display: flex; align-items: center; gap: 10px; padding: 14px 0; }
.solo-top .logo { padding: 0; color: var(--ink); }
.solo-top .logo small { color: var(--mute); }

/* ---------- 공통 요소 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .grow { flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-head p { margin: 4px 0 0; color: var(--ink2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 10px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--soft); border-color: #cfd6e3; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #2b1a00; }
.btn.danger { color: var(--err); border-color: #f2c4c4; }
.btn.danger:hover { background: var(--err-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 16px; border-radius: 11px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 16px; width: 32px; height: 32px; border-radius: 8px; color: var(--ink2); }
.icon-btn:hover { background: var(--line2); }
:focus-visible { outline: 3px solid rgba(15, 118, 110, .45); outline-offset: 2px; }

input[type=text], input[type=number], input[type=password], input[type=date], input[type=time], input[type=search], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid #d5dbe6; border-radius: 8px; height: 34px; padding: 0 10px; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; width: 100%; min-height: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); vertical-align: middle; }
label.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink2); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 99px; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.lab { background: var(--brand-soft); color: var(--brand); }
.badge.g1 { background: #e6efff; color: #1d4ed8; } .badge.g2 { background: #f1eaff; color: #6d28d9; } .badge.g3 { background: #fff1e2; color: #b45309; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--mute); padding: 9px 14px; cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 표 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line2); padding: 6px 8px; text-align: left; vertical-align: middle; }
.tbl th { background: var(--soft); font-size: 12.5px; color: var(--ink2); font-weight: 700; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl tr:hover td { background: #fbfcfe; }
.tbl td input[type=text], .tbl td input[type=number], .tbl td select { width: 100%; height: 30px; border-color: transparent; background: transparent; padding: 0 6px; }
.tbl td input:hover, .tbl td select:hover { border-color: #d5dbe6; background: #fff; }
.tbl td input:focus, .tbl td select:focus { border-color: var(--brand); background: #fff; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl .w60 { width: 60px; } .tbl .w80 { width: 80px; } .tbl .w100 { width: 100px; } .tbl .w140 { width: 140px; }
.tbl tr.bad td { background: var(--err-soft); }
.tbl tr.warn td { background: #fffaf0; }

/* 통계 카드 */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--mute); font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat .v small { font-size: 13px; color: var(--mute); font-weight: 600; margin-left: 2px; }

/* 알림 박스 */
.note { border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; background: var(--info-soft); color: #1e3a8a; margin-bottom: 12px; }
.note.warn { background: var(--warn-soft); color: #7a4b00; }
.note.err { background: var(--err-soft); color: #8b1c1c; }
.note.ok { background: var(--ok-soft); color: #14532d; }
.note b { font-weight: 750; }

/* 문제 목록 */
.issues { list-style: none; margin: 0; padding: 0; }
.issues li { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line2); font-size: 14px; align-items: flex-start; }
.issues li .badge { margin-top: 2px; }
.issues li .grow { flex: 1; }

/* 단계 카드 (홈) */
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.step:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.step .no { font-size: 12px; font-weight: 800; color: var(--brand); }
.step b { font-size: 15.5px; }
.step .st { font-size: 12.5px; color: var(--mute); }
.hero { background: linear-gradient(120deg, #0f2a3f 0%, #0f766e 70%, #2aa597 100%); color: #fff; border-radius: 16px; padding: 26px 28px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 160, 61, .55), transparent 65%); }
.hero h1 { color: #fff; font-size: 28px; }
.hero p { color: #d7efe9; max-width: 640px; }
.hero .btn { position: relative; z-index: 1; }

/* ---------- 시간표 그리드 ---------- */
.ttg-wrap { overflow-x: auto; }
table.ttg { border-collapse: separate; border-spacing: 3px; width: 100%; table-layout: fixed; min-width: 560px; }
.ttg th { font-size: 12.5px; color: var(--ink2); font-weight: 700; padding: 4px; text-align: center; }
.ttg th.pcol { width: 54px; }
.ttg th.pcol small { display: block; font-weight: 500; color: var(--mute); font-size: 10.5px; }
.ttg td { height: 58px; border-radius: 8px; background: #fff; border: 1px solid var(--line); padding: 4px 6px; vertical-align: top; font-size: 12.5px; line-height: 1.3; position: relative; overflow: hidden; }
.ttg td.off { background: repeating-linear-gradient(45deg, #f1f3f7, #f1f3f7 6px, #e9ecf2 6px, #e9ecf2 12px); border-color: transparent; }
.ttg td.empty { background: #fbfcfd; border-style: dashed; }
.ttg td.lunch-after { border-bottom: 3px solid #f6d8a8; }
.ttg .cell { display: flex; flex-direction: column; gap: 1px; height: 100%; }
.ttg .s { font-weight: 750; font-size: 13.5px; color: var(--ink); }
.ttg .t { color: var(--ink2); }
.ttg .rm { margin-top: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--lab); }
.ttg .rm::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--lab); display: inline-block; }
.ttg td.has { border-left: 4px solid var(--c, #94a3b8); }
.ttg td.prac { background: linear-gradient(180deg, #f0faf8, #ffffff); border-color: #bfe6df; border-left-color: var(--lab); }
.ttg td.simul { background: #f7f4ff; }
.ttg td.bulk { background: #fff9ef; }
.ttg td.fixed::after { content: '고정'; position: absolute; right: 4px; top: 3px; font-size: 10px; font-weight: 800; color: #9a6b00; background: #ffeec7; padding: 0 4px; border-radius: 4px; }
.ttg td.chg { box-shadow: inset 0 0 0 2px var(--accent); }
.ttg td.chg::before { content: attr(data-chg); position: absolute; right: 4px; bottom: 3px; font-size: 10px; font-weight: 800; color: #8a4b00; background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.ttg td.conf { border-color: var(--err); background: var(--err-soft); }
.ttg td.conf::before { content: '!'; position: absolute; right: 5px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--err); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.ttg td.now { box-shadow: 0 0 0 2px var(--info); }
.ttg td.sel { box-shadow: 0 0 0 3px var(--ink); z-index: 2; }
.ttg td.click { cursor: pointer; }
.ttg td.o-move { background: #e8f7ee !important; border-color: #7cc89a !important; }
.ttg td.o-swap { background: #e6efff !important; border-color: #7aa2f0 !important; }
.ttg td.o-no { opacity: .55; }
.ttg td.o-move::after, .ttg td.o-swap::after { position: absolute; right: 4px; bottom: 3px; font-size: 10px; font-weight: 800; padding: 0 4px; border-radius: 4px; }
.ttg td.o-move::after { content: '이동'; background: #c9ecd6; color: #1b6b3c; }
.ttg td.o-swap::after { content: '교환'; background: #cfdcfb; color: #1d47a8; }
.ttg.compact td { height: 44px; font-size: 11.5px; }
.ttg.compact .s { font-size: 12px; }
.ttg.big td { height: 70px; font-size: 14px; }
.ttg.big .s { font-size: 16px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); margin: 8px 0; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }

/* 편집기 */
.editor { display: grid; grid-template-columns: 190px minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.editor > * { min-width: 0; }
.picker { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; max-height: calc(100vh - 160px); overflow-y: auto; position: sticky; top: 74px; }
.picker .lst button { display: flex; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); gap: 6px; align-items: center; }
.picker .lst button:hover { background: var(--line2); }
.picker .lst button.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.picker .lst button .badge { margin-left: auto; }
.sidepanel { position: sticky; top: 74px; }
.stepper { display: none; gap: 6px; margin-bottom: 12px; }
.stepper div { flex: 1; text-align: center; font-size: 12.5px; font-weight: 700; padding: 8px 4px; border-radius: 8px; background: var(--line2); color: var(--mute); }
.stepper div.on { background: var(--brand); color: #fff; }
.stepper div.done { background: var(--brand-soft); color: var(--brand); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); padding: 18px 18px 24px; z-index: 60; }

/* 진행 피드 */
.feed { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--ink2); }
.feed li .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; background: var(--line2); color: var(--mute); flex: none; }
.feed li.done .ic { background: var(--ok-soft); color: var(--ok); }
.feed li.run .ic { background: var(--brand); color: #fff; animation: pulse 1.2s infinite; }
.feed li.run { color: var(--ink); font-weight: 650; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(15, 118, 110, .15); } }
.bar { height: 10px; background: var(--line2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2bb3a3); border-radius: 99px; transition: width .25s; }
.bar.warn > i { background: var(--accent); }
.bar.err > i { background: var(--err); }

/* 품질 */
.gradebox { display: flex; align-items: center; gap: 18px; }
.grade { width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; font-size: 46px; font-weight: 900; color: #fff; background: var(--brand); flex: none; }
.grade.B { background: #2f6fed; } .grade.C { background: #b7791f; } .grade.D, .grade.F { background: var(--err); }

/* 모달·토스트 */
.modal-wrap { position: fixed; inset: 0; background: rgba(16, 28, 48, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; margin: 0; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
#toast-box { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #15233b; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: opacity .4s, transform .4s; }
.toast.err { background: var(--err); } .toast.ok { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* 빈 상태 */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink2); }
.empty-state .big { font-size: 40px; margin-bottom: 6px; }
.empty-state h3 { margin-bottom: 6px; }

/* 학생·교사 모바일 */
.mob-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.mob-tabs button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 650; color: var(--ink2); cursor: pointer; }
.mob-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.daycards { display: none; }
.daycard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.daycard h4 { margin: 0 0 6px; font-size: 14px; }
.daycard .li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line2); font-size: 14px; align-items: center; }
.daycard .li:first-of-type { border-top: 0; }
.daycard .li .p { width: 38px; font-weight: 800; color: var(--brand); flex: none; }
.daycard .li.now { background: var(--info-soft); border-radius: 8px; padding-left: 6px; }
.wiz { counter-reset: w; }
.wiz-step { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: #fff; }
.wiz-step h4 { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.wiz-step h4::before { counter-increment: w; content: counter(w); width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; }
.optlist { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fff; text-align: left; font: inherit; width: 100%; }
.opt:hover { border-color: var(--brand); }
.opt.on { border-color: var(--brand); background: var(--brand-soft); }
.opt .grow { flex: 1; }

/* AI 안내 */
.flow { counter-reset: f; list-style: none; padding: 0; margin: 0; }
.flow li { position: relative; padding: 0 0 14px 40px; }
.flow li::before { counter-increment: f; content: counter(f); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.flow li::after { content: ''; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.flow li:last-child::after { display: none; }
.prompt { background: #0f1b2e; color: #dbe7f5; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin: 6px 0; white-space: pre-wrap; }

/* ---------- 반응형 ---------- */
@media (min-width: 861px) {
  .app { background: linear-gradient(90deg, #101c30 248px, transparent 248px); }
}
@media (max-width: 1180px) {
  .editor { grid-template-columns: 190px minmax(0, 1fr); }
  .editor .sidepanel { grid-column: 1 / -1; position: static; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 14px; }
  .top .crumb { display: none; }
  .top > .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .top .badge.info { display: none; }
  .content { padding: 16px 14px 32px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .picker { position: static; max-height: none; }
  .picker .lst { display: flex; gap: 4px; overflow-x: auto; }
  .picker .lst button { width: auto; flex: none; border: 1px solid var(--line); }
  .stepper { display: flex; }
  h1 { font-size: 22px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 22px; }
}
@media (max-width: 600px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .daycards { display: block; }
  table.ttg { min-width: 460px; border-spacing: 2px; }
  .ttg td { height: 50px; font-size: 11.5px; padding: 3px 4px; }
  .ttg .s { font-size: 12px; }
  .ttg-wrap.m-hide { display: none; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .stat .v { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .side, .top, .foot .np, .no-print, .picker, .sidepanel, .stepper { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; page-break-inside: avoid; }
  .ttg td { height: 50px; }
  .print-page { page-break-after: always; }
}


/* ---------- 디자인 패스 v2 (2026-11-12, Muse) ---------- */
:root {
  --r: 14px;
  --shadow: 0 1px 2px rgba(21, 35, 59, .05), 0 8px 24px rgba(21, 35, 59, .07);
}
::selection { background: rgba(20, 184, 166, .28); }
body { background: radial-gradient(1100px 480px at 85% -120px, rgba(15, 118, 110, .07), transparent 60%), var(--bg); }
.side { background: linear-gradient(180deg, #0c1730 0%, #101c30 55%, #0a2622 130%); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }
.logo-mark { box-shadow: 0 4px 14px rgba(20, 184, 166, .45); }
.nav a { transition: background .15s, color .15s; }
.nav a.on { background: linear-gradient(90deg, rgba(20, 184, 166, .28), rgba(20, 184, 166, .10)); box-shadow: inset 3px 0 0 #2dd4bf; }
.top { box-shadow: 0 1px 0 rgba(21, 35, 59, .02), 0 6px 18px rgba(21, 35, 59, .04); }
.btn.primary { background: linear-gradient(135deg, #0d9488, var(--brand)); border-color: transparent; box-shadow: 0 4px 12px rgba(15, 118, 110, .28); }
.btn.primary:hover { background: linear-gradient(135deg, #0f766e, var(--brand2)); }
.btn.accent { box-shadow: 0 4px 12px rgba(242, 160, 61, .35); }
.card { transition: box-shadow .2s, border-color .2s; }
.step { transition: border-color .15s, box-shadow .15s, transform .15s; }
.step:hover { transform: translateY(-2px); }
.hero { background: linear-gradient(115deg, #0a1f33 0%, #0b4f4a 55%, #0f766e 85%, #15957f 100%); box-shadow: 0 16px 36px rgba(11, 79, 74, .28); }
.hero::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 56px), repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 56px); pointer-events: none; }
.hero h1 { font-size: 30px; letter-spacing: -.02em; position: relative; z-index: 1; }
.hero p { position: relative; z-index: 1; }
.stat { background: linear-gradient(180deg, #ffffff, #fbfcfe); }
.stat .v { color: var(--ink); }
table.ttg { border-spacing: 4px; }
.ttg td { border-radius: 10px; transition: box-shadow .15s, transform .15s; }
.ttg td.has { border-left-width: 5px; }
.ttg td.click:hover { box-shadow: 0 4px 14px rgba(21, 35, 59, .14); }
.grade { background: linear-gradient(140deg, #0d9488, var(--brand2)); box-shadow: 0 10px 24px rgba(15, 118, 110, .3); }
.grade.B { background: linear-gradient(140deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 24px rgba(47, 111, 237, .3); }
.chip { transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.tabs button { transition: color .15s; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=time], input[type=search], select { transition: border-color .15s, box-shadow .15s; }
.modal { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.daycard { box-shadow: var(--shadow); }
.mob-tabs button.on { background: linear-gradient(135deg, #1c2b47, var(--ink)); }

/* ===== 회원 시스템 (로그인 게이트·관리자모드) ===== */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.gate-inner { width: 100%; max-width: 420px; }
.gate-logo { justify-content: center; margin-bottom: 18px; color: var(--ink); }
.gate-logo small { color: var(--mute); }
.gate-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 12px 32px rgba(21,35,59,.08); }
.gate-card h2 { margin: 0 0 8px; font-size: 19px; }
.gate-loading { text-align: center; color: var(--mute); margin: 8px 0; }
.gate-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--line2); }
.gate-tabs button { flex: 1; padding: 10px; background: none; border: none; font: inherit; font-weight: 700; color: var(--mute); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.gate-tabs button.on { color: var(--brand, #0f766e); border-bottom-color: var(--brand, #0f766e); }
.gate-form { display: grid; gap: 12px; }
.gate-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 650; color: var(--ink2); }
.gate-form input { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; width: 100%; box-sizing: border-box; }
.gate-form input:focus { outline: 2px solid var(--brand, #0f766e); outline-offset: 0; border-color: transparent; }
.gate-msg { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin: 0 0 12px; }
.gate-msg.err { background: var(--err-soft); color: var(--err); }
.gate-msg.ok { background: var(--ok-soft); color: var(--ok); }
.gate-note { font-size: 12.5px; color: var(--mute); margin: 2px 0 0; line-height: 1.5; }
.gate-foot { text-align: center; font-size: 12.5px; color: var(--mute); margin-top: 14px; line-height: 1.5; }
.btn.block { width: 100%; justify-content: center; padding: 12px; }
.gate-admin-sep { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--mute); font-size: 12px; }
.gate-admin-sep::before, .gate-admin-sep::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.btn.admin-mode-btn { background: #15233b; border-color: #15233b; color: #fff; font-weight: 700; }
.btn.admin-mode-btn:hover { background: #0f766e; border-color: #0f766e; color: #fff; }
.gate-admin-note { text-align: center; }
.gate-adminbox { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.gate-adminbox[hidden] { display: none; }
.gate-adminbox input[readonly] { background: var(--soft, #f3f5f9); color: var(--mute); }
.gate-link { background: none; border: none; color: var(--mute); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 2px; justify-self: center; }
.member-badge { font-size: 13px; font-weight: 650; color: var(--ink2); white-space: nowrap; }
.nav a.admin-mode-link { background: #15233b; color: #fff; font-weight: 700; margin-top: 4px; }
.nav a.admin-mode-link:hover, .nav a.admin-mode-link.on { background: #0f766e; color: #fff; }
td.end { text-align: right; }
.solo-acct { display: flex; justify-content: flex-end; align-items: center; gap: 10px; max-width: 1080px; margin: 0 auto; padding: 12px 16px 0; }

/* 회원 화면 중앙 정렬 (보노 지정) */
.gate-card h2, .gate-card > p { text-align: center; }
.gate-form label { text-align: center; }
.gate-form input { text-align: center; }
.gate-form .btn.block { text-align: center; }
#adm-list .tbl th, #adm-list .tbl td { text-align: center; }
#adm-list .tbl td.end { text-align: center; }

/* 로그인/회원가입 팝업 (홈 공개 구조) */
.auth-overlay { position: fixed; inset: 0; background: rgba(21,35,59,.45); z-index: 200; overflow-y: auto; }
.auth-overlay .gate { min-height: 100%; }
.auth-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 17px; cursor: pointer; color: var(--mute); padding: 4px 8px; }
.auth-overlay .gate-card { position: relative; }
