/* 손글씨: Gaegu (SIL OFL 1.1, public/fonts/OFL-Gaegu.txt). 한글 11,172자와 기본 문장부호만 담아 자체 호스팅한다. */
@font-face { font-family: 'DM Serif Display'; src: url(/fonts/dmserif-latin.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Gaegu'; src: url(/fonts/gaegu.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
/* 영어 손글씨: Caveat (SIL OFL 1.1, public/fonts/OFL-Caveat.txt). 영어는 글자 높이가 낮아 112%로 키운다. */
@font-face { font-family: 'Caveat'; src: url(/fonts/caveat-latin.woff2) format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; size-adjust: 112%; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Caveat'; src: url(/fonts/caveat-latin-ext.woff2) format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; size-adjust: 112%; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* 어드벤트 캘린더
   방향: 손으로 만든 종이 선물. 판(그림)만 색을 갖고 나머지 화면은 조용하게.
   간격 4/8/12/16/20/24/32, 곡선 하나(--ease), 강조색 하나(--accent). */
:root {
  --foil: linear-gradient(165deg, #fff5cf 0%, #f0cd7a 30%, #c99536 55%, #f7e1a1 75%, #b8862c 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  --night: #0f1b1d;
  --ink: #1c1a17; --ink2: #5c554b; --ink3: #8a8378; --ink4: #b5ada1;
  --paper: #fbf8f2; --group: #fffdf9; --canvas: #f2efe9; --fill: #ebe5da; --hair: rgba(60, 50, 40, .13);
  --accent: #b23a2e; --accent-press: #9a3127;
  --cream: #f6efe0; --pine: #1d3b33;
  --w1: rgba(255,255,255,.92); --w2: rgba(255,255,255,.62); --w3: rgba(255,255,255,.4); --wfill: rgba(255,255,255,.08); --whair: rgba(255,255,255,.1);
  --ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  --letter: 'Gowun Batang', 'AppleMyungjo', serif;
  --num: 'DM Serif Display', Georgia, serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--night); color: var(--w1); font: 400 16px/1.45 var(--ui); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  word-break: keep-all; overflow-wrap: break-word; -webkit-text-size-adjust: 100%;
}
body.light { background: var(--canvas); color: var(--ink); }
body.light #snow { display: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
a { color: inherit; text-decoration: none; }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }

/* 누르면 살짝 들어가는 공통 반응 */
.press { transition: transform .18s var(--ease), opacity .18s var(--ease), background-color .18s var(--ease); }
.press:active { transform: scale(.97); opacity: .85; }

/* 위에서 내려오는 알림 */
#toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 10px); transform: translate(-50%, calc(-100% - 20px));
  background: rgba(28, 28, 30, .88); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  color: #fff; padding: 11px 18px; border-radius: 22px; font-size: 14px; font-weight: 500; line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; z-index: 95; max-width: calc(100vw - 32px); text-align: center; text-wrap: balance;
  transition: transform .45s var(--ease);
}
#toast.on { transform: translate(-50%, 0); }

/* ---------- 보기 화면 ---------- */
.viewer { min-height: 100svh; display: flex; flex-direction: column; align-items: center; padding: calc(var(--safe-t) + 8px) 0 calc(var(--safe-b) + 24px); }
.v-top { width: 100%; max-width: 600px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; min-height: 40px; }
.v-to { font-size: 14px; color: var(--w2); }
.round { position: relative; width: 44px; height: 44px; border: 0; background: none; color: var(--w2); display: grid; place-items: center; }
.round::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--wfill); }
.round svg { position: relative; width: 17px; height: 17px; }
.v-title { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.025em; text-align: center; margin: 4px 24px 6px; text-wrap: balance; }
.v-intro { margin: 0 24px 4px; font-size: 14px; line-height: 1.45; color: var(--w2); text-align: center; text-wrap: balance; }
.v-intro[hidden] { display: none; }
/* 판 바로 위 한 줄. 뜯을 문이 있을 때만 눌러서 모서리를 한 번 들썩여 볼 수 있다. */
.v-status { display: block; width: 100%; max-width: 600px; min-height: 44px; padding: 10px 24px; border: 0; background: none; font-size: 15px; line-height: 1.4; color: var(--w1); text-align: center; text-wrap: balance; }
.v-status:not(.act) { pointer-events: none; }
.v-status.act { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 4px; }
.pv-pill { position: sticky; top: calc(var(--safe-t) + 8px); z-index: 5; display: flex; align-items: center; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 20px; white-space: nowrap;
  background: rgba(36, 44, 46, .78); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.pv-pill span { padding: 0 8px 0 10px; color: var(--w2); }
.demo-pill { min-height: 52px; padding: 4px 4px 4px 14px; font-size: 13px; }
.demo-pill span { flex: 1; padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.demo-pill button, .demo-pill a { padding: 0 12px; font-size: 14px; }
.demo-pill .cta-pill { background: rgba(255,255,255,.9); color: #1b2426; }
.pv-pill button, .pv-pill a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; flex: none; border: 0; border-radius: 22px; padding: 0 14px; background: rgba(255,255,255,.12); color: var(--w1); font-weight: 500; }

.board-wrap { width: 100%; display: flex; justify-content: center; padding: 0 3vw; margin-top: 18px; }
.board {
  --w: min(94vw, 560px, calc((100svh - 190px) / 1.5));
  position: relative; width: max(300px, var(--w)); aspect-ratio: 2 / 3;
  background: #20343a var(--cover, url(/img/cover.jpg)) center / 100% 100% no-repeat;
  border-radius: 6px; padding: 3.4%;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.25), 0 50px 80px -30px rgba(0,0,0,.8), 0 18px 30px -12px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.3);
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(6, 1fr); gap: 2.4%;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.board::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(165deg, rgba(255,255,255,.06), transparent 35%, rgba(0,0,0,.14)); }

.door { --c: clamp(12px, 32cqmin, 18px); position: relative; container-type: size; border: 0; padding: 0; margin: 0; background: none; outline: none; touch-action: pan-y; -webkit-user-select: none; }
.door.ready { touch-action: none; }
.door:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* 문 안쪽 */
.hole { position: absolute; inset: 0; border-radius: 2px; overflow: hidden; opacity: 0;
  background: radial-gradient(100% 90% at 50% 30%, #4a301d 0%, #2a1a10 60%, #170e08 100%); }
.hole::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 4px 10px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; z-index: 3; }
.door.ready .hole, .door.lifting .hole, .door.torn .hole { opacity: 1; }
.thumb { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease) .1s; }
.door.torn .thumb { opacity: 1; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb .play { position: absolute; left: 6%; bottom: 6%; width: clamp(14px, 22cqmin, 24px); height: clamp(14px, 22cqmin, 24px); border-radius: 50%; background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 2; }
.thumb .play svg { width: 55%; height: 55%; fill: #fff; margin-left: 8%; }
.thumb .orn { position: absolute; inset: 14%; background: center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.thumb::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(20,10,0,.45)); pointer-events: none; }
.hole-num { position: absolute; z-index: 4; right: 5%; bottom: 4%; font: 400 clamp(10px, 20cqmin, 22px)/1 var(--num); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); opacity: 0; transition: opacity .3s .3s; }
.door.torn .hole-num { opacity: .95; }
.glow { position: absolute; inset: 0; z-index: 5; background: radial-gradient(60% 50% at 50% 50%, rgba(255,214,140,.85), rgba(255,180,90,.2) 55%, transparent 75%); opacity: var(--glow, 0); mix-blend-mode: screen; pointer-events: none; }

/* 뜯긴 가장자리 */
.rim { position: absolute; inset: -1px; pointer-events: none; display: none; z-index: 6; }
.door.torn .rim { display: block; }
.rim .fiber { position: absolute; inset: 0; background: #f4ecdb; }
.rim .print { position: absolute; inset: 0; background-image: var(--cover, url(/img/cover.jpg)); background-repeat: no-repeat; background-size: var(--bw) var(--bh); background-position: var(--bx) var(--by); filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }

/* 문 */
.flap { position: absolute; inset: 0; z-index: 7; border-radius: 2px; will-change: transform;
  background-image: var(--cover, url(/img/cover.jpg)); background-repeat: no-repeat; background-size: var(--bw) var(--bh); background-position: var(--bx) var(--by);
  transform-origin: var(--ox, 50%) var(--oy, 50%); transition: transform .5s var(--ease); }
.door.dragging .flap { transition: none; }
.door.torn .flap { display: none; }
.flap::before { content: ''; position: absolute; inset: 0; border-radius: 2px;
  box-shadow: 0 0 0 .75px rgba(20,10,0,.55), inset 1px 1px 0 rgba(255,255,255,.28), inset -1px -1px 0 rgba(0,0,0,.25), 0 1px 0 .75px rgba(255,255,255,.12); }
.flap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--shade-dir, 180deg), rgba(0,0,0,0), rgba(0,0,0,.5)); opacity: var(--shade, 0); pointer-events: none; }
.door.lifting .flap { filter: drop-shadow(0 10px 12px rgba(0,0,0,.45)); }
/* 뜯을 수 있는 문: 귀퉁이가 접혀 안쪽이 살짝 보인다 */
.door.ready:not(.lifting) .flap { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%); }
.curl { position: absolute; right: 0; bottom: 0; width: var(--c); height: var(--c); z-index: 8; display: none; pointer-events: none;
  background: linear-gradient(to bottom right, #fbf4e4 0%, #f1e4c8 30%, #d8c29b 47%, transparent 50%);
  filter: drop-shadow(-1.5px -1.5px 2px rgba(40,20,0,.35)); }
.door.ready .hole { background: #1b130d; }
.door.ready.lifting .hole { background: radial-gradient(100% 90% at 50% 30%, #4a301d 0%, #2a1a10 60%, #170e08 100%); }
.door.ready:not(.lifting) .curl { display: block; }
.door.ready.hinting .curl { animation: curl 1.1s var(--ease); transform-origin: 100% 100%; }
@keyframes curl { 35% { transform: scale(1.7); } }
.num { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%); font: 400 clamp(17px, 46cqmin, 64px)/1 var(--num); letter-spacing: -0.02em;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.55)) drop-shadow(0 0 6px rgba(0,0,0,.45)); pointer-events: none; }
.door[data-day="24"] .num, .door[data-day="25"] .num { font-size: clamp(22px, 52cqmin, 120px); }

.door.shake .flap { animation: shake .4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-3px); } 45% { transform: translateX(3px); } 70% { transform: translateX(-2px); } }
.board.thump { animation: thump .3s var(--ease); }
@keyframes thump { 35% { transform: translateY(1.5px); } }

.v-foot { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 24px; text-align: center; }
.v-hint { font-size: 14px; color: var(--w2); }
.v-from { font: 400 16px/1.5 var(--letter); color: var(--w2); }
.v-make { margin-top: 8px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 14px; color: var(--w2); }

.flying { position: fixed; border-radius: 2px; background-repeat: no-repeat; will-change: transform, opacity; }
.flying::before { content: ''; position: absolute; inset: 0; box-shadow: inset 1px 1px 0 rgba(255,255,255,.28), inset -1px -1px 0 rgba(0,0,0,.25); }
.flying .back { position: absolute; inset: 0; background: #d9c29a var(--grain); backface-visibility: hidden; transform: rotateY(180deg); }
.bit { position: fixed; width: 5px; height: 4px; background: #f3ead6; border-radius: 1px; will-change: transform, opacity; }

/* ---------- 열린 칸 (시트) ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 60; opacity: 0; transition: opacity .35s var(--ease); }
.sheet-back.on { opacity: 1; }
.sheet { position: fixed; inset: 0; z-index: 61; display: flex; justify-content: center; align-items: flex-end; pointer-events: none; }
.card { pointer-events: auto; width: min(100%, 600px); max-height: calc(100svh - var(--safe-t) - 12px); display: flex; flex-direction: column;
  background: var(--paper) var(--grain); color: var(--ink); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.35); will-change: transform; touch-action: pan-y; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: rgba(60,50,40,.22); margin: 8px auto 0; flex: none; }
.card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 16px 14px 20px; flex: none; cursor: grab; }
.card-day { font: 400 46px/.9 var(--num); color: var(--accent); min-width: 1.1em; }
.card-date b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.card-date span { font-size: 14px; color: var(--ink3); }
.x { position: relative; width: 44px; height: 44px; border: 0; background: none; color: var(--ink2); display: grid; place-items: center; }
.x::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: rgba(60,50,40,.1); }
.x svg { position: relative; }
.x svg { width: 13px; height: 13px; stroke-width: 2.6; }
.card-body { overflow-y: auto; padding: 2px 20px 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; }
.card-nav { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px calc(6px + var(--safe-b)); border-top: .5px solid var(--hair); flex: none; }
.navbtn { border: 0; background: none; color: var(--accent); font-size: 16px; font-weight: 500; min-height: 44px; padding: 10px 12px; display: inline-flex; align-items: center; gap: 2px; border-radius: 10px; }
.navbtn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.navbtn[hidden] { display: inline-flex; visibility: hidden; }
.blk { margin: 0 0 20px; }
.blk-img img, .blk-video video { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--fill); }
.blk-video video { max-height: 72svh; background: #000; }
.blk-img img { cursor: zoom-in; }
.cap { font-size: 15px; line-height: 1.45; color: var(--ink2); margin-top: 8px; }
.cap a { display: flex; align-items: center; width: fit-content; min-height: 44px; color: var(--accent); }
.yt { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; }

.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.blk-link a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.75); border: .5px solid var(--hair); }
.blk-link .lt { width: 36px; height: 36px; border-radius: 10px; background: var(--fill); display: grid; place-items: center; color: var(--accent); flex: none; }
.blk-link .lt svg { width: 18px; height: 18px; }
.blk-link a span { flex: 1; min-width: 0; }
.blk-link a b { display: block; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-link a small { color: var(--ink3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.blk-link a > svg { width: 16px; height: 16px; color: var(--ink4); flex: none; }
.sign { font: 400 18px/1.5 var(--letter); color: var(--ink2); text-align: right; margin: -4px 0 16px; }
.empty-note { padding: 12px 0 36px; text-align: center; }
.empty-note p { margin: 0; }
.empty-note .en-h { font-size: 18px; line-height: 1.45; font-weight: 600; color: var(--ink); text-wrap: balance; }
.empty-note .en-s { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--ink2); }
.zoom { position: fixed; inset: 0; z-index: 90; background: #000; display: grid; place-items: center; animation: fade .25s var(--ease); }
.zoom img { max-width: 100vw; max-height: 100svh; object-fit: contain; }
@keyframes fade { from { opacity: 0; } }

/* ---------- 묶음 목록 (편집·첫 화면 공통) ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 0 0 calc(var(--safe-b) + 40px); }
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--safe-t) + 6px) 8px 6px;
  background: rgba(242,239,233,.82); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); }
.nav a, .nav .navtxt { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; padding: 8px; }
.nav a svg { width: 22px; height: 22px; stroke-width: 2.2; }
.save-state { font-size: 13px; color: var(--ink3); padding: 8px 10px; white-space: nowrap; }
.save-state.err { color: var(--accent); font-weight: 600; }
.large { font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; margin: 4px 20px 22px; text-wrap: balance; }
.gh { font-size: 13px; color: var(--ink3); margin: 0 32px 7px; }
.gh.split { display: flex; justify-content: space-between; }
.group { background: var(--group); border-radius: 14px; margin: 0 16px 8px; overflow: hidden; }
.gf { font-size: 13px; color: var(--ink3); margin: 0 32px 30px; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; position: relative; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--hair); }
.row > label, .row > .lbl { font-size: 17px; width: 88px; flex: none; }
.row input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; outline: none; padding: 12px 0; color: var(--ink); }
.row input::placeholder { color: var(--ink4); }
.row .chev { width: 16px; height: 16px; color: var(--ink4); stroke-width: 2.4; }
.row.link { justify-content: space-between; font-size: 17px; }
.row.link small { color: var(--ink3); font-size: 15px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 600; background: var(--accent); color: #fff; width: 100%; }
.btn:active { background: var(--accent-press); }
.btn svg { width: 19px; height: 19px; stroke-width: 2.1; }
.btn.tint { background: rgba(118,104,84,.1); color: var(--ink); font-weight: 500; height: 44px; font-size: 16px; }
.btn:disabled { opacity: .45; }
.share { padding: 16px; display: grid; gap: 10px; }
.share .url { font-size: 15px; color: var(--ink3); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 8px 4px; }
.share .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }


/* 하루 편집 시트 */
.de-back { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 60; animation: fade .3s var(--ease); }
.de { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; top: calc(var(--safe-t) + 10px); max-width: 640px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--canvas); color: var(--ink); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,.2); will-change: transform; }
.de.enter { animation: up .45s var(--ease); }
@keyframes up { from { transform: translateY(100%); } }
.de-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 8px 8px; flex: none; touch-action: none; }
.de-head .grab { grid-column: 1 / -1; margin: 4px auto 6px; }
.de-title { display: flex; align-items: center; gap: 2px; }
.de-title div { text-align: center; min-width: 120px; }
.de-title b { display: block; font-size: 17px; font-weight: 600; }
.de-title small { font-size: 12px; color: var(--ink3); }
.chevbtn { width: 36px; height: 36px; border: 0; background: none; color: var(--accent); display: grid; place-items: center; border-radius: 50%; }
.chevbtn svg { width: 20px; height: 20px; stroke-width: 2.3; }
.chevbtn:disabled { color: var(--ink4); }
.done { justify-self: end; border: 0; background: none; color: var(--accent); font-size: 17px; font-weight: 600; padding: 8px 10px; }
.de-body { overflow-y: auto; padding: 4px 16px 24px; flex: 1; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.upl { padding: 22px 16px 18px; }
.upl .bar { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.upl .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s var(--ease); }
.upl .t { font-size: 13px; color: var(--ink3); text-align: center; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tools { display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(var(--safe-b) + 6px); flex: none;
  background: rgba(255,253,249,.9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: .5px solid var(--hair); }
.tools button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--ink2); border-radius: 10px; }
.tools button svg { width: 24px; height: 24px; color: var(--accent); stroke-width: 1.7; }

/* ---------- 첫 화면 ---------- */
.home { padding-bottom: calc(var(--safe-b) + 40px); max-width: 520px; margin: 0 auto; }
.stage { padding: calc(var(--safe-t) + 40px) 0 8px; display: flex; justify-content: center; perspective: 900px; }
.cal { width: 168px; aspect-ratio: 2 / 3; border-radius: 6px; position: relative; z-index: 1; background: center / cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 40px 60px -24px rgba(0,0,0,.9), 0 16px 24px -10px rgba(0,0,0,.6);
  transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -10deg)); transition: transform .9s var(--ease); transform-style: preserve-3d; }
.cal::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(calc(120deg + var(--ry, -10deg) * 3), rgba(255,255,255,.18), transparent 45%, rgba(0,0,0,.2)); }
.cal .d { position: absolute; left: 39%; top: 37%; width: 22%; height: 15%; border-radius: 1px; background: radial-gradient(#5a3a22, #1f140b); box-shadow: inset 0 2px 5px rgba(0,0,0,.7); }
.cal .d::before { content: ''; position: absolute; inset: 10% 12%; background: url(/img/assets/orn-bauble.png) center / contain no-repeat; }
.cal .d::after { content: ''; position: absolute; inset: -2px; border: 1px dashed rgba(255,250,238,.7); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.home h1 { font-size: 30px; line-height: 1.22; font-weight: 700; letter-spacing: -0.03em; text-align: center; margin: 28px 24px 10px; text-wrap: balance; }
.home .lede { font-size: 16px; line-height: 1.55; color: var(--w2); text-align: center; margin: 0 32px 32px; text-wrap: balance; }
.dark .group { background: #1d2a2c; }
.dark .row + .row::before { border-color: var(--whair); }
.dark .row input { color: var(--w1); }
.dark .row input::placeholder { color: var(--w3); }
.dark .gh, .dark .gf { color: var(--w3); }
.dark .row.link small, .dark .row .chev { color: var(--w3); }
.cta { margin: 16px 16px 12px; width: calc(100% - 32px); }
.demo-link { display: flex; align-items: center; justify-content: center; gap: 4px; width: fit-content; min-height: 44px; margin: 0 auto 28px; padding: 0 16px; color: rgba(255,255,255,.62); font-size: 15px; font-weight: 500; }
.demo-link::after { content: '›'; font-size: 20px; line-height: 1; margin-top: -2px; }
.demo-link:active { color: rgba(255,255,255,.9); }

@media (prefers-reduced-motion: reduce) {
  .cal { transition: none; }
  .door.ready.hinting .curl { animation: none; }
}


.card-head, .grab { touch-action: none; }

/* 배경 고르기 */
.themes { display: flex; gap: 12px; overflow-x: auto; padding: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.themes::-webkit-scrollbar { display: none; }
.th { flex: none; width: 88px; border: 0; background: none; padding: 0; text-align: center; scroll-snap-align: start; scroll-margin-left: 16px; color: var(--ink2); font-size: 13px; }
.th i { display: block; position: relative; aspect-ratio: 2 / 3; border-radius: 8px; background: var(--fill) center / cover; margin-bottom: 8px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 4px 10px -2px rgba(0,0,0,.18); transition: box-shadow .25s var(--ease); }
.th.on { color: var(--ink); font-weight: 600; }
.th.on i { box-shadow: 0 0 0 2.5px var(--group), 0 0 0 4.5px var(--accent), 0 6px 14px -2px rgba(0,0,0,.25); }
.th.on i::after { content: ''; position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; box-shadow: 0 0 0 2px #fff; }
/* 첫 화면 부채꼴 */
.stage { position: relative; }
.cal.side { position: absolute; top: calc(var(--safe-t) + 58px); left: 50%; width: 136px; margin-left: -68px; opacity: .9; transition: none; }
.cal.side.l { transform: translateX(-92px) rotate(-11deg); }
.cal.side.r { transform: translateX(92px) rotate(11deg); }
.cal.side::after { background: rgba(0,0,0,.18); }

/* 숫자가 어느 그림 위에서도 읽히도록 */
.plate { position: absolute; left: 50%; top: 50%; width: 78cqmin; height: 64cqmin; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(12,8,4,.55), rgba(12,8,4,.28) 55%, transparent); pointer-events: none; }
.door[data-day="25"] .plate, .door[data-day="24"] .plate { width: 70cqmin; height: 56cqmin; }
.theme-midnight .plate { background: radial-gradient(closest-side, rgba(8,14,40,.6), transparent); }

/* v4: 손가락 홈과 깨끗한 칼선 */
.rim { display: none !important; }
/* 문 모서리: 들린 귀퉁이(.curl)와 점선 칼선(.cut)은 아래 v9 */
.door.ready.lifting .hole, .door.torn .hole { background: radial-gradient(100% 90% at 50% 30%, #4a301d 0%, #2a1a10 60%, #170e08 100%); }
.hole::after { box-shadow: inset 0 0 0 1.25px rgba(236,224,200,.9), inset 2px 3px 0 1.25px rgba(0,0,0,.35), inset 0 6px 12px rgba(0,0,0,.6); border-radius: 2px; }
.door.ready .hole::after { box-shadow: none; }

.flying::before { box-shadow: inset 0 0 0 .75px rgba(20,10,0,.5), inset 1px 1px 0 rgba(255,255,255,.28); }
.hole::after { box-shadow: inset 0 0 0 1px rgba(236,224,200,.45), inset 0 5px 9px rgba(0,0,0,.65), inset 0 -1px 0 rgba(255,255,255,.08); }
.door.torn { filter: drop-shadow(0 -1px 0 rgba(0,0,0,.25)); }

/* v5: 가운데에 뜨는 카드 */
.viewer { transition: transform .32s var(--ease), filter .32s var(--ease); }
.viewer.behind { transform: scale(.94); filter: brightness(.7) saturate(.9); }
.sheet-back { background: rgba(5,8,10,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet { align-items: center; padding: calc(var(--safe-t) + 16px) 18px calc(var(--safe-b) + 16px); }
.card { position: relative; width: min(100%, 440px); max-height: min(82svh, 760px); border-radius: 22px; overflow: hidden;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 30px 80px -10px rgba(0,0,0,.6), 0 10px 24px -6px rgba(0,0,0,.4); transform-origin: 50% 50%; }
.grab { display: none; }
.lid { position: relative; flex: none; height: 132px; display: flex; align-items: flex-end; gap: 14px; padding: 16px 18px; background-color: #2a1a10; color: #fff; touch-action: none; cursor: grab; }
.lid::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 20%, rgba(0,0,0,.62)); }
.lid > * { position: relative; }
.lid-num { flex: none; text-align: center; font: 400 58px/.8 var(--num); background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); padding-top: 6px; }
.lid-date { flex: 1; min-width: 0; margin-left: 4px; padding-bottom: 2px; }
.lid-date b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.lid-date span { font-size: 13px; color: rgba(255,255,255,.75); }
.lid .x { position: absolute; top: 5px; right: 5px; color: #fff; }
.lid .x::before { background: rgba(0,0,0,.45); }
.card-body { padding: 20px 20px 6px; }
.card-nav { padding: 4px 6px calc(4px); }
.dots { overflow: hidden; flex: none; }
.dots-track { display: flex; transition: transform .28s var(--ease, ease); }
.dots i { flex: none; width: 11px; height: 8px; position: relative; }
.dots i::before { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(60,50,40,.22); transition: all .2s; }
.dots i.md::before { width: 4px; height: 4px; margin: -2px 0 0 -2px; }
.dots i.sm::before { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; }
.dots i.on::before { background: var(--accent); width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
@media (prefers-reduced-motion: reduce) { .viewer.behind { transform: none; } }

/* v6: 문 모양 */
.door[data-shape="arch"] { --rad: 50% 50% 3px 3px / 32% 32% 3px 3px; }
.door[data-shape="round"] { --rad: 50%; }
.door .flap, .door .hole, .door .hole::after, .door .flap::before, .door .flap::after { border-radius: var(--rad, 2px); }
.door[data-shape="round"] .plate { width: 70cqmin; height: 60cqmin; }


/* 잠긴 문 누름 */
.door.locked:active .flap { transform: scale(.96); transition-duration: .12s; }
.num { display: block; }

/* 카드가 구멍으로 돌아왔을 때 */
.door.settle .thumb { animation: settle .5s var(--ease); }
@keyframes settle { 0% { transform: scale(1.12); filter: brightness(1.5); } 100% { transform: none; } }



/* 편집: 문 배치 미리보기 */
/* v7: 영상·사진을 원래 비율대로, 좌우 검은 띠 없이 */
.blk-video, .blk-img { display: flex; flex-direction: column; align-items: center; }
.blk-video video, .blk-img img { width: auto; height: auto; max-width: 100%; max-height: 64svh; background: transparent; border-radius: 14px; }
.blk-video video:not([data-ready]) { width: 100%; aspect-ratio: 9 / 16; max-height: 64svh; background: var(--fill); }
/* 세로 영상이 카드 높이를 넘지 않게: 카드 최대 높이에서 머리·넘기기 줄·여백을 뺀 만큼까지, 비율은 그대로 */
.blk-video video { max-height: min(64svh, calc(82svh - 300px)); touch-action: pan-y; }
.blk-video video:not([data-ready]) { max-height: min(64svh, calc(82svh - 300px)); }
.yt-note:empty { display: none; }



/* ---------- 속지(편지지): 받는 화면과 편집 화면이 같은 규칙을 쓴다 ---------- */
:root { --hand: 'Gaegu', 'Gowun Batang', 'AppleMyungjo', serif; }
.paper { --pb: #f8ebd4; --pk: #493426; --pt: 12; --pi: none; --pis: none;
  position: relative; container-type: inline-size; color: var(--pk); border-radius: 3px; background: var(--pb);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 1px 3px rgba(60,40,20,.14); }
/* 종이 그림은 ::before에 깐다 (cqw가 이 종이의 너비를 따르도록). 그림 아래 끝은 base 색으로 이어 붙인다 */
.paper::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(transparent, var(--pb)) 0 124cqw / 100% 16cqw no-repeat, var(--pi) center top / 100% auto no-repeat; }
.paper.sm::before { background: var(--pis) center top / 100% auto no-repeat; }
/* 줄노트: 글줄이 괘선 위에 앉도록 줄 간격을 괘선 두 칸에 맞추고, 그림이 끝난 뒤에도 괘선을 이어 그린다 */
.paper[data-paper="lined"]:not(.sm)::before { background-image: var(--pi), linear-gradient(rgba(146,149,180,.8) 0 max(1px, .22cqw), transparent 0), linear-gradient(90deg, transparent 4.55cqw, rgba(221,153,140,.9) 4.55cqw 4.85cqw, transparent 4.85cqw);
  background-size: 100% auto, 100% 4.397cqw, 100% 100%; background-position: center top, 0 12.8cqw, 0 0; background-repeat: no-repeat, repeat-y, no-repeat; }
.paper[data-paper="lined"] .paper-in { padding-top: 20.1cqw; }
.paper[data-paper="lined"] .letter, .paper[data-paper="lined"] textarea { font-size: clamp(18px, 6.8cqw, 27px); line-height: 8.794cqw; }
.paper[data-paper="lined"] .sign { margin-top: 8.794cqw; font-size: clamp(18px, 6.8cqw, 27px); line-height: 8.794cqw; }
.paper-in { position: relative; padding: calc(var(--pt) * 1.4cqw) 9cqw 10cqw; }
.letter, .paper textarea { font: 400 clamp(21px, 7.4cqw, 29px)/1.62 var(--hand); letter-spacing: -0.012em; overflow-wrap: break-word; word-break: keep-all; }
.letter { white-space: pre-wrap; }
.letter.short, .paper textarea.short { font-size: clamp(25px, 8.8cqw, 35px); line-height: 1.5; }
.paper .sign { margin: 1.1em 0 0; font: 400 clamp(21px, 7.4cqw, 29px)/1.4 var(--hand); letter-spacing: -0.012em; color: var(--pk); opacity: .85; text-align: right; }
/* 높이는 내용에 맞춘다. 짧은 쪽지도 엽서만큼(220px)은 되어 장식이 잘리지 않고, 긴 편지는 길어진다 */
.blk-text.paper, .eb-paper { max-width: 400px; margin-left: auto; margin-right: auto; }
.blk-text .paper-in, .eb-paper .paper-in { min-height: max(220px, 62cqw); }
.blk-text.paper { margin-bottom: 20px; }
.paper textarea { display: block; width: 100%; min-height: 1.7em; margin: 0; padding: 0; border: 0; border-radius: 0; resize: none; overflow: hidden; outline: none; background: transparent; color: var(--pk); caret-color: var(--pk); }
.paper textarea::placeholder { color: var(--pk); opacity: .38; }

/* 판 위 쪽지 */
.thumb .note, .ed-door .note { position: absolute; inset: 9% 8% 12% 9%; transform: rotate(-2.5deg); overflow: hidden; border-radius: 2px; text-align: left; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.note .note-in { position: relative; z-index: 1; padding: calc(var(--pt) * 1.4cqw) 10cqw 0; font: 400 max(7px, 15cqw)/1.45 var(--hand); }
.note.paper::after { content: ''; z-index: 2; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, var(--pb)); }
.thumb .note.link, .ed-door .note.link { display: grid; place-items: center; background: #fbf7ee; color: var(--ink2); }
.thumb .note.link svg, .ed-door .note.link svg { width: 38%; height: auto; color: var(--accent); }
.thumb .note.link { font-family: var(--ui); font-weight: 600; text-align: center; }
.thumb .note.link svg { display: block; margin: 0 auto 6%; }

/* ---------- 편집: 위쪽과 판 ---------- */
.nav-r { display: flex; align-items: center; gap: 2px; }
.nav .nav-pv { font-size: 17px; font-weight: 500; }
.nav button.nav-pv { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 8px 10px; border: 0; background: none; font-family: inherit; }
.nav .nav-pv svg { width: 21px; height: 21px; stroke-width: 1.9; margin-right: 3px; }
.page.ed { padding-bottom: calc(var(--safe-b) + 112px); }
.title-input { display: block; width: calc(100% - 40px); margin: 6px 20px 14px; padding: 4px 0; border: 0; border-radius: 0; background: transparent; outline: none; color: var(--ink); text-overflow: ellipsis;
  font: 700 30px/1.15 var(--ui); letter-spacing: -0.03em; }
.title-input::placeholder { color: var(--ink4); }
.ed .group { margin-bottom: 16px; }
.ed .group > .row { min-height: 46px; }
.prog { margin: 4px 20px 14px; }
.prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 15px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.prog-num b { color: var(--ink); font-weight: 650; }
.prog-hint { border: 0; background: none; padding: 4px 0; color: var(--accent); font-size: 14px; font-weight: 500; }
.prog-hint.plain { color: var(--ink3); font-weight: 400; }
.prog .bar { height: 4px; border-radius: 2px; background: rgba(60,50,40,.12); overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width .6s var(--ease); }
.board-wrap { display: flex; justify-content: center; padding: 0 16px; margin: 0 0 28px; }
.ed-board { position: relative; width: min(100%, 430px); aspect-ratio: 2 / 3; padding: 3.4%; border-radius: 6px; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(6, 1fr); gap: 2.4%;
  background: #20343a var(--cover, url(/img/cover.jpg)) center / 100% 100% no-repeat; box-shadow: 0 0 0 .5px rgba(0,0,0,.3), 0 16px 30px -18px rgba(30,20,10,.6); user-select: none; -webkit-user-select: none; }
.ed-door { --rad: 2px; position: relative; container-type: size; display: block; border: 0; padding: 0; margin: 0; border-radius: var(--rad); background: none; outline: none; touch-action: manipulation; }
.ed-door[data-shape="arch"] { --rad: 50% 50% 3px 3px / 32% 32% 3px 3px; }
.ed-door[data-shape="round"] { --rad: 50%; }
.ed-door:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ed-door.empty { background: var(--cover) no-repeat; background-size: var(--bw) var(--bh); background-position: var(--bx) var(--by); }
.ed-door.empty::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 .75px rgba(20,10,0,.55), inset 1px 1px 0 rgba(255,255,255,.28), inset -1px -1px 0 rgba(0,0,0,.25); }
.ed-door.full { overflow: hidden; background: radial-gradient(100% 90% at 50% 30%, #4a301d 0%, #2a1a10 60%, #170e08 100%); }
.ed-door.full::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; box-shadow: inset 0 3px 8px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.35); }
.ed-door img, .ed-door video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ed-door .num { pointer-events: none; }
.ed-door[data-day="25"] .num { font-size: clamp(22px, 52cqmin, 120px); }
.ed-door .dn { position: absolute; z-index: 4; right: 6%; bottom: 4%; font: 400 clamp(10px, 20cqmin, 18px)/1 var(--num); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.ed-door .badge { position: absolute; left: 6%; bottom: 6%; z-index: 4; width: clamp(14px, 24cqmin, 22px); height: clamp(14px, 24cqmin, 22px); border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; }
.ed-door .badge svg { width: 55%; height: 55%; fill: #fff; margin-left: 8%; }
.ed-door .count { position: absolute; right: 6%; top: 5%; z-index: 4; font-size: 10px; font-weight: 600; color: #fff; background: rgba(0,0,0,.45); border-radius: 8px; padding: 1px 5px; }
.ed-board.deal .ed-door { animation: deal .45s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(var(--i) * 12ms); }
@keyframes deal { from { transform: scale(.5); opacity: 0; } }

/* 꾸미기·설정 */
.row.link { width: 100%; border: 0; background: none; text-align: left; justify-content: space-between; }
.row.link span { min-width: 0; }
.row.link:active { background: rgba(118,104,84,.08); }
.theme-wrap + .row.link::before, .theme-acts .row.link::before, .row.pw-edit::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--hair); }
.row.url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-head { justify-content: space-between; }
.pw-head .lbl { width: auto; flex: 1; }
.pw-stat { font-size: 15px; color: var(--ink3); }
.pw-stat.on { color: var(--ink2); }
.pw-val { font-size: 17px; color: var(--ink2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-act { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; padding: 6px 16px 16px; }
.sw { position: relative; flex: none; width: 51px; height: 31px; padding: 0; border: 0; border-radius: 16px; background: rgba(120,120,128,.26); transition: background .25s var(--ease); }
.sw i { position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.sw.on { background: #34c759; }
.sw.on i { transform: translateX(20px); }

/* 아래 고정 보내기 줄 */
.sendbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(var(--safe-b) + 10px); background: rgba(242,239,233,.94); border-top: .5px solid var(--hair);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); }
.sendbar > * { max-width: 608px; margin-left: auto; margin-right: auto; }
.send-hint { font-size: 12px; color: var(--ink3); text-align: center; margin-bottom: 6px; }
.send-hint[hidden] { display: none; }
.btn.send.weak { background: #e3ddd1; color: var(--ink); }
.btn.send.weak:active { background: #d9d2c4; }

/* ---------- 하루 편집 ---------- */
.de-head .grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: rgba(60,50,40,.22); margin: 4px auto 6px; }
.de-head .save-state { justify-self: start; padding: 8px; font-size: 13px; }
.de-body { padding-top: 6px; }
.de-empty { padding: 26px 8px 18px; }
.de-empty h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.de-empty p { margin: 0; font-size: 15px; color: var(--ink3); }
.choices { margin: 0 0 8px; }
.choice { width: 100%; min-height: 64px; padding: 10px 16px; gap: 14px; border: 0; background: none; text-align: left; }
.choice > svg:first-child { width: 27px; height: 27px; flex: none; color: var(--accent); stroke-width: 1.6; }
.choice .ct { flex: 1; min-width: 0; }
.choice .ct b { display: block; font-size: 17px; font-weight: 600; }
.choice .ct small { display: block; margin-top: 1px; font-size: 13px; color: var(--ink3); }
.eb { margin-bottom: 22px; animation: pop .35s var(--ease); }
.eb-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px 6px; }
.eb-head .kind { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink3); }
.eb-head .kind svg { width: 16px; height: 16px; }
.eb-head .acts { display: flex; }
.eb-head .acts button { width: 36px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink3); display: grid; place-items: center; }
.eb-head .acts svg { width: 18px; height: 18px; }
.eb-head .acts button:disabled { opacity: .3; }
.eb-head .acts button.del { color: var(--accent); }
.eb-card { background: var(--group); border-radius: 14px; overflow: hidden; }
.eb-card .field { display: block; width: 100%; padding: 13px 16px; border: 0; border-top: .5px solid var(--hair); border-radius: 0; background: transparent; outline: none; color: var(--ink); font-size: 16px; }
.eb-card .field:first-child { border-top: 0; }
.eb-card .field::placeholder { color: var(--ink4); }
.eb-card .media { background: var(--fill); display: flex; justify-content: center; }
.eb-card .media img, .eb-card .media video { display: block; width: auto; max-width: 100%; max-height: 320px; object-fit: contain; }
.eb-card .ytprev { aspect-ratio: 16 / 9; background: #000 center / cover; }
.yt-note { padding: 0 16px 11px; font-size: 12px; color: var(--ink3); }
.yt-note.ok { color: #2f7d4f; }
.yt-note.bad { color: var(--accent); }
.upl { padding: 22px 16px 18px; }
.papers { position: relative; display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 14px; scroll-snap-type: x proximity; scroll-padding-left: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.papers::-webkit-scrollbar { display: none; }
.pp { position: relative; flex: none; width: 58px; padding: 0; border: 0; background: none; display: grid; justify-items: center; gap: 8px; font-size: 11px; color: var(--ink3); scroll-snap-align: start; }
.pp i { display: block; width: 100%; aspect-ratio: 5 / 7; border-radius: 6px; background: var(--pb) var(--pis) center top / 100% auto no-repeat; box-shadow: 0 0 0 .5px rgba(0,0,0,.2); transition: box-shadow .2s var(--ease); }
.pp.on i { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent); }
.pp.on { color: var(--ink); font-weight: 600; }
.pp .tick { position: absolute; right: -4px; top: 66px; width: 20px; height: 20px; padding: 4px; border-radius: 50%; background: var(--accent); color: #fff; stroke-width: 3; box-shadow: 0 0 0 2px var(--canvas); }
.undo { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 78px); z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: rgba(28,28,30,.92); color: #fff; font-size: 14px; animation: pop .3s var(--ease); }
.undo[hidden], .tools[hidden] { display: none; }
.undo button { border: 0; background: none; color: #ffb4a8; font-size: 14px; font-weight: 600; padding: 6px 10px; }

/* ---------- 비밀번호 잠금 화면 ---------- */
.lock { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px); background: var(--night); color: var(--w1); overflow: hidden;
  transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease); }
.lk-bg { position: absolute; inset: -30px; background: center / cover no-repeat; filter: blur(26px) brightness(.45) saturate(1.1); transform: scale(1.05); }
.lk-box { position: relative; width: min(100%, 340px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.lk-seal { width: 76px; height: 76px; margin-bottom: 20px; border-radius: 22px; display: grid; place-items: center; color: var(--w1); background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: transform .5s var(--ease); }
.lk-seal svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.lk-seal .shackle { transform-origin: 16px 10.5px; transition: transform .5s var(--ease); }
.lk-seal.open { transform: scale(1.06); }
.lk-seal.open .shackle { transform: translateY(-1px) rotate(28deg); }
.lk-cal { max-width: 100%; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--w3); }
.lk-h { margin: 0 0 8px; font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; }
.lk-sub { margin: 0 0 26px; font-size: 15px; line-height: 1.5; color: var(--w2); text-wrap: balance; }
.lk-sub b { color: var(--w1); font-weight: 600; }
.lk-form { width: 100%; display: grid; gap: 10px; }
.lk-field { position: relative; }
.lk-input { display: block; width: 100%; height: 60px; padding: 0 52px; border: 0; border-radius: 16px; outline: none; text-align: center; font-size: 22px; font-weight: 500; letter-spacing: .02em; color: var(--w1);
  background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.22); -webkit-text-security: disc; transition: background .2s var(--ease), box-shadow .2s var(--ease); }
.lk-input.show { -webkit-text-security: none; }
.lk-input::placeholder { color: var(--w3); font-weight: 400; }
.lk-input:focus { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.lk-eye { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--w3); display: grid; place-items: center; }
.lk-eye[aria-pressed="true"] { color: var(--w1); }
.lk-eye svg { width: 20px; height: 20px; }
.lk-msg { min-height: 20px; font-size: 14px; color: #ffb4a8; }
.lk-go { height: 52px; border: 0; border-radius: 14px; background: rgba(255,255,255,.92); color: #1b2426; font-size: 17px; font-weight: 600; }
.lk-go:disabled { opacity: .35; }
.lock.leave { opacity: 0; transform: scale(1.04); filter: blur(8px); pointer-events: none; }
.viewer.arrive { animation: arrive .4s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: scale(.96) translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .viewer.arrive, .ed-board.deal .ed-door { animation: none; } .lock { transition: none; } }














/* 내 사진 배경 */
.th.mine i { display: grid; place-items: center; color: var(--ink2); background-color: var(--fill); background-size: cover; background-repeat: no-repeat; background-position: center; }
.th.mine i svg { width: 26px; height: 26px; }
.th.mine:disabled { opacity: .65; }
.ed-board.adjusting { touch-action: none; }
.adj { position: absolute; inset: 0; z-index: 20; border-radius: inherit; cursor: grab; touch-action: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.92); }
.adj.grab { cursor: grabbing; }
.adj-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 7px 7px 14px; border-radius: 14px; background: rgba(28,28,30,.74); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; font-size: 14px; }
.adj-done { border: 0; background: #fff; color: #1c1c1e; font: 600 14px/1 var(--sans, inherit); padding: 8px 14px; border-radius: 10px; }

/* 만드는 사람 돕기: 아이디어, 문장 시작, 추천 영상 */
.idea-link { display: inline-flex; align-items: center; gap: 2px; margin: 10px 0 0; padding: 4px 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 500; }
.idea-link svg { width: 14px; height: 14px; stroke-width: 2.4; }
.de-idea { margin: 10px 0 8px !important; font-size: 15px !important; line-height: 1.5; color: var(--ink2) !important; }
.de-idea b { font-weight: 600; color: var(--ink); }
.choice .sug { margin-left: 8px; padding: 1px 7px; border-radius: 9px; background: rgba(184,52,42,.1); color: var(--accent); font-size: 11px; font-style: normal; font-weight: 600; vertical-align: 2px; }
.starters, .recs { margin-top: 14px; }
.st-title { padding: 0 4px 8px; font-size: 13px; font-weight: 500; color: var(--ink3); }
.st-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs button { flex: none; border: 0; border-radius: 15px; padding: 6px 13px; background: rgba(60,50,40,.08); color: var(--ink2); font-size: 14px; }
.st-tabs button.on { background: var(--ink); color: #fff; font-weight: 600; }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { max-width: 100%; border: .5px solid var(--hair); border-radius: 14px; padding: 9px 13px; background: var(--group); color: var(--ink); font-size: 15px; line-height: 1.4; text-align: left; }
.st-toggle { border: 0; background: none; padding: 6px 4px; color: var(--accent); font-size: 14px; font-weight: 500; }
.rec-list { background: var(--group); border-radius: 12px; overflow: hidden; }
.rec { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 9px 14px 9px 10px; text-align: left; color: var(--ink); }
.rec + .rec::before { content: ''; position: absolute; top: 0; left: 118px; right: 0; border-top: .5px solid var(--hair); }
.rec i { flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--fill) center / cover; }
.rec .rt { flex: 1; min-width: 0; }
.rec .rt b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .rt small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--ink3); }
.rec .tick, .idea .tick { flex: none; width: 20px; height: 20px; color: var(--accent); stroke-width: 2.4; }
.who { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0 2px; }
.who-h { flex: 0 0 100%; padding: 0 2px; font-size: 13px; font-weight: 500; color: var(--ink3); }
.who button { flex: 1 1 auto; min-height: 44px; border: 0; border-radius: 12px; padding: 0 8px; background: rgba(60,50,40,.08); color: var(--ink2); font-size: 14px; white-space: nowrap; }
.who button.on { background: var(--ink); color: #fff; font-weight: 600; }
.starters .who { margin-top: -2px; }
.idea-list { margin-bottom: 20px; }
.row.idea { position: relative; align-items: flex-start; gap: 14px; width: 100%; border: 0; background: none; padding: 12px 16px; text-align: left; color: var(--ink); }
.row.idea + .row.idea::before { content: ''; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--hair); }
.idea .id { flex: none; width: 34px; padding-top: 2px; font-size: 14px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums; }
.idea .it { flex: 1; min-width: 0; }
.idea .it b { display: block; font-size: 16px; font-weight: 600; }
.idea .it b em { margin-left: 8px; font-size: 12px; font-style: normal; font-weight: 500; color: var(--ink3); }
.idea .it small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ink3); }
.idea.done .it b { color: var(--ink3); }
.idea > svg:last-child { margin-top: 4px; }

/* 자동 시연 (?tour=1): 첫 화면 휴대폰 틀 안에서 돌아간다 */
html.tour, html.tour body { overflow: hidden; }
.tour * { pointer-events: none !important; }
.tour .pv-pill, .tour .demo-pill, .tour .round, .tour .v-make, .tour .v-hint { display: none !important; }
.tour .board-wrap:not(.tour-in) { opacity: 0; }
.tour .board-wrap.tour-in { animation: tourIn 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tourIn { from { opacity: 0; transform: translateY(22px) scale(.96); } }
.tour-finger { position: fixed; left: 0; top: 0; z-index: 200; width: 46px; height: 46px; border-radius: 50%; pointer-events: none; opacity: 0; scale: 1.35; will-change: transform;
  background: rgba(255,255,255,.3); border: 1.5px solid rgba(255,255,255,.7); transition: opacity .22s ease, scale .18s ease, background .18s ease; }
.tour-finger.on { opacity: 1; scale: 1; }
.tour-finger.press { scale: .82; background: rgba(255,255,255,.5); }

/* ---------- v7: 문 경계와 숫자가 어떤 배경에서도 읽히게 ---------- */
/* 칼선: 바깥은 어두운 1px, 안쪽은 밝은 1px. 칼집 낸 종이처럼 보인다. 윗변·왼변은 살짝 밝고 아랫변·오른변은 살짝 어둡다. */
.flap::before, .ed-door.empty::before {
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.34), inset 0 0 6px 1px rgba(0,0,0,.2);
  background: linear-gradient(135deg, rgba(255,255,255,.15), rgba(255,255,255,0) 32%, rgba(0,0,0,0) 62%, rgba(0,0,0,.17)); }
.door:not(.torn), .ed-door { filter: drop-shadow(0 1px 1.2px rgba(0,0,0,.4)); }
.door.torn { filter: drop-shadow(0 -1px 0 rgba(0,0,0,.25)); }

.ed-door.full::after { box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), inset 0 3px 8px rgba(0,0,0,.55); }
/* 밝은 배경(테마 tone:light, 밝은 내 사진)은 문마다 옅은 덮개를 깔아 무늬 대비를 낮춘다 */
.tone-light .flap::before, .tone-light .ed-door.empty::before {
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0) 32%, rgba(0,0,0,0) 62%, rgba(0,0,0,.17)), linear-gradient(rgba(20,12,6,var(--veil, .1)), rgba(20,12,6,var(--veil, .1))); }
.plate { background: radial-gradient(closest-side, rgba(12,8,4,.6), rgba(12,8,4,.32) 58%, transparent); }
.theme-midnight .plate { background: radial-gradient(closest-side, rgba(8,14,40,.65), rgba(8,14,40,.3) 58%, transparent); }
.ed-door .plate { position: absolute; left: 50%; top: 50%; width: 78cqmin; height: 64cqmin; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.ed-door[data-day="25"] .plate, .ed-door[data-day="24"] .plate { width: 70cqmin; height: 56cqmin; }
.ed-door[data-shape="round"] .plate { width: 70cqmin; height: 60cqmin; }
/* 금박 숫자: 얇은 어두운 외곽 */
.num { filter: var(--numfx, drop-shadow(1px 0 0 rgba(30,14,0,.78)) drop-shadow(-1px 0 0 rgba(30,14,0,.78)) drop-shadow(0 1px 0 rgba(30,14,0,.78)) drop-shadow(0 -1px 0 rgba(30,14,0,.78)) drop-shadow(0 0 5px rgba(0,0,0,.5))); }

/* 숫자 스타일: 배경에 맞춰 고른다 (판에 numeral-gold / ivory / ink / red 클래스) */
.numeral-ivory { --foil: linear-gradient(170deg, #fffefa 0%, #f8eed8 50%, #e6d7b6 100%); }
.numeral-ink { --foil: linear-gradient(170deg, #55362a 0%, #2b1912 55%, #1b0f0b 100%);
  --numfx: drop-shadow(1px 0 0 rgba(255,247,232,.9)) drop-shadow(-1px 0 0 rgba(255,247,232,.9)) drop-shadow(0 1px 0 rgba(255,247,232,.9)) drop-shadow(0 -1px 0 rgba(255,247,232,.9)) drop-shadow(0 1px 3px rgba(255,255,255,.55)); }
.numeral-red { --foil: linear-gradient(170deg, #c13a30 0%, #8e1a1d 55%, #6d0f16 100%);
  --numfx: drop-shadow(1px 0 0 rgba(255,247,232,.92)) drop-shadow(-1px 0 0 rgba(255,247,232,.92)) drop-shadow(0 1px 0 rgba(255,247,232,.92)) drop-shadow(0 -1px 0 rgba(255,247,232,.92)) drop-shadow(0 1px 3px rgba(255,255,255,.5)); }
.numeral-ink .plate, .numeral-red .plate { background: radial-gradient(closest-side, rgba(255,246,228,.78), rgba(255,246,228,.4) 58%, transparent); }

/* 내 사진: 사진이 선명하게 보이도록 문 덮개를 깔지 않는다. 대비는 칼선과 숫자 그림자가 맡는다 */
.theme-custom .flap::before, .theme-custom .ed-door.empty::before { background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,0) 30%, rgba(0,0,0,0) 65%, rgba(0,0,0,.1)); }

/* 숫자 스타일 고르기 */
.ns-wrap { padding: 4px 16px 16px; border-top: .5px solid var(--hair); }
.ns-title { padding: 12px 0 10px; font-size: 13px; color: var(--ink3); }
.numerals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ns { border: 0; background: none; padding: 0; text-align: center; color: var(--ink2); font-size: 12px; }
.ns i { position: relative; display: block; container-type: size; aspect-ratio: 5 / 4; border-radius: 8px; overflow: hidden; background: var(--fill) center / cover; margin-bottom: 6px; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); }
.ns .plate { width: 90cqw; height: 70cqh; }
.ns .num { font-size: 52cqh; }
.ns.on { color: var(--ink); font-weight: 600; }
.ns.on i { box-shadow: 0 0 0 2px var(--group), 0 0 0 4px var(--accent); }
/* 1일부터 채우기, 목록으로 보기 */
.fill-btn { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 32px); margin: 4px 16px 12px; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; text-align: left; }
.fill-btn[hidden] { display: none; }
.fill-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.seg { display: flex; margin: 0 16px 12px; padding: 2px; border-radius: 9px; background: rgba(60,50,40,.1); }
.seg button { flex: 1; border: 0; border-radius: 7px; padding: 6px 0; background: none; color: var(--ink2); font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--group); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.board-wrap[hidden], .ed-list[hidden] { display: none; }
.ed-list { margin: 0 16px 28px; }
.ed-li { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 10px 16px; border: 0; background: none; text-align: left; color: var(--ink); }
.ed-li + .ed-li::before { content: ''; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--hair); }
.ed-li .ld { flex: none; width: 34px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ed-li .ls { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-li.empty .ls { color: var(--ink4); }
.ed-li.empty .ld { color: var(--ink3); }
.ed-li.next .ld, .ed-li.next .ls { color: var(--accent); }
/* 다음에 채울 칸을 은은하게 */
.ed-door.next::after { content: ''; position: absolute; inset: -3px; z-index: 5; border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 1px #c99b49; }
/* 하루 시트: 다음 빈 칸으로 */
.next-bar { display: flex; align-items: center; justify-content: space-between; flex: none; margin: 0 16px 8px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; }
.next-bar[hidden] { display: none; }
.next-bar svg { width: 18px; height: 18px; stroke-width: 2.4; }

/* QA: 태블릿처럼 넓은 화면에서도 글 종이는 받는 화면 카드와 같은 폭(세로 속지 비율)으로 */
.eb-paper { max-width: 420px; margin-left: auto; margin-right: auto; }

/* ---------- 스토리 카드 (인스타그램 공유) ---------- */
.send-row { display: flex; gap: 8px; }
.send-row .btn.send { flex: 1; min-width: 0; width: auto; }
.send-row .btn.story { flex: none; width: auto; padding: 0 16px; height: 50px; font-size: 15px; font-weight: 600; }
.card-end { display: flex; justify-content: center; padding: 4px 0 16px; }
.brag { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border: 0; border-radius: 22px; padding: 0 18px; background: rgba(60,50,40,.08); color: var(--ink); font-size: 15px; font-weight: 500; }
.brag svg { width: 15px; height: 15px; stroke-width: 2; }
.brag:disabled { opacity: .5; }
.sc-back { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s var(--ease); }
.sc-back.on { opacity: 1; }
.sc-sheet { position: fixed; z-index: 81; left: 50%; bottom: 0; width: min(100%, 520px); max-height: calc(100svh - var(--safe-t) - 8px); overflow-y: auto; overscroll-behavior: contain; transform: translateX(-50%);
  padding: 0 20px calc(var(--safe-b) + 18px); border-radius: 22px 22px 0 0; background: rgba(32,32,34,.97); color: #fff; box-shadow: 0 -10px 50px rgba(0,0,0,.5);
  transition: transform .45s var(--ease); touch-action: pan-y; }
.sc-sheet.enter { transform: translate(-50%, 100%); }
.sc-sheet[style*="translateY"] { transform: translate(-50%, 0) !important; }
.sc-grab { width: 36px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: rgba(255,255,255,.25); }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 14px; cursor: grab; }
.sc-title b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.sc-title small { display: block; margin-top: 2px; font-size: 13px; color: rgba(255,255,255,.55); }
.sc-close { border: 0; background: none; color: #ff8a7a; font-size: 16px; font-weight: 500; padding: 6px 0 6px 12px; }
.sc-stage { position: relative; margin: 0 auto; width: min(100%, calc((100svh - 330px) * 9 / 16)); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #151517; box-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 12px 30px rgba(0,0,0,.45); }
.sc-img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-touch-callout: default; transition: opacity .35s var(--ease); }
.sc-stage.loading .sc-img { opacity: 0; }
.sc-stage.loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.07) 50%, transparent 80%) -100% 0 / 200% 100% no-repeat; animation: stSheen 1.4s linear infinite; }
@keyframes stSheen { to { background-position: 100% 0; } }
.sc-hint { margin: 12px 4px 0; font-size: 13px; line-height: 1.45; color: rgba(255,255,255,.62); text-align: center; text-wrap: balance; }
.sc-hint[hidden], .sc-after[hidden] { display: none; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.07); font-size: 16px; }
.sc-acts { display: flex; gap: 8px; margin-top: 16px; }
.sc-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border: 0; border-radius: 14px; background: rgba(255,255,255,.12); color: #fff; font-size: 17px; font-weight: 600; }
.sc-btn.primary { background: var(--accent); }
.sc-btn.primary:active { background: var(--accent-press); }
.sc-btn[hidden] { display: none; }
.sc-btn:disabled { opacity: .45; }
.sc-btn svg { width: 19px; height: 19px; stroke-width: 2.1; }
.sc-after { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: stIn .4s var(--ease) both; }
.sc-after p { margin: 0; font-size: 14px; line-height: 1.4; color: rgba(255,255,255,.82); text-wrap: balance; }
.sc-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 14px; padding: 8px 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 14px; font-weight: 600; }
.sc-copy svg { width: 15px; height: 15px; }
@keyframes stIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .sc-sheet, .sc-back, .sc-img { transition: none; } .sc-after { animation: none; } .sc-stage.loading::after { animation: none; } }
.ig-note { position: fixed; left: 50%; top: calc(var(--safe-t) + 8px); transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 24px); padding: 6px 6px 6px 14px; border-radius: 18px; background: rgba(28,28,30,.82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: rgba(255,255,255,.88); font-size: 12.5px; line-height: 1.3; }
.ig-note button { flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: rgba(255,255,255,.7); display: grid; place-items: center; }
.ig-note button svg { width: 11px; height: 11px; stroke-width: 2.6; }


/* ---------- 편집 화면: 첫 화면의 겨울밤으로 이어 가기 ---------- */
body.night {
  --ink: #f5f0e6; --ink2: #dcd6ca; --ink3: #c0b9ad; --ink4: #a39c90;
  --hair: #3a4650; --group: #202b32; --fill: #2a363e; --canvas: #111820;
  --accent: #c99b49; --accent-press: #b58a3c; --gold: #c99b49;
  background: #111820; color: var(--ink);
}
.ed-bg { position: fixed; inset: 0; z-index: -1; background: #111820; }
.hand { font-family: var(--hand); letter-spacing: -0.01em; }
.page.ed { position: relative; z-index: 1; padding-bottom: calc(var(--safe-b) + 128px); }

.night .nav { background: #111820; box-shadow: 0 1px 0 var(--hair); }
.night .nav a, .night .nav .navtxt { color: var(--ink); min-height: 44px; padding: 8px 10px; }
.night .nav .nav-pv { color: var(--gold); }
.night .save-state { color: var(--ink3); }
.night .save-state.err { color: #ffb4a8; }
.night .title-input { margin: 10px 20px 8px; font: 700 28px/1.25 var(--ui); letter-spacing: -0.02em; color: var(--ink); }
.night .title-input::placeholder { color: var(--ink4); }

/* 받는 사람·보내는 사람 */
.env { margin: 12px 20px 4px; padding: 2px 18px; border-radius: 12px; background: #202b32; }
.env-row { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--hair); }
.env-row:last-child { border-bottom: 0; }
.env-l { flex: none; width: 6.4em; font: 500 14px/1.25 var(--ui); color: var(--ink3); }
.env-in { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; outline: none; color: var(--ink); font: 400 18px/1.3 var(--ui); caret-color: #c99b49; }
.env-in::placeholder { color: var(--ink4); opacity: 1; font-size: 16px; }
.env-in:focus-visible { outline: 2px solid #c99b49; outline-offset: 2px; border-radius: 4px; }
.env-note { margin: 6px 24px 0; font-size: 18px; line-height: 1.35; color: var(--ink3); }

/* 진행: 문 25개를 단색 막대로 */
.prog { margin: 20px 20px 12px; display: flex; flex-direction: column; gap: 10px; }
.prog-num { font: 600 17px/1.3 var(--ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.prog-num b { font-weight: 700; color: var(--gold); }
.flakes { display: grid; grid-template-columns: repeat(25, 1fr); gap: 2px; height: 8px; }
.fl { display: block; border-radius: 1px; background: #3a4650; }
.fl.on { background: #c99b49; }
.prog-hint { font: 400 15px/1.45 var(--ui); color: var(--ink2); }
.prog-hint[hidden] { display: none; }

/* 다음 문을 가리키는 종이 버튼 */
.night .fill-btn { display: flex; align-items: center; gap: 16px; width: calc(100% - 40px); margin: 8px 20px 10px; min-height: 72px; padding: 12px 18px; border: 0; border-radius: 12px; text-align: left; background: #f5f0e6; color: #29231f; }
.night .fill-btn:active { background: #e9e3d6; }
.fb-n { flex: none; min-width: 40px; text-align: center; font: 400 40px/1 var(--num); color: #8a6420; }
.fb-t { flex: 1; min-width: 0; }
.fb-t b { display: block; font: 700 17px/1.3 var(--ui); letter-spacing: -0.01em; color: #29231f; }
.fb-t small { display: block; margin-top: 2px; font: 400 14px/1.3 var(--ui); color: #62584f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.night .fill-btn svg { flex: none; width: 20px; height: 20px; color: #62584f; stroke-width: 2.2; }

/* 판 위 도구: 손글씨 링크와 보기 전환 */
.ed-tools { display: flex; align-items: center; justify-content: space-between; margin: 2px 20px 8px; min-height: 48px; }
.night .idea-link { margin: 0; padding: 0; min-height: 44px; color: var(--ink); font: 600 15px/1.2 var(--ui); text-align: left; }
.night .idea-link svg { width: 15px; height: 15px; margin-left: 2px; }
.vt { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: #202b32; }
.vt button { width: 46px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--ink3); display: grid; place-items: center; }
.vt button svg { width: 22px; height: 22px; stroke-width: 1.7; }
.vt button.on { background: #3a4650; color: var(--ink); }

/* 판: 주인공 */
.night .board-wrap { margin: 0 0 8px; padding: 6px 20px 30px; }
.night .ed-board { width: min(100%, 430px); box-shadow: 0 0 0 1px #3a4650; }
.night .ed-list { margin: 0 20px 30px; border-radius: 12px; overflow: hidden; background: #202b32; }
.night .ed-li { min-height: 52px; color: var(--ink); }
.night .ed-li .ld { color: var(--ink2); }
.night .ed-li.empty .ld { color: var(--ink3); }
.night .ed-li.empty .ls { color: var(--ink3); }
.night .ed-li.next .ld, .night .ed-li.next .ls { color: var(--gold); }
.night .row .chev { color: var(--ink3); }

/* 꾸미기 */
.deck { margin-top: 6px; }
.deck-h { margin: 30px 24px 6px; font: 700 20px/1.3 var(--ui); letter-spacing: -0.02em; color: var(--ink); }
.deck-p { margin: 0 24px 14px; font-size: 15px; line-height: 1.5; color: var(--ink2); }
.ed-card, .night .page.ed .group { margin: 0 20px 14px; border-radius: 12px; overflow: hidden; background: #202b32; }
.ec-t { margin: 0; padding: 16px 18px 0; font: 600 15px/1.3 var(--ui); letter-spacing: -0.01em; color: var(--ink2); }
.ec-p { margin: 0; padding: 14px 18px 6px; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.ed-card .row.link { min-height: 52px; }
.ghost-pill { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 40px); margin: 4px 20px 14px; min-height: 48px; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px #4a555e; color: var(--ink); font-size: 16px; font-weight: 500; }
.ghost-pill svg { width: 18px; height: 18px; }
.night .themes { padding: 12px 18px 16px; scroll-padding-left: 18px; }
.night .th { color: var(--ink2); scroll-margin-left: 18px; }
.night .th.on { color: var(--ink); }
.night .th.on i { box-shadow: 0 0 0 2px #202b32, 0 0 0 4px var(--gold); }
.night .th.mine i { color: var(--ink2); }
.night .numerals { padding: 12px 18px 18px; }
.night .ns { color: var(--ink2); }
.night .ns.on { color: var(--ink); }
.night .ns.on i { box-shadow: 0 0 0 2px #202b32, 0 0 0 4px var(--gold); }
.night .theme-acts .row.link { color: var(--ink); }
.night .row.link:active { background: rgba(246,240,228,.08); }
.night .page.ed .sw { background: #4a555e; }
.night .page.ed .sw.on { background: #c99b49; }
.night .page.ed .sw::before { content: ''; position: absolute; inset: -8px -4px; }
.night .page.ed .btn { background: #f4ecd9; color: #1b1710; border-radius: 999px; }
.night .page.ed .btn:active { background: #e6dcc4; }
.night .page.ed .btn.tint { background: rgba(246,240,228,.12); color: var(--ink); }
.night .pw-stat.on { color: var(--gold); }

.night .btn.send { height: 50px; border-radius: 999px; background: #f4ecd9; color: #1b1710; font-size: 17px; }
.night .btn.send:active { background: #e6dcc4; }
.night .btn.send.weak { background: rgba(246,240,228,.16); color: var(--ink); box-shadow: inset 0 0 0 .5px rgba(246,240,228,.28); }
.night .btn.send.weak:active { background: rgba(246,240,228,.24); }

/* 하루 편집 시트: 크림색 종이 */
.de-back { background: rgba(8,10,20,.6); }
.de { --ink: #2b2018; --ink2: #5a4a3a; --ink3: #6c5c4b; --ink4: #76695c; --hair: rgba(90,66,40,.16); --group: rgba(255,252,244,.72); --fill: #eee4d0; --canvas: #f6efe0; --accent: #a52e2e; --accent-press: #8f2b18;
  background: #f5f0e6; color: var(--ink); border-radius: 16px 16px 0 0; }
.de .btn { background: #29231f; color: #f6f0e4; }
.de .btn:active { background: #14110f; }
.de-head .grab { background: rgba(90,66,40,.28); }
.de-title b { font: 700 20px/1.2 var(--letter); letter-spacing: -0.02em; }
.de-title small { font-size: 12.5px; }
.de-empty h2 { font: 700 26px/1.25 var(--letter); letter-spacing: -0.03em; }
.de .de-idea { margin: 12px 0 8px !important; font: 400 15px/1.5 var(--ui) !important; color: var(--ink2) !important; }
.de .de-idea b { color: #62584f; font-weight: 600; }
.de-empty p { color: var(--ink3); }
.de .choices { background: none; box-shadow: none; overflow: visible; display: grid; gap: 10px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.de .choice { min-height: 68px; border-radius: 16px; background: rgba(255,252,244,.78); box-shadow: 0 0 0 .5px rgba(90,66,40,.16), 0 6px 14px -8px rgba(70,46,20,.35); }
.de .choice + .choice::before { display: none; }
.de .choice > svg:first-child { color: #62584f; }
.de .choice:active { background: #fff; }
.de .tools { background: rgba(250,244,230,.92); }
.de .tools button { color: var(--ink2); }
.de .tools button svg { color: #62584f; }
.de .next-bar { background: #29231f; color: #f6f0e4; border-radius: 14px; }
.de .next-bar svg { color: #e6c27a; }
.de .papers .pp.on i { box-shadow: 0 0 0 2px #f6efe0, 0 0 0 4px #62584f; }
.de .pp .tick { background: #62584f; box-shadow: 0 0 0 2px #f6efe0; }
.de .done { color: #62584f; }
.de .chevbtn { color: #62584f; }
.de .chevbtn:disabled { color: #a79a8a; }
.de .eb-head .acts button { width: 44px; height: 36px; }
.de .eb-head .acts button.del { color: #a52e2e; }


.de .chevbtn { width: 44px; height: 44px; }
.de .done { min-height: 44px; min-width: 44px; }
.de .eb-head .acts button { height: 44px; }
.night .env-in { min-height: 44px; }
.night .nav .nav-pv, .night .nav a { min-height: 44px; }


/* 배포 전 다듬기: 고정 바는 불투명하게, 안내는 읽기 쉽게 */
.night .page.ed { padding-bottom: calc(var(--safe-b) + 160px); }
.page.ed::after { content: ''; display: block; height: calc(var(--safe-b) + 8px); }
.env-note { margin: 8px 24px 0; font: 400 13px/1.45 var(--ui); letter-spacing: -0.01em; color: var(--ink3); }
.de .st-toggle { color: #62584f; font-weight: 600; }
.de .st-tabs button.on { background: #29231f; color: #f6f0e4; }
.de .chip { background: rgba(255,252,244,.8); }
.de .idea-list { background: none; box-shadow: none; overflow: visible; display: grid; gap: 8px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.de .row.idea { border-radius: 14px; background: rgba(255,252,244,.78); box-shadow: 0 0 0 .5px rgba(90,66,40,.16), 0 4px 10px -6px rgba(70,46,20,.3); min-height: 64px; }
.de .row.idea + .row.idea::before { display: none; }
.de .idea .id { color: #62584f; font-family: var(--num); font-size: 17px; font-weight: 400; }
.de .idea .it small { color: var(--ink3); }
.de .idea .tick { color: #62584f; }
.de .rec .tick { color: #62584f; }
.adj-bar { background: rgba(14,18,30,.94); box-shadow: inset 0 0 0 .5px rgba(246,240,228,.2), 0 10px 24px -8px rgba(0,0,0,.6); border-radius: 999px; padding: 6px 6px 6px 18px; color: #f6f0e4; }
.adj-done { min-height: 44px; min-width: 64px; border-radius: 999px; background: #f4ecd9; color: #1b1710; font-weight: 700; }




.sc-rows .sc-row { margin-top: 8px; min-height: 52px; }
.sc-rows { margin-top: 6px; }

/* 개인정보·분석 안내 (/privacy) */
.privacy { max-width: 560px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 22px calc(48px + env(safe-area-inset-bottom)); color: #f3e8d2; line-height: 1.7; }
.privacy-back { display: inline-flex; align-items: center; min-height: 44px; color: #d9b970; font-size: 14px; text-decoration: none; }
.privacy h1 { margin: 8px 0 6px; font-family: 'DM Serif Display', 'Gowun Batang', serif; font-weight: 400; font-size: 30px; line-height: 1.25; }
.privacy-lead { margin: 0 0 28px; color: rgba(243, 232, 210, .78); }
.privacy section { padding: 18px 0; border-top: 1px solid rgba(243, 232, 210, .14); }
.privacy h2 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #e8cf94; }
.privacy p { margin: 0; font-size: 15px; color: rgba(243, 232, 210, .9); }

.priv-link { display: block; width: fit-content; margin: 18px auto 0; padding: 12px 8px; color: rgba(243, 232, 210, .66); font-size: 13px; text-decoration: none; }

/* 언어 선택 */
.lang-pick { appearance: none; -webkit-appearance: none; display: block; margin: 12px auto 0; min-height: 44px; padding: 0 28px 0 12px; border: 0; border-radius: 10px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23f3e8d2' stroke-opacity='.7' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center; color: rgba(243, 232, 210, .78); font: 500 13px/1 system-ui, -apple-system, sans-serif; text-align: center; text-align-last: center; cursor: pointer; }
.lang-pick option { color: #1b1b1b; }

/* 일본어·중국어 글은 단어 단위가 아니라 글자 단위로 줄을 바꾼다 */
html[data-lang="ja"] .letter, html[data-lang="ja"] .paper textarea, html[data-lang="zh-TW"] .letter, html[data-lang="zh-TW"] .paper textarea { word-break: normal; line-break: strict; letter-spacing: 0; }
html[data-lang="en"] .letter, html[data-lang="en"] .paper textarea, html[data-lang="en"] .paper .sign { letter-spacing: 0; word-break: normal; }
/* ---------- 편집 화면: 저장 상태·링크 카드·비밀번호 (impl_save) ---------- */
.nav { flex-wrap: wrap; }
.save-live { flex: 1 1 100%; }
.save-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin: 0 0 2px; padding: 2px 4px 2px 12px; border: 1px solid rgba(255,180,168,.5); border-radius: 10px; color: #ffb4a8; font-size: 14px; font-weight: 600; line-height: 1.35; }
.save-banner[hidden], .sb-btn[hidden] { display: none; }
.sb-t { flex: 1 1 180px; padding: 8px 0; }
.sb-btn { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--ink); font: 600 14px/1.2 var(--ui); text-decoration: underline; text-underline-offset: 3px; }
.ask-url { width: 100%; min-height: 48px; margin: 0 0 14px; padding: 0 12px; border: 0; border-radius: 10px; background: #202b32; color: var(--ink); font: 400 15px/1.3 var(--ui); user-select: text; -webkit-user-select: text; }
.ask-back.top { z-index: 72; }
.ask.top { z-index: 73; }
.night .save-state.err { min-height: 44px; display: inline-flex; align-items: center; }
.night .nav .nav-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 10px; border: 0; background: none; color: var(--ink); font-size: 17px; }
.nav .nav-link svg { width: 20px; height: 20px; stroke-width: 2; }
.title-wrap { display: flex; align-items: flex-start; gap: 8px; margin: 10px 20px 8px; cursor: text; }
.night .title-wrap .title-input { flex: 1; min-width: 0; width: auto; margin: 0; padding: 4px 0; resize: none; overflow: hidden; max-height: calc(2.5em + 8px); font-size: 28px; line-height: 1.25; text-overflow: clip; }
.title-pen { flex: none; width: 20px; height: 20px; margin-top: 12px; color: var(--ink3); stroke-width: 1.8; }
.keep-note { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin: 0 20px 12px; padding: 4px 4px 4px 14px; border: 1px solid rgba(246,240,228,.22); border-radius: 12px; font-size: 14px; line-height: 1.4; color: var(--ink2); }
.keep-note[hidden] { display: none; }
.keep-note .kn-t { flex: 1 1 200px; padding: 6px 0; }
.keep-note .kn-btn { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.keep-note .kn-x { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--ink3); }
.keep-note .kn-x svg { width: 18px; height: 18px; stroke-width: 2; }
.link-sec .ec-act { display: grid; gap: 8px; padding: 10px 18px 18px; }
.link-sec .ec-act .btn { width: 100%; }
.link-sec .ec-warn { padding-top: 0; font-weight: 600; color: var(--ink); }
.night .page.ed { padding-bottom: calc(var(--safe-b) + 40px); }
.ask-back { position: fixed; inset: 0; z-index: 70; background: rgba(8,10,20,.62); }
.ask { position: fixed; z-index: 71; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); max-width: 420px; margin: 0 auto; padding: 22px 20px 20px; border-radius: 16px; background: #1d2630; color: var(--w1); box-shadow: 0 0 0 1px rgba(246,240,228,.14); }
.ask h2 { margin: 0 0 8px; font: 700 20px/1.3 var(--ui); letter-spacing: -0.02em; }
.ask p { margin: 0 0 18px; font-size: 16px; line-height: 1.5; color: var(--w2); }
.ask-acts { display: grid; gap: 8px; }
.ask .btn { height: 50px; border-radius: 999px; background: #f4ecd9; color: #1b1710; }
.ask .btn.tint { background: rgba(246,240,228,.12); color: var(--w1); }
.cap-note { flex: none; padding: 8px 16px; text-align: center; font-size: 14px; color: var(--ink2); }
.cap-note[hidden] { display: none; }
.tools button:disabled { opacity: .38; }
.eb-note { margin: 6px 4px 0; font-size: 13px; line-height: 1.4; color: var(--ink3); }
.pw-note { margin: 0; padding: 8px 16px 0; font-size: 13px; line-height: 1.4; color: var(--ink3); }
.pw-err { margin: 0; padding: 8px 16px 12px; font-size: 14px; line-height: 1.4; color: #ffb4a8; }
.pw-err[hidden] { display: none; }

/* ---------- v9: 받는 화면 — 종이 신호, 카드, 잠금 ---------- */
/* 문 상태는 종이로 말한다. 뜯을 수 있는 문: 금박 숫자 + 점선 칼선 + 들린 모서리 + 살짝 뜬 그림자. 아직 안 열린 문: 금박도 칼선도 그림자도 없는 평평한 인쇄. */
.board { --cut: rgba(255,247,228,.95); --cut-edge: rgba(24,14,6,.4); --flat: #f2ead9; --flatfx: drop-shadow(1px 0 0 rgba(20,10,0,.6)) drop-shadow(-1px 0 0 rgba(20,10,0,.6)) drop-shadow(0 1px 0 rgba(20,10,0,.6)) drop-shadow(0 -1px 0 rgba(20,10,0,.6)); }
.board.numeral-ink, .board.numeral-red { --flatfx: drop-shadow(1px 0 0 rgba(255,247,232,.85)) drop-shadow(-1px 0 0 rgba(255,247,232,.85)) drop-shadow(0 1px 0 rgba(255,247,232,.85)) drop-shadow(0 -1px 0 rgba(255,247,232,.85)); }
.board.numeral-ink { --flat: #2b1912; }
.board.numeral-red { --flat: #7c1a1c; }
.board.tone-light { --cut: rgba(46,32,20,.95); --cut-edge: rgba(255,250,240,.5); }
.door.ready { filter: drop-shadow(0 2px 1.5px rgba(0,0,0,.45)); }
.door.ready .flap::before { box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.3); }
.cut { position: absolute; inset: 4px; display: none; pointer-events: none; border: 1px dashed var(--cut); border-radius: var(--rad, 2px); box-shadow: 0 0 0 1px var(--cut-edge); }
.door.ready:not(.lifting) .cut { display: block; }
.door[data-shape="round"] .curl { width: calc(var(--c) * .8); height: calc(var(--c) * .8); right: 4%; bottom: 4%; }
.door.locked { filter: none; }
.door.locked .flap::before { background: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.door.locked .num { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--flat); filter: var(--flatfx); }
.door.locked .plate { opacity: .6; }
.today-tag { display: none; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); padding: 1px 4px; border-radius: 2px; background: #f3ecdc; color: #29231f; font: 600 12px/1.3 var(--ui); letter-spacing: 0; white-space: nowrap; pointer-events: none; }
.door.today.ready:not(.lifting) .today-tag { display: block; }

/* 카드: 사진은 카드 높이의 60% 안에서, 다음 글이 48px 이상 보이게 */
.card { --ch: min(82svh, 760px); --lidh: 132px; --navh: 56px; max-height: var(--ch); }
.lid { height: var(--lidh); }
.card .blk-img img, .card .blk-video video, .card .blk-video video:not([data-ready]) { max-height: max(120px, min(calc(var(--ch) * .6), calc(var(--ch) - var(--lidh) - var(--navh) - 108px))); }
.card-body.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
@media (max-height: 700px) { .card { --lidh: 96px; } .lid { padding: 12px 18px; } .lid-num { font-size: 46px; } }

/* 잠금 화면: 종이 한 장과 입력 칸. 제목·이름·표지는 쓰지 않는다. */
.lock { background: #111820; transition: opacity .35s var(--ease); }
.lock.leave { transform: none; filter: none; }
.lk-box { width: min(100%, 360px); padding: 28px 24px 24px; border-radius: 6px; background: #f5f0e6 var(--grain); color: #29231f; align-items: stretch; text-align: left; box-shadow: 0 0 0 .5px rgba(0,0,0,.3), 0 24px 60px -20px rgba(0,0,0,.7); }
.lk-seal { width: 28px; height: 28px; margin: 0 0 12px; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: #29231f; place-items: start; }
.lk-seal svg { width: 28px; height: 28px; }
.lk-seal.open { transform: none; }
.lk-h { margin: 0 0 8px; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; color: #29231f; }
.lk-sub { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: #62584f; text-wrap: balance; }
.lk-hint { margin: -4px 0 0; font-size: 16px; line-height: 1.5; color: #29231f; }
.lk-hint b { font-weight: 600; }
.lk-note { margin: 2px 0 16px; font-size: 14px; line-height: 1.45; color: #62584f; }
.lk-input { height: 56px; border-radius: 6px; background: #fffdf8; color: #29231f; box-shadow: inset 0 0 0 1px #8b8175; font-size: 20px; text-align: left; padding: 0 52px 0 14px; letter-spacing: .02em; }
.lk-input:focus { background: #fff; box-shadow: inset 0 0 0 2px #29231f; }
.lk-input::placeholder { color: #6f655a; }
.lk-eye { color: #62584f; }
.lk-eye[aria-pressed="true"] { color: #29231f; }
.lk-msg { color: #a52e2e; min-height: 20px; }
.lk-go { height: 52px; border-radius: 6px; background: #29231f; color: #f5f0e6; }
.lk-go:disabled { opacity: .4; }

/* 동작 줄이기: 전환 없이 결과만 */
@media (prefers-reduced-motion: reduce) {
  .viewer, .viewer *, .sheet-back, .card, .card *, .lock, .lock *, .dots-track { transition: none !important; animation: none !important; }
}

@media (max-width: 380px) { .night .nav .nav-pv svg { display: none; } .night .nav .nav-link { padding: 8px 8px; } .nav .save-state { padding: 8px 6px; } }
.link-sec { scroll-margin-top: 64px; }
@media (max-width: 380px) { .night .nav .nav-link, .night .nav .nav-pv { font-size: 15px; padding: 8px 6px; } .night .nav a { padding: 8px 6px; font-size: 15px; } .nav .save-state { padding: 8px 4px; font-size: 12px; } }
.keep-note { display: grid; grid-template-columns: 1fr 44px; grid-template-areas: "t x" "b x"; align-items: start; gap: 0; padding: 6px 0 4px 14px; }
.keep-note .kn-t { grid-area: t; flex: none; padding: 6px 0 0; }
.keep-note .kn-btn { grid-area: b; justify-self: start; padding: 0; }
.keep-note .kn-x { grid-area: x; align-self: start; }

/* 들린 모서리: 접힌 종이 뒷면은 크림색, 그 아래는 문 바탕이 살짝 어두워질 뿐 (검은 구멍처럼 보이지 않게) */
.door.ready:not(.lifting) .hole { background: linear-gradient(135deg, transparent 45%, rgba(40,22,8,.34) 100%); }
.curl { background: linear-gradient(to bottom right, #f6ead3 0%, #ead8b4 38%, #d2b98d 47%, transparent 50%); filter: drop-shadow(1px 1px 1.5px rgba(40,22,8,.4)); }


/* 같은 문 충돌: 두 쪽 비교 (평면, 장식 없음) */
.ask.cmp { max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.cmp-col { min-width: 0; padding: 10px; border-radius: 10px; background: #202b32; }
.cmp-col > b { display: block; margin: 0 0 8px; font: 700 14px/1.3 var(--ui); color: var(--w1); }
.cmp-col > * + * { margin-top: 8px; }
.cmp-col > b + * { margin-top: 0; }
.cmp-col img { display: block; width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; }
.cmp-t { max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14px/1.45 var(--ui); color: var(--w1); }
.cmp-m { overflow-wrap: anywhere; font: 400 13px/1.4 var(--ui); color: var(--w2); }
@media (max-width: 340px) { .cmp-cols { grid-template-columns: 1fr; } }
/* 복구 코드(편집 화면 안내)와 편집 링크 다시 받기(첫 화면) */
.keep-note { grid-template-areas: "t x" "b x" "r x"; }
.keep-note .kn-rc { grid-area: r; display: flex; align-items: center; flex-wrap: wrap; gap: 0 10px; padding: 6px 0 8px; }
.keep-note .kn-rc[hidden] { display: none; }
.keep-note .kn-rl { font-weight: 600; color: var(--ink); }
.keep-note .kn-code { font: 600 17px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: var(--ink); user-select: all; -webkit-user-select: all; }
.keep-note .kn-rc .kn-btn { padding: 0 4px; }
.keep-note .kn-rn { flex-basis: 100%; }
.ask label { display: block; margin: 0 0 6px; font-size: 13px; color: var(--w2); }
.ask .rc-err, .ask .pw-err { margin: -4px 0 12px; padding: 0; font-size: 14px; line-height: 1.4; color: #ffb4a4; }
.ask .rc-err[hidden], .ask .pw-err[hidden] { display: none; }
.ask .rc-note { margin: 0 0 16px; font-size: 13px; line-height: 1.45; color: var(--w2); }
.gf-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.lp-foot .lp-recover { margin-left: 4px; border: 0; background: none; font-family: inherit; cursor: pointer; }
.ask.rc-box { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.save-banner.rv .sb-t { flex-basis: 100%; padding-bottom: 0; }
.save-banner a.sb-btn { display: inline-flex; align-items: center; flex: none; white-space: nowrap; }
