/* 플린더스 스티커 다이어리 — app.css 다음에 읽는 덧칠(디자인시스템.md 8절 app-overlay.css + 화면별).
   정본: ~/server/notes/malbiseo-brand-1118/6-스티커-최종/ (컴포넌트.html · screens/).
   층: ① 정보 층(Pretendard · --ink/--t2~t4 · 분류 -fg) ② 장식 층(.deco: 테이프·스티커·손글씨 — 정보 위에 겹치지 않음, 누를 수 없음, 화면 읽기에서 빠짐).
   한 화면 장식 최대 3개 · 손글씨는 세 곳뿐(홈 메모 한 줄 · 칠하기 「← 모두 되는 날!」 · 미리보기 그림). 도장·말하기 스티커는 정보·단추라 세지 않음.
   「확정」 = 빨간 이중 원 도장(.stamp) · 「확인 필요」 = --thought 칩(.check-chip) — 뜻이 반대라 모양도 다르게(10절). */

/* ── 바탕: 종이 모눈 점 ── */
body { background-image: var(--deco-paper); background-size: 18px 18px; background-position: 50vw 9px; }   /* 점 무늬를 화면 가운데(접히는 선) 기준 좌우 대칭으로 — 두 쪽(펼친 공책)일 때 양쪽 종이가 같게 보이게. 종이는 body 라 시스템 띠 밑까지 깔림 */
.deco { pointer-events: none; user-select: none; -webkit-user-select: none; }
.hand { font-family: var(--f-hand); font-weight: 400; letter-spacing: 0; color: var(--t3); }

/* ── 부품 규격(7절) ── */
.btn { border-radius: var(--r-btn); font-weight: 700; }
.btn.primary { box-shadow: var(--shadow-btn); }
.btn[disabled] { opacity: .4; }
.chip { min-height: 28px; padding: 0 10px; font-weight: 700; }
.chip.k { padding-left: 9px; }
.input, .textarea, .select { border-width: 1.5px; }
.input { min-height: 52px; }
.input:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--hover); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sheet { border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
.grab { width: 40px; }
.h1 { font-weight: 800; }

/* ── 다이어리 쪽(종이) — 묶음 면은 종이처럼 살짝 뜨고, 줄 사이는 점선 ── */
.group { border-radius: var(--r-paper); box-shadow: var(--shadow-paper); }
.row + .row::before, .item + .item::before, .in-row + .in-row::before, .cand + .cand::before { border-top: 1px var(--rule-style) var(--line-2); }
/* 카드 목록 = 묶인 쪽(왼쪽 고리 구멍) */
.card-list.group { padding-left: var(--holes-pad); background-image: var(--deco-holes); background-size: 14px 22px; background-repeat: repeat-y; background-position: 0 10px; }

/* 목록 줄 날짜 탭(52) — 숫자 22/800 + 월·요일 13 */
.dtab { flex: none; width: 52px; text-align: center; border-right: 2px solid var(--line); padding-right: 8px; align-self: stretch; display: grid; align-content: center; }
.dtab b { display: block; font: 800 22px/1 var(--f-num); color: var(--ink); }
.dtab span { display: block; font-size: 13px; font-weight: 700; line-height: 1; color: var(--t3); margin-top: 5px; white-space: nowrap; }
/* 좁은 목록(두 칸 화면 왼쪽·접힌 폰): 날짜 탭·도장을 줄이고 「확인 필요」 칩은 제목 아래로 — 제목이 「동창 ...」처럼 일찍 잘리지 않게 */
.card-list { container-type: inline-size; }
@container (max-width: 340px) {
  .card-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: 'd g s c' 'd k s c'; column-gap: 8px; row-gap: 4px; }
  .card-row > .dtab, .card-row > .tile { grid-area: d; }
  .card-row > .grow { grid-area: g; }
  .card-row > .check-chip { grid-area: k; justify-self: start; min-height: 24px; padding: 0 8px; font-size: 13px; }
  .card-row > .stamp { grid-area: s; }
  .card-row > .chev { grid-area: c; }
  .card-row .dtab { width: 44px; padding-right: 6px; }
  .card-row .dtab b { font-size: 20px; }
  .card-row .dtab span { font-size: 12px; }
  .card-row .stamp.sm { width: 40px; height: 40px; font-size: 13px; }
}

/* ── 확정 도장(64, 목록 44) — 2.5px 바깥 원 + 안쪽 원, -12° ── */
.stamp { display: inline-grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: var(--stamp-r); color: var(--stamp);
  border: 2.5px solid var(--stamp); box-shadow: inset 0 0 0 calc(3px * var(--stamp-ring)) var(--s1), inset 0 0 0 calc(4.5px * var(--stamp-ring)) var(--stamp); background: var(--stamp-tint);
  transform: rotate(calc(-12deg * var(--tilt-k))); font: 800 15px/1.05 var(--f-sans); letter-spacing: 0; text-align: center; white-space: nowrap; }
.stamp.sm { width: 44px; height: 44px; font-size: 13px; border-width: 2px; box-shadow: inset 0 0 0 calc(2px * var(--stamp-ring)) var(--s1), inset 0 0 0 calc(3px * var(--stamp-ring)) var(--stamp); }
/* 확인 필요 칩 — 도장이 아니라 칩(뜻이 반대) */
.chip.check-chip { background: var(--thought-tint); color: var(--thought-fg); border-color: var(--thought); }

/* ── 테이프(장식) ── */
.tape { display: var(--deco-tape); position: absolute; height: 20px; width: 76px; background: var(--tape); z-index: 2; pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 97% 25%, 100% 50%, 97% 75%, 100% 100%, 0 100%, 3% 75%, 0 50%, 3% 25%); }
.tape.t2 { background: var(--tape-2); } .tape.t3 { background: var(--tape-3); }

/* ── 약속 카드(app-overlay.css) — 묶인 쪽 + 줄 노트 ── */
.card6 { position: relative; border-radius: var(--r-paper); box-shadow: var(--shadow-paper); padding-left: calc(var(--sp-5) + var(--holes-pad));
  background-image: var(--deco-holes); background-size: 14px 22px; background-repeat: repeat-y; background-position: 0 10px; }
.card6 > .tape { top: -9px; left: 50%; transform: translateX(-50%) rotate(calc(-3deg * var(--tilt-k))); }
.c6-title { letter-spacing: 0; font-weight: 800; text-wrap: balance; word-break: keep-all; }
.c6-head { position: relative; }
.c6-head:has(.stamp) .c6-title { padding-right: 76px; }
.c6-head:has(.stamp) { min-height: 60px; }   /* 제목이 짧은 스킨(손글씨 끈 스킨)에서도 아래 문장이 도장 밑으로 들어가지 않게 */
.c6-head > .stamp { position: absolute; top: -6px; right: -4px; }
/* 받는 사람 미리보기도 종이 */
.preview { background: var(--s1); border-radius: var(--r-paper); box-shadow: var(--shadow-paper); border-style: var(--rule-style); }
.pv-title { font-weight: 800; }

/* ── 홈 만들기: 「말하거나 적기」 한 줄 + 산호 말하기 스티커(72, 화면에 하나) ── */
.composer { position: relative; }
.composer .hand-memo { display: var(--deco-hand-line); margin: 2px 84px 0 0; text-align: right; font-size: 22px; line-height: 1.1; transform: rotate(calc(-3deg * var(--tilt-k))); }
.composer-acts.diary { display: flex; align-items: center; gap: var(--sp-3); grid-template-columns: none; }
.write-pill { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-2); min-height: 52px; padding: 0 var(--sp-4);
  border: 1.5px solid var(--line-2); border-radius: var(--r-m); background: var(--s1); color: var(--t3); font-weight: 600; text-decoration: none; }
.write-pill svg { color: var(--t3); flex: none; }
.speak-stk { flex: none; width: 72px; height: 72px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--rec-bg); color: var(--rec-fg); border: var(--die-w) solid var(--stk-die); box-shadow: var(--shadow-sticker);
  transform: rotate(var(--tilt-s)); transition: transform var(--dur) var(--ease-out); }
.speak-stk svg { width: 32px; height: 32px; }
.speak-stk:active { transform: rotate(var(--tilt-s)) scale(.97); }

/* 녹음 메모 큰 단추도 산호 스티커 */
.rec-btn { background: var(--rec-bg); color: var(--rec-fg); border: var(--die-w) solid var(--stk-die); box-shadow: var(--shadow-sticker); }

/* ── 두 쪽(듀오·폴더블 펼침) — 묶음 그림자·점선 + 묶음 위 시계 스티커 ── (판정 = js/ui/layout.js WIDE_QUERY) */
@media (min-width: 600px) and (min-height: 561px) and (min-aspect-ratio: 1/1) {
  .split .spread { grid-template-columns: calc(var(--mid) - var(--gap) - 8px) 16px minmax(0, 1fr); }   /* 묶음(16px) 가운데 = 50vw — app.css --mid */
  .split .pane-l { padding-right: 6px; } .split .pane-r { padding-left: 6px; }   /* 기울인 스티커·그림자가 접힘선 둘레(가운데 ±20)로 삐져나오지 않게 */
  .split .gutter { position: relative; width: 16px; background: linear-gradient(90deg, transparent, var(--gutter-shade) 45%, var(--gutter-shade) 55%, transparent); }
  .split .gutter::after { content: ""; display: block; height: 100%; margin: 0 auto; width: 0; border-left: 2px var(--rule-style) var(--line-2); }
  .split .gutter::before { content: ""; position: absolute; top: 2px; left: 50%; width: 40px; height: 38px; transform: translateX(-50%) rotate(calc(-4deg * var(--tilt-k)));
    background: var(--deco-spine) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
}

/* ── 붙는 움직임 — 줄인 움직임이면 페이드만 ── */
@keyframes stick { 0% { opacity: 0; transform: translateY(-6px) rotate(calc(var(--tilt, -3deg) - 6deg)) scale(1.06); } 70% { opacity: 1; transform: rotate(var(--tilt, -3deg)) scale(.98); } 100% { transform: rotate(var(--tilt, -3deg)) scale(1); } }
@keyframes stamp-in { 0% { opacity: 0; transform: rotate(calc(-24deg * var(--tilt-k))) scale(1.25); } 70% { opacity: 1; transform: rotate(calc(-12deg * var(--tilt-k))) scale(.96); } 100% { transform: rotate(calc(-12deg * var(--tilt-k))) scale(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .c6-head > .stamp { animation: stamp-in var(--dur-stick) var(--ease-stick) both; } }
@media (prefers-reduced-motion: reduce) {
  .c6-head > .stamp { animation: fadein 160ms linear both; }
  .speak-stk { transition: none; }
}

/* ── 로그인: 심볼 96(-6°) + 이름 ── */
.login-sym { margin-bottom: var(--sp-4); }
.login-sym img { height: 96px; width: auto; transform: rotate(calc(-6deg * var(--tilt-k))); }
.mark { font-weight: 800; }

/* ── 매달 지킬 날(screens/monthly.js) — 메모지 글쓰기(디자인시스템 11절). 종이·목록 줄·도장은 공용 부품(memo-paper.css · ui/memo-text.js), 여기는 매달 것만 ── */
/* 분류 스티커(칼선 흰색 + 스티커 그림자, 먹 기호만) */
.mstk { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: #22201C; border: 2.5px solid var(--stk-die); box-shadow: var(--shadow-sticker); transform: rotate(var(--tilt-s)); border-radius: var(--r-sticker); }
.mstk.stk-sky { background: var(--stk-sky); } .mstk.stk-butter { background: var(--stk-butter); }
.mstk.stk-sage { background: var(--stk-sage); } .mstk.stk-lilac { background: var(--stk-lilac); }
.mseg .mstk, .nl-title .mstk { width: 24px; height: 24px; border-width: 2px; border-radius: 7px; box-shadow: none; }
.nl-title .mstk { margin-top: .1em; }
.monthly-home .m-hd { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-6) 2px var(--sp-3); }
.monthly-home .m-hd .hand-h { margin: 0; flex: 1; }
.monthly-home .link-btn { padding: 0; min-height: 0; }
/* 목록 줄 = noteLine + 오른쪽 「했어요」 — 줄 노트 선은 바깥(.m-line)에 한 번 */
.m-list .m-line { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--memo-rule); }
.m-list .m-line:last-child, .m-list > .note-line:last-child { border-bottom: 0; }
.m-list .m-line > .note-line { flex: 1; min-width: 0; border-bottom: 0; }
.m-list .nl-first { -webkit-line-clamp: 3; }
.m-list .nl-time { white-space: nowrap; }
.m-list .nl-tags { font-size: 13px; font-weight: 800; color: var(--t3); }
.m-line.overdue .nl-tags, .m-line.overdue .nl-time { color: var(--signal-fg); }
.m-line.done .nl-tags { color: var(--done-fg); }
.m-line.off .nl-title, .m-line.off .nl-first { color: var(--t3); }
.m-line.off .mstk { opacity: .6; }
.m-list .note-line > .stamp-done, .m-list .note-line > .stamp-notyet { width: 46px; height: 46px; font-size: 12px; align-self: center; }
.m-list .note-line > .stamp-done svg { width: 16px; height: 16px; }
.btn.m-done { flex: none; min-height: 44px; padding: 0 12px; gap: 4px; font-size: var(--fs-s); white-space: nowrap; }
@media (max-width: 380px) {
  .m-list .note-line > .stamp-done, .m-list .note-line > .stamp-notyet { width: 40px; height: 40px; font-size: 11px; }
  .btn.m-done { padding: 0 10px; } .btn.m-done svg { display: none; }
}
/* 편집 창 맨 위 몫들 — 메모지 줄 */
.m-done-box { margin: 4px 0 var(--sp-3); border-radius: var(--r-paper); background: var(--s1); box-shadow: var(--shadow-paper); padding: 2px 12px; }
.m-occ { padding: 10px 0; border-bottom: 1px solid var(--memo-rule); }
.m-occ:last-child { border-bottom: 0; }
.m-occ-top { display: flex; align-items: center; gap: 10px; }
.m-occ-top .grow { flex: 1; min-width: 0; }
.m-occ-top .d { font-size: var(--fs-s); color: var(--t2); }
.m-occ.overdue .m-occ-top .d { color: var(--signal-fg); }
.m-log { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; color: var(--t3); }
.m-log:empty { display: none; }
.m-log li::before { content: '– '; }
/* 편집 창(양식 — 11-6 표 「양식이라 그대로」) */
.m-line .switch { margin-left: 2px; }
.m-add { padding-bottom: var(--sp-8); }
.f-lab { display: flex !important; align-items: center; gap: 4px; }
.info-btn { width: 44px; height: 44px; margin: -12px -8px -12px -6px; border: 0; background: none; color: var(--t3); display: inline-grid; place-items: center; padding: 0; border-radius: 50%; }
.info-btn[aria-expanded='true'] { color: var(--ink); }
.tip { margin: 0 0 8px; padding: 10px 12px; border-radius: var(--r-s); background: var(--s2); color: var(--t2); font-size: var(--fs-s); line-height: 1.45; }
.monthly-screen > .tip { margin: 0 var(--sp-4) var(--sp-3); }
.mseg { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
.mseg.n4 { --n: 4; } .mseg.n3 { --n: 3; }
.mseg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 4px; white-space: nowrap; min-width: 0; }
.mseg button.on { background: var(--ink); color: var(--bg); }
.m-days { gap: 8px; }
.chip.pick { min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line-2); background: var(--s1); color: var(--t2); font-size: var(--fs-s); }
.chip.pick.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.m-time { margin-top: 10px; max-width: 180px; }
.m-time .input:disabled { opacity: .4; }
.m-amt { position: relative; }
.m-amt .input { padding-right: 40px; font-variant-numeric: tabular-nums; }
.m-won { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--t3); font-weight: 600; }
.m-on { padding: var(--sp-3) 0 !important; margin-top: var(--sp-3); }
.m-next { margin: var(--sp-3) 0 0; font-weight: 700; color: var(--t2); }
@media (prefers-reduced-motion: reduce) { .mstk { transform: none; } }
/* 함께 보기 */
.m-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.m-fs:disabled .input, .m-fs:disabled .mseg { opacity: .55; }
.m-from { margin: 0 0 8px; color: var(--t2); font-size: var(--fs-s); }
.m-people { list-style: none; margin: 4px 0 10px; padding: 0; }
.m-people li { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--memo-rule); }
.m-people li .grow { flex: 1; min-width: 0; }
.m-share .btn + .btn { margin-top: 8px; }
.m-add .btn + .btn { margin-top: 10px; }
.m-join-card { padding: 18px 16px 18px 20px; background-image: none; }
.m-join-card .acts { margin-top: 14px; }
/* 폰 폭: 날짜 여백을 줄여 손글씨 이름이 한 줄에 들어가게(메모지 여백 선도 같은 자리로) */
@media (max-width: 440px) {
  .memo-page.m-list:not(.plain) { background-image: linear-gradient(to right, transparent 60px, var(--memo-margin) 60px, var(--memo-margin) 61.5px, transparent 61.5px); }
  .m-list .note-line { grid-template-columns: 60px minmax(0, 1fr) auto; column-gap: 10px; }
  .memo-page.plain.m-list .note-line { grid-template-columns: minmax(0, 1fr) auto; }
  .m-list .nl-time { padding-right: 8px; font-size: 12px; white-space: normal; word-break: keep-all; }
  .m-list .nl-title .mstk { width: 20px; height: 20px; border-radius: 6px; } .m-list .nl-title .mstk svg { width: 12px; height: 12px; }
  .m-list .nl-title { gap: 6px; }
  .m-list .m-line { gap: 6px; }
}
/* 분류 묶음(돈·할일·개인) — 손글씨 제목 한 줄 + 오른쪽 끝 작은 「함께 보기」(함께 보는 사람이 있으면 「○명과 보는 중」) */
.m-sec-hd { display: flex; align-items: center; gap: 8px; margin: 0 2px var(--sp-3); }
.m-sec-hd .hand-h { flex: 1; margin: 0; }
.m-share-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; margin-right: -6px; border: 0; background: none; color: var(--t2); font: 700 13px/1 var(--f-sans); border-radius: var(--r-s); cursor: pointer; }
.m-share-btn:active { background: var(--hover); }
.m-kinds { margin-top: 8px; }
.m-kind-seg button { font-size: 13px; }
.m-kind-seg .mstk { width: 20px; height: 20px; border-width: 1.5px; border-radius: 6px; }
/* 반복(11-20) — 이름 옆 작은 도장(한 번 = 점선 · 되풀이 = 실선) · 편집 창 「반복」 체크 칸 */
.m-rep { flex: none; display: inline-block; font: 800 12px/1 var(--f-sans); letter-spacing: 0; word-spacing: 0; color: var(--t2); background: var(--s1);
  border: 1.5px solid currentColor; border-radius: 6px; padding: 3px 5px 2px; white-space: nowrap; align-self: center; transform: rotate(calc(-4deg * var(--tilt-k))); }
.m-rep.rep-once { border-style: dashed; transform: rotate(calc(3deg * var(--tilt-k))); }
.nl-title:has(.m-rep) { flex-wrap: wrap; row-gap: 4px; }
.nl-title .m-nt { word-break: keep-all; }
@media (prefers-reduced-motion: reduce) { .m-rep { transform: none; } }
.m-reps { gap: 8px; }
.chip.pick.m-rep-pick { gap: 6px; padding: 0 14px 0 10px; }
.m-box { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid currentColor; display: inline-grid; place-items: center; }
.m-box svg { width: 14px; height: 14px; }
.m-date { min-width: 0; width: 100%; max-width: 100%; text-align: left; }
.m-date::-webkit-date-and-time-value { text-align: left; }
.m-line.fin .nl-tags, .m-line.fin .nl-time { color: var(--done-fg); }

/* 만드는 중·멈춘 카드 줄(11-27): 줄 누름 = 카드, 오른쪽 휴지통 = 지우기 — 안의 링크가 줄 전체 높이를 차지 */
.card-row.has-del { padding-top: 0; padding-bottom: 0; padding-right: var(--sp-2); }
.card-row.has-del .row-main { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0; min-height: var(--tap-lg); padding: 13px 0; color: inherit; text-decoration: none; }
.card-row.has-del .row-main:active { background: var(--s2); }
.card-row.has-del > .icon-btn { flex: none; color: var(--t3); }
@container (max-width: 340px) { .card-row.has-del { display: flex; } }
