:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface2: #eef1f5; --text: #15171c; --muted: #646b78; --line: #e1e5eb;
  --brand: #0f5fd6; --brand-2: #1573f8; --brand-ink: #ffffff; --accent: #d4ad3a;
  --present: #23945a; --late: #c98207; --absent: #d3433b; --excused: #3a78d4; --none: #b5aec0;
  --radius: 14px; --shadow: 0 1px 2px rgba(30, 20, 50, .06), 0 4px 14px rgba(30, 20, 50, .05);
  --nav-h: 64px; --top-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13; --surface: #17191f; --surface2: #20232b; --text: #f1f3f6; --muted: #9aa1ad; --line: #2c303a;
    --brand: #3d8bff; --brand-2: #66a3ff; --brand-ink: #ffffff; --accent: #e3c05a;
    --present: #3cba78; --late: #e6a23a; --absent: #ef6a62; --excused: #6aa2f0; --none: #5d5669;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13; --surface: #17191f; --surface2: #20232b; --text: #f1f3f6; --muted: #9aa1ad; --line: #2c303a;
  --brand: #3d8bff; --brand-2: #66a3ff; --accent: #e3c05a; --present: #3cba78; --late: #e6a23a; --absent: #ef6a62; --excused: #6aa2f0; --none: #5d5669; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
body.noscroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: 22px; line-height: 1.3; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 17px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.ok { color: var(--present); font-weight: 600; }
.warn { color: var(--absent); font-weight: 600; }
.ic { flex: none; }

/* ---------- 레이아웃 ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.me { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px; border-radius: 999px; }
.me .role { font-size: 12px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--brand-2); font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 11px; background: var(--brand); color: var(--brand-ink); }
.avatar.lg { width: 56px; height: 56px; font-size: 16px; }
.main { padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.page { max-width: 1120px; margin: 0 auto; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); }
.nav a.on { color: var(--brand-2); font-weight: 700; }
.nav a span { white-space: nowrap; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 0 24px; }
  .nav { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 16px 12px; gap: 4px; background: var(--surface); }
  .nav a { flex: none; height: 44px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
  .nav a.on { background: var(--surface2); }
  .main { padding: 28px 32px 48px; }
  h1 { font-size: 26px; }
}

/* ---------- 공통 컴포넌트 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; gap: 8px 24px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; gap: 8px; }
.hello { margin: 4px 0 16px; }
.hello p { margin: 0 0 2px; font-size: 13px; }
.link { color: var(--brand-2); font-size: 13px; font-weight: 600; }
.empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 14px; margin-bottom: 10px; padding: 6px 0; }
.meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface2); color: var(--muted); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--absent); }
.btn.block { width: 100%; min-height: 48px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.xs { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--surface2); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }

.seg-ctl { display: inline-flex; background: var(--surface2); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg-ctl button { border: 0; background: none; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.seg-ctl button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { --c: var(--brand-2); flex: none; border: 1px solid var(--line); background: var(--surface); min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.pill { --c: var(--brand-2); display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.tag-extra { background: color-mix(in srgb, var(--accent) 22%, transparent); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.tag-cancel { background: color-mix(in srgb, var(--absent) 14%, transparent); color: var(--absent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 4px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.tile-l { font-size: 12px; color: var(--muted); }
.tiles.t4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tiles.t5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.t5 .tile:first-child { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; }
.tiles.t5 .tile:not(:first-child) { text-align: center; padding: 10px 4px; }
@media (min-width: 700px) { .tiles.t5 { grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); } .tiles.t5 .tile:first-child { grid-column: auto; display: block; } }
.tile-v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.tile-s { font-size: 12px; color: var(--muted); }
.tile.present .tile-v { color: var(--present); } .tile.late .tile-v { color: var(--late); } .tile.absent .tile-v { color: var(--absent); } .tile.excused .tile-v { color: var(--excused); }

.progress { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; flex: 1; min-width: 60px; }
.progress span { display: block; height: 100%; background: var(--present); border-radius: 99px; }

/* 상태 */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st-present { --s: var(--present); } .st-late { --s: var(--late); } .st-absent { --s: var(--absent); } .st-excused { --s: var(--excused); } .st-none { --s: var(--none); } .st-future { --s: var(--line); }
.st { color: var(--s); background: color-mix(in srgb, var(--s) 14%, transparent); }
.sym { color: var(--s); margin-right: 3px; }

/* 수업 카드 */
.sess { --c: var(--brand-2); display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 10px 12px; }
.sess.canceled { opacity: .6; }
.sess.canceled .sess-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.sess-time { display: flex; flex-direction: column; align-items: center; min-width: 46px; font-size: 13px; }
.sess-time b { font-size: 15px; }
.sess-time span { color: var(--muted); font-size: 12px; }
.sess-main { flex: 1; min-width: 0; }
.sess-title { font-weight: 700; }
.sess-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.day-group { margin-bottom: 16px; }
.day-h { display: flex; align-items: baseline; gap: 8px; font-weight: 700; margin: 0 0 8px; }
.day-h .muted { font-size: 12px; font-weight: 500; }

.next-card { --c: var(--brand-2); display: block; color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 12px; background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--c) 70%, var(--brand)) 100%); box-shadow: var(--shadow); }
.next-card .eyebrow { font-size: 12px; opacity: .85; font-weight: 600; }
.next-card .next-title { font-size: 20px; font-weight: 800; margin: 2px 0 6px; }
.next-card .meta { color: rgba(255, 255, 255, .85); }

.class-row { --c: var(--brand-2); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 10px 12px; }
.class-row-name { font-weight: 700; }
.class-grid, .hw-grid, .log-grid, .fb-grid { display: grid; gap: 10px; }
@media (min-width: 700px) { .class-grid, .hw-grid, .log-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .class-grid, .hw-grid { grid-template-columns: repeat(3, 1fr); } .fb-grid { grid-template-columns: 1fr 1fr; } }
.class-card { --c: var(--brand-2); display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.class-card-h { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
.names { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.names span { font-size: 12px; padding: 2px 8px; background: var(--surface2); border-radius: 6px; }
.class-hero { --c: var(--brand-2); display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--radius); padding: 16px; }
.class-hero h1 { margin: 4px 0; }
.class-hero p { margin: 6px 0; }

.student-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.rate { text-align: right; font-weight: 800; font-size: 16px; color: var(--present); }
.rate small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.rate.low { color: var(--absent); }
.slot { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 4px 4px 14px; flex-wrap: wrap; }
.rec { --c: var(--brand-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 10px 12px; }
.rec-d { font-weight: 600; font-size: 14px; }
.today-card { display: flex; flex-direction: column; gap: 0; }
.today-card .sess { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.today-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 8px 12px; }

/* 숙제 */
.hw-item { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.hw-item.done .hw-title { color: var(--muted); text-decoration: line-through; }
.checkbox { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); background: var(--surface); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 16px; }
.checkbox.on { background: var(--present); border-color: var(--present); }
.hw-body { flex: 1; min-width: 0; }
.hw-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hw-title { font-weight: 700; margin-top: 4px; }
.hw-desc { color: var(--muted); font-size: 14px; margin-top: 2px; }
.hw-dates { font-size: 12px; color: var(--muted); margin-top: 4px; }
.due { font-size: 12px; font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.due.over { color: var(--absent); }
.hw-card { --c: var(--brand-2); display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.fb { margin-top: 10px; padding: 10px 12px; background: var(--surface2); border-radius: 10px; font-size: 14px; }
.fb-by { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.fb-by b { color: var(--text); }
.fb-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: 14px; }
.fb-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.fb-row-h { display: flex; align-items: center; gap: 10px; }
.fb-form { display: flex; gap: 8px; margin-top: 8px; align-items: flex-end; }
.fb-form textarea { flex: 1; min-height: 40px; resize: vertical; }

/* 일지 */
.log { --c: var(--brand-2); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 12px 14px; }
.log-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.log-d { font-size: 12px; color: var(--muted); }
.log-c { font-weight: 700; }
.log-b { font-size: 14px; }
.log-next { font-size: 13px; margin-top: 8px; padding: 8px 10px; background: var(--surface2); border-radius: 8px; }
.log-next b { color: var(--brand-2); margin-right: 4px; }
.log-by { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: right; }

/* 달력 */
.cal-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .cal-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } .cal-layout.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.month-nav strong { font-size: 16px; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.sun { color: var(--absent) !important; } .sat { color: var(--excused) !important; }
.cal-day { min-height: 54px; border: 1px solid transparent; background: var(--surface2); border-radius: 10px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.cal-day .n { font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--text); }
.cal-day.sun .n { color: var(--absent); } .cal-day.sat .n { color: var(--excused); }
.cal-day.today .n { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 6px; }
.cal-day.sel { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 12%, var(--surface)); }
.cal-c { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: 100%; }
.dot { --c: var(--brand-2); display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.dot.x { background: transparent; border: 1.5px solid var(--c); }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--s); }
.bar { --c: var(--brand-2); display: block; width: 80%; height: 4px; border-radius: 3px; background: var(--c); }
.bar.future { opacity: .35; }
.abs { font-style: normal; font-size: 10px; font-weight: 800; color: var(--absent); line-height: 1; }
.unc { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--late); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
@media (min-width: 900px) { .cal-day { min-height: 72px; } }

/* 출결 체크 */
.roster { --c: var(--brand-2); padding: 0; overflow: hidden; }
.roster > .sess { border: 0; border-left: 4px solid var(--c); border-radius: 0; }
.roster-tools { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.roster-list { border-top: 1px solid var(--line); }
.roster-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.roster-row:last-child { border-bottom: 0; }
.roster-row .nm { font-weight: 600; min-width: 52px; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 4px; }
.seg-b { min-height: 36px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-b.on { background: var(--s); border-color: var(--s); color: #fff; }

/* 출결표 */
.table-wrap { overflow-x: auto; margin: 10px -14px -14px; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.att-table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.att-table th, .att-table td { padding: 4px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.att-table thead th { font-weight: 600; color: var(--muted); font-size: 12px; }
.att-table thead th.today { color: var(--brand-2); }
.att-table .sticky { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 6px 12px 6px 14px; z-index: 1; min-width: 72px; border-right: 1px solid var(--line); }
.th-btn { border: 0; background: none; color: inherit; font-weight: inherit; display: flex; flex-direction: column; align-items: center; padding: 4px 2px; min-width: 40px; }
.th-btn small { font-size: 11px; }
.cell { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--s); font-weight: 800; font-size: 15px; }
.cell.st-present, .cell.st-late, .cell.st-absent, .cell.st-excused { background: color-mix(in srgb, var(--s) 15%, var(--surface)); border-color: color-mix(in srgb, var(--s) 40%, transparent); }
.cell.st-none { color: var(--muted); }
.cell:disabled { background: var(--surface2); border-style: dashed; cursor: default; }
.rate-c { font-weight: 800; color: var(--present); padding: 0 12px !important; }
.rate-c.low { color: var(--absent); }
.att-table tfoot td, .att-table tfoot th { color: var(--muted); border-bottom: 0; }

/* 시트(모달) */
#sheet { display: none; }
#sheet.open { display: block; position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 8, 25, .45); animation: fade .15s ease; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease; }
.sheet-h { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; background: var(--surface); padding: 12px 0 8px; z-index: 1; }
@media (min-width: 700px) { .sheet { left: 50%; top: 50%; bottom: auto; width: min(520px, 92vw); transform: translate(-50%, -50%); border-radius: 20px; padding-bottom: 20px; animation: fade .15s ease; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-ctx { --c: var(--brand-2); display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-left: 4px solid var(--c); background: var(--surface2); border-radius: 10px; margin-bottom: 12px; }
.me-card { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.install { background: var(--surface2); border-radius: 12px; padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.install ul { margin: 0; padding-left: 18px; }
.install li.hl { font-weight: 600; }

/* 폼 */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; color: var(--text); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand-2) 50%, transparent); outline-offset: 0; border-color: var(--brand-2); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.form .check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; color: var(--text); font-weight: 500; border-radius: 8px; }
.form .check:hover { background: var(--surface2); }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--brand); }
.colors > div, .colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors legend { width: 100%; }
.color-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-opt span { display: block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.color-opt input:checked + span { border-color: var(--text); }

/* 로그인 */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 55%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 20px; box-shadow: var(--shadow); text-align: center; }
.login-card .form { text-align: left; margin-top: 18px; }
.login-logo { display: flex; justify-content: center; margin: -28px -20px 14px; padding: 26px 20px 22px; background: #0e0f13; border-radius: 22px 22px 0 0; }
.login-logo img { width: min(240px, 70%); height: auto; }
.brand-mark { border-radius: 9px; flex: none; }
.login-card p { margin: 4px 0 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 20px 0 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); min-height: 64px; }
.demo-btn b { font-size: 15px; color: var(--brand-2); }
.demo-btn span { font-size: 12px; color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { #toast { bottom: 32px; } }

/* ---------- 알림·레슨비 ---------- */
.top-r { display: flex; align-items: center; gap: 2px; }
.bell { position: relative; color: var(--text); }
.bdg { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--absent); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.nav a span { font-size: 10.5px; }
@media (min-width: 960px) { .nav a span { font-size: 15px; } }
.nomt { margin-top: 0; }
.tiny { font-size: 11px; }
.amt { font-size: 15px; white-space: nowrap; }
.bstate { --s: var(--muted); display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--s); background: color-mix(in srgb, var(--s) 14%, transparent); white-space: nowrap; }
.bs-paid { --s: var(--present); } .bs-sent { --s: var(--late); } .bs-overdue { --s: var(--absent); } .bs-scheduled { --s: var(--muted); }
.bill-card { --s: var(--late); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--s); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.bill-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.bill-amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.bill-items { list-style: none; margin: 10px 0 12px; padding: 10px 0 0; border-top: 1px dashed var(--line); font-size: 14px; }
.bill-items li { display: flex; justify-content: space-between; padding: 2px 0; color: var(--muted); }
.pay-banner { --s: var(--late); display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--s) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--s) 35%, transparent); }
.pay-banner .small { color: var(--s); font-weight: 700; }
.pay-ok { display: flex; gap: 12px; align-items: center; color: var(--present); }
.pay-ok b { color: var(--text); }
.info-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface2); font-size: 13px; color: var(--text); }
.info-box .ic { color: var(--brand-2); margin-top: 1px; }
.checkout { text-align: center; padding: 8px 0 14px; }
.pay-methods { display: flex; flex-direction: column; gap: 8px; }
.pm input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pm > span { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.pm > span > span { display: flex; flex-direction: column; }
.pm small { font-size: 12px; color: var(--muted); }
.pm input:checked + span { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 8%, var(--surface)); }
.pm input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.demo-note { font-size: 12px; color: var(--muted); background: var(--surface2); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.vbank { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.vbank div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.done-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px 0 20px; color: var(--present); }
.done-box b { color: var(--text); font-size: 18px; }
.done-box span { color: var(--muted); font-size: 14px; }
.noti { display: flex; gap: 10px; text-align: left; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.noti .grow { display: flex; flex-direction: column; gap: 2px; }
.noti.unread { background: color-mix(in srgb, var(--brand-2) 8%, var(--surface)); border-color: color-mix(in srgb, var(--brand-2) 35%, transparent); }
.noti-ic { --s: var(--brand-2); flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--s); background: color-mix(in srgb, var(--s) 14%, transparent); }
.nt-paid .noti-ic { --s: var(--present); } .nt-overdue .noti-ic { --s: var(--absent); } .nt-remind .noti-ic { --s: var(--late); }
.bill-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.bill-row .grow { display: flex; flex-direction: column; }
.bill-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.collect { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.collect > div:first-child { display: flex; flex-direction: column; grid-row: span 2; }
.collect b { font-size: 26px; font-weight: 800; }
.progress.big { height: 10px; }
.timeline { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.timeline div { display: flex; gap: 10px; }
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row .check { flex: 1; }
.toggle-row select { width: 110px; }
.inline-form { flex-direction: row; align-items: flex-end; }
.inline-form label { flex: 1; }
.pay-ways { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pw { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
.pw .grow { display: flex; flex-direction: column; }
.pw-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--brand-2); }
.reported { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--excused) 12%, var(--surface)); color: var(--text); font-size: 14px; }
.reported > .ic { color: var(--excused); }
.bs-reported { --s: var(--excused); }
.bill-row.req { border-color: color-mix(in srgb, var(--excused) 45%, transparent); }
.nt-deposit .noti-ic { --s: var(--excused); }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row3 .btn { padding: 0 6px; }
/* 다듬기 */
.nav-ic { position: relative; display: inline-flex; }
.nav-dot { position: absolute; top: -1px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--absent); border: 2px solid var(--surface); }
.today-actions { gap: 8px; }
.today-prog { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
.today-actions .btn { flex: 1; }
@media (min-width: 900px) { .today-prog { flex: 1 1 auto; } .today-actions .btn { flex: none; } }
.class-hero > div:first-child:not(.avatar), .class-hero > .grow { flex: 1 1 220px; }
.push-card { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.push-card > .ic { color: var(--brand-2); }
.push-card .grow { display: flex; flex-direction: column; }
.pw .acct { font-weight: 700; font-size: 15px; letter-spacing: .01em; word-break: keep-all; overflow-wrap: anywhere; }
.demo-grid .demo-btn:nth-child(n+3) { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; min-height: 52px; }
.avatar.sm { font-size: 12px; }

/* 회원가입 · 아이디/비밀번호 찾기 */
.auth-links { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 10px; }
.auth-links button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; padding: 10px 8px; min-height: 44px; cursor: pointer; }
.auth-links button:last-child { color: var(--brand-2); font-weight: 700; }
.auth-links i { width: 1px; height: 12px; background: var(--line); }
.sheet-note { margin: 0 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface2); font-size: 14px; line-height: 1.55; }
.sheet-note.center { text-align: center; }
.form label .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form .check.agree { align-items: flex-start; padding: 12px; min-height: 0; border: 1px solid var(--line); border-radius: 12px; }
.form .check.agree input { margin-top: 3px; }
.form .check.agree > span { display: flex; flex-direction: column; gap: 4px; }
.found { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.found-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .04em; }
.done-ic { width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center; color: var(--present); background: color-mix(in srgb, var(--present) 15%, transparent); }
.req-block { margin-bottom: 8px; }
.req { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--brand-2) 35%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--brand-2) 6%, var(--surface)); }
.req .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-signup .noti-ic, .nt-welcome .noti-ic { --s: var(--present); } .nt-reset .noti-ic { --s: var(--late); }
.reset-banner { display: flex; align-items: center; gap: 10px; text-align: left; margin-top: 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); }
.reset-banner .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reset-banner.ok { border-color: color-mix(in srgb, var(--present) 45%, var(--line)); background: color-mix(in srgb, var(--present) 10%, var(--surface)); }
.nt-reset-ok .noti-ic { --s: var(--present); }
