:root {
  --navy: #23356b; --red: #c8202f; --green: #5b7c12; --teal: #4fb7c5; --ink: #222; --sub: #6b6b6b;
  --line: #e2e2e2; --bg: #f5f5f3; --card: #fff; --yellow: #fdf6b9;
  --nav-h: 62px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid #ccc; border-radius: 8px; padding: 9px 10px; background: #fff; width: 100%; font-size: 16px; }
textarea { resize: vertical; }
a { color: var(--navy); }
#app { max-width: 980px; margin: 0 auto; min-height: 100vh; background: var(--card); padding-bottom: calc(var(--nav-h) + var(--safe-b) + 10px); }

/* 위 막대 */
#top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; background: #fff; border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
#top h1 { flex: 1; margin: 0; font-size: 18px; text-align: center; font-weight: 700; letter-spacing: -0.3px; }
#syncDot { width: 9px; height: 9px; border-radius: 50%; background: #37b24d; }
#syncDot.busy { background: #fab005; } #syncDot.off { background: #e03131; }
.icon-btn { background: none; border: 0; font-size: 22px; padding: 4px 8px; cursor: pointer; line-height: 1; color: #555; }
#topBack { font-size: 30px; }
body.login #top, body.login #nav { display: none; }

/* 아래 메뉴 */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #111; padding-bottom: var(--safe-b); max-width: 980px; margin: 0 auto; }
#nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: var(--nav-h); color: #bbb; text-decoration: none; font-size: 11px; gap: 2px; }
#nav a .ni { font-size: 21px; line-height: 1; font-weight: 700; }
#nav a .ni-p { font-family: Georgia, serif; font-style: italic; }
#nav a.on { color: #5ce1d7; }

main { padding: 12px 14px; }
.hint { color: var(--sub); font-size: 13px; }
.center { text-align: center; }
.tag { display: inline-block; font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef1f8; color: var(--navy); margin-right: 5px; vertical-align: middle; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.row.end { justify-content: flex-end; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid #c9c9c9; background: #fff; border-radius: 8px; padding: 9px 14px; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: #f4f4f4; border-color: #e6e6e6; }
.btn.danger { color: #c92a2a; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin: 6px 0; }
.btn:disabled { opacity: .45; }
.empty { text-align: center; padding: 40px 10px; }
h3.sec { font-size: 16px; margin: 22px 0 8px; padding-left: 9px; border-left: 4px solid var(--green); display: flex; align-items: baseline; gap: 6px; }
h3.sec small { color: var(--sub); font-weight: 400; font-size: 13px; }
h3.sec .more { margin-left: auto; font-size: 13px; font-weight: 400; text-decoration: none; color: var(--sub); }
h4 { margin: 16px 0 6px; font-size: 14px; }
.info { background: #f6f6f6; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #555; margin: 14px 0; }

/* 홈 */
.hello { font-size: 14px; color: var(--sub); margin: 2px 0 10px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 22px; cursor: pointer; }
.quick button span { font-size: 12px; line-height: 1.3; color: #333; }
.kidcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kc { border: 1px solid var(--line); border-left: 5px solid var(--kc); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.kcn { font-weight: 700; } .kcn small { color: var(--sub); font-weight: 400; }
.kcs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: #444; margin-top: 4px; }
.kcs b { color: var(--kc); }
.planrow { margin-bottom: 10px; }
.covers { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: thin; }
.cvw { flex: 0 0 auto; width: 84px; cursor: pointer; }
.cvw small { display: block; font-size: 12px; line-height: 1.3; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cvw small i { font-style: normal; font-weight: 700; }
.cv, .cvm, .cvs, .cvl { object-fit: cover; background: #eee; border: 1px solid #ddd; display: block; }
.cvm { width: 84px; height: 116px; }
.cvs { width: 44px; height: 60px; flex: 0 0 44px; }
.cvl { width: 110px; height: 152px; flex: 0 0 110px; }
.nocv { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: #777; padding: 3px; word-break: keep-all; background: linear-gradient(135deg, #f1efe6, #e2ded0); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.clist { list-style: none; padding: 0; margin: 0; }
.clist li { padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.clist.big li small { display: block; color: var(--sub); margin-top: 2px; }
.clist .phn { font-size: 12px; color: var(--sub); }

/* 아이 탭 */
.kidtabs { display: flex; gap: 6px; overflow-x: auto; margin: -2px 0 10px; }
.kt { flex: 0 0 auto; border: 0; border-radius: 10px 10px 0 0; padding: 9px 16px; background: #e9e6df; color: #444; font-weight: 700; cursor: pointer; }
.kt.on { background: var(--kc); color: #fff; }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #2f3d4c; color: #fff; padding: 8px 10px; border-radius: 8px; flex-wrap: wrap; }
.subhead small { opacity: .8; }
.pill { border: 0; border-radius: 6px; padding: 6px 10px; background: #8d97a0; color: #fff; margin-left: 4px; cursor: pointer; font-weight: 600; }
.pill.on { background: var(--red); }
.monthnav { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 8px; }
.monthnav b { font-size: 18px; min-width: 130px; text-align: center; }
.monthnav button { border: 0; background: none; font-size: 22px; padding: 2px 10px; cursor: pointer; color: #333; }

/* 달력 */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; max-width: 520px; margin: 0 auto; }
.cal th { font-size: 12px; font-weight: 600; padding: 6px 0; background: #f2f2f2; border: 1px solid #ddd; }
.cal td { border: 1px solid #ddd; height: 44px; text-align: center; cursor: pointer; padding: 2px; }
.cal td span { display: inline-flex; width: 38px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; }
.cal .w0 { color: #e8590c; } .cal .w6 { color: #1c7ed6; }
.cal th.w0, .cal th.w6 { color: inherit; }
.cal td.has span { background: var(--yellow); border: 1px solid #d9cf7a; color: #333; border-radius: 16px; }
.cal td.td { background: #fff4f4; font-weight: 700; color: var(--red); }
.cal td.sel { outline: 3px solid var(--red); outline-offset: -3px; }
.cal td.o { cursor: default; background: #fafafa; }
.nsum { max-width: 300px; margin: 14px auto; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.sm-row { display: flex; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid #eee; }
.sm-row.empty { color: #aaa; }
.nsum .btn.wide { margin: 0; border-radius: 0; }
.nebar { position: sticky; top: 52px; z-index: 5; display: flex; align-items: center; justify-content: space-between; background: var(--red); color: #fff; padding: 6px 8px; margin: 14px -14px 0; }
.nebar .btn { padding: 6px 10px; font-size: 13px; }
.nebar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.nebar span { display: flex; gap: 6px; }
.ne { border-bottom: 1px solid #ddd; padding: 10px 0; }
.neh { display: flex; justify-content: space-between; align-items: center; background: #f1f1f1; margin: 0 -14px; padding: 6px 14px; }
.phbtn { cursor: pointer; font-size: 20px; }
.netime { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.netime input { width: 52px; padding: 6px; text-align: center; }
.qbt { display: inline-flex; margin-left: auto; }
.qbt button { border: 1px solid #ddd; background: #f8f8f8; padding: 7px 9px; font-size: 13px; cursor: pointer; margin-left: -1px; }
.qbt button.on { background: #333; color: #fff; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ph { position: relative; }
.ph img { width: 74px; height: 74px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; cursor: pointer; }
.phx { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #333; color: #fff; font-size: 12px; cursor: pointer; }
.bigimg { width: 100%; height: auto; display: block; }
.totals { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.totals span { background: #f4f4f4; border-radius: 8px; padding: 6px 12px; display: flex; flex-direction: column; min-width: 80px; }
.totals small { color: var(--sub); font-size: 12px; } .totals b { font-size: 15px; }
.nv { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.nvd { font-weight: 700; color: var(--red); cursor: pointer; margin-bottom: 4px; }
.nve { margin: 6px 0; font-size: 14px; }
.nve .tm { color: var(--navy); font-weight: 600; margin-left: 4px; }

/* 책벌레 */
.bughead { background: #6cc4cf; color: #fff; text-align: center; font-weight: 700; padding: 12px; margin: -12px -14px 12px; font-size: 17px; }
.bugtable { border: 1px solid #ddd; border-radius: 10px; overflow: hidden; }
.bugrow { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-bottom: 1px solid #eee; gap: 8px; flex-wrap: wrap; }
.bugrow:last-child { border-bottom: 0; }
.bn { font-weight: 600; }
.bbt { display: flex; gap: 6px; flex-wrap: wrap; }
.tb { border: 1px solid #b4d6c4; background: #dff2e6; border-radius: 6px; padding: 6px 9px; font-size: 13px; cursor: pointer; }
.tb.t0 { background: #d8ecf8; border-color: #a9cde6; }
.shelfsum { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; flex-wrap: wrap; }
.shelfsum span:first-child { color: #c2255c; }
.shelfsum span:last-child { margin-left: auto; color: #999; }
.seg { display: flex; gap: 0; margin: 6px 0 10px; overflow-x: auto; }
.seg button { flex: 1 0 auto; border: 1px solid #d0d0d0; background: #fff; padding: 8px 10px; cursor: pointer; margin-left: -1px; font-size: 14px; }
.seg button:first-child { border-radius: 8px 0 0 8px; } .seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button.on { background: var(--navy); color: #fff; border-color: var(--navy); position: relative; }
.addbar { display: flex; gap: 6px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.addbar input { flex: 1; min-width: 130px; }
.countline { font-size: 13px; color: var(--sub); margin: 6px 0; }
.rday { margin: 10px 0; }
.rdh { font-weight: 700; font-size: 14px; padding: 4px 0; border-bottom: 2px solid #eee; }
.rdh small { color: var(--sub); font-weight: 400; }
.rrow, .lrow, .ri { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.rrow > div, .lrow > div, .ri > div { flex: 1; min-width: 0; }
.rrow b, .lrow b, .ri b { display: block; font-size: 14px; }
.rrow small, .lrow small, .ri small { color: var(--sub); font-size: 12px; }
.cnt { color: var(--red); font-style: normal; }
.rk { width: 22px; text-align: center; color: var(--green); font-size: 16px; flex: 0 0 22px; }
.updn { display: flex; flex-direction: column; }
.updn button { border: 1px solid #ddd; background: #fafafa; font-size: 10px; padding: 3px 8px; cursor: pointer; }

/* 책나무 */
.srch { display: flex; gap: 6px; margin: 4px 0 10px; }
.srch input { flex: 1; }
.ttabs { display: flex; background: var(--green); border-radius: 8px 8px 0 0; overflow-x: auto; }
.ttabs button { flex: 1 0 auto; border: 0; background: transparent; color: #fff; padding: 11px 10px; font-weight: 600; cursor: pointer; }
.ttabs button.on { background: #fff; color: #222; border-radius: 8px 8px 0 0; margin-top: 4px; }
.ttable { border: 1px solid #ddd; border-top: 0; }
.trow { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-bottom: 1px solid #eee; gap: 6px; }
.trow > span:first-child { font-weight: 600; }
.tbt { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tbt button { border: 1px solid #bbb; background: #fff; padding: 5px 8px; font-size: 13px; cursor: pointer; position: relative; }
.tbt button.dk { background: #5a6b40; color: #fff; border-color: #5a6b40; }
.tbt button:nth-child(2).dk { background: #555; border-color: #555; }
.tbt button i { position: absolute; top: -7px; right: -5px; background: var(--red); color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.plantabs { display: flex; gap: 4px; margin: 4px 0; }
.plantabs button { border: 1px solid #ccc; border-bottom: 0; background: #eee; border-radius: 8px 8px 0 0; padding: 7px 14px; cursor: pointer; }
.plantabs button.on { background: #3456b0; color: #fff; border-color: #3456b0; }
.week { border-top: 1px solid #ddd; padding: 10px 0; }
.wh { display: flex; align-items: baseline; gap: 4px; color: #c39bd3; font-weight: 700; margin-bottom: 4px; }
.wh .wn { font-size: 30px; line-height: 1; }
.wh .btn { margin-left: auto; color: #333; }
.wl div { padding: 7px 2px; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #666; cursor: pointer; }
.wl b { color: #222; font-weight: 500; margin-left: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chipb { border: 1px solid #ccc; border-radius: 16px; background: #fff; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chipb i { font-style: normal; color: var(--sub); }
.chipb.on { background: var(--green); color: #fff; border-color: var(--green); }
.chipb.on i { color: #e8f0d5; }
.chipb.add { border-style: dashed; color: var(--green); }
.chip { display: inline-block; border-left: 3px solid var(--kc, #999); background: #f5f5f5; padding: 3px 8px; margin: 2px; font-size: 12px; border-radius: 4px; }

/* 연산 */
.mtabs { display: flex; background: #111; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.mtabs button { flex: 1; border: 0; background: #8c8c8c; color: #fff; padding: 10px 4px; font-weight: 600; cursor: pointer; font-size: 14px; }
.mtabs button.on { background: #111; }
.gchips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.gchips button { border: 0; background: #f1f1f1; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.gchips button.on { background: var(--red); color: #fff; }
.semrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.semrow button { border: 1px solid #ccc; background: #fff; border-radius: 6px; padding: 7px 14px; cursor: pointer; }
.semrow button.on { background: #333; color: #fff; }
.semrow label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.semrow select { width: auto; padding: 6px; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin: 8px 0; }
.units button { text-align: left; border: 1px solid #ddd; background: #fff; border-radius: 8px; padding: 11px 12px; cursor: pointer; }
.units button.on { border-color: var(--red); background: #fff3f3; font-weight: 700; }
.opt { margin: 8px 0; }
.lbl { display: block; font-size: 13px; color: var(--sub); margin: 10px 0 4px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin: 6px 0; }
.chk input { width: auto; }
.sheetbar { position: sticky; top: 52px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; padding: 10px 0; border-bottom: 1px solid var(--line); margin-top: 16px; flex-wrap: wrap; }
.sheetbar span { display: flex; gap: 6px; }
.preview { background: #e9e9e9; padding: 10px; border-radius: 8px; overflow-x: auto; }
.preview .ws-page { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); margin: 0 auto 12px; max-width: 760px; padding: 22px 22px 30px; }

/* 학습지 */
.ws-head { border-bottom: 2px solid #222; margin-bottom: 14px; padding-bottom: 8px; }
.ws-head h2 { margin: 0 0 6px; font-size: 18px; }
.ws-head h2 small { color: var(--red); font-size: 14px; }
.ws-meta { display: flex; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.ws-meta u { display: inline-block; min-width: 70px; text-decoration: none; border-bottom: 1px solid #333; }
.ws-grid { display: grid; gap: 16px 18px; }
.ws-grid.c2 { grid-template-columns: 1fr 1fr; } .ws-grid.c3 { grid-template-columns: repeat(3, 1fr); } .ws-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.ws-q { display: flex; gap: 8px; align-items: flex-start; font-size: 17px; min-height: 34px; break-inside: avoid; }
.ws-q .no { flex: 0 0 auto; font-size: 12px; color: #888; min-width: 20px; padding-top: 3px; }
.ws-grid.vtl .ws-q { min-height: 130px; }
.ansgrid .ws-q { font-size: 14px; min-height: 0; }
.qq { line-height: 2; }
.bx { display: inline-block; width: 40px; height: 26px; border: 1.5px solid #555; border-radius: 4px; vertical-align: middle; margin: 0 2px; }
sup .bx { width: 18px; height: 16px; }
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.15; margin: 0 2px; font-size: .92em; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.fr .bx { width: 26px; height: 20px; margin: 1px 0; }
.mw { vertical-align: middle; margin-right: 1px; }
.vt { font-family: "Courier New", ui-monospace, monospace; font-size: 20px; line-height: 1.35; display: inline-block; }
.vt i { font-style: normal; display: inline-block; width: 0.75em; text-align: center; }
.vt b { position: absolute; margin-left: -0.1em; font-weight: 400; }
.vt > div:nth-child(2) { position: relative; }
.vt .vl { border-top: 2px solid #222; margin: 2px 0; }
.vt .va { height: 1.4em; }
.clocks .ws-q { flex-direction: column; align-items: center; }
.clk { width: 120px; height: 120px; }
.ct { text-align: center; font-size: 15px; margin-top: 4px; }
.sys { display: inline-block; line-height: 1.6; }

/* 창 */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
.modal.full .sheet { height: 92vh; max-width: 760px; }
@media (min-width: 700px) { .modal { align-items: center; } .modal .sheet { border-radius: 14px; } .modal.full .sheet { height: 86vh; } }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.mbody { padding: 12px 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.cmsg { font-size: 15px; margin: 6px 0 14px; }
.ptabs { display: flex; gap: 0; margin-bottom: 10px; overflow-x: auto; }
.ptabs button { flex: 1 0 auto; border: 0; border-bottom: 2px solid #eee; background: none; padding: 9px 8px; cursor: pointer; font-weight: 600; color: #777; }
.ptabs button.on { color: var(--red); border-bottom-color: var(--red); }
.reslist { max-height: 46vh; overflow-y: auto; }
.ri .btn { flex: 0 0 auto; }
.cart { border-top: 2px solid #eee; margin-top: 12px; padding-top: 8px; }
.carthead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.carthead select { width: auto; padding: 5px 8px; font-size: 14px; }
.cartlist { max-height: 26vh; overflow-y: auto; margin: 6px 0; }
.ci { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.ci > span:not(.nocv) { flex: 1; }
.ci .cvs { width: 30px; height: 40px; flex-basis: 30px; }
.scanbox { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 4 / 3; background: #000; border-radius: 10px; overflow: hidden; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; }
.scanline { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border: 3px solid rgba(255,255,255,.85); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.form label { display: block; font-size: 13px; color: var(--sub); margin: 10px 0; }
.form label input, .form label select, .form label textarea { margin-top: 4px; color: var(--ink); }
.bd { display: flex; gap: 12px; }
.bdi { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bdi input { padding: 6px 8px; }
.bdi .bt { font-weight: 700; }
.mini { display: flex; flex-wrap: wrap; }
.kerow { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.kerow input[type=color] { width: 44px; height: 40px; padding: 2px; flex: 0 0 44px; }
.kerow select { width: 110px; flex: 0 0 110px; }
.menu { list-style: none; padding: 0; margin: 0; }
.menu li { padding: 15px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 16px; display: flex; justify-content: space-between; }
.menu li small { color: var(--sub); }
.menu2 .btn { margin: 4px 0; }
.cd h3 { margin: 6px 0; }
.cmemo { white-space: normal; line-height: 1.7; margin: 10px 0; word-break: break-word; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%) translateY(20px); background: rgba(20,20,20,.92); color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.loginbox { max-width: 340px; margin: 70px auto; text-align: center; }
.loginbox .logo { font-size: 54px; }
.loginbox input { text-align: center; font-size: 20px; letter-spacing: 3px; margin: 10px 0; }
.err { color: #c92a2a; min-height: 20px; }
#print-area { display: none; }

@media (max-width: 420px) {
  .quick button span { font-size: 11px; }
  .ws-grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .preview .ws-grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .tbt button { padding: 5px 6px; font-size: 12px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  #app, #modalRoot, #toast { display: none !important; }
  #print-area { display: block; }
  .ws-page { page-break-after: always; padding: 0; }
  .ws-page:last-child { page-break-after: auto; }
  .ws-grid.c4 { grid-template-columns: repeat(4, 1fr) !important; }
  .ws-grid.c3 { grid-template-columns: repeat(3, 1fr) !important; }
  .ws-q { font-size: 16pt; }
  .ws-grid.c2 .ws-q { min-height: 15mm; }
  .ansgrid .ws-q { font-size: 11pt; min-height: 0; }
}
