/* Layout: 휴대폰 우선 — 칠판색 상단바(큰 시계), 종이색 본문, 하단 탭.
   스케줄표는 기존에 쓰던 인쇄 카드(민트 머리줄·검은 괘선·빨강/파랑/주황 안내 줄)를 그대로 따름. 넓은 화면에서는 가운데 980px */
:root {
  --paper: #F2F4EF; --card: #FFFFFF; --ink: #17231D; --muted: #5C6B62;
  --line: #D8DFD5; --line-strong: #B7C2B8; --rule: #1D2A23;
  --board: #1F4A37; --board-ink: #F3F6EE; --board-muted: #A6C1B1;
  --brand-ink: #1F4A37; --brand-soft: #E1ECE4;
  --mint: #D3EBE2; --mint-ink: #163A2C;
  --van: #F2B705; --van-ink: #3A2B00; --van-soft: #FFF3C8;
  --walk: #2A7A4B; --walk-soft: #E0F1E6;
  --pick: #3A5EC2; --pick-soft: #E3E9FA;
  --self: #7A4FB5; --self-soft: #EFE6FA;
  --warn: #B25400; --warn-soft: #FDEAD3;
  --stop: #BE3333; --stop-soft: #FAE2E2;
  --hl: #FFE45C; --hl-ink: #2E2600; --hl-add: #CDEBC0;
  --n-red: #C62828; --n-blue: #1F4FB0; --n-orange: #D2601A;
  --scrim: rgba(10, 20, 15, .5);
  --glow: rgba(242, 183, 5, .35);
  --ring-row: rgba(255, 255, 255, .09);
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 8px 24px rgba(20, 40, 30, .08);
  --f-display: "Do Hyeon", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1411; --card: #161F1A; --ink: #E3EBE5; --muted: #95A59B;
    --line: #26332C; --line-strong: #3A4A40; --rule: #8FA398;
    --board: #1A4533; --board-ink: #EEF4EC; --board-muted: #93B7A2;
    --brand-ink: #8ED0AC; --brand-soft: #1B3127;
    --mint: #1C3A2F; --mint-ink: #CFEBDD;
    --van: #F5C431; --van-ink: #2A1F00; --van-soft: #372E10;
    --walk: #6FC28F; --walk-soft: #15301F;
    --pick: #93ACF2; --pick-soft: #1B2644;
    --self: #C3A2F0; --self-soft: #2A1F3D;
    --warn: #F2A650; --warn-soft: #382511;
    --stop: #F07E7E; --stop-soft: #3A1B1B;
    --hl: #5E5012; --hl-ink: #FFF3B8; --hl-add: #1F4027;
    --n-red: #FF8A80; --n-blue: #9DB8FF; --n-orange: #FFB072;
    --scrim: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1411; --card: #161F1A; --ink: #E3EBE5; --muted: #95A59B;
  --line: #26332C; --line-strong: #3A4A40; --rule: #8FA398;
  --board: #1A4533; --board-ink: #EEF4EC; --board-muted: #93B7A2;
  --brand-ink: #8ED0AC; --brand-soft: #1B3127;
  --mint: #1C3A2F; --mint-ink: #CFEBDD;
  --van: #F5C431; --van-ink: #2A1F00; --van-soft: #372E10;
  --walk: #6FC28F; --walk-soft: #15301F;
  --pick: #93ACF2; --pick-soft: #1B2644;
  --self: #C3A2F0; --self-soft: #2A1F3D;
  --warn: #F2A650; --warn-soft: #382511;
  --stop: #F07E7E; --stop-soft: #3A1B1B;
  --hl: #5E5012; --hl-ink: #FFF3B8; --hl-add: #1F4027;
  --n-red: #FF8A80; --n-blue: #9DB8FF; --n-orange: #FFB072;
  --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.grow { flex: 1; }

/* ---------- 상단바 ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--board); color: var(--board-ink); padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.eyebrow { font-size: 11px; letter-spacing: .08em; color: var(--board-muted); margin: 0; }
.brand b { font: 400 20px/1.15 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font: 400 30px/1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.alarm-pill { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--board-ink); border: 1px solid var(--board-muted); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.alarm-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--board-muted); }
.alarm-pill.on i { background: var(--van); box-shadow: 0 0 0 3px var(--glow); }
.netbar { margin: 0; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; text-align: center; padding: 6px 16px; }

.app { max-width: 980px; margin: 0 auto; padding-inline: 16px; padding-block: 4px calc(96px + env(safe-area-inset-bottom, 0px)); }

/* ---------- 공통 조각 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.primary { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.btn.van { background: var(--van); border-color: var(--van); color: var(--van-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-ink); }
.btn.danger { color: var(--stop); border-color: var(--stop); }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; font-weight: 600; }
.iconbtn { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; color: var(--ink); }

.chip { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.chip.van { background: var(--van); color: var(--van-ink); }
.chip.walk { background: var(--walk-soft); color: var(--walk); }
.chip.pick { background: var(--pick-soft); color: var(--pick); }
.chip.self { background: var(--self-soft); color: var(--self); }
.chip.plain { background: var(--brand-soft); color: var(--ink); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-ink); line-height: 1.7; white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.stop { background: var(--stop-soft); color: var(--stop); }
.badge.pick { background: var(--pick-soft); color: var(--pick); }
.badge.walk { background: var(--walk-soft); color: var(--walk); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.ph { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 6px; }
.ph h3 { margin: 0; font: 400 20px/1.2 var(--f-display); }
.ph h3 small { font: 500 12.5px var(--f-body); color: var(--muted); margin-left: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 10px; max-width: 64ch; }
.page-head { padding-block: 16px 10px; }
.page-head h2 { margin: 0; font: 400 26px/1.2 var(--f-display); }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 60ch; }
.empty { list-style: none; padding: 26px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--r); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty b { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.note { font-size: 13.5px; background: var(--pick-soft); color: var(--ink); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; white-space: pre-line; }
.status { font-size: 13px; color: var(--brand-ink); margin: 6px 0 0; min-height: 1.2em; }
.problem { margin: 0; font-size: 12.5px; color: var(--stop); font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.toggle small { color: var(--muted); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--board); }
.n-red { color: var(--n-red); } .n-blue { color: var(--n-blue); } .n-orange { color: var(--n-orange); }

/* ---------- 날짜 머리 ---------- */
.dayhead { display: flex; align-items: center; gap: 10px; padding-block: 14px 6px; }
.dh-title { flex: 1; min-width: 0; text-align: center; }
.dh-title h2 { margin: 0; font: 400 25px/1.15 var(--f-display); }
.dh-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.backtoday { display: flex; justify-content: center; margin-bottom: 8px; }
.backtoday:has(> [hidden]) { display: none; }

/* ---------- 알람 ---------- */
.alarm { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); margin-bottom: 12px; }
.alarm.off { background: var(--van-soft); border-color: var(--van); }
.al-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.al-text > b { font-size: 15px; }
.al-meta { color: var(--muted); font-size: 12.5px; }
.al-next { font-family: var(--f-display); font-size: 18px; font-weight: 400; }

.quickbar { display: flex; gap: 8px; margin-bottom: 12px; }
.quickbar .btn { flex: 1; min-height: 46px; font-size: 15px; }

/* ---------- 오늘 안내(하교·특강·방과후) ---------- */
.dayinfo { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; display: grid; gap: 4px; }
.di-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.di-l { flex: none; width: 44px; font-weight: 700; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.di-notes { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; }
.di-notes li { font-weight: 600; }
.di-edit { justify-self: end; font-size: 12.5px; }
.tdchanges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 12px; }

/* ---------- 오늘 타임라인 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.slot { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 4px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.slot-time { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding-top: 2px; }
.slot-time b { font: 400 25px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.slot-time small { font-size: 11px; color: var(--muted); }
.nexttag { font-size: 11px; font-weight: 700; background: var(--van); color: var(--van-ink); border-radius: 4px; padding: 0 6px; }
.slot.next { border-color: var(--van); box-shadow: inset 0 0 0 1px var(--van); }
.slot.past { opacity: .55; }
.slot-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dg { display: flex; flex-direction: column; gap: 6px; }
.dg + .dg { border-top: 1px dashed var(--line); padding-top: 10px; }
.dg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dg-dest { font-weight: 700; font-size: 15.5px; }
.dg-end { font-size: 12.5px; color: var(--muted); }
.dg-n { font-size: 12px; color: var(--muted); }
.dg-done { margin-left: auto; min-height: 30px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-size: 12.5px; font-weight: 600; padding: 2px 10px; cursor: pointer; color: var(--muted); }
.dg-done[aria-pressed="true"] { background: var(--walk); border-color: var(--walk); color: var(--card); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); font-size: 14.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.pill small { font-size: 11px; color: var(--muted); font-weight: 500; }
.pill.st-changed { border-color: var(--warn); background: var(--warn-soft); }
.pill.st-added { border-color: var(--pick); background: var(--pick-soft); }
.pill.st-cancel { text-decoration: line-through; color: var(--muted); border-style: dashed; background: transparent; }
.pill.done { background: var(--walk); border-color: var(--walk); color: var(--card); }
.pill.done small { color: var(--card); }
.pill.done::before { content: "✓"; }
.pill.overlap { box-shadow: 0 0 0 2px var(--stop-soft); }
.dg-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); }
.dg-notes b { color: var(--ink); font-weight: 600; }
.dg-notes .warnline { color: var(--stop); }
.openlist h3 { margin: 0 0 8px; font: 400 18px/1.2 var(--f-display); }
.openlist .og + .og { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.og-l { font-size: 12.5px; font-weight: 700; color: var(--brand-ink); margin-bottom: 6px; }

/* ---------- 스케줄표: 요일 탭 ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg-b { border: 0; background: transparent; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg-b[aria-pressed="true"] { background: var(--board); color: var(--board-ink); }
.daytabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 6px; margin-bottom: 12px; }
.daytab { display: flex; flex-direction: column; align-items: center; padding: 7px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); }
.daytab b { font: 400 21px/1.1 var(--f-display); }
.daytab span { font-size: 11px; color: var(--muted); }
.daytab[aria-selected="true"] { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.daytab[aria-selected="true"] span { color: var(--board-muted); }
.daytab.today b::after { content: "•"; color: var(--van); margin-left: 2px; }

/* ---------- 스케줄표: 인쇄 카드 모양 ---------- */
.cards { display: grid; gap: 16px; }
.cards.all { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.daycard { background: var(--card); border: 2px solid var(--rule); container-type: inline-size; min-width: 0; }
.dc-head { display: flex; align-items: center; gap: 10px; background: var(--mint); color: var(--mint-ink); border-bottom: 2px solid var(--rule); padding: 8px 12px; }
.dc-head h3 { margin: 0; font: 400 26px/1 var(--f-display); }
.dc-dis { font: 400 18px/1 var(--f-display); }
.dc-date { font-size: 12.5px; font-weight: 600; margin-left: auto; }
.dc-rows { display: grid; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 700px) { .dc-rows.two { grid-template-columns: 1fr 1fr; } .dc-rows.two > .dc-tw + .dc-tw { border-left: 2px solid var(--rule); } }
@container (max-width: 699px) { .dc-rows.two > .dc-tw + .dc-tw thead { display: none; } }
.dc-tw { overflow-x: auto; }
.dc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dc-table th { background: var(--mint); color: var(--mint-ink); font-size: 12px; font-weight: 700; padding: 5px 6px; border-bottom: 1.5px solid var(--rule); border-right: 1px solid var(--rule); text-align: center; white-space: nowrap; }
.dc-table td { padding: 7px 6px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); font-size: 14px; text-align: center; vertical-align: middle; }
.dc-table th:last-child, .dc-table td:last-child { border-right: 0; }
.dc-table tr[data-act] { cursor: pointer; }
.dc-table tbody tr:hover td { background: var(--brand-soft); }
.dc-table .c-no { width: 30px; color: var(--muted); font-size: 12px; }
.dc-table .c-name { text-align: left; white-space: nowrap; font-weight: 600; }
.dc-table .c-name .g { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.dc-table .c-time { font: 400 16px/1.2 var(--f-display); white-space: nowrap; }
.dc-table .c-time.word { font: 600 13.5px/1.2 var(--f-body); color: var(--brand-ink); }
.dc-table .c-dest { font-weight: 600; }
.dc-table s { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; font-family: var(--f-body); }
.dc-table .sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--warn); }
.dc-table tr.st-changed td { background: var(--hl); color: var(--hl-ink); }
.dc-table tr.st-added td { background: var(--hl-add); }
.dc-table tr.st-cancel td { color: var(--muted); }
.dc-table tr.st-cancel .c-name, .dc-table tr.st-cancel .c-dest, .dc-table tr.st-cancel .c-time { text-decoration: line-through; }
.dc-table .badge { margin-left: 4px; vertical-align: 1px; }
.dc-foot { border-top: 2px solid var(--rule); }
.dc-fr { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.dc-fr:last-child { border-bottom: 0; }
.dc-fl { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; border-right: 1.5px solid var(--rule); font-weight: 700; font-size: 13.5px; }
.dc-fl small { font-weight: 500; font-size: 12px; line-height: 1.5; margin-top: 4px; }
.dc-fv { padding: 6px 10px; font-size: 13.5px; font-weight: 600; text-align: center; display: flex; align-items: center; justify-content: center; }
.dc-fv.lines { flex-direction: column; align-items: stretch; padding: 0; }
.dc-fv.lines p { margin: 0; padding: 4px 10px; border-bottom: 1px solid var(--line); }
.dc-fv.lines p:last-child { border-bottom: 0; }
.dc-fv.lines p.hl { background: var(--hl); color: var(--hl-ink); }
.dc-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--rule); }

/* ---------- 카톡 변경 ---------- */
textarea#kkText { width: 100%; min-height: 130px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; background: var(--paper); resize: vertical; line-height: 1.5; }
.paste-top, .paste-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.lab { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.lab small { font-weight: 400; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="password"], .field select, .field textarea, .trow input {
  min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; background: var(--card); width: 100%; min-width: 0; }
.field textarea { min-height: 70px; resize: vertical; }
.imgpick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-strong); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1; cursor: pointer; }
.drafts { display: flex; flex-direction: column; gap: 10px; }
.draft { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.draft.off { opacity: .55; }
.draft-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-src { font-size: 12px; color: var(--muted); }
.draft blockquote { margin: 0; padding: 8px 10px; background: var(--paper); border-radius: 8px; font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opt { border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.opt[aria-pressed="true"] { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.f-other { flex: 1 1 110px; min-width: 0; max-width: 180px; min-height: 34px; border: 1px dashed var(--line-strong); border-radius: 999px; padding: 4px 12px; background: transparent; }
.trow { display: flex; align-items: center; gap: 6px; }
.trow input { flex: 1; }
.or { font-size: 12px; color: var(--muted); margin-right: 2px; }
.applybar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 10px 12px; margin-block: 12px 18px; box-shadow: var(--shadow); font-size: 13.5px; }
.dgroup { margin: 14px 0 6px; font: 400 17px var(--f-display); color: var(--brand-ink); }
.dgroup:first-child { margin-top: 4px; }
.chlist { list-style: none; margin: 0; padding: 0; }
.ch { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ch-main { flex: 1; min-width: 0; font-size: 14px; }
.ch-main small { display: block; color: var(--muted); }
.ch details { font-size: 12.5px; color: var(--muted); }
.ch details p { margin: 4px 0 0; }

/* ---------- 관리 ---------- */
.terms { display: flex; flex-direction: column; gap: 8px; }
.term { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 4px; }
.term.sel { border-color: var(--board); box-shadow: inset 0 0 0 1px var(--board); }
.term-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: none; border: 0; text-align: left; padding: 8px; cursor: pointer; color: var(--ink); }
.term-main span { font-size: 12.5px; color: var(--muted); }
.kidlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.kidcard { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-align: left; color: var(--ink); }
.kc-name { display: flex; align-items: baseline; gap: 6px; }
.kc-name b { font-size: 15.5px; }
.kc-name small { color: var(--muted); }
.kc-week { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.kc-day { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; min-width: 0; background: var(--card); border-radius: 6px; padding: 4px 5px; }
.kc-day i { font-style: normal; font-weight: 700; color: var(--brand-ink); }
.kc-day span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.plain th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--rule); white-space: nowrap; }
table.plain td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain tr:last-child td { border-bottom: 0; }
table.plain td.t { font: 400 20px/1.1 var(--f-display); white-space: nowrap; }
.dds { display: inline-flex; gap: 2px; }
.dd { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); }
.dd.on { background: var(--board); color: var(--board-ink); border-color: var(--board); }
.setrows { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.setrow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-align: left; color: var(--ink); }
.setrow span { font-size: 12.5px; color: var(--muted); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.urlbox { display: flex; gap: 6px; align-items: center; margin: 6px 0 10px; }
.urlbox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
.steps { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--muted); }
.steps li { margin-bottom: 3px; }
details.help summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--brand-ink); margin-top: 6px; }
.ntfy { border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; display: grid; gap: 10px; margin-bottom: 6px; }
.ntfy.on { border-color: var(--walk); background: var(--walk-soft); }
.nt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.urlbox .lab { white-space: nowrap; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.draft.quick { border: 0; padding: 0; }
select { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; background: var(--card); max-width: 100%; }
.field .f-other { max-width: none; border-radius: 8px; margin-top: 6px; min-height: 38px; }

/* ---------- 하단 탭 ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tab-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px; gap: 4px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 0; background: none; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--brand-ink); background: var(--brand-soft); }

/* ---------- 창(모달) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; padding-top: env(safe-area-inset-top, 0px); }
.sheet { background: var(--card); color: var(--ink); width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow); }
#modalBody { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 700px) { .modal { align-items: center; padding: 24px; } .sheet { border-radius: 18px; max-height: 88vh; } }
.sheet h3 { margin: 0; font: 400 23px/1.2 var(--f-display); }
.sheet h3 small { font: 500 13px var(--f-body); color: var(--muted); margin-left: 4px; }
.sub { margin: -6px 0 0; color: var(--muted); font-size: 13px; }
.mh { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.modal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.sheet-sum { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.sheet-sum b { font: 400 24px var(--f-display); }
.sheet-acts { display: flex; flex-direction: column; gap: 8px; }
.sheet-acts .btn { justify-content: flex-start; }
.srcbox { background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.srcbox p { margin: 4px 0; }
.srcbox blockquote { margin: 6px 0 0; color: var(--muted); font-size: 13px; border-left: 3px solid var(--line-strong); padding-left: 8px; }
.kweek { display: flex; flex-direction: column; gap: 8px; }
.kw-day { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kw-d { font: 400 21px/1.6 var(--f-display); color: var(--brand-ink); }
.kw-list { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 10px; background: var(--paper); cursor: pointer; font-size: 13.5px; color: var(--ink); text-align: left; }
.kw-item b { font: 400 16px var(--f-display); }
.kw-item em { font-style: normal; font-size: 11.5px; color: var(--warn); }
.kw-add { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 6px 10px; background: none; cursor: pointer; color: var(--brand-ink); font-size: 13px; }
.chipedit { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.echip { display: inline-flex; align-items: center; gap: 2px; background: var(--brand-soft); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 13.5px; }
.echip button { border: 0; background: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 16px; }
.addrow { display: flex; gap: 6px; }
.addrow input { flex: 1; min-width: 0; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 10px; background: var(--card); }
.copybox { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; background: var(--paper); font-size: 13.5px; }

/* ---------- 알람 울림 화면 ---------- */
.ring { position: fixed; inset: 0; z-index: 90; background: var(--board); color: var(--board-ink); display: flex; align-items: center; justify-content: center; padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.ring::before { content: ""; position: fixed; inset: 10px; border: 4px solid var(--van); border-radius: 20px; pointer-events: none; animation: ringpulse 1.2s ease-in-out infinite; }
@keyframes ringpulse { 50% { opacity: .25; } }
.ring-in { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.ring-head { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--board-muted); }
.ring-sec { display: flex; flex-direction: column; gap: 8px; }
.ring-kicker { margin: 0; font-size: 16px; font-weight: 700; color: var(--van); }
.ring-time { margin: 0; font: 400 76px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.ring-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ring-list li { display: flex; flex-direction: column; gap: 6px; background: var(--ring-row); border-radius: 12px; padding: 12px 14px; }
.ring-list .rl-dest { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; }
.ring-list .rl-names { font-size: 21px; font-weight: 600; line-height: 1.4; }
.ring-acts { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.ring-acts .btn { min-height: 54px; font-size: 17px; padding: 10px 24px; }
.ring .btn:not(.van) { background: transparent; color: var(--board-ink); border-color: var(--board-muted); }

/* ---------- 로그인 ---------- */
.login { position: fixed; inset: 0; z-index: 80; background: var(--board); display: grid; place-items: center; padding: 16px; }
.login-in { width: 100%; max-width: 360px; background: var(--card); border-radius: 18px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-in .eyebrow { color: var(--muted); }
.login-in h1 { margin: 0; font: 400 28px/1.15 var(--f-display); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 95; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

:focus-visible { outline: 3px solid var(--van); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ring::before { animation: none; } * { scroll-behavior: auto !important; } }
@media (max-width: 420px) {
  .slot { grid-template-columns: 54px minmax(0, 1fr); padding: 10px; gap: 4px 10px; }
  .slot-time b { font-size: 22px; }
  .clock { font-size: 26px; }
  .dc-table td { font-size: 13px; padding: 6px 4px; }
  .dc-table .c-no { width: 24px; }
  .dc-fr { grid-template-columns: 76px minmax(0, 1fr); }
}

/* ---------- 인쇄: 스케줄표 카드만 ---------- */
.print-area { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  :root { --paper: #fff; --card: #fff; --ink: #000; --muted: #333; --rule: #000; --mint: #D3EBE2; --mint-ink: #000; --hl: #FFE45C; --hl-ink: #000; --hl-add: #CDEBC0; --n-red: #C62828; --n-blue: #1F4FB0; --n-orange: #D2601A; color-scheme: light; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .print-area .daycard { break-inside: avoid; page-break-inside: avoid; margin-bottom: 8mm; }
  .print-area .dc-rows.two { grid-template-columns: 1fr 1fr; }
  .print-area .dc-rows.two > .dc-tw + .dc-tw { border-left: 2px solid #000; }
  .print-area .dc-table td { font-size: 11.5pt; padding: 4px; }
  .print-area .badge, .print-area .dc-table s { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
