/* ===== 기본: 화이트 + 파스텔 한 가지 (색 6가지는 themes.css의 html[data-color]) =====
   색마다 바뀌는 건 --tint · --tint-mid · --accent · --accent-deep · --dot 와 그 파생값뿐이고,
   글자 · 선 · 흰 바탕은 공통. 파스텔 색은 면 · 틴트에만 쓰고 글자색에는 쓰지 않음 */
:root {
  /* 색마다 바뀌는 값 (기본 연핑크, Her Empire 토큰) */
  --tint: #FBE7EE;
  --tint-mid: #F6D3E0;
  --accent: #F2B8C9;
  --accent-deep: #E3A6B6;
  --dot: rgba(242, 184, 201, 0.35);
  --glow: rgba(242, 184, 201, 0.35);
  --wash: #FFFBFC;
  --shade: rgba(227, 166, 182, 0.10);
  --shade-2: rgba(227, 166, 182, 0.16);

  /* 공통 */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --text: #1C1C1E;
  --text-2: #5E5E63;
  --line: #ECE6E9;
  --sun: #C25A72;
  --sat: #5877AE;
  --faint: #C9C3C6;
  --out-bg: #FBF9FA;
  --mark-text: #FFFFFF;
  --pill-line: #1C1C1E;
  --primary-text: #1C1C1E;
  --danger: #9E4A5E;
  --gold: #E8C9A0;
  --backdrop: rgba(28, 28, 30, 0.22);

  /* 파생 (위 색 값을 따라감, 시즌은 themes.css에서 직접 덮어씀) */
  --tint-2: var(--tint-mid);
  --accent-strong: var(--accent-deep);
  --ring: var(--accent-deep);
  --cell-open: var(--tint);
  --cell-line: var(--line);
  --mark: var(--accent);
  --today-ring: var(--accent-deep);
  --today-glow: var(--glow);
  --primary-bg: var(--tint-mid);
  --note-bg: var(--tint);
  --ph-bg: var(--wash);
  --ph-line: var(--accent);
  --tape-1: var(--tint-mid);
  --tape-2: var(--tint);
  --tape-3: var(--accent);
  --spark-1: var(--gold);
  --spark-2: var(--accent);
  --confetti-1: var(--accent);
  --confetti-2: var(--tint-mid);
  --confetti-3: var(--gold);
  --shadow: 0 8px 24px var(--shade), 0 1px 2px rgba(28, 28, 30, 0.03);
}

html {
  color-scheme: light only;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.8px, transparent 2px);
  background-size: 24px 24px;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s ease;
}
body.sheet-open { overflow: hidden; }

.app, .sec, .btn, .link-btn, .mbtn, .chip, .door, .inside, .photo, .sheet, .ph,
.note, .chk-dot, .g-in, .field input, .field textarea, .bar, .bar span, .palette-btn .sw,
.swatch span, .season-chip, .palette-pop {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.illus svg * { transition: fill .3s ease; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

button { font: inherit; color: inherit; cursor: pointer; }
/* iOS 자동 확대 방지 */
input, textarea, select { font-size: 16px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 12px; }

/* 영어 제목 · 숫자 전용 (한글에는 쓰지 않음) */
.en, .logo, .dday b {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
.ko-title { font-weight: 300; letter-spacing: -0.03em; }

/* ===== 레이아웃 ===== */
.app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}
@media (min-width: 800px) {
  .app { padding-left: 24px; padding-right: 24px; padding-top: 16px; }
  .top { margin-left: -24px; margin-right: -24px; padding-left: 26px; padding-right: 26px; }
}

/* ===== 헤더 (상단 고정, 스크롤하면 흰 반투명 블러) ===== */
.top {
  position: sticky; top: 0; z-index: 10;
  height: calc(56px + env(safe-area-inset-top));
  margin: 0 -16px;
  padding: env(safe-area-inset-top) 18px 0;
  display: flex; align-items: center;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.top.stuck {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.top-row { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { min-width: 0; }
.wordmark { display: flex; align-items: center; gap: 4px; }
.logo { margin: 0; display: flex; flex-direction: column; letter-spacing: 0; }
.logo .l1 { font-size: 20px; line-height: 1.05; }
.logo .l2 { font-size: 13px; line-height: 1.2; letter-spacing: 0.02em; }
.logo-bow { width: 24px; height: 24px; transform: rotate(-12deg); margin-left: 2px; }
.season-mark { display: inline-block; width: 18px; height: 18px; line-height: 0; }
.season-mark:empty { display: none; }
.season-mark svg { width: 100%; height: 100%; overflow: visible; }
.season-mark svg * { vector-effect: non-scaling-stroke; }
.logo-sub { margin: 2px 0 0; font-size: 11px; line-height: 1.3; color: var(--text-2); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }

/* 팔레트 버튼 + 팝오버 */
.palette-wrap { position: relative; flex: none; }
.palette-btn {
  width: 44px; height: 44px; margin-right: -10px; padding: 0;
  border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center;
}
.palette-btn .sw {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--text);
}
.palette-pop {
  position: absolute; z-index: 15; top: calc(100% + 6px); right: -6px;
  padding: 12px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 12px 32px rgba(28, 28, 30, 0.10);
}
.pal-title { margin: 0 0 6px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: var(--text-2); }
.sheet .pal-title { margin-bottom: 10px; }
.swatches { display: flex; gap: 2px; }
.swatch {
  width: 44px; height: 44px; padding: 0; flex: none;
  border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center;
}
.swatch span {
  width: 32px; height: 32px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(28, 28, 30, 0.08);
}
.swatch[aria-checked="true"] span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.seasons { display: flex; gap: 8px; margin-top: 10px; }
.season-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
}
.season-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #FFFFFF; }
.sheet .swatches { justify-content: space-between; }
.sheet .seasons .season-chip { flex: 1; }

.hero { padding: 0 2px; }
.dday {
  margin: 14px 0 0;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
  font-size: 16px; font-weight: 400; letter-spacing: -0.02em; color: var(--text);
}
.dday b { font-size: 64px; line-height: 1; letter-spacing: -0.01em; color: var(--text); }
.today-label { margin: 8px 0 6px; font-size: 15px; font-weight: 400; color: var(--text-2); letter-spacing: -0.02em; }

/* ===== 섹션 ===== */
.sec {
  position: relative;
  margin: 18px 0;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sec h2 { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-weight: 400; }
.sec h2 .en { font-size: 26px; line-height: 1.15; }
.sec h2 .ko { font-size: 15px; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }
.count { white-space: nowrap; font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ===== 비전보드: 빨랫줄 2줄에 나무집게로 집은 폴라로이드 ===== */
/* 줄 끝이 섹션 카드 테두리 밖까지 닿게 테두리 1px만큼 더 넓힘 */
.board-wrap { position: relative; margin: 0 -17px; }
.board {
  overflow: hidden;
  padding: 2px 0 6px;
}
/* 한 줄 3장, 카드 폭은 열 폭으로 고정 (app.js fitCols), 줄 높이는 그 줄에서 가장 높은 카드 */
.b-track { display: flex; flex-direction: column; width: 100%; }
.b-row {
  position: relative;
  display: flex; align-items: flex-start; justify-content: center; gap: 10px;
  padding: 0 17px;
}
.b-row + .b-row { margin-top: -2px; }
.b-line { position: absolute; left: 0; top: 0; height: 40px; overflow: visible; pointer-events: none; }
.b-line path { fill: none; stroke: #B9A48D; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.card {
  position: relative;
  flex: 0 0 auto; width: calc(var(--w, 114px) + 12px);
  padding: 16px 0 0; margin: 0;
  border: 0; background: transparent;
  text-align: left;
  transform: translateY(var(--sag, 0px));
  border-radius: 6px;
}
.card .peg {
  position: absolute; z-index: 2; top: 0; left: 50%;
  width: 14px; height: 30px; margin-left: -7px;
  transform: rotate(var(--peg-rot, 0deg));
  transform-origin: 50% 12px;
  filter: drop-shadow(0 1px 1px rgba(28, 28, 30, .12));
}
.pol {
  display: block;
  padding: 6px 6px 18px;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(28, 28, 30, .06), 0 4px 10px rgba(28, 28, 30, .06);
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 0;
}
.card .photo {
  position: relative;
  display: block;
  width: 100%; height: var(--h, 160px);
  border-radius: 2px;
  overflow: hidden;
  background: var(--tint);
}
.card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-2);
  font-size: 14px; letter-spacing: -0.02em;
}
/* 빈 카드: 점선 폴라로이드 */
.card.blank .pol, .card.add .pol { background: var(--ph-bg); box-shadow: none; outline: 1.5px dashed var(--ph-line); outline-offset: -1.5px; }
.card.blank .photo, .card.add .photo { background: transparent; }
.card.add .pol { background: rgba(255, 255, 255, .6); outline-color: var(--line); }
.card.ghost .ph { font-size: 20px; color: var(--faint); }
.card.loading .pol { background: #FFFFFF; outline: 0; box-shadow: 0 1px 2px rgba(28, 28, 30, .06), 0 4px 10px rgba(28, 28, 30, .06); }

.pol-txt { display: block; margin: 0 0 -12px; padding-top: 5px; }
.c-title, .c-cap {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; word-break: keep-all; overflow-wrap: anywhere;
  padding: 0 1px; letter-spacing: -0.03em;
}
.c-title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.card .skel {
  position: absolute; inset: 0; border-radius: 2px;
  background: linear-gradient(100deg, var(--tint) 30%, var(--wash) 50%, var(--tint) 70%);
  background-size: 300% 100%;
  animation: skel 1.3s ease-in-out infinite;
}
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.c-title.empty { color: var(--faint); font-weight: 400; }
.c-cap { margin-top: 1px; font-size: 11px; line-height: 1.35; color: var(--text-2); }


/* ===== 목표 ===== */
.goals { list-style: none; margin: 6px 0 0; padding: 0; }
.goal { position: relative; display: flex; align-items: center; gap: 4px; min-height: 54px; }
.goal + .goal { border-top: 1px solid var(--line); }
.chk {
  flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center;
}
.chk-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--surface);
  display: grid; place-items: center;
}
.chk-dot svg { width: 13px; height: 13px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s cubic-bezier(.3,1.5,.5,1); }
.goal.done .chk-dot { background: var(--mark); border-color: var(--mark); }
.goal.done .chk-dot svg { opacity: 1; transform: scale(1); }
.g-in {
  flex: 1; min-width: 0; height: 44px;
  border: 0; background: transparent;
  font: inherit; font-size: 16px; letter-spacing: -0.02em; color: var(--text);
  padding: 0 4px;
}
.g-in::placeholder, .field input::placeholder, .field textarea::placeholder {
  color: var(--faint); font-family: inherit; font-size: inherit; letter-spacing: inherit;
}
.goal.done .g-in { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--accent-strong); color: var(--text-2); }

.confetti { position: absolute; left: 22px; top: 50%; width: 0; height: 0; pointer-events: none; }
.confetti i {
  position: absolute; left: 0; top: 0;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--c);
  animation: pop .9s cubic-bezier(.2,.7,.3,1) forwards;
}
.confetti i:nth-child(3n) { border-radius: 50%; }
@keyframes pop {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; }
}

/* ===== 캘린더 ===== */
.cal-sec { padding: 18px 8px 18px; }
.cal-head { padding: 0 8px; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px 8px; }
.mbtn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 22px; line-height: 1; display: grid; place-items: center; color: var(--text);
}
.mbtn[disabled] { opacity: .3; cursor: default; }
.chips { display: flex; align-items: center; gap: 2px; }
.chip {
  min-width: 56px; height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  font-size: 16px; letter-spacing: -0.03em;
}
.chip[aria-current="true"] { border-color: var(--pill-line); color: var(--text); }
.chips .dot { color: var(--faint); }

.week, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week { padding: 2px 0 6px; text-align: center; font-size: 15px; color: var(--text-2); }
.week .sun { color: var(--sun); }
.week .sat { color: var(--sat); }

.day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 44px;
  padding: 0; margin: 0; border: 0;
  background: transparent;
  perspective: 600px;
  border-radius: 14px;
}
.day.blank { pointer-events: none; }
.day.out {
  display: grid; place-items: center;
  background: var(--out-bg); color: var(--faint);
  font-size: 15px;
}
.day .num { font-size: 15px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.day.sun .num, .day.holiday .num { color: var(--sun); }
.day.sat .num { color: var(--sat); }

.inside, .door {
  position: absolute; inset: 0;
  border-radius: 14px;
  display: grid; place-items: center;
  border: 1px solid var(--cell-line);
}
.inside { background: var(--surface); }

.door {
  z-index: 1;
  transform-origin: left center;
  backface-visibility: hidden;
  background: var(--cell-open);
  border-color: transparent;
  transition: transform .45s cubic-bezier(.45,.05,.25,1), background-color .3s ease, opacity .3s ease;
}
.day.opening { z-index: 3; }
.day.opening .door { transform: rotateY(-105deg); opacity: .85; }

.day.locked { cursor: default; }
.day.locked .door { background: var(--surface); border-color: var(--cell-line); }
.day.locked .num { opacity: .4; }
.lock {
  position: absolute; z-index: 2; top: 4px; right: 4px;
  width: 9px; height: 9px; opacity: .45;
}
.lock svg { display: block; width: 100%; height: 100%; }

.ev {
  position: absolute; z-index: 2; left: 3px; bottom: 2px;
  font-size: 11px; line-height: 1;
}
.ev.txt { font-size: 9px; letter-spacing: -0.04em; color: var(--text-2); }
.day.locked .ev { opacity: .55; }

.day.today { z-index: 2; transform: scale(1.04); }
.day.today .door, .day.today .inside { border: 2px solid var(--today-ring); animation: glow 2.8s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--today-glow); }
  50% { box-shadow: 0 0 0 5px var(--today-glow); }
}

.day.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

.progress { padding: 18px 10px 0; }
.bar { height: 6px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.bar span {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width .5s ease, background-color .3s ease;
}
.progress-label { margin: 10px 0 0; font-size: 15px; font-weight: 400; color: var(--text-2); text-align: center; letter-spacing: -0.02em; }
.progress-label b { color: var(--text); font-weight: 600; }

/* ===== 하단 ===== */
.foot {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px;
  padding: 4px 0 0; color: var(--faint); font-size: 15px;
}
.link-btn {
  min-height: 44px; padding: 0 10px;
  border: 0; background: transparent; color: var(--text-2);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em; border-radius: 10px;
}
.link-btn.danger { color: var(--danger); }
.privacy { margin: 2px 0 0; text-align: center; font-size: 12px; letter-spacing: -0.01em; color: #8E888B; }

/* ===== 바텀시트 ===== */
.backdrop {
  position: fixed; inset: 0; z-index: 20;
  background: var(--backdrop);
  opacity: 0; transition: opacity .25s ease;
}
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 21;
  left: 50%; bottom: 0;
  width: min(100%, 560px);
  max-height: 88vh; overflow-y: auto;
  transform: translate(-50%, 100%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), background-color .3s ease;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 0 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(28, 28, 30, 0.10);
  overscroll-behavior: contain;
}
.sheet.show { transform: translate(-50%, 0); }
/* 손잡이: 아래로 60px 이상 끌면 닫힘 */
.sheet-grab {
  position: sticky; top: 0; z-index: 2;
  margin: 0 -18px 6px; padding: 10px 0 12px;
  background: var(--surface);
  touch-action: none; cursor: grab;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto; }
.sheet input, .sheet textarea { scroll-margin: 96px 0 120px; }
.s-title {
  margin: 0 0 14px;
  font-size: 20px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.35;
}
.s-ev { font-size: 15px; color: var(--text-2); margin-left: 8px; font-weight: 400; }

.field { display: block; margin: 14px 0; }
.field > span { display: block; margin-bottom: 6px; font-size: 15px; color: var(--text-2); letter-spacing: -0.02em; }
.field textarea.auto { display: block; line-height: 1.4; overflow-y: hidden; }
/* 글자 수: 칸 오른쪽 아래 작은 회색, 400자 넘으면 진하게 */
.field > .f-count { margin: 4px 2px 0; text-align: right; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.field > .f-count.near { color: var(--text); font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; letter-spacing: -0.02em;
  resize: none;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--today-glow); }

.row { display: flex; gap: 10px; margin-top: 16px; }
.row .btn { flex: 1; }
.btn {
  min-height: 48px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--pill-line);
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; }
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.wide { width: 100%; }
.btn.toggle[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); }
.btn.dark { background: var(--text); color: var(--surface); border-color: var(--text); }

/* 브라우저 안내 시트 (인앱 · 홈 화면에 추가) */
.gs-body { margin: 0; font-size: 15px; letter-spacing: -0.02em; line-height: 1.6; color: var(--text); }
.gs-hint { margin: 8px 0 0; font-size: 15px; letter-spacing: -0.02em; color: var(--text-2); }
.gs-steps { margin: 4px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--tint); }
.gs-steps p { margin: 0; font-size: 15px; letter-spacing: -0.02em; line-height: 1.7; color: var(--text); }

.bs-preview { display: flex; justify-content: center; margin: 4px 0 14px; }
.bs-preview .photo { position: relative; width: 120px; height: 152px; border-radius: 18px; overflow: hidden; background: var(--tint); }
.bs-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bs-preview .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--ph-line); border-radius: 18px; background: var(--ph-bg); color: var(--text-2); font-size: 15px; }

.note {
  position: relative;
  margin: 10px 2px 4px;
  padding: 24px 20px 20px;
  background: var(--note-bg);
  border-radius: 16px;
  font-size: 16px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.65;
  color: var(--text);
}
.note::before {
  content: ""; position: absolute; top: -9px; left: 50%;
  width: 68px; height: 20px;
  transform: translateX(-50%) rotate(-4deg);
  background-color: var(--tape-1);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 2px, transparent 2px 8px);
  opacity: .85;
}
.note p { margin: 0; }

/* ===== 토스트 ===== */
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--pill-line);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 장식 레이어 (카드 뒤 배경) ===== */
.deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.deco span { position: absolute; line-height: 1; user-select: none; }
.deco .spark svg { display: block; width: 100%; height: 100%; }
.deco .spark { animation: twinkle var(--d, 4s) ease-in-out infinite; }
@keyframes twinkle {
  0%, 100% { opacity: .9; transform: scale(1) rotate(0); }
  50% { opacity: .45; transform: scale(.8) rotate(12deg); }
}

/* 시즌 떨어지는 일러스트: 카드 뒤에서 끝없이 낙하 + 좌우 흔들림 + 천천히 회전 */
.deco .fall {
  top: -64px;
  animation: fall var(--d, 18s) linear var(--dl, 0s) infinite;
  will-change: transform;
}
.deco .sway { display: block; width: 100%; height: 100%; animation: sway var(--sd, 4s) ease-in-out infinite alternate; }
.deco .fall svg { display: block; width: 100%; height: 100%; overflow: visible; }
.deco .fall svg * { vector-effect: non-scaling-stroke; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(calc(100vh + 140px)) rotate(var(--rot, 120deg)); }
}
@keyframes sway {
  0% { transform: translateX(calc(var(--sx, 12px) * -1)); }
  100% { transform: translateX(var(--sx, 12px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .deco .fall { top: var(--y, 20%); }
}

.inside .num { padding-top: 5px; }


/* ===== 모바일: 날짜 칸 간격 6px에서 4px로 (375px 폭에서 칸 44px 확보) ===== */
@media (max-width: 420px) {
  .cal-sec { padding-left: 4px; padding-right: 4px; }
  .cal-head { padding: 0 12px; }
  .cal-nav { padding: 0 6px 8px; }
  .progress { padding-left: 14px; padding-right: 14px; }
  .week, .grid { gap: 4px; }
}
@media (max-width: 359px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .top { margin-left: -12px; margin-right: -12px; padding-left: 14px; padding-right: 14px; }
  .day { min-height: 0; }
  .chip { min-width: 48px; padding: 0 8px; }
  .dday b { font-size: 56px; }
  .swatch { width: 40px; }
}

/* ===== 손그림 일러스트 (illus.js, 면 색은 테마 변수) ===== */
.illus { display: inline-block; flex: none; line-height: 0; pointer-events: none; }
.illus svg { display: block; width: 100%; height: 100%; overflow: visible; }
.illus svg * { vector-effect: non-scaling-stroke; }

.dday-bow { width: 38px; height: 38px; align-self: center; transform: translate(-4px, 2px) rotate(-14deg); }
.card .ph .illus, .bs-preview .ph .illus { width: 30px; height: 30px; }
.card:nth-child(2n) .ph .illus { transform: rotate(-8deg); }
.corner-star { position: absolute; z-index: 2; top: -15px; right: 18px; width: 34px; height: 34px; transform: rotate(12deg); }
.cal-berry { width: 28px; height: 28px; align-self: center; transform: rotate(-10deg); }
.note-bear { position: absolute; right: -6px; bottom: -12px; width: 36px; height: 36px; transform: rotate(10deg); }
.foot-illus { display: flex; justify-content: center; margin: 18px 0 0; }
.foot-illus .illus { width: 34px; height: 34px; transform: rotate(-6deg); }

/* ===== 스티커북: 7열 10행 ===== */
.book {
  display: grid; grid-template-columns: repeat(7, minmax(0, 40px));
  justify-content: space-between; row-gap: 8px;
  margin-top: 10px;
}
.bk-cell {
  width: 100%; aspect-ratio: 1 / 1; padding: 0; margin: 0;
  border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center;
}
.bk-empty {
  width: 72%; height: 72%; border-radius: 50%;
  border: 1.5px dashed var(--accent);
  opacity: .55;
}
.bk-stk { display: block; width: 100%; height: 100%; }
.bk-stk svg, .sticker-pop svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bk-stk svg *, .sticker-pop svg * { vector-effect: non-scaling-stroke; }
.bk-stk { filter: drop-shadow(0 1px 1.5px rgba(28, 28, 30, .14)); }

/* 스티커북 접기/펴기 토글 */
.book-sec { margin: 9px 0; padding: 4px 16px; }
.book-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 14px; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.book-toggle:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.book-toggle.pulse { animation: bkPulse .6s ease-out; }
@keyframes bkPulse {
  0% { background: transparent; }
  40% { background: var(--tint); }
  100% { background: transparent; }
}
.bt-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-width: 0; }
.bt-title .en { font-size: 26px; line-height: 1.15; }
.bt-title .ko { font-size: 15px; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }
.bt-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chev { display: block; color: var(--text-2); transition: transform .3s ease; }
.book-sec.open .chev { transform: rotate(180deg); }
.book-body {
  max-height: 0; overflow: hidden; width: 100%;
  transition: max-height .3s ease;
}
.book-sec.open .book-body { max-height: 600px; }
.book-sec .book { margin-top: 10px; padding-bottom: 14px; }
@media (max-width: 480px) {
  .book-sec { margin: 9px 0; padding: 4px 16px; }
  .book { grid-template-columns: repeat(7, 34px); row-gap: 4px; }
  .book-sec .book { padding-bottom: 12px; }
}

/* ===== 오늘 칸 시트 ===== */
.sticker-pop {
  width: 96px; height: 96px; margin: -2px auto 22px;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 4px 6px rgba(28, 28, 30, .12));
}
.sticker-pop.pop { animation: stickerPop .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes stickerPop {
  0% { transform: scale(0) rotate(-18deg); }
  65% { transform: scale(1.1) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}
.mission { position: relative; margin: 16px 2px 0; }
.mi-label { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; color: var(--text-2); }
.mi-row { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.mi-text { font-size: 16px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.45; color: var(--text); }
.mission.done .chk-dot { background: var(--mark); border-color: var(--mark); }
.mission.done .chk-dot svg { opacity: 1; transform: scale(1); }
.mission.done .mi-text { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--accent-deep); color: var(--text-2); }
.mission .confetti { left: 12px; top: 38px; }
.sealed { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 6px; }
.sealed-env { width: 96px; height: 96px; transform: rotate(-4deg); }
.sealed.empty .sealed-env { opacity: .7; }
.sealed-line { margin: 0; font-size: 15px; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }

/* ===== 캘린더 칸: 쓴 날 봉투 · 안 쓴 지난 날 흐린 숫자 ===== */
.env { position: absolute; z-index: 2; top: 2px; right: 2px; width: 13px; height: 10px; }
.day.written .inside .num { padding-top: 8px; }
.env svg { display: block; width: 100%; height: 100%; }
.day.blank-past .num { opacity: .35; }
.day.blank-past .inside { background: var(--out-bg); border-color: transparent; }
.day.written .inside { background: var(--surface); border-color: var(--accent); }

/* ===== 12월 31일 봉인 해제 자리 ===== */
.unseal { padding: 0 8px; }
.unseal-line {
  margin: 0 0 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 15px; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2);
}
.lock-ic { width: 13px; height: 13px; display: inline-block; }
.lock-ic svg { display: block; width: 100%; height: 100%; }
.unseal-cta { position: relative; padding-top: 14px; margin-bottom: 14px; }
.unseal-spark { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: flex-end; }
.unseal-spark svg { width: 12px; height: 12px; display: block; }
.unseal-spark svg:nth-child(2) { width: 18px; height: 18px; }
.unseal-btn { min-height: 54px; font-size: 20px; }

/* ===== 편지 뷰 (위에서 내려옴) ===== */
.letters {
  position: fixed; inset: 0; z-index: 24;
  overflow-y: auto; overscroll-behavior: contain;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.8px, transparent 2px);
  background-size: 24px 24px;
  transform: translateY(-100%);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.letters.show { transform: translateY(0); }
.letters-inner {
  max-width: 600px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}
.letters-top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 -16px 8px; padding: 6px 16px;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.letters-top h2 { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-weight: 400; }
.letters-top h2 .en { font-size: 32px; line-height: 1.1; }
.letters-top h2 .ko { font-size: 15px; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }
.lt-card {
  margin: 12px 0; padding: 18px 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
}
.lt-date { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.lt-mi { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 400; color: var(--text-2); }
.lt-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; }
.lt-dot svg { width: 10px; height: 10px; }
.lt-mi.done .lt-dot { background: var(--accent-deep); border-color: var(--accent-deep); }
.lt-msg { margin: 6px 0 10px; font-size: 15px; color: #8E888B; letter-spacing: -0.02em; }
.lt-label { margin: 10px 0 2px; font-size: 15px; color: var(--text-2); letter-spacing: -0.02em; }
.lt-text { margin: 0; font-size: 17px; line-height: 1.55; letter-spacing: -0.02em; word-break: keep-all; overflow-wrap: anywhere; }
.lt-sum { margin: 20px 0 16px; padding: 18px; border-radius: 20px; background: var(--tint); }
.lt-sum p { margin: 4px 0; font-size: 16px; letter-spacing: -0.02em; }
.lt-sum b { font-weight: 600; }

/* ===== 비전보드 드래그 정렬 ===== */
.card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.card img { -webkit-user-drag: none; pointer-events: none; }
.board.dragging { cursor: grabbing; }
.card.lifted {
  z-index: 10; pointer-events: none;
  transform: translate(var(--dx, 0px), calc(var(--sag, 0px) + var(--dy, 0px))) scale(1.06);
  transition: none;
}
.card.lifted .pol { box-shadow: 0 14px 30px rgba(28, 28, 30, .18), 0 2px 6px rgba(28, 28, 30, .10); }
.card.drop-target .pol { outline: 2px solid var(--text); outline-offset: 3px; }
.card { transition: transform .18s ease; }
.card.drop-target { transform: translateY(var(--sag, 0px)) scale(.96); }
body.board-dragging { -webkit-user-select: none; user-select: none; }

/* ===== 테마 시트: 뒤 화면이 바뀌는 게 보이게 스크림 옅게, 높이 최소 ===== */
.backdrop.pal-sheet { background: rgba(28, 28, 30, 0.12); }
.sheet.pal-sheet { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.sheet.pal-sheet .sheet-grab { padding: 8px 0 8px; margin-bottom: 0; }
.sheet.pal-sheet .pal-title { margin-bottom: 4px; }
.sheet.pal-sheet .seasons { margin-top: 8px; }

/* ===== 오늘의 2분 미션: 사용자가 문장 바꾸기 ===== */
.mi-text { min-width: 0; overflow-wrap: anywhere; }
.mi-edit {
  flex: none; width: 36px; height: 36px; padding: 0; margin-left: 2px;
  border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
}
.mi-edit svg { width: 16px; height: 16px; display: block; }
.mi-input {
  flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 10px;
  font: 400 16px "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: -0.01em; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--accent); border-radius: 10px; outline: none;
}
.mi-reset {
  flex: none; height: 36px; padding: 0 6px; margin-left: 4px;
  border: 0; background: transparent;
  font-size: 12px; font-weight: 400; letter-spacing: -0.01em; color: var(--text-2);
  text-decoration: underline; text-underline-offset: 2px;
}

/* ===== 첫 방문 안내 시트 ===== */
.wl-title { font-size: 24px; letter-spacing: -0.01em; }
.wl-list { list-style: none; margin: 4px 0 0; padding: 0; }
.wl-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; letter-spacing: -0.02em; line-height: 1.5; color: var(--text); }
.wl-ic { flex: none; width: 20px; height: 20px; display: block; }
.wl-ic svg { width: 100%; height: 100%; display: block; }
.wl-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
