/* ───────── 기본 ───────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { --fz: 1; -webkit-text-size-adjust: 100%; }
html[data-fs="small"] { --fz: .92; }
html[data-fs="large"] { --fz: 1.12; }
body { font-family: var(--font); color: var(--ink); letter-spacing: -0.01em; background: var(--leather); background-image: var(--leather-img); min-height: 100vh; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
input, textarea { background: transparent; border: 0; outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
input:focus-visible, textarea:focus-visible, .rich:focus-visible { outline: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.boot { color: #888; font-size: 13px; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.muted { color: var(--muted-2); }
.small { font-size: 11.5px; line-height: 1.6; }
.mt { margin-top: 22px; }
.grow { flex: 1 1 auto; min-height: 8px; }

/* ───────── 펼친 책 (PC) ───────── */
.stage { position: relative; height: 100vh; height: 100dvh; }
.book-wrap { position: relative; height: calc(100dvh - 53px); width: min(calc(100vw - 120px), calc((100dvh - 53px) * 1.56)); margin: 22px auto 0; transform: translateX(-24px); }
.book { touch-action: pan-y pinch-zoom; position: absolute; inset: 0; display: flex; background: var(--paper); border-radius: 4px; box-shadow: 0 14px 34px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.35); perspective: 2400px; }
.page { position: relative; flex: 1 1 0; min-width: 0; background: var(--paper); overflow: hidden; isolation: isolate; }
.page.L { border-radius: 4px 0 0 4px; }
.page.R { border-radius: 0 4px 4px 0; }
.page::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--paper-tex) center / cover; mix-blend-mode: multiply; opacity: var(--paper-tex-opacity); z-index: -1; }
.page > .in { position: absolute; inset: 26px 44px 24px 44px; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #ddd transparent; }
.page.L > .in { right: 54px; }
.page.R > .in { left: 54px; }
.in > * { flex-shrink: 0; }
.binder { display: none; } /* 테마 장식(스크랩 플래너) */
.fold { position: absolute; left: calc(50% - 14px); top: 0; width: 28px; height: 100%; pointer-events: none; z-index: 6; background: linear-gradient(90deg, rgba(0,0,0,0) 0, rgba(0,0,0,.055) 45%, rgba(0,0,0,.085) 50%, rgba(0,0,0,.055) 55%, rgba(0,0,0,0) 100%); }
.stage-note { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 10.5px; color: #777; pointer-events: none; }

/* 종이 가장자리: 마우스를 올리면 살짝 들림 → 누르면 넘어감 */
.edge { position: absolute; top: 0; bottom: 0; width: 22px; z-index: 7; cursor: pointer; transition: background .2s; }
.edge-l { left: 0; border-radius: 4px 0 0 4px; }
.edge-r { right: 0; border-radius: 0 4px 4px 0; }
.edge-l:hover { background: linear-gradient(90deg, rgba(0,0,0,.10), rgba(0,0,0,0)); box-shadow: inset 3px 0 0 rgba(255,255,255,.6); }
.edge-r:hover { background: linear-gradient(270deg, rgba(0,0,0,.10), rgba(0,0,0,0)); box-shadow: inset -3px 0 0 rgba(255,255,255,.6); }

/* 오른쪽 세로 인덱스 탭 */
.vtabs { position: absolute; left: 100%; top: 38px; bottom: 28px; display: flex; flex-direction: column; gap: 6px; }
.vtabs .tab { width: 40px; padding: 18px 0 calc(18px - .3em); display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 12.5px; font-weight: 600; color: var(--tab-text); background: var(--tab); border-radius: 0 8px 8px 0; writing-mode: vertical-rl; letter-spacing: .3em; box-shadow: 2px 2px 6px rgba(0,0,0,.4); min-height: 70px; transition: background .15s; }
.vtabs .tab:hover { background: #adadad; }
.vtabs .tab.on { background: #fff; color: var(--ink); }
.vtabs .tab-sp { flex: 1; }
.mtabs { display: none; }

/* 넘김 애니메이션 */
.anim-layer { position: absolute; inset: 0; display: flex; }
.anim-layer > .page { flex: 1 1 0; }
.leaf { position: absolute; top: 0; bottom: 0; z-index: 8; transform-style: preserve-3d; will-change: transform; }
.leaf.from-r { left: 50%; transform-origin: left center; }
.leaf.from-l { left: 0; transform-origin: right center; }
.leaf.origin-l { left: 0; right: 0; transform-origin: left center; }
.leaf-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; overflow: hidden; background: var(--paper); }
.leaf-face > .page { flex: 1; }
.leaf-face.back { transform: rotateY(180deg); }
.leaf-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,0) 60%); pointer-events: none; opacity: 0; }
.leaf.from-l .leaf-shade { background: linear-gradient(270deg, rgba(0,0,0,.35), rgba(0,0,0,0) 60%); }

/* ───────── 공통 머리·섹션·쪽 아래 ───────── */
.hd { display: flex; align-items: flex-end; gap: 14px; height: 64px; margin-bottom: 22px; }
.hd-r { justify-content: flex-end; gap: 8px; }
.bignum { font-family: var(--font-num); font-weight: 900; font-size: 55px; line-height: .8; letter-spacing: -.045em; white-space: nowrap; }
.hd-txt { padding-bottom: 2px; min-width: 0; }
.hd-title { font-size: 12px; font-weight: 700; letter-spacing: .3em; }
.hd-sub { font-size: 11px; color: var(--muted); letter-spacing: .3em; margin-top: 3px; white-space: nowrap; }
.hd-link { font-size: 11px; color: var(--muted); letter-spacing: .3em; }
.hd-link:hover { color: var(--ink); }
.caret { letter-spacing: 0; }
.hd-right { margin-left: auto; align-self: center; }
.sec { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--ink); padding-bottom: 7px; }
.sec.mt { margin-top: 26px; }
.lab { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .2em; }
.lab b { color: var(--ink); margin-left: 6px; letter-spacing: .1em; }
.lab-btn { color: var(--ink); }
.lab-btn:hover { text-decoration: underline; }
.lab-sub { color: #bbb; margin-left: 4px; }
.sec-right { font-size: 10.5px; color: var(--muted); }
.foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; font-size: 10px; color: var(--faint); letter-spacing: .2em; font-weight: 500; gap: 10px; }
.foot-txt { font-size: 10px; color: var(--faint); letter-spacing: .2em; font-weight: 500; padding-bottom: 2px; }

/* 알약 버튼: 높이 30px, 12px 600, 간격 8px */
.pill { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 14px; border-radius: 15px; font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 0; border: 1px solid var(--ink); color: var(--ink); background: transparent; white-space: nowrap; }
.pill:hover { background: rgba(0,0,0,.04); }
.pill.dark { background: var(--ink); color: #fff; padding: 0 18px; }
.pill.dark:hover { background: #333; }
.pill.danger { border-color: var(--danger); color: var(--danger); }
.pill.dark.danger { background: var(--danger); color: #fff; }
.pill:disabled { opacity: .45; }
.btns { display: inline-flex; gap: 8px; align-items: center; }
.linkbtn { font-size: 12px; color: #555; font-weight: 500; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }
.linkbtn.strong { font-weight: 600; color: var(--ink); margin-top: 12px; display: inline-block; }
.back-link { font-size: 12px; font-weight: 600; color: #555; margin-right: auto; padding: 7px 0; }
.back-link:hover { color: var(--ink); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; border: 1px solid var(--ink); border-radius: 10px; padding: 1px 8px; margin-left: 6px; letter-spacing: 0; vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border: 1px solid #d4d4d4; border-radius: 14px; padding: 3px 11px; color: var(--muted-2); }
.chip.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 6px; }
.toggle { width: 34px; height: 19px; border-radius: 10px; background: #d4d4d4; position: relative; display: inline-block; flex: none; transition: background .15s; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--ink); }
.toggle.on::after { left: 17px; }

/* 체크박스: 둥근 네모, 체크하면 검은 채움 + 흰 ✓ */
.cb { width: 12px; height: 12px; border: 1.3px solid var(--ink); border-radius: 24%; flex: none; position: relative; margin-right: 9px; background: transparent; padding: 0; }
.cb::before { content: ""; position: absolute; inset: -8px; } /* 손가락 닿는 범위 넓힘 */
.cb.on { background: var(--ink); }
.cb.on::after { content: ""; position: absolute; left: 34%; top: 12%; width: 26%; height: 50%; border: solid #fff; border-width: 0 1.6px 1.6px 0; border-radius: 1px; transform: rotate(45deg); }
.cb.sm { width: 9px; height: 9px; margin-right: 5px; }
.cb.sm.on::after { border-width: 0 1.2px 1.2px 0; }
.s { text-decoration: line-through; color: var(--faint); }
.hlt, mark.hl, .rich mark { background: linear-gradient(transparent 52%, var(--hl) 52%); color: inherit; }
mark { background: linear-gradient(transparent 45%, var(--hl) 45%); color: inherit; }

/* 줄(점선) */
.dl { min-height: 27px; border-bottom: 1px dotted var(--dot); font-size: calc(12.5px * var(--fz)); display: flex; align-items: flex-end; padding-bottom: 4px; }
.dl.big { min-height: 36px; font-size: calc(14px * var(--fz)); }
.trow { display: flex; align-items: center; position: relative; }
.trow.dl { align-items: flex-end; }
.trow.dl .cb { margin-bottom: 2px; }
.t-text { flex: 1; min-width: 0; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-del { opacity: 0; color: #999; font-size: 15px; width: 22px; height: 22px; line-height: 22px; text-align: center; flex: none; }
.trow:hover .t-del, .erow:hover .t-del, .t-del:focus { opacity: 1; }
@media (hover: none) { .t-del { opacity: .45; } }
.inline-in { width: 100%; min-width: 0; font-size: inherit; padding: 0; }
.inline-in::placeholder, .add-btn { color: #bbb; }
.add-btn { font-size: inherit; }
.add-btn:hover { color: #777; }
.erow { display: flex; align-items: flex-end; gap: 0; }
.e-time { width: 48px; color: #999; font-size: 11.5px; font-weight: 600; flex: none; }
.e-text { flex: 1; min-width: 0; }
.e-add { display: flex; align-items: flex-end; gap: 6px; width: 100%; }
.e-time-in { width: 92px; flex: none; font-size: 12px; }
.mini-ok { font-size: 11px; font-weight: 600; border: 1px solid var(--ink); border-radius: 10px; padding: 1px 8px; flex: none; }

/* ───────── 월간 ───────── */
.dh { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .35em; padding: 0 0 8px 2px; }
.dh .sun { color: var(--ink); }
.dh-r { grid-template-columns: repeat(3, 1fr) 1.35fr; }
.dh-memo { padding-left: 14px; }
.mgrid { display: grid; border-top: 1px solid var(--ink); flex: 1 1 auto; min-height: 0; }
.mgrid.c4 { grid-template-columns: repeat(4, 1fr); }
.mgrid.c3 { grid-template-columns: repeat(3, 1fr); }
.mgrid.c7 { grid-template-columns: repeat(7, 1fr); }
.mgrid > .mc { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.mgrid.c4 > .mc:nth-child(4n), .mgrid.c7 > .mc:nth-child(7n) { border-right: none; }
.mc { padding: 7px 8px; font-size: 12px; position: relative; overflow: hidden; cursor: pointer; min-height: 0; }
.mc:hover { background: rgba(0,0,0,.018); }
.mc.su { background: var(--sun-bg); }
.mc-top { display: flex; align-items: center; gap: 0; min-width: 0; }
.mc .n { font-size: 12.5px; font-weight: 500; }
.mc.out .n { color: #cfcfcf; }
.mc.today .n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; margin: -3px 0 -3px -4px; }
.dmark { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-left: 5px; flex: none; }
.dmark.done { background: var(--ink); }
.dmark.draft { border: 1px solid var(--ink); }
.holname { font-size: 9.5px; color: var(--ink); margin-left: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.holname.m { margin: 2px 0 0; font-size: 8.5px; }
.ti { font-size: calc(10.5px * var(--fz)); display: flex; align-items: center; margin-top: 4px; white-space: nowrap; color: var(--ink-2); min-width: 0; }
.ti-text { overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 10px; color: var(--faint); margin-top: 3px; }
.cnt { font-size: 10px; font-weight: 600; color: #666; margin-top: 3px; }
.deco-layer { position: absolute; inset: 0; pointer-events: none; }
.m-right { display: flex; flex: 1 1 auto; min-height: 0; }
.m-right > .mgrid { flex: 3; }
.memo-col { flex: 1.35; border-top: 1px solid var(--ink); padding: 12px 0 0 16px; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.memo-h { display: flex; justify-content: space-between; align-items: baseline; }
.memo-cnt { font-size: 11px; font-weight: 700; }
.memo-ev { margin-top: 22px; }
.memo-fill { flex: 1; min-height: 10px; background: repeating-linear-gradient(transparent 0 26px, transparent 26px, var(--dot) 26px 27px); background-size: 100% 27px; opacity: .55; }
.nextmini { margin-top: auto; border-top: 1px solid var(--ink); padding-top: 12px; display: block; width: 100%; text-align: left; }
.nm-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.nm-num { font-weight: 900; font-size: 26px; line-height: 1; letter-spacing: -.04em; }
.nm-name { font-size: 10.5px; font-weight: 700; letter-spacing: .3em; }
.nm-sub { font-size: 10px; color: #999; margin-left: auto; }
.nm-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 7px; text-align: center; font-size: 11px; }
.nm-w { font-size: 10px; color: #999; }
.nm-grid .b { font-weight: 800; }
.nm-hol { font-size: 10px; color: #999; margin-top: 9px; min-height: 12px; }

/* 한 해 보기 */
.ygrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 14px; margin-top: 16px; flex: 1 1 auto; align-content: start; }
.ym { align-self: start; display: block; text-align: left; border-radius: 6px; padding: 6px 8px 8px; margin: -6px -8px 0; border: 1.5px solid transparent; }
.ym:hover { background: rgba(0,0,0,.025); }
.ym.cur { border-color: var(--ink); }
.ym-head { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--ink); padding-bottom: 4px; margin-bottom: 6px; }
.ym-num { font-weight: 900; font-size: 20px; letter-spacing: -.03em; line-height: 1; }
.ym-name { font-size: 9.5px; font-weight: 700; letter-spacing: .3em; }
.ym-cur { font-size: 9.5px; color: #777; margin-left: auto; }
.ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 3px; text-align: center; font-size: 11px; }
.ym-w { font-size: 8.5px; font-weight: 700; color: #555; }
.ym-d { height: 21px; line-height: 21px; border-radius: 4px; }
.ym-d.su { background: rgba(0,0,0,.075); }
.ym-d.today { background: var(--ink); color: #fff; border-radius: 50%; width: 21px; margin: 0 auto; font-weight: 700; }
.yhol { font-size: 10.5px; color: #666; border-top: 1px dotted var(--dot); padding-top: 8px; margin-top: 10px; line-height: 1.6; }
.yr-nav { font-size: 10px; letter-spacing: .2em; color: var(--faint); padding-bottom: 2px; }
.yr-nav .linkbtn { font-size: 10px; letter-spacing: .2em; color: var(--faint); }

/* ───────── 그날 모아보기 ───────── */
.day-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(1.5px); }
.day-box { position: relative; width: min(1140px, calc(100vw - 80px)); height: min(760px, calc(100vh - 80px)); background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); padding: 30px 40px; display: flex; flex-direction: column; overflow: hidden; }
.day-head { display: flex; align-items: flex-end; gap: 14px; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); flex: none; }
.day-actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }
.day-close { font-size: 13px; height: 32px; padding: 0 14px; border-width: 1.3px; }
.day-cols { display: grid; gap: 0; margin-top: 20px; flex: 1; min-height: 0; }
.day-cols.three { grid-template-columns: 1fr 1fr 1fr; }
.day-cols.two { grid-template-columns: 1fr 1fr; }
.day-col { padding: 0 34px; border-left: 1px solid var(--line-2); overflow-y: auto; min-height: 0; }
.day-col:first-child { padding-left: 0; border-left: 0; }
.day-col:last-child { padding-right: 0; }
.day-col .lab.mt { margin-top: 22px; }
.day-dtitle { font-size: 17px; font-weight: 700; margin-top: 6px; }
.day-dbody { font-size: 13.5px; line-height: 1.8; color: #444; margin-top: 6px; }
.day-field { margin-top: 10px; font-size: 12.5px; color: #666; }
.day-memo { display: block; width: 100%; text-align: left; margin-top: 10px; border: 1px solid var(--line-2); border-radius: 6px; padding: 12px; background: repeating-linear-gradient(#fff 0 27px, #eee 27px 28px); }
.day-memo-title { font-size: 14px; font-weight: 700; }
.day-memo-body { font-size: 12.5px; line-height: 28px; }
.day-memo-meta { font-size: 11px; color: #999; }
body.modal-open { overflow: hidden; }

/* ───────── 할 일(주간) ───────── */
.bignum.long { font-size: 55px; }
.wk-list { flex: 1 0 auto; display: flex; flex-direction: column; }
.wk-row { display: flex; flex: 1 0 auto; min-height: 64px; border-bottom: 1px solid var(--line); }
.wk-row.su { background: var(--sun-bg); }
.wk-date { width: 62px; flex: none; border-right: 1px solid var(--line); padding: 9px 0 0 4px; }
.wk-num { font-size: 19px; font-weight: 600; height: 28px; display: flex; align-items: center; }
.wk-row.today .wk-num span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 17px; }
.wk-dow { font-size: 10px; letter-spacing: .2em; color: #999; margin-top: 4px; }
.wk-hol { font-size: 9px; color: var(--ink); margin-top: 2px; letter-spacing: 0; }
.wk-items { flex: 1; padding: 9px 0 6px 12px; min-width: 0; }
.wk-t { font-size: calc(13px * var(--fz)); min-height: 22px; }
.wk-t .cb { width: 10px; height: 10px; margin-right: 8px; }
.wk-ev { font-size: calc(12.5px * var(--fz)); min-height: 22px; display: flex; align-items: center; color: var(--ink-2); }
.wk-add { height: 20px; display: flex; align-items: center; font-size: 12px; }
.add-in.plus::placeholder { color: #ccc; }
.wk-right { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.imp-row { min-height: 32px; font-size: calc(13px * var(--fz)); }
.imp-n { width: 20px; font-weight: 700; flex: none; }
.line-in { width: 100%; font-size: inherit; padding: 0; }
.habits { margin-top: 8px; }
.hhead, .hrow { display: flex; align-items: center; }
.hhead { padding-bottom: 6px; }
.hhead > span:first-child { flex: 1; }
.hrow { height: 30px; border-bottom: 1px dotted var(--dot); }
.h-name { flex: 1; font-size: calc(13px * var(--fz)); }
.hdots { display: flex; }
.hcell { width: 26px; display: flex; justify-content: center; }
.hw { font-size: 10px; color: #999; }
.hw.on { color: var(--ink); font-weight: 700; }
.hdot { width: 15px; height: 15px; border-radius: 50%; border: 1px solid #cfcfcf; display: block; padding: 0; position: relative; }
.hdot::before { content: ""; position: absolute; inset: -6px; }
.hdot.v1 { background: var(--ink); border-color: var(--ink); }
.hdot.v2 { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); border-color: var(--ink); }
.hdot:disabled { opacity: .55; }
.grid-wrap { flex: 1 1 auto; display: flex; min-height: 140px; }
.grid-memo { flex: 1; resize: none; background-image: linear-gradient(#ececec 1px, transparent 1px), linear-gradient(90deg, #ececec 1px, transparent 1px); background-size: 18px 18px; padding: 10px 8px; font-size: calc(13px * var(--fz)); line-height: 26px; }
/* B안 시간표 */
.tt { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.tt-head { display: flex; padding: 8px 0 6px; border-bottom: 1.5px solid var(--ink); }
.tt-gut { width: 34px; flex: none; }
.tt-col-h { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tt-w { font-size: 10.5px; font-weight: 600; color: #999; }
.tt-n { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 500; }
.tt-n.on { background: var(--ink); color: #fff; font-weight: 700; }
.tt-view { position: relative; flex: 1 1 auto; min-height: 200px; }
.tt-scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cfcfcf transparent; }
.tt-body { position: relative; }
.tt-line { position: absolute; left: 34px; right: 0; border-top: 1px solid var(--line); }
.tt-hour { position: absolute; left: 0; font-size: 10px; color: #999; transform: translateY(-1px); padding-top: 2px; }
.tt-cols { position: absolute; left: 34px; right: 0; top: 0; bottom: 0; display: flex; }
.tt-col { flex: 1; position: relative; border-left: 1px solid #ececec; cursor: copy; }
.tt-block { position: absolute; left: 2px; right: 2px; background: #f1f1f1; border-left: 2px solid var(--ink); font-size: 10.5px; padding: 3px 4px; line-height: 1.3; overflow: hidden; text-align: left; cursor: pointer; }
.tt-block:hover { background: #e8e8e8; }
.tt-note { position: absolute; right: 10px; z-index: 3; font-size: 11px; color: #555; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; }
.tt-note.down { bottom: 6px; }
.tt-note.up { top: 6px; }

/* ───────── 일기 ───────── */
.meta-wrap { display: flex; gap: 18px; }
.meta { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.meta-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.meta-l { width: 34px; flex: none; }
.sleep-in { display: inline-flex; align-items: center; font-weight: 600; }
.time-in { font-weight: 600; font-size: 14px; width: 78px; padding: 2px 0; }
.time-in::-webkit-calendar-picker-indicator { display: none; }
.sleep-t { font-weight: 600; font-size: 14px; }
.badge-sleep { white-space: nowrap; }
.badge-sleep.muted { color: #bbb; border-color: #ddd; font-weight: 400; }
.pick { display: flex; gap: 2px; flex-wrap: wrap; }
.pk { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 5px; opacity: .35; filter: grayscale(.6); min-width: 44px; }
.pk:hover { opacity: .65; }
.pk.on { opacity: 1; filter: none; }
.pk-ic { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.pk.on .pk-ic { background: var(--chip-on); }
.pk-l { font-size: 10px; }
.pk.on .pk-l { font-weight: 700; }
.pick.read .pk { cursor: default; }
.emo-txt { line-height: 1; }
.meta-hint { font-size: 10px; color: #aaa; margin-left: 44px; }
.photo-box { width: clamp(140px, 36%, 236px); height: 164px; border: 1px dashed #cfcfcf; position: relative; flex: none; overflow: hidden; }
.photo-box.has { border: 0; background: #eee; }
.photo-add { width: 100%; height: 100%; color: #bbb; font-size: 12px; text-align: center; }
.photo-add:hover { color: #777; }
.photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cnt { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.6); letter-spacing: .1em; }
.photo-rep { position: absolute; left: 8px; top: 6px; font-size: 10px; color: #fff; background: rgba(0,0,0,.55); padding: 1px 6px; border-radius: 8px; }
.photo-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 16px; text-align: center; line-height: 26px; }
.photo-nav.prev { left: 6px; } .photo-nav.next { right: 6px; }
.photo-plus { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 15px; text-align: center; line-height: 26px; }
.fields { display: flex; flex-direction: column; }
.field { margin-top: 18px; }
.field-ta { display: block; width: 100%; resize: none; font-size: calc(14px * var(--fz)); line-height: 44px; padding: 0; height: auto; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='44'%3E%3Crect y='43' width='1.6' height='1' fill='%23bdbdbd'/%3E%3C/svg%3E"); background-size: 4px 44px; overflow: hidden; }
.field-ta.read { pointer-events: none; }
.title-line { border-bottom: 1px dotted var(--dot); margin-top: 6px; }
.title-in { width: 100%; font-size: calc(17px * var(--fz)); font-weight: 700; height: 40px; padding-top: 4px; }
.done-info { font-size: 11px; color: #999; }
.diary-tools { display: inline-flex; align-items: center; gap: 12px; font-size: 11.5px; color: #666; font-weight: 500; }
.diary-tools .tb { color: #666; min-width: 16px; text-align: center; }
.diary-tools .tb:hover { color: var(--ink); }
.font-sel { border: 0; background: transparent; font-size: 11.5px; color: #666; font-weight: 500; }
.rich-wrap { position: relative; }
.rich { outline: none; font-size: calc(14.5px * var(--fz)); line-height: 47px; min-height: 47px; word-break: break-word; }
.diary-rich { min-height: calc(47px * 8); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='47'%3E%3Crect y='46' width='1.6' height='1' fill='%23bdbdbd'/%3E%3C/svg%3E"); background-size: 4px 47px; }
.rich.empty::before { content: attr(data-placeholder); color: #bbb; position: absolute; pointer-events: none; }
.rich[contenteditable="false"].empty::before { content: none; }
.rich font[size="2"] { font-size: .82em; } .rich font[size="4"] { font-size: 1.18em; } .rich font[size="5"] { font-size: 1.4em; } .rich font[size="6"] { font-size: 1.75em; } .rich font[size="1"] { font-size: .7em; } .rich font[size="7"] { font-size: 2.1em; }
.rich img { display: block; border-radius: 2px; cursor: pointer; background: #eee; }
.rich img.img-right { float: right; margin: 6px 0 8px 18px; clear: right; }
.rich img.img-center { margin: 8px auto; float: none; }
.rich img.missing { min-height: 60px; }
.rich::after { content: ""; display: block; clear: both; }
.img-sel { position: absolute; border: 1px solid var(--ink); pointer-events: none; z-index: 3; }
.img-handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 1.5px solid var(--ink); border-radius: 2px; pointer-events: auto; touch-action: none; }
.img-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.img-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.img-menu { position: absolute; z-index: 4; display: flex; background: #fff; border: 1px solid var(--ink); border-radius: 15px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.img-menu button { font-size: 12px; font-weight: 600; padding: 6px 12px; }
.img-menu button + button { border-left: 1px solid var(--line); }
.img-menu button:hover { background: #f4f4f4; }
.danger { color: var(--danger) !important; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.tag { font-size: 12px; border: 1px solid #d4d4d4; border-radius: 14px; padding: 3px 11px; color: #888; display: inline-flex; align-items: center; gap: 4px; }
.tag.add:hover { color: var(--ink); border-color: #999; }
.tag-x { color: #aaa; font-size: 13px; line-height: 1; }
.tag-in { font-size: 12px; border: 1px solid var(--ink); border-radius: 14px; padding: 3px 11px; width: 110px; }
.del-link { font-size: 11px; color: #999; margin-top: 14px; }
/* 일기 목록 */
.dlist { display: flex; flex-direction: column; }
.flow-src { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.flow-dst { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.draft-card { display: flex; align-items: center; gap: 14px; background: rgba(0,0,0,.035); border-radius: 8px; padding: 12px 18px; margin-top: 12px; font-size: 13px; text-align: left; width: 100%; }
.draft-card .badge { margin-left: 0; }
.draft-card b { font-size: 14px; font-weight: 800; }
.dc-title { flex: 1; min-width: 0; color: #444; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-go { font-size: 12px; font-weight: 600; }
.li { display: flex; gap: 22px; padding: 16px 0 18px; border-bottom: 1px solid var(--line-2); text-align: left; width: 100%; align-items: flex-start; }
.li:hover { background: rgba(0,0,0,.015); }
.li-date { width: 86px; flex: none; }
.li-date b { display: block; font-size: 23px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.li-date span { font-size: 10.5px; color: #999; letter-spacing: .1em; }
.li-main { flex: 1; min-width: 0; }
.li-title { display: flex; align-items: center; gap: 6px; font-size: calc(15px * var(--fz)); font-weight: 700; }
.li-prev { font-size: calc(12.5px * var(--fz)); color: #555; margin-top: 8px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-thumb { width: 86px; height: 86px; flex: none; background: #eee; overflow: hidden; }
.li-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.li-month { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .2em; padding: 18px 0 6px; border-bottom: 1px solid var(--ink); }
.empty-note { padding: 40px 0; text-align: center; font-size: 13px; line-height: 1.9; color: #666; }

/* ───────── 메모 ───────── */
.mlist { display: flex; flex-direction: column; }
.mi { display: flex; align-items: center; gap: 18px; padding: 16px 16px; border-bottom: 1px solid var(--line-2); text-align: left; width: 100%; position: relative; }
.mi.sel { background: rgba(0,0,0,.035); }
.mi:hover { background: rgba(0,0,0,.02); }
.cover { width: 80px; height: 62px; flex: none; border: 1px solid var(--line-2); overflow: hidden; background: #fff; }
.cover.photo { border: 0; background: #ddd; }
.cover.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.lined { background: repeating-linear-gradient(#fff 0 9px, #e3e3e3 9px 10px); }
.cover.plus { border: 1px dashed #bbb; display: flex; align-items: center; justify-content: center; color: #999; font-size: 18px; }
.mi-main { flex: 1; min-width: 0; }
.mi-title { font-size: calc(16px * var(--fz)); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-title.muted { color: #999; }
.mi-meta { font-size: 12px; color: #888; margin-top: 5px; }
.pin { font-size: 10.5px; font-weight: 600; border: 1px solid var(--ink); border-radius: 3px; padding: 1px 6px; }
.mi-more { color: #aaa; font-size: 16px; padding: 0 4px; }
.mi-more:hover { color: var(--ink); }
.memo-hints { margin-top: 18px; font-size: 11.5px; color: #888; line-height: 2; }
.memo-hd { gap: 14px; }
.memo-title { font-size: 33px; font-weight: 800; letter-spacing: -.03em; min-width: 4em; flex: 0 1 auto; field-sizing: content; max-width: 70%; width: auto; line-height: 1; padding-bottom: 2px; }
.memo-title::placeholder { color: #bbb; }
.memo-dates { font-size: 11px; color: #9a9a9a; letter-spacing: .3em; padding-bottom: 4px; white-space: nowrap; }
.memo-hd .btns { margin-left: auto; align-self: center; }
.memo-toolbar { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.memo-tools { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.tb.chip { font-size: 13px; color: var(--ink); border-color: #ccc; padding: 4px 14px; border-radius: 6px; }
.tb.chip:hover { border-color: var(--ink); }
.hlchip { background: linear-gradient(transparent 55%, var(--hl) 55%); }
.tb-sp { flex: 1; }
.tb.undo { font-size: 16px; color: #999; width: 26px; }
.tb.undo:hover { color: var(--ink); }
.note-wrap { position: relative; flex: 1 1 auto; min-height: 300px; display: flex; flex-direction: column; }
.memo-rich { flex: 1 1 auto; min-height: 300px; line-height: 47px; background-image: linear-gradient(transparent 46px, #ddd 46px); background-size: 100% 47px; padding-left: 4px; }
.note-wrap .rich-wrap { flex: 1 1 auto; display: flex; flex-direction: column; }
.sticker-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.stk { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; user-select: none; }
.stk img { width: 100%; display: block; }
.stk.sel { outline: 1.5px dashed var(--ink); outline-offset: 5px; border-radius: 4px; }
.stk-handle { position: absolute; right: -9px; bottom: -9px; width: 14px; height: 14px; border: 1.5px solid var(--ink); background: #fff; border-radius: 3px; display: none; cursor: nwse-resize; }
.stk.sel .stk-handle, .stk:hover .stk-handle { display: block; }
.stk-menu { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--ink); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px 0; width: 180px; font-size: 13px; }
.stk-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; width: 100%; }
.stk-row + .stk-row { border-top: 1px solid #eee; }
.tip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.tip-card { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; min-height: 190px; position: relative; }
.tip-demo { display: flex; justify-content: center; margin-top: 26px; }
.tip-demo.sel img { outline: 1.5px dashed var(--ink); outline-offset: 6px; border-radius: 4px; }
.tip-menu { font-size: 11px; border: 1px solid var(--ink); border-radius: 8px; margin-top: 18px; background: #fff; }
.tip-menu > div { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; }
.tip-menu > div + div { border-top: 1px solid #eee; }
.tip-menu .toggle { transform: scale(.75); }
.dlg.tip { width: min(760px, calc(100vw - 32px)); }
.stk-pick-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.stk-pick { width: 52px; height: 52px; padding: 5px; border: 1px solid var(--line-2); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.stk-pick img { max-width: 100%; max-height: 100%; }
.stk-pick:hover { border-color: var(--ink); }
.stk-pick.add { font-size: 11.5px; border-style: dashed; border-color: #bbb; color: #777; width: auto; padding: 0 10px; }
.stk-del { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.dlg.stk-picker { width: min(560px, calc(100vw - 32px)); }

/* ───────── 검색 ───────── */
.search-box { display: flex; align-items: center; gap: 10px; border-bottom: 1.5px solid var(--ink); padding: 4px 0 8px; }
.search-ic { font-size: 20px; color: #777; }
.search-in { flex: 1; font-size: 16px; min-width: 0; }
.search-in::-webkit-search-cancel-button { display: none; }
.sr-info { font-size: 11px; color: #999; margin: 10px 0 4px; }
.sr-list { display: flex; flex-direction: column; }
.sr-list .sec { margin-top: 18px; }
.sr { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dotted var(--dot); text-align: left; width: 100%; align-items: baseline; }
.sr:hover { background: rgba(0,0,0,.02); }
.sr-date { width: 46px; flex: none; font-weight: 700; font-size: 13px; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sr-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 2px; }
.sr-sub { font-size: 12px; color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-cb { width: 10px; height: 10px; border: 1.3px solid var(--ink); border-radius: 24%; display: inline-block; margin-right: 7px; flex: none; }
.sr-cb.on { background: var(--ink); }
.sr-empty { font-size: 12px; padding: 10px 0; }

/* ───────── 설정 ───────── */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dotted var(--dot); font-size: 13px; }
.set-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-l small { font-size: 11px; color: #999; }
.set-c { flex: none; display: flex; align-items: center; gap: 8px; }
.radios { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.radio { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border: 1px solid #ccc; border-radius: 15px; font-size: 12px; font-weight: 600; cursor: pointer; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.radio.disabled { opacity: .45; cursor: default; }
.radio small { font-size: 10px; font-weight: 400; }
.radio:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.sel { border: 1px solid #ccc; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; background: #fff; }
.wchoice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.wopt { border: 1px solid #ddd; border-radius: 12px; padding: 12px; text-align: left; background: #fff; }
.wopt.on { border: 2px solid var(--ink); padding: 11px; }
.wopt-t { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.wopt small { display: block; font-size: 11px; color: #888; margin: 3px 0 8px 24px; }
.rdot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rdot.on::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.wprev { height: 150px; border: 1px solid var(--line-2); box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 10px 12px; font-size: 8.5px; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.wp-lab { font-size: 7.5px; color: #999; letter-spacing: .15em; border-bottom: 1px solid var(--ink); padding: 4px 0 2px; }
.wp-line { border-bottom: 1px dotted var(--dot); height: 12px; display: flex; align-items: center; }
.wp-line.dots { justify-content: flex-end; gap: 4px; }
.wp-line.dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid #ccc; }
.wp-line.dots i.on { background: var(--ink); border-color: var(--ink); }
.wp-grid { flex: 1; background-image: linear-gradient(#eee 1px, transparent 1px), linear-gradient(90deg, #eee 1px, transparent 1px); background-size: 8px 8px; }
.wp-days { font-size: 8px; color: #999; text-align: right; letter-spacing: .3em; padding: 2px 0; }
.wp-tt { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.wp-tl { border-top: 1px solid #e3e3e3; }
.wp-blk { position: absolute; width: 12%; background: #eee; border-left: 2px solid var(--ink); }
.set-sub { padding: 12px 0; border-bottom: 1px dotted var(--dot); }
.set-sub > .lab { margin-bottom: 8px; display: block; line-height: 1.5; }
.emo-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.emo-cell { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 6px; }
.emo-in { width: 46px; font-size: 12px; border-bottom: 1px dotted #ccc; }
.field-edit { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.field-edit .line-in { flex: 1; border-bottom: 1px dotted var(--dot); font-size: 13px; padding: 4px 0; }
.mini { width: 26px; height: 26px; border: 1px solid #ccc; border-radius: 6px; font-size: 12px; text-align: center; }
.mini:disabled { opacity: .3; }
.mini-sp { width: 26px; }
.notice { font-size: 12px; line-height: 1.7; color: #555; background: rgba(0,0,0,.035); border-radius: 8px; padding: 10px 12px; margin: 10px 0 4px; }
.on-txt { font-size: 12px; font-weight: 700; }
.chk-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin: 10px 0 6px; }
.chk-row input { accent-color: var(--ink); width: 15px; height: 15px; vertical-align: -2px; }
.pw-box { display: flex; gap: 8px; }
.pw-box .dlg-input { flex: 1; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.trash-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dotted var(--dot); font-size: 12.5px; }
.trash-row .badge { margin-left: 0; }
.tr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .pill { height: 26px; padding: 0 10px; font-size: 11px; }

/* ───────── 창·알림·잠금 ───────── */
.dlg-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { background: #fff; border-radius: 12px; padding: 22px; width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.4); max-height: calc(100vh - 32px); overflow-y: auto; }
.dlg-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.dlg-msg { font-size: 13px; line-height: 1.7; color: #444; white-space: pre-line; margin-bottom: 8px; word-break: keep-all; }
.dlg-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.dlg-input { border: 1px solid #ccc; border-radius: 8px; padding: 9px 10px; font-size: 14px; background: #fff; width: 100%; }
.dlg-input:focus { border-color: var(--ink); }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg-del { margin-top: 14px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #1a1a1a; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 22px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-btn { color: #fff; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.pop-menu { position: fixed; z-index: 85; background: #fff; border: 1px solid var(--ink); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px 0; min-width: 160px; }
.pop-menu button { display: block; width: 100%; padding: 10px 14px; font-size: 13px; text-align: left; }
.pop-menu button:hover { background: #f4f4f4; }
.lock-screen { position: fixed; inset: 0; z-index: 100; background: var(--leather); background-image: var(--leather-img); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lock-box { background: #fff; border-radius: 6px; padding: 36px 32px 28px; width: min(360px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.55); text-align: center; }
.lock-date { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-bottom: 8px; }
.lock-date .big { font-weight: 900; font-size: 48px; line-height: .8; letter-spacing: -.045em; }
.lock-date .sub { font-size: 11px; color: #999; letter-spacing: .3em; }
.lock-title { font-size: 15px; font-weight: 700; }
.lock-msg { font-size: 12.5px; color: #777; min-height: 18px; }
.lock-input { border: 1px solid #ccc; border-radius: 8px; padding: 11px; font-size: 20px; text-align: center; letter-spacing: .3em; }
.lock-input:focus { border-color: var(--ink); }
.lock-box .pill { height: 40px; border-radius: 20px; font-size: 14px; }
.lock-box .linkbtn { margin-top: 4px; }

/* ───────── 휴대폰: 위쪽 가로 탭 + 한 쪽씩 ───────── */
.is-mobile .stage { height: auto; min-height: 100dvh; padding: 0 14px 30px; }
body:has(#app.is-mobile) { overflow: auto; }
.is-mobile .book-wrap { height: auto; width: auto; margin: 0; transform: none; }
.is-mobile .vtabs { display: none; }
.is-mobile .mtabs { display: flex; gap: 4px; position: sticky; top: 0; z-index: 20; padding-top: 14px; background: var(--leather); background-image: var(--leather-img); }
.mtabs .tab { flex: 1; text-align: center; padding: 9px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--tab-m-text); background: var(--tab-m); border-radius: 8px 8px 0 0; display: flex; justify-content: center; align-items: center; min-height: 37px; }
.mtabs .tab.on { background: #fff; color: var(--ink); }
.mtabs .tab-search { flex: 0 0 42px; }
.is-mobile .book { position: relative; inset: auto; border-radius: 0 0 4px 4px; box-shadow: 0 14px 30px rgba(0,0,0,.6); min-height: calc(100dvh - 51px - 30px); display: block; }
.is-mobile .page.M { border-radius: 0 0 4px 4px; min-height: calc(100dvh - 51px - 30px); overflow: visible; }
.is-mobile .page.M::after { position: absolute; }
.is-mobile .page.M > .in { position: relative; inset: auto; padding: 22px 18px 14px; overflow: visible; min-height: calc(100dvh - 51px - 30px); }
.is-mobile .edge, .is-mobile .fold { display: none; }
.is-mobile .anim-layer { position: relative; display: block; }
.is-mobile .leaf.origin-l { position: absolute; top: 0; bottom: auto; }
.is-mobile .stage-note { display: none; }
.is-mobile .hd { height: 50px; gap: 10px; margin-bottom: 18px; }
.is-mobile .bignum { font-size: 53px; }
.is-mobile .bignum.long { font-size: 31px; }
.is-mobile .hd-title { font-size: 11px; }
.is-mobile .hd-sub { font-size: 10.5px; }
.is-mobile .dh { grid-template-columns: repeat(7, 1fr); letter-spacing: .1em; text-align: center; padding-left: 0; }
.is-mobile .mc { padding: 5px; min-height: 78px; }
.is-mobile .mc.today .n { margin: -2px 0 -2px -2px; }
.m-memo { display: flex; gap: 16px; margin-top: 16px; }
.m-memo > div { flex: 1; min-width: 0; }
.is-mobile .memo-ev { margin-top: 0; }
.is-mobile .foot { margin-top: 24px; }
.m-topbar { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px; }
.m-topbar .btns { margin-left: auto; }
.is-mobile .hd .hd-right .pill { margin-left: 6px; }
.is-mobile .meta-wrap { gap: 12px; }
.is-mobile .meta-wrap.m { padding-top: 12px; border-top: 1px solid var(--ink); align-items: flex-start; }
.is-mobile .photo-box { width: 110px; height: 96px; }
.is-mobile .pick { gap: 0; }
.is-mobile .pk { min-width: 38px; padding: 2px 2px; }
.is-mobile .pk-ic { width: 30px; height: 30px; }
.is-mobile .meta-row { flex-wrap: wrap; gap: 6px; }
.is-mobile .meta-l { width: 26px; }
.is-mobile .field { margin-top: 14px; }
.is-mobile .field-ta { line-height: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='40'%3E%3Crect y='39' width='1.6' height='1' fill='%23bdbdbd'/%3E%3C/svg%3E"); background-size: 4px 40px; font-size: calc(13.5px * var(--fz)); }
.is-mobile .rich { line-height: 40px; font-size: calc(13.5px * var(--fz)); }
.is-mobile .diary-rich { min-height: calc(40px * 6); background-size: 4px 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='40'%3E%3Crect y='39' width='1.6' height='1' fill='%23bdbdbd'/%3E%3C/svg%3E"); }
.is-mobile .sec { margin-top: 18px; }
.is-mobile .hd + .sec, .is-mobile .m-topbar + .hd + .sec { margin-top: 0; }
.is-mobile .diary-tools { gap: 9px; }
.is-mobile .wk-list { flex: none; }
.is-mobile .wk-row { min-height: 66px; flex: none; }
.is-mobile .wk-date { width: 48px; }
.is-mobile .wk-num { font-size: 16px; }
.m-hint { margin-top: 12px; font-size: 11px; color: #999; text-align: center; }
.wk-right.m { margin-top: 18px; }
.is-mobile .tt-view { height: 460px; flex: none; }
.is-mobile .grid-wrap { min-height: 220px; }
.is-mobile .li { gap: 12px; }
.is-mobile .li-date { width: 58px; }
.is-mobile .li-date b { font-size: 19px; }
.is-mobile .li-thumb { width: 64px; height: 64px; }
.is-mobile .mi { padding: 14px 6px; gap: 12px; }
.is-mobile .cover { width: 64px; height: 50px; }
.is-mobile .memo-title { font-size: 26px; width: 100%; }
.is-mobile .memo-hd { flex-wrap: wrap; height: auto; align-items: baseline; }
.is-mobile .note-wrap { min-height: 60vh; }
.is-mobile .memo-rich { background-image: linear-gradient(transparent 39px, #ddd 39px); background-size: 100% 40px; }
.is-mobile .ygrid.m { grid-template-columns: repeat(3, 1fr); column-gap: 12px; row-gap: 10px; }
.is-mobile .ym-grid { font-size: 8.5px; }
.is-mobile .ym-d { height: 15px; line-height: 15px; }
.is-mobile .ym-d.today { width: 15px; }
.is-mobile .ym-w { font-size: 7px; }
.is-mobile .ym-num { font-size: 15px; }
.is-mobile .ym-name { font-size: 7px; letter-spacing: .15em; }
.is-mobile .ym-cur { display: none; }
.yr-top { display: flex; flex-direction: column; }
.yr-top .yr-nav { margin: -8px 0 6px; text-align: right; }
.is-mobile .set-row { flex-wrap: wrap; }
.is-mobile .wchoice { grid-template-columns: 1fr; }
.is-mobile .sr-sub { white-space: normal; }
/* 휴대폰 그날 모아보기: 거의 전체 화면 */
@media (max-width: 899px) {
  .day-wrap { align-items: stretch; justify-content: stretch; padding: 0; }
  .day-box { width: 100%; height: 100%; border-radius: 0; padding: 18px 18px 12px; overflow-y: auto; }
  .day-head { gap: 10px; padding-bottom: 12px; }
  .day-head .bignum { font-size: 37px; }
  .day-cols.three, .day-cols.two { display: flex; flex-direction: column; overflow: visible; }
  .day-col { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line-2); overflow: visible; }
  .day-col:first-child { border-top: 0; padding-top: 0; }
  .tip-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { body { background: #fff; } .vtabs, .mtabs, .edge { display: none; } }

/* ───────── 휴대폰: 자유 일기 미리보기 + 집중 쓰기 시트 ───────── */
.free-prev { display: block; width: 100%; text-align: left; padding: 10px 0 4px; }
.fp-title { font-size: calc(17px * var(--fz)); font-weight: 700; padding: 6px 0 8px; border-bottom: 1px dotted var(--dot); }
.fp-body { font-size: calc(13.5px * var(--fz)); line-height: 40px; min-height: 120px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='40'%3E%3Crect y='39' width='1.6' height='1' fill='%23bdbdbd'/%3E%3C/svg%3E"); background-size: 4px 40px; }
.fp-title.ph, .fp-body.ph { color: #bbb; }
.fp-tags { font-size: 12px; color: #888; margin-top: 10px; }
.fp-go { font-size: 11px; font-weight: 600; color: #777; margin-top: 10px; text-align: right; }
.fs-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); }
.fs-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 6vh; top: 6dvh; background: var(--paper); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; isolation: isolate; transition: transform .2s; }
.fs-sheet::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--paper-tex) center / cover; mix-blend-mode: multiply; opacity: var(--paper-tex-opacity); z-index: -1; }
.fs-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 18px 18px 10px; border-bottom: 1px solid var(--ink); margin: 0 0 0; touch-action: none; flex: none; }
.fs-grab { position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: #ccc; }
.fs-label { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .2em; margin-right: auto; }
.fs-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 18px 80px; -webkit-overflow-scrolling: touch; }
.fs-body .diary-rich { min-height: calc(40px * 8); }
.fs-foot { font-size: 10px; color: var(--faint); letter-spacing: .2em; margin-top: 16px; }
.fs-tools { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #fff; border-top: 1px solid var(--line); padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; }
.fs-sheet.kb .fs-tools { padding-bottom: 8px; }
.fs-tools .diary-tools { gap: 16px; font-size: 13px; }
.fs-tools .diary-tools .tb { min-width: 22px; min-height: 28px; font-size: 13px; }
.fs-tools .font-sel { font-size: 13px; }
.fs-body .rich { line-height: 40px; font-size: calc(14px * var(--fz)); }
.fs-body .diary-rich { background-size: 4px 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='40'%3E%3Crect y='39' width='1.6' height='1' fill='%23bdbdbd'/%3E%3C/svg%3E"); }

/* 여러 줄이 되는 '시간 + 내용', '체크박스 + 글' 줄: 시간·체크박스를 첫 줄에 맞추고 줄 높이는 내용만큼 늘어남 */
.trow.dl, .erow.dl { align-items: flex-start; line-height: 18px; padding: 5px 0 4px; height: auto; }
.trow.dl.big, .erow.dl.big { line-height: 22px; padding-top: 10px; }
.erow.dl, .erow.dl.big, .wk-ev { align-items: baseline; }
.trow .t-text { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.erow .e-text { overflow-wrap: anywhere; }
.trow.dl .cb { margin-top: 3px; margin-bottom: 0; }
.trow.dl.big .cb { margin-top: 5px; }
.wk-t { align-items: flex-start; line-height: 20px; padding: 1px 0; }
.wk-t .cb { margin-top: 5px; }
.wk-ev { line-height: 20px; padding: 1px 0; }
.t-del { align-self: flex-start; }

/* 추가 입력바: 줄 전체가 누르는 영역(최소 40px) */
.add-line { display: flex; align-items: center; min-height: 40px; cursor: text; width: 100%; padding: 0; }
.add-line.dl { align-items: center; padding: 0; min-height: 40px; }
.add-label { color: #bbb; font-size: inherit; pointer-events: none; }
.add-line:hover .add-label { color: #777; }
.add-box { display: flex; align-items: center; gap: 8px; width: 100%; }
.add-input { flex: 1; min-width: 0; font-size: inherit; padding: 6px 0 4px; border-bottom: 1.5px solid var(--ink); }
.add-input::placeholder { color: #aaa; }
.add-time { width: 96px; flex: none; font-size: 12px; padding: 6px 0 4px; border-bottom: 1.5px solid var(--ink); color: #777; }
.add-time::-webkit-calendar-picker-indicator { opacity: .4; }
.wk-items { cursor: text; }
.wk-items .t-list { cursor: default; }
.add-line.wk-add { min-height: 40px; height: auto; font-size: calc(13px * var(--fz)); }

/* 창이 세로로 길 때 아래가 휑하지 않게: 내용 영역이 남는 높이를 채움(최대값 있음) */
.page:not(.M) .ygrid { flex: 1 1 0; min-height: 520px; max-height: 1000px; grid-template-rows: repeat(3, minmax(0, 1fr)); align-content: stretch; }
.page:not(.M) .ym { align-self: stretch; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.page:not(.M) .ym-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: auto repeat(6, minmax(0, 1fr)); align-items: center; max-height: 250px; }
.page:not(.M) .ym-d { height: 21px; line-height: 21px; width: 100%; }
.page:not(.M) .ym-d.today { width: 21px; justify-self: center; }
/* 일기 왼쪽: 하루 기록 칸이 남는 높이를 나눠 가짐(칸마다 3~6줄) */
.page.L .fields { flex: 1 1 auto; min-height: 0; }
.page.L .field { flex: 1 1 0; display: flex; flex-direction: column; min-height: calc(44px * 3 + 30px); max-height: calc(44px * 6 + 30px); }
.page.L .field-ta { flex: 1 1 auto; min-height: 132px; }
/* 일기 오른쪽: 본문 줄 노트가 아래까지 */
.page.R .rich-wrap:has(.diary-rich) { flex: 1 1 auto; display: flex; flex-direction: column; max-height: calc(47px * 18); }
.page.R .diary-rich { flex: 1 1 auto; }

/* 한글 큰 제목: 숫자 대문자 높이와 같아 보이게(약 45px, 800) — 숫자 제목은 55px 그대로 */
.bignum.ko { font-size: 45px; font-weight: 800; letter-spacing: -.03em; line-height: .86; }
.is-mobile .bignum.ko { font-size: 43px; }
/* 확인 창의 위험 버튼: 바탕은 흰색, '지우기' 글자만 빨강(모노톤 유지) */
.pill.dark.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.pill.dark.danger:hover { background: #fff5f5; }
.more-btn { padding: 0 11px; font-size: 15px; border-color: #bbb; letter-spacing: 1px; }
.dc-more { color: #999; font-size: 16px; padding: 0 2px 0 6px; }
.dc-more:hover { color: var(--ink); }


/* 날짜 색 — 일요일·공휴일 회색보다 우선. 어두운 색이면 칸 안 글자·표시를 흰색으로 반전 */
.mc.colored { background: var(--dc); }
.mc.colored::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dc-bar); }
.mc.colored.dc-dark::before { width: 1px; background: rgba(255,255,255,.55); }
.mc.colored:hover { background: var(--dc); filter: brightness(.985); }
.dc-fg, .dc-fg .n, .dc-fg .holname, .dc-fg .ti, .dc-fg .ti-text, .dc-fg .cnt, .dc-fg .wk-dow, .dc-fg .wk-hol, .dc-fg .wk-num { color: var(--fg); }
.dc-fg .s, .dc-fg .ti-text.s { color: var(--fg60); }
.dc-fg .more { color: var(--fg60); }
.dc-fg .dmark.done { background: var(--fg); }
.dc-fg .dmark.draft { border-color: var(--fg); }
.dc-fg .cb { border-color: var(--fg); }
.dc-fg .cb.on { background: var(--fg); }
.dc-fg .cb.on::after { border-color: var(--dc); }
.mc.today.dc-fg .n { background: var(--fg); color: var(--dc); }
.wk-date.dc { background: var(--dc); }
.wk-row.today .wk-date.dc-fg .wk-num span { background: var(--fg); color: var(--dc); }
.nm-grid .dc { background: var(--dc); border-radius: 4px; }
.nm-grid .dc.dc-fg { color: var(--fg); }
.ym-d.dc { background: var(--dc); }
.ym-d.dc.dc-fg { color: var(--fg); }
.ym-d.dc.today { background: var(--ink); color: #fff; box-shadow: 0 0 0 3px var(--dc); }
.ym-d.dc.today.dc-fg { background: var(--fg); color: var(--dc); box-shadow: 0 0 0 3px var(--dc); }
/* 고르기: 머리에는 지금 색 하나 → 펼침 패널(그레이/컬러/내 색) */
.dc-pick { position: relative; margin-right: 8px; }
.dc-trigger { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 5px; border: 1px solid #ccc; border-radius: 16px; font-size: 12px; font-weight: 600; color: #555; }
.dc-trigger:hover { border-color: var(--ink); }
.dc-cur { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); position: relative; }
.dc-cur.none::after, .dc-sw.none::after { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1.3px; background: #bbb; transform: rotate(45deg); }
.dc-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; background: #fff; border: 1px solid var(--ink); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 12px 14px 8px; width: max-content; max-width: min(460px, calc(100vw - 32px)); }
.dc-row2 { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.dc-rlab { width: 34px; flex: none; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .1em; }
.dc-sws { display: flex; gap: 7px; flex-wrap: wrap; }
.dc-sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.16); position: relative; flex: none; padding: 0; background: #fff; }
.dc-sw::before { content: ""; position: absolute; inset: -5px; }
.dc-sw.none { border-color: #bbb; }
.dc-sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.dc-sw.add { border: 1px dashed #aaa; color: #777; font-size: 14px; line-height: 24px; text-align: center; }
.dc-hint { font-size: 10.5px; color: #aaa; margin-top: 4px; }
.dc-dlg { width: min(380px, 100%); }
.dc-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.dc-picker { width: 48px; height: 40px; border: 1px solid #ccc; border-radius: 8px; padding: 2px; background: #fff; flex: none; }
.dc-hex { flex: 1; font-family: ui-monospace, monospace; text-transform: uppercase; }
.dc-preview { width: 52px; height: 40px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; }
.dc-preview.dc-dark { color: #fff; }
.dc-msg { font-size: 12px; color: var(--danger); min-height: 16px; margin-top: 6px; }
.dc-manage { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.dc-mng { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 16px; padding: 3px 8px 3px 4px; position: relative; font-size: 11px; }
.dc-mng .stk-del { position: static; width: 16px; height: 16px; line-height: 16px; font-size: 11px; }
.dc-hexlab { font-family: ui-monospace, monospace; color: #666; }
@media (max-width: 899px) {
  .day-head { flex-wrap: wrap; }
  .day-actions { display: contents; }
  .day-close { margin-left: auto; align-self: center; }
  .dc-pick { order: 2; width: 100%; margin: 12px 0 0; }
  .dc-panel { position: static; margin-top: 10px; width: 100%; max-width: none; box-shadow: none; }
  .dc-sw { width: 30px; height: 30px; }
  .dc-sws { gap: 9px; }
}
.dc-rlab { width: 42px; }
.dc-nonelab { font-size: 11.5px; color: #888; align-self: center; }

/* 글자 색 줄 */
.fg-row { border-top: 1px dotted var(--dot); margin-top: 4px; padding-top: 9px; }
.fg-opt { height: 28px; padding: 0 11px; border: 1px solid #ccc; border-radius: 14px; font-size: 11.5px; font-weight: 600; color: #555; display: inline-flex; align-items: center; gap: 5px; }
.fg-opt.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.fg-opt:disabled { opacity: .4; }
.fg-chip { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); }
.fg-warn { font-size: 11px; color: var(--danger); align-self: center; }
.fg-note { font-size: 11px; color: #999; align-self: center; }
.day-col p.muted { font-size: 13px; margin-top: 8px; }
@media (max-width: 899px) { .dc-sw { width: 27px; height: 27px; } .dc-sws { gap: 6px; } .dc-rlab { width: 40px; } }

/* 검토 1회차 */
.title-read { height: auto; min-height: 40px; padding: 8px 0 6px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.dc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; border: 1px solid rgba(0,0,0,.15); }
/* 휴대폰 누르기 영역 40px 이상(보이는 크기는 그대로, 닿는 범위만 넓힘) */
@media (pointer: coarse) {
  .cb::before { inset: -14px; }
  .t-del { position: relative; }
  .t-del::before { content: ""; position: absolute; inset: -9px; }
  .hd-link { display: inline-block; padding: 14px 0; margin: -14px 0; }
  .mtabs .tab { min-height: 44px; }
  .time-in { min-height: 40px; }
  .hdot::before { inset: -12px; }
  .back-link { padding: 12px 0; }
}
/* 한 해 보기: 낮은 창(1280×720 등)에서도 공휴일 목록까지 한 쪽에, '이번 달' 테두리가 잘리지 않게 */
.page:not(.M) .ygrid { min-height: 0; padding: 0 6px; margin: 16px -6px 0; column-gap: 34px; row-gap: 10px; }
.page:not(.M) .ym { margin: 0; padding: 4px 6px 4px; }
.page:not(.M) .ym-grid { row-gap: 0; }
.page:not(.M) .ym-d { height: auto; min-height: 0; max-height: 21px; line-height: 1; padding: 3px 0; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.page:not(.M) .ym-d.today { width: 21px; height: 21px; padding: 0; }
@media (max-height: 760px) {
  .page:not(.M) .ym-head { padding-bottom: 2px; margin-bottom: 3px; }
  .page:not(.M) .ym-num { font-size: 16px; }
  .page:not(.M) .ym-d { font-size: 10px; padding: 1px 0; }
  .page:not(.M) .ym-d.today { width: 17px; height: 17px; }
  .page:not(.M) .yhol { margin-top: 6px; padding-top: 5px; font-size: 10px; }
}
.img-drop { position: absolute; z-index: 5; pointer-events: none; }
.img-drop.line { background: var(--ink); border-radius: 1px; }
.img-drop.box { border: 1.5px dashed var(--ink); border-radius: 3px; background: rgba(0,0,0,.03); }
.rich img.dragging { opacity: .4; }
.rich img { touch-action: none; }
/* 서식 도구 추가: 취소선·형광펜·글자색·목록 */
.tb-hl { background: linear-gradient(transparent 50%, var(--hl) 50%); padding: 0 1px; }
.tb-a { font-weight: 700; border-bottom: 2.5px solid #9C5B5B; line-height: 1; padding: 0 1px; }
.rich ul, .rich ol { padding-left: 1.4em; margin: 0; }
.rich ul.checklist { list-style: none; padding-left: 0; }
.rich ul.checklist > li { position: relative; padding-left: 26px; }
.rich ul.checklist > li::before { content: ""; position: absolute; left: 2px; top: 50%; width: 13px; height: 13px; margin-top: -8px; border: 1.3px solid var(--ink); border-radius: 24%; box-sizing: border-box; cursor: pointer; }
.rich ul.checklist > li[data-checked="1"]::before { background: var(--ink); }
.rich ul.checklist > li[data-checked="1"]::after { content: ""; position: absolute; left: 6.5px; top: 50%; margin-top: -6px; width: 3.5px; height: 7px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.rich ul.checklist > li[data-checked="1"] { color: var(--faint); text-decoration: line-through; }
.color-pop { position: fixed; z-index: 75; background: #fff; border: 1px solid var(--ink); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.2); padding: 12px 14px 10px; width: min(360px, calc(100vw - 16px)); }
.cp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cp-default { height: 26px; font-size: 11px; padding: 0 10px; }
/* 팔레트 탭·밝기 단계 */
.pal { display: flex; flex-direction: column; gap: 8px; }
.pal-none { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #888; }
.pal-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pal-tab { flex: none; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 11.5px; font-weight: 600; color: #666; border: 1px solid transparent; }
.pal-tab.on { border-color: var(--ink); color: var(--ink); }
.pal-tab:hover { color: var(--ink); }
.pal-row { display: flex; gap: 8px; flex-wrap: wrap; min-height: 30px; align-items: center; }
.pal-shades { display: flex; gap: 8px; align-items: center; padding: 8px 0 2px; border-top: 1px dotted var(--dot); flex-wrap: wrap; }
.pal-slab { font-size: 10.5px; font-weight: 600; color: var(--muted); width: 30px; flex: none; }
.dc-sw.base { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #999; }
.fs-tools .diary-tools { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; max-width: 100%; }
.fs-tools { justify-content: flex-start; }
.rich[contenteditable="false"] img { touch-action: auto; }
.diary-tools { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
/* 처음 시작 화면 */
.onb { position: fixed; inset: 0; z-index: 95; background: rgba(16,16,16,.97); background-image: var(--leather-img); background-blend-mode: multiply; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; touch-action: pan-y; animation: onbIn .25s ease-out; }
.onb.out { opacity: 0; transition: opacity .2s; }
@keyframes onbIn { from { opacity: 0; } }
.onb-skip { position: absolute; top: 18px; right: 18px; color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; padding: 10px 12px; }
.onb-skip:hover { color: #fff; }
.onb-stage { position: relative; width: min(440px, 100%); height: min(460px, 62vh); }
.onb-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; animation: onbCard .3s ease-out; }
.onb-card.leave { opacity: 0; transform: translateX(-12px); transition: opacity .2s, transform .2s; }
@keyframes onbCard { from { opacity: 0; transform: translateX(12px); } }
.onb-card.back { animation-name: onbCardB; }
@keyframes onbCardB { from { opacity: 0; transform: translateX(-12px); } }
.onb-art { width: min(280px, 80vw); height: auto; margin-bottom: 26px; overflow: visible; }
.onb-art .draw { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: onbDraw .8s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes onbDraw { to { stroke-dashoffset: 0; } }
.onb.still .onb-art .draw, .onb.still .onb-card { animation: none; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .onb-art .draw { animation: none; stroke-dashoffset: 0; } .onb-card, .onb { animation: none; } }
.onb-art .draw.solid { fill: #121212; }
.onb-art .draw.white { fill: #fff; fill-opacity: 0; animation: onbDraw .8s cubic-bezier(.4,0,.2,1) forwards, onbFillIn .3s ease-out .5s forwards; }
@keyframes onbFillIn { to { fill-opacity: 1; } }
.onb-art .fill { fill: #fff; opacity: 0; animation: onbFade .25s ease-out .6s forwards; }
.onb-art .fill.eye { animation: onbFade .25s ease-out .6s forwards, onbBlink 4.2s ease-in-out 2s infinite; }
.onb-art .bob { animation: onbBob 2.6s ease-in-out 1.4s infinite alternate; will-change: transform; }
@keyframes onbFade { to { opacity: 1; } }
@keyframes onbBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes onbBob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.onb.still .onb-art .fill { animation: none; opacity: 1; }
.onb.still .onb-art .draw.white { animation: none; fill-opacity: 1; }
.onb.still .onb-art .bob { animation: none; }
@media (prefers-reduced-motion: reduce) { .onb-art .fill { animation: none; opacity: 1; } .onb-art .bob { animation: none; } }
/* 시작 화면 일러스트 애니메이션(사용자 그림 조각) — transform·opacity만 써서 끊김 없이 */
.onb-ill { position: relative; width: min(280px, 70vw); max-height: min(280px, 34vh); margin-bottom: 22px; }
.onb-ill.ill-swipe { width: min(320px, 78vw); margin: 32px 0 54px; }
.onb-ill.ill-book, .onb-ill.ill-lock, .onb-ill.ill-phone { height: min(270px, 34vh); width: auto; }
.onb-ill img { position: absolute; display: block; user-select: none; pointer-events: none; }
.onb-ill .ill-base { inset: 0; width: 100%; height: 100%; animation: illReveal .7s cubic-bezier(.2,.8,.2,1) both; }
.onb-ill .ill-part { opacity: 0; animation: illPop .45s cubic-bezier(.3,1.5,.5,1) .45s forwards; will-change: transform; }
@keyframes illReveal { from { opacity: 0; transform: translateY(10px); clip-path: inset(0 0 100% 0); } 60% { opacity: 1; } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes illPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.ill-book, .ill-lock, .ill-phone { animation: illBob 3s ease-in-out 1.2s infinite alternate; }
@keyframes illBob { to { transform: translateY(-4px); } }
/* 1장: 김이 피어오르고, 반짝이는 선, 펜이 사각사각 */
.ill-book .p-steam { animation: illPop .4s ease-out .5s forwards, illSteam 1.8s ease-in-out 1s infinite alternate; }
@keyframes illSteam { from { transform: translateY(2px); opacity: .45; } to { transform: translateY(-7px); opacity: 1; } }
.ill-book .p-spark { transform-origin: 0% 100%; animation: illPop .45s cubic-bezier(.3,1.5,.5,1) .7s forwards, illSpark 1.3s ease-in-out 1.2s infinite alternate; }
@keyframes illSpark { from { transform: scale(1); } to { transform: scale(1.15) rotate(-4deg); } }
/* 연필 쥔 손: 다이어리 줄을 따라 천천히 쓰고(translate), 연필심을 축으로 사각사각(rotate) */
.ill-book .p-hand { transform-origin: 3.6% 92%; animation: illPop .4s ease-out .55s forwards, illHandMove 3.6s cubic-bezier(.45,0,.55,1) 1s infinite both, illHandScribble .3s ease-in-out 1s infinite alternate both; }
@keyframes illHandMove { 0% { translate: -3% 0; } 70% { translate: 4% .3%; } 100% { translate: -3% 0; } }
@keyframes illHandScribble { from { rotate: -1.6deg; } to { rotate: 1.4deg; } }
/* 2장: 종이가 살랑, 화살표가 양쪽으로 */
.ill-swipe .ill-base { animation: illReveal .7s cubic-bezier(.2,.8,.2,1) both, illSway 2.6s ease-in-out .9s infinite alternate; transform-origin: 50% 90%; }
@keyframes illSway { from { transform: rotate(-2deg) translateX(-3px); } to { transform: rotate(2deg) translateX(3px); } }
.ill-swipe .p-arrL { animation: illPop .4s ease-out .55s forwards, illLeft 1.3s ease-in-out 1s infinite alternate; }
.ill-swipe .p-arrR { animation: illPop .4s ease-out .65s forwards, illRight 1.3s ease-in-out 1.65s infinite alternate; }
@keyframes illLeft { to { transform: translateX(-9px); } }
@keyframes illRight { to { transform: translateX(9px); } }
/* 3장: 자물쇠가 툭 떨어져 잠기고, 가끔 흔들 */
.ill-lock .p-lock { transform-origin: 50% 0%; animation: illDrop .6s cubic-bezier(.3,1.4,.5,1) .5s forwards, illShake 3.2s ease-in-out 1.6s infinite; }
@keyframes illDrop { from { opacity: 0; transform: translateY(-30%); } to { opacity: 1; transform: none; } }
@keyframes illShake { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-6deg); } 82% { transform: rotate(5deg); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(1deg); } }
/* 4장: 앱 아이콘이 하나씩, 내려받기 화살표가 콩콩 */
.ill-phone .p-a1 { animation-delay: .45s; } .ill-phone .p-a2 { animation-delay: .55s; } .ill-phone .p-a3 { animation-delay: .65s; } .ill-phone .p-a4 { animation-delay: .75s; }
.ill-phone .p-dl { animation: illPop .4s ease-out .9s forwards, illDown .7s cubic-bezier(.5,0,.5,1) 1.3s infinite alternate; }
@keyframes illDown { to { transform: translateY(16%); } }
.onb.still .onb-ill, .onb.still .onb-ill img { animation: none !important; opacity: 1; transform: none; clip-path: none; }
@media (prefers-reduced-motion: reduce) { .onb-ill, .onb-ill img { animation: none !important; opacity: 1 !important; transform: none !important; clip-path: none !important; } }
.onb-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; word-break: keep-all; }
.onb-sub { font-size: 14px; color: rgba(255,255,255,.7); line-height: 1.6; word-break: keep-all; }
.onb-btns { display: flex; gap: 8px; margin-top: 20px; }
.onb-pill { height: 36px; padding: 0 18px; border-radius: 18px; border: 1px solid rgba(255,255,255,.7); color: #fff; font-size: 13px; font-weight: 600; }
.onb-pill.dark { background: #fff; color: #1a1a1a; border-color: #fff; }
.onb-foot { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 10px; }
.onb-dots { display: flex; gap: 8px; }
.onb-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); }
.onb-dots span.on { background: #fff; }
.onb-next { min-width: 160px; height: 44px; border-radius: 22px; background: #fff; color: #1a1a1a; font-size: 14px; font-weight: 700; }
.dc-panel { width: min(400px, calc(100vw - 32px)); }
.onb-next, .onb-pill, .onb-skip { text-align: center; justify-content: center; display: inline-flex; align-items: center; }
.pal-tabs { flex-wrap: wrap; overflow: visible; }
@media (max-width: 899px) { .day-cols.three > .day-col, .day-cols.two > .day-col { flex: none; } .day-cols.three, .day-cols.two { flex: none; } }
.memo-toolbar .memo-tools { display: contents; }
.memo-toolbar .tb.chip { padding: 4px 11px; font-size: 12.5px; }

/* 휴대폰 일기: 쪽 넘김 안내 (기록 쪽 ↔ 자유 일기 쪽) */
.m-flip-hint { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin: 18px 0 2px; padding: 6px 0; background: none; border: 0; font-family: var(--font-ui, inherit); font-size: 11px; color: var(--muted); letter-spacing: .08em; cursor: pointer; }
.m-flip-hint .m-dots { display: flex; gap: 5px; }
.m-flip-hint .m-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); opacity: .5; }
.m-flip-hint .m-dots i.on { background: var(--ink); opacity: 1; }

/* PC 위젯 창 (?widget) — 가죽·링 없이 달력만, 날짜를 누르면 그날 모아보기 */
.widget-mode body { background: var(--paper); overflow: hidden; }
.wg { position: relative; height: 100vh; padding: 14px 14px 12px; display: flex; flex-direction: column; background: var(--paper); isolation: isolate; }
.wg::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: var(--paper-tex) center / cover; mix-blend-mode: multiply; opacity: var(--paper-tex-opacity); z-index: -1; }
.wg .wg-grid { flex: 1 1 auto; min-height: 0; }
.is-mobile .wg .mc { min-height: 0; }
.wg-nav { display: flex; gap: 4px; align-items: center; }
.wg-btn { height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--ink); border-radius: 14px; background: transparent; color: var(--ink); font-family: var(--font-ui, inherit); font-size: 13px; line-height: 1; cursor: pointer; }
.wg-btn.wg-today { font-size: 11.5px; font-weight: 600; }
.wg-btn:hover { background: rgba(0,0,0,.05); }
.wg-empty { font-family: var(--font-ui, inherit); font-size: 12px; color: var(--muted); margin: auto; text-align: center; }
