/*
 * 화면 스타일. 원칙: 단순하게, 줄을 맞추고, 색은 거의 쓰지 않는다.
 *  - 글꼴: Pretendard(앱에 포함, fonts/OFL.txt). 본문 15px, 보조 13px.
 *  - 색: 회색 바탕 + 흰 면 + 먹색 글자. 계절 색은 작은 강조에만.
 *  - 모양: 1px 선, 둥글기 10px, 그림자 없음.
 */
@font-face { font-family: "Pretendard"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/Pretendard-Regular.woff") format("woff"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/Pretendard-SemiBold.woff") format("woff"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/Pretendard-Bold.woff") format("woff"); }
/* 제목·숫자·단추용 둥근 글꼴(나눔스퀘어라운드, SIL OFL 1.1). 본문은 읽기 쉽게 Pretendard 그대로 */
@font-face { font-family: "NanumSquareRound"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/NanumSquareRoundB.woff2") format("woff2"); }
@font-face { font-family: "NanumSquareRound"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/NanumSquareRoundEB.woff2") format("woff2"); }

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --ink: #1c1d1f;
  --sub: #5d6166;
  --faint: #8d9298;
  --line: #e6e6e2;
  --accent: #a2591f;
  --accent-soft: #f6ece0;
  --danger: #b3261e;
  --radius: 10px;
  --gap: 16px;
  --font-round: "NanumSquareRound", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
body[data-season="spring"] { --accent: #ad4468; --accent-soft: #f9e9ee; }
body[data-season="summer"] { --accent: #1c7680; --accent-soft: #e2f1f2; }
body[data-season="autumn"] { --accent: #a2591f; --accent-soft: #f6ece0; }
body[data-season="winter"] { --accent: #45588a; --accent-soft: #e8ecf5; }
/* 별이 된 아이: 계절과 상관없이 늘 같은 차분한 색 */
body[data-mode="memorial"] { --bg: #f3f4f7; --line: #e2e4ea; --accent: #4a5680; --accent-soft: #e9ecf4; }

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 400; line-height: 1.55;
  letter-spacing: -0.005em; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, dl, dd { margin: 0; }
h1, h2, h3, strong { font-weight: 600; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
small { font-size: 0.867rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: -0.22em; }

/* ── 틀 ─────────────────────────────────────────── */
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
#view { flex: 1; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body[data-screen="welcome"] #view { padding-bottom: 24px; }
.page { padding: 4px var(--gap) 28px; display: flex; flex-direction: column; gap: 24px; }
.page > .no-print:not(.doc-actions) { display: flex; flex-direction: column; gap: 14px; }

#top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 52px;
  padding: env(safe-area-inset-top) var(--gap) 0; background: var(--bg);
}
.top-title { font-size: 1.2rem; font-weight: 700; flex: 1; min-width: 0; }
#top.sub { padding-left: 4px; }
#top.sub .top-title { font-size: 1.067rem; font-weight: 600; }
.pet-switch {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 0.933rem; flex: none;
}
.pet-switch .icon { color: var(--faint); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--radius); color: var(--ink); flex: none; }
.icon-btn.subtle { color: var(--faint); width: 36px; height: 36px; }

#tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 6;
  display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px;
  color: var(--faint); text-decoration: none; font-size: 0.733rem; position: relative;
}
.tab.on { color: var(--ink); font-weight: 600; }
.tab.on::before { content: ""; position: absolute; top: -1px; left: 50%; width: 24px; height: 2px; margin-left: -12px; background: var(--ink); }

/* ── 단추 ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid transparent; font-weight: 600; font-size: 0.933rem;
  text-decoration: none; white-space: nowrap; background: none;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-text { color: var(--sub); font-weight: 400; text-decoration: underline; padding: 0 8px; }
.btn-text.danger { color: var(--danger); }
.btn-small { height: 34px; padding: 0 12px; font-size: 0.867rem; border-radius: 8px; }
.btn-wide { width: 100%; }
.btn-file { cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── 묶음과 목록 ────────────────────────────────── */
.block { display: flex; flex-direction: column; gap: 8px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.block h2, .block-head h2 { font-size: 0.867rem; font-weight: 600; color: var(--sub); }
.block-head a, .block-head .link { font-size: 0.867rem; color: var(--sub); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.block-head a:not(.btn)::after { content: "›"; color: var(--faint); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: block; color: inherit; text-decoration: none; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.note-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; gap: 10px; color: var(--sub); font-size: 0.933rem; }
.note-box h2 { color: var(--ink); }
.hint { font-size: 0.867rem; color: var(--faint); }
.hint a { color: var(--sub); }
.hint.center, .center { text-align: center; }
.hint.warn { color: var(--ink); background: var(--accent-soft); padding: 10px 12px; border-radius: var(--radius); }
.lead { color: var(--sub); font-size: 0.933rem; }
.muted { color: var(--faint); }
.empty { color: var(--sub); font-size: 0.933rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; }
.plain { display: flex; flex-direction: column; gap: 4px; }
.plain li { padding-left: 12px; position: relative; }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

.rows, .menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row, .menu-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 54px; width: 100%;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); text-decoration: none;
}
.row:first-child, .menu-row:first-child { border-top: 0; }
.row-when { flex: none; width: 4.4em; font-size: 0.867rem; color: var(--sub); }
.row.today .row-when { color: var(--accent); font-weight: 600; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-main strong { font-weight: 600; }
.row-main small { color: var(--sub); }
.row-side { flex: none; display: flex; align-items: center; gap: 6px; }
.row.past { opacity: 0.55; }
.row .chev, .menu-row .chev { color: var(--faint); flex: none; }
.menu-row > .icon:first-child { color: var(--sub); }
.done-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: 0.867rem; flex: none; }
.day { display: flex; flex-direction: column; gap: 6px; }
.day-title { font-size: 0.867rem; font-weight: 600; color: var(--sub); }

/* ── 얼굴과 머리말 ──────────────────────────────── */
.face { flex: none; border-radius: 50%; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; border: 1px solid var(--line); }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face-initial { font-weight: 700; color: var(--accent); line-height: 1; }
.face.react { animation: nod 0.9s ease; }
@keyframes nod {
  0% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.06) rotate(-4deg); }
  50% { transform: scale(1.06) rotate(4deg); }
  75% { transform: scale(1.03) rotate(-2deg); }
  100% { transform: none; }
}
.profile { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.profile-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-size: 1.333rem; font-weight: 700; line-height: 1.3; }
.season-line { color: var(--accent); font-weight: 600; font-size: 0.933rem; }
.profile-sub { color: var(--sub); font-size: 0.867rem; }
.reaction { color: var(--sub); font-size: 0.867rem; }
.reaction:empty { display: none; }

/* ── 오늘: 오늘의 장면, 이번 계절 ────────────────── */
.moment { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.moment.empty { padding: 22px 16px; }
.moment h2 { font-size: 1.2rem; font-weight: 700; }
.moment.empty p { color: var(--sub); margin-top: -6px; }
.moment .btn { height: 48px; }
.import-list { color: var(--ink); }
.moment-view { position: relative; padding: 0; border: 0; background: var(--bg); border-radius: var(--radius); overflow: hidden; display: block; width: 100%; }
.moment-view img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.moment-foot { display: flex; align-items: center; gap: 8px; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strip-cell { position: relative; display: block; }
.strip-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.block-head h2 .season-dot { display: inline-block; vertical-align: 1px; }
.care-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.care-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 0.933rem; color: var(--sub); }
.care-chip.done { border-color: var(--ink); color: var(--ink); font-weight: 600; }

/* ── 돌봄 줄 ──────────────────────────────── */
.care-row .care-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--sub); flex: none; }
.care-row .care-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--faint); flex: none; }
.care-row.done .care-mark { background: var(--ink); border-color: var(--ink); color: #fff; }
.care-row.recent .care-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.care-row.recent .row-main small { color: var(--accent); font-weight: 600; }
.care-row:active, .log-row:active { background: var(--bg); }
.log-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.row-main .log-detail { color: var(--ink); }
.chip-small { height: 30px; padding: 0 10px; font-size: 0.867rem; color: var(--sub); }
.quick-fill { margin-top: -10px; }
.care-form .thumb-preview img { max-height: 140px; }
/* 2초 영상 */
.clip-view { width: 100%; max-height: 46vh; border-radius: var(--radius); background: #111; object-fit: cover; aspect-ratio: 1; }
.clip-view.small { max-height: 200px; width: auto; max-width: 100%; aspect-ratio: auto; }
.clip-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.clip-bar span { display: block; height: 100%; width: 0; background: var(--ink); }
.clip-bar.run span { width: 100%; transition: width 2s linear; }
.clip-mark { position: absolute; right: 4px; top: 4px; font-style: normal; font-size: 0.667rem; font-weight: 600; color: #fff; background: rgba(20, 20, 22, 0.7); border-radius: 4px; padding: 1px 5px; }
.log-thumb-wrap, .photo-cell { position: relative; }
.log-thumb-wrap { flex: none; display: block; }
.reel-open { margin-left: auto; height: 28px; }
/* 계절 이어 보기 */
.reel { position: fixed; inset: 0; z-index: 40; background: #111; color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.reel-top { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 0; }
.reel-close { color: #fff; }
.reel-sound { margin-left: auto; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.reel-bars { display: flex; gap: 3px; padding: 0 12px; }
.reel-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
.reel-bars span.done, .reel-bars span.on { background: #fff; }
.reel-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; cursor: pointer; }
.reel-stage img, .reel-stage video { max-width: 100%; max-height: 100%; border-radius: var(--radius); object-fit: contain; }
.reel-caption { text-align: center; padding: 4px 16px 16px; min-height: 2.6em; color: rgba(255, 255, 255, 0.85); font-size: 0.933rem; }

/* ── 스위치·나눠 보기·입력 ──────────────────────── */
.switch { width: 44px; height: 26px; border-radius: 999px; border: 0; background: #cfd1d4; position: relative; padding: 0; flex: none; }
.switch .switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch.on { background: var(--ink); }
.switch.on .switch-knob { transform: translateX(18px); }
.switch-label { font-size: 0.8rem; color: var(--sub); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #e9e9e6; border-radius: var(--radius); padding: 3px; }
.seg a { text-align: center; height: 34px; line-height: 34px; border-radius: 8px; text-decoration: none; color: var(--sub); font-size: 0.933rem; }
.seg a.on { background: var(--surface); color: var(--ink); font-weight: 600; }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-weight: 600; font-size: 0.867rem; color: var(--sub); }
.field-hint { font-size: 0.867rem; color: var(--faint); }
input[type="text"], input[type="date"], input[type="time"], input[type="datetime-local"], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; line-height: 1.6; }
.form-error { color: var(--danger); font-weight: 600; font-size: 0.933rem; }
.form-error:empty { display: none; }
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 0.933rem; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.photo-row { display: flex; align-items: center; gap: 14px; }
.photo-row > div:last-child { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.thumb-preview img { max-height: 160px; border-radius: var(--radius); margin-bottom: 6px; }
.thumb-preview:empty { display: none; }
.prompts summary { color: var(--sub); font-size: 0.933rem; min-height: 36px; display: flex; align-items: center; cursor: pointer; }
.letter-form textarea { min-height: 240px; }

/* ── 증상·편지·알림 카드 ────────────────────────── */
.symptom-head { display: flex; align-items: center; gap: 8px; }
.symptom-head strong { flex: none; }
.symptom-head small { flex: 1; color: var(--sub); }
.symptom p { margin-top: 2px; }
.symptom-photo { max-height: 180px; border-radius: 8px; margin-top: 8px; }
.letter-card { display: flex; flex-direction: column; gap: 4px; }
.letter-card small, .letter-full small, .notif small { color: var(--sub); }
.letter-card p, .letter-full p, .notif p { white-space: pre-line; }
.letter-card p { color: var(--sub); }
.letter-full { display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; line-height: 1.9; }
.letter-full h2 { font-size: 1.067rem; }
.notif { display: flex; flex-direction: column; gap: 3px; }
.notif p { color: var(--sub); font-size: 0.867rem; }

/* ── 앨범 ───────────────────────────────────────── */
.season-group { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.season-title { display: flex; align-items: center; gap: 6px; font-size: 0.867rem; font-weight: 600; color: var(--sub); }
.season-title small { color: var(--faint); font-weight: 400; }
.season-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.season-spring .season-dot { background: #e29bb2; }
.season-summer .season-dot { background: #62b0ba; }
.season-autumn .season-dot { background: #d98f49; }
.season-winter .season-dot { background: #8c9dc0; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-cell { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: transparent; text-align: left; display: flex; flex-direction: column; }
.photo-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-cell span { padding: 4px 2px 0; font-size: 0.8rem; color: var(--sub); background: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-view { display: flex; flex-direction: column; gap: 8px; }
.photo-view img { border-radius: var(--radius); width: 100%; }
.photo-view small { color: var(--sub); }

/* ── 가족·아이 고르기 ───────────────────────────── */
.row.member.on { background: var(--bg); }
.row.member input { border: 0; background: transparent; padding: 0; font-weight: 600; width: 100%; min-height: 24px; }
.invite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.invite-code { font-size: 1.333rem; font-weight: 700; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; margin-right: auto; }
.pet-list { display: flex; flex-direction: column; gap: 8px; }
.pet-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 56px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.pet-row.on { border-color: var(--ink); }
.pet-row-name { font-weight: 600; flex: 1; }
.pet-row-mode { color: var(--sub); font-size: 0.867rem; }
.app-foot { text-align: center; color: var(--faint); font-size: 0.8rem; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.app-foot strong { color: var(--sub); font-size: 0.867rem; }

/* ── 첫 화면 ────────────────────────────────────── */
.welcome { padding-top: 14vh; gap: 14px; }
.welcome h1 { font-size: 1.733rem; font-weight: 700; }
.welcome-sub { color: var(--sub); margin-top: -8px; }
.welcome-points { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; color: var(--sub); font-size: 0.933rem; gap: 6px; }
.welcome-mark { position: relative; width: 44px; height: 44px; margin-bottom: 6px; }
.welcome-mark span { position: absolute; width: 26px; height: 26px; border-radius: 50%; opacity: 0.9; }
.welcome-mark span:nth-child(1) { left: 0; top: 0; background: #e9a3b8; }
.welcome-mark span:nth-child(2) { right: 0; top: 0; background: #6fb6bf; }
.welcome-mark span:nth-child(3) { right: 0; bottom: 0; background: #dd9049; }
.welcome-mark span:nth-child(4) { left: 0; bottom: 0; background: #8f9fc2; }

/* ── 아래에서 올라오는 창, 안내 ─────────────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(20, 20, 22, 0.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 20px var(--gap) calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px;
}
.sheet-title { font-size: 1.067rem; font-weight: 700; }
.sheet-body { display: flex; flex-direction: column; gap: 8px; color: var(--sub); }
.sheet-body > div { display: flex; flex-direction: column; gap: 8px; }
.sheet-body strong, .sheet-body label { color: var(--ink); }
.sheet-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  width: calc(100% - 32px); max-width: 448px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.933rem;
}
.toast-actions { display: flex; gap: 10px; flex: none; }
.toast-action { background: none; border: 0; color: #fff; font-weight: 600; text-decoration: underline; min-height: 32px; padding: 0 4px; flex: none; }

/* ── 한 장짜리 문서: 화면에서도 종이처럼 ────────── */
.doc-holder { display: flex; flex-direction: column; }
.doc { background: #fff; color: #222; border: 1px solid var(--line); border-radius: 6px; padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.doc-header { border-bottom: 2px solid #222; padding-bottom: 8px; }
.doc-header h2 { font-size: 1.333rem; font-weight: 700; }
.doc-header p { color: #666; font-size: 0.933rem; }
.doc-kv { display: grid; grid-template-columns: 6em 1fr; gap: 4px 10px; }
.doc-kv dt { color: #666; }
.doc-kv.large { font-size: 1.067rem; }
.doc-kv.large dd { font-weight: 600; }
.doc-section { font-size: 1rem; font-weight: 700; border-left: 3px solid #222; padding-left: 8px; margin-top: 6px; }
.doc-text { white-space: pre-line; }
.doc-text.muted { color: #666; }
.doc-list { display: flex; flex-direction: column; gap: 2px; padding-left: 1.1em; list-style: disc; }
.doc-entries { display: flex; flex-direction: column; }
.doc-entry { padding: 8px 0; border-bottom: 1px solid #e2e2e2; }
.doc-entry-when { color: #666; font-size: 0.867rem; }
.doc-entry-title { font-weight: 600; }
.doc-entry img { max-height: 160px; margin-top: 6px; border-radius: 4px; }
.doc-photo img { margin: 0 auto; max-height: 280px; border-radius: 4px; }
.doc-photo-small.round img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.doc-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.doc-photos figure { margin: 0; break-inside: avoid; }
.doc-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.doc-photos figcaption { font-size: 0.733rem; color: #666; margin-top: 2px; }
.doc-big { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.doc-big strong { font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.doc-big-alert { background: #b3261e; color: #fff; padding: 10px; }
.doc-big-alert strong { font-size: 1.867rem; }
.doc-big-contact { border: 2px solid #222; padding: 10px; }
.doc-big-label { color: #666; font-size: 0.867rem; }
.doc-footer { color: #777; font-size: 0.8rem; border-top: 1px solid #e2e2e2; padding-top: 8px; margin-top: 6px; }
.doc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ══ 계절 띠 디자인 (2026-11-21 A안) ══════════════════
 * 첫 화면 위쪽이 지금 계절의 색이 된다. 계절마다 앱의 얼굴이 바뀐다.
 * --band 띠 바탕, --band-deep 띠의 큰 원, --band-ink 띠 위 글자, --accent-soft 옅은 강조
 */
:root { --bg: #faf7f0; --line: #ebe4d6; --sub: #6b6253; --faint: #9a917f; }
body[data-season="spring"] { --band: #f2b8c6; --band-deep: #e79fb2; --band-ink: #4a1f2c; --accent: #a8456a; --accent-soft: #f8e0e7; }
body[data-season="summer"] { --band: #7cc4c9; --band-deep: #5fb0b6; --band-ink: #0f3b40; --accent: #1c7680; --accent-soft: #d9eff0; }
body[data-season="autumn"] { --band: #e3a857; --band-deep: #d18f3c; --band-ink: #3b2a12; --accent: #9a5a1c; --accent-soft: #f0e2c6; }
body[data-season="winter"] { --band: #9fb1d1; --band-deep: #8499bf; --band-ink: #1e2a45; --accent: #45588a; --accent-soft: #e3e9f4; }
body[data-mode="memorial"] { --bg: #f5f5f8; --line: #e3e5ec; --sub: #62677a; --faint: #9196a6; --band: #c9cedb; --band-deep: #b4bbcc; --band-ink: #2a2f42; --accent: #4a5680; --accent-soft: #e6e9f1; }

/* 첫 화면: 위 막대도 띠 색으로 이어진다 */
body[data-screen="home"] #top { background: var(--band); }
body[data-screen="home"] #top .top-title { visibility: hidden; }
body[data-screen="home"] .pet-switch { border-color: transparent; background: rgba(255, 255, 255, 0.55); color: var(--band-ink); }
.band {
  position: relative; margin: -4px calc(var(--gap) * -1) 34px; padding: 6px var(--gap) 26px; min-height: 176px;
  background: var(--band); color: var(--band-ink);
}
.band::before { content: ""; position: absolute; right: -44px; top: -70px; width: 190px; height: 190px; border-radius: 50%; background: var(--band-deep); }
.band::after { content: ""; position: absolute; left: -70px; bottom: -40px; width: 230px; height: 110px; border-radius: 50%; background: var(--band-deep); opacity: 0.45; }
.band { overflow: visible; }
.band-text { position: relative; z-index: 1; padding-right: 110px; display: flex; flex-direction: column; }
.band-text small { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; }
.band-text h2 { font-size: 2.133rem; font-weight: 700; line-height: 1.16; margin-top: 6px; }
.band-text h2 span { display: block; }
.band-text p { font-size: 0.867rem; margin-top: 8px; }
.band-text .reaction { color: var(--band-ink); font-weight: 600; }
.band .face { position: absolute; right: var(--gap); bottom: -34px; z-index: 2; border: 5px solid var(--bg); background: var(--accent-soft); }
/* 사진 띠: 이번 계절에 찍은 사진이 띠의 바탕이 된다. 글자가 읽히게 아래쪽을 어둡게 덮는다 */
.band.band-photo { min-height: 300px; background-size: cover; background-position: center; color: #fff; display: flex; align-items: flex-end; }
.band.band-photo::before { right: 0; top: 0; left: 0; bottom: 0; width: auto; height: auto; border-radius: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.12) 55%, rgba(0, 0, 0, 0.62) 100%); }
.band.band-photo::after { display: none; }
.band.band-photo .band-text { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
.band.band-photo .band-text .reaction { color: #fff; }
body[data-screen="home"]:has(.band-photo) #top { position: absolute; left: 0; right: 0; max-width: 480px; margin: 0 auto; background: transparent; }
body[data-screen="home"]:has(.band-photo) .band { margin-top: -4px; padding-top: 60px; }
body[data-screen="home"]:has(.band-photo) .pet-switch { background: rgba(255, 255, 255, 0.82); color: var(--ink); }

/* 띠가 화면 가장자리에서 잘리도록(큰 원이 삐져나오지 않게) */
.page:has(> .band) { overflow-x: clip; }
.band::before, .band::after { clip-path: none; }
#view { overflow-x: clip; }

/* 오늘의 장면: 비어 있을 때는 먹색 카드로 또렷하게 */
.moment { border-radius: 18px; }
.moment.empty { background: var(--ink); border-color: var(--ink); color: #fff; }
.moment.empty p { color: rgba(255, 255, 255, 0.72); }
.moment.empty .btn-primary { background: var(--band); color: var(--band-ink); }
.moment.empty .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.moment-view { border-radius: 14px; }
.strip { gap: 6px; }
.strip-cell img { border-radius: 12px; }

/* 단추·칩·탭: 둥글고 따뜻하게 */
.btn { border-radius: 14px; }
.btn-small { border-radius: 10px; }
.rows, .menu, .card, .empty, .note-box, .invite { border-radius: 16px; }
.care-chip { border-width: 1.5px; }
.care-chip.done { background: var(--band-ink); border-color: var(--band-ink); color: #fff; }
.chip.on { background: var(--band-ink); border-color: var(--band-ink); }
.switch.on { background: var(--band-ink); }
#tabs { background: var(--bg); border-top-color: var(--line); padding-left: 8px; padding-right: 8px; }
.tab { flex-direction: row; gap: 6px; height: 40px; margin: 9px 2px; border-radius: 999px; font-size: 0.8rem; }
.tab.on { background: var(--accent-soft); color: var(--band-ink); }
.tab.on::before { display: none; }
.tab:not(.on) span { display: none; }
#view { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.season-line { color: var(--accent); }

/* 가족 댓글 */
.comments-block { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.comments { display: flex; flex-direction: column; gap: 6px; }
.comment { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 0.933rem; color: var(--ink); }
.comment strong { flex: none; }
.comment span { flex: 1; min-width: 0; }
.comment small { color: var(--faint); }
.comment-form { display: flex; gap: 6px; }
.comment-form input { flex: 1; min-height: 40px; }
input[type="email"], input[type="password"] { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ══ B안 (2026-11-21): 모노 + 지금 계절 색 한 가지 ══════════════
 * 감성은 사진과 지금 계절 색 하나로, 세련됨은 흰 면·가는 선·넉넉한 여백으로,
 * 전문성은 반듯한 숫자와 절제된 색으로. 위 A안 위에 덮어쓴다.
 */
:root { --bg: #fbfaf8; --surface: #ffffff; --ink: #17171a; --sub: #5c5c60; --faint: #9a9a9f; --line: #e9e7e2; --soft: #f2f1ed; }
body[data-season="spring"] { --accent: #b85f80; --accent-soft: #f7e9ee; --band: #c9708f; --band-deep: #b85f80; --band-ink: #ffffff; }
body[data-season="summer"] { --accent: #2f7f89; --accent-soft: #e4f1f2; --band: #3a8f9a; --band-deep: #2f7f89; --band-ink: #ffffff; }
body[data-season="autumn"] { --accent: #a8652f; --accent-soft: #f5ebe1; --band: #b8743c; --band-deep: #a8652f; --band-ink: #ffffff; }
body[data-season="winter"] { --accent: #52679a; --accent-soft: #e9edf5; --band: #5f74a3; --band-deep: #52679a; --band-ink: #ffffff; }
body[data-mode="memorial"] { --bg: #f8f8fa; --line: #e6e7ec; --soft: #f0f1f4; --accent: #5a6480; --accent-soft: #eceef4; --band: #6b7590; --band-deep: #5a6480; --band-ink: #ffffff; }

.page { gap: 28px; }
/* 띠: 장식 원 없이 평평한 계절 색 한 면(사진이 있으면 사진) */
.band::before, .band::after { display: none; }
.band.band-photo::before { display: block; }
.band { margin-bottom: 30px; padding-bottom: 28px; }
.band-text small { font-size: 0.8rem; letter-spacing: 0.04em; opacity: 0.9; }
.band-text h2 { font-size: 2.2rem; line-height: 1.14; letter-spacing: -0.02em; }
.band-text p { font-size: 0.867rem; opacity: 0.92; }
.band .face { border: 4px solid var(--bg); }
body[data-screen="home"] .pet-switch { background: rgba(255, 255, 255, 0.92); color: var(--ink); }

/* 묶음 제목: 작고 진하게, 옆 글은 회색 */
.block h2, .block-head h2 { font-size: 1rem; color: var(--ink); letter-spacing: -0.01em; }
.block-head a, .block-head .link { color: var(--faint); }

/* 면: 흰 바탕 + 가는 선, 둥글기 14px, 그림자 없음 */
.rows, .menu, .card, .empty, .note-box, .invite, .pet-row { border-radius: 14px; border-color: var(--line); }
.moment, .moment.empty { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; }
.moment.empty p { color: var(--sub); }
.moment.empty .btn-primary, .moment .btn-primary { background: var(--ink); color: #fff; }
.moment.empty .btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* 단추: 먹색 하나, 나머지는 선 */
.btn { border-radius: 12px; letter-spacing: -0.01em; }
.btn-small { border-radius: 10px; }
.btn-ghost { border-color: #dcdad5; }
.care-chip { border-width: 1px; border-color: #dcdad5; color: var(--sub); }
.care-chip.done { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on, .switch.on { background: var(--ink); border-color: var(--ink); }
.seg { background: var(--soft); }
.row.today .row-when, .done-mark, .season-line { color: var(--accent); }

/* 아래 탭: 흰 막대, 글자 모두 보이게, 고른 탭 아래 계절 색 점 */
#tabs { background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line); padding-left: 0; padding-right: 0; }
.tab { flex-direction: column; gap: 2px; height: 56px; margin: 0; border-radius: 0; font-size: 0.733rem; color: var(--faint); }
.tab:not(.on) span { display: inline; }
.tab.on { background: none; color: var(--ink); }
.tab.on::before { display: block; content: ""; position: absolute; top: auto; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }

/* 계절 표시 점: 지금 계절 색 체계에 맞춘 차분한 색 */
.season-spring .season-dot { background: #c9708f; }
.season-summer .season-dot { background: #3a8f9a; }
.season-autumn .season-dot { background: #b8743c; }
.season-winter .season-dot { background: #5f74a3; }

/* 계절 고리: 사진 없는 칸은 회색, 지금 계절만 계절 색 */
.ring-block .ring-svg .rq { fill: #e6e4df; fill-opacity: 1; }
.ring-block .ring-svg a:has(.rq-now) .rq { fill: var(--accent-soft); }
.ring-block .ring-svg .rq-now { stroke: var(--accent); stroke-width: 3; }
.ring-block .ring-svg .rq-name { fill: var(--sub); }
.ring-block .ring-nav { width: 36px; height: 36px; font-size: 1.1rem; border-color: var(--line); }
.ring-block .ring-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; border-top: 1px solid var(--line); padding-top: 14px; text-decoration: none; color: inherit; }
.ring-block .ring-stats span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 400; }
.ring-block .ring-stats span + span { border-left: 1px solid var(--line); }
.ring-block .ring-stats b { font-family: var(--font-round); font-weight: 800; font-size: 1.333rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.ring-block .ring-stats small { color: var(--sub); font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  .face.react { animation: none; }
  .switch .switch-knob { transition: none; }
}

@media print {
  @page { margin: 14mm; }
  html { font-size: 11pt; }
  body { background: #fff; }
  .no-print, #top, #tabs, #overlay-root { display: none !important; }
  #app { max-width: none; }
  #view, .page { padding: 0; }
  .doc { border: 0; padding: 0; }
  .doc-entry { break-inside: avoid; }
}

/* 캐릭터 만들기 */
.char-photo { width: 96px; height: 96px; border-radius: 16px; overflow: hidden; background: var(--card, #fff); border: 1px solid var(--line, #e4e4e0); display: grid; place-items: center; flex: none; }
.char-photo img { width: 100%; height: 100%; object-fit: cover; }
.char-empty { font-size: 0.8rem; color: var(--faint); text-align: center; padding: 6px; }
.char-result:empty { display: none; }
.char-result { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.char-wait { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 12px; border: 1px dashed var(--line, #e4e4e0); border-radius: 16px; text-align: center; }
.char-wait small { color: var(--sub); }
.char-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line, #e4e4e0); border-top-color: var(--accent, #b4793a); animation: char-spin 0.9s linear infinite; }
@keyframes char-spin { to { transform: rotate(360deg); } }
.char-compare { display: flex; align-items: center; justify-content: center; gap: 16px; }
.char-compare figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.char-compare figcaption { font-size: 0.8rem; color: var(--sub); }
.char-arrow { color: var(--faint); font-size: 1.2rem; }
.char-big { width: 100%; max-width: 260px; align-self: center; border-radius: 16px; }
.notice { background: var(--accent-soft); color: var(--text, #222); border-radius: 12px; padding: 10px 12px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* 병원 기록 */
.vet-sum { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.vet-sum-main { display: flex; flex-direction: column; gap: 2px; }
.vet-sum-main strong { font-size: 1.6rem; line-height: 1.2; }
.vet-sum small { color: var(--sub); }
.vet-sum-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.vet-todo { color: var(--accent); font-size: 0.867rem; font-weight: 600; }
.med-rows { display: flex; flex-direction: column; gap: 6px; }
.med-row { display: grid; grid-template-columns: 1.3fr 1.5fr 56px 32px; gap: 6px; align-items: center; }
.med-row input { min-width: 0; }
.doc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-thumb { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; padding: 0; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-thumb-img { width: 76px; height: 76px; border: 0; padding: 0; background: none; display: block; }
.doc-thumb-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.55); color: #fff; font-size: 14px; line-height: 22px; padding: 0; }
.doc-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--sub); font-size: 0.8rem; border-style: dashed; cursor: pointer; }
.visit-card h2 { margin: 2px 0 10px; }
.visit-card h3 { font-size: 0.933rem; margin: 14px 0 6px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; margin: 0; }
.kv dt { color: var(--sub); font-size: 0.867rem; }
.kv dd { margin: 0; white-space: pre-line; }
.med-list li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); }
.med-list small, .med-card small { color: var(--sub); }
.med-card { display: flex; flex-direction: column; gap: 2px; }
.doc-entry p { white-space: pre-line; }

/* 추억 연대기·장소 */
.tl-rows { display: flex; flex-direction: column; gap: 6px; }
.tl-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); text-align: left; color: inherit; text-decoration: none; font: inherit; cursor: pointer; }
.tl-row .row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tl-row .row-main strong, .tl-row .row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row small { color: var(--sub); }
.tl-out { border-color: var(--accent); }
.tl-date { flex: none; width: 58px; white-space: nowrap; font-size: 0.8rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.tl-thumbs { flex: none; display: flex; align-items: center; }
.tl-thumbs img { width: 38px; height: 38px; object-fit: cover; border-radius: 9px; border: 2px solid var(--card, #fff); margin-left: -10px; }
.tl-thumbs img:first-child { margin-left: 0; }
.tl-thumbs em { font-style: normal; font-size: 0.75rem; color: var(--sub); margin-left: 4px; }
.tl-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tl-day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tl-day-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.place-row { gap: 12px; }
.place-cover { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }

/* 계절 고리 (첫 화면) */
.ring-head { display: flex; justify-content: center; align-items: center; gap: 18px; }
.ring-year { font-size: 1.05rem; font-weight: 700; min-width: 3.5em; text-align: center; }
.ring-nav { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1; }
.ring-nav:disabled { opacity: 0.3; }
.ring-wrap { display: flex; justify-content: center; margin: 8px 0 4px; }
.ring-svg { width: min(100%, 300px); height: auto; }
.ring-svg a { cursor: pointer; }
.ring-svg .rq { fill-opacity: 0.28; }
.ring-svg .rq-spring { fill: #e29bb2; }
.ring-svg .rq-summer { fill: #62b0ba; }
.ring-svg .rq-autumn { fill: #d98f49; }
.ring-svg .rq-winter { fill: #8c9dc0; }
.ring-svg .rq-now { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.ring-svg .rq-future { fill: none; stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 4 4; }
.ring-svg .rq-empty { fill: var(--line); fill-opacity: 0.35; }
.ring-svg .rq-name { font-size: 14px; font-weight: 700; fill: var(--sub); font-family: var(--font); pointer-events: none; }
.ring-svg .rq-name.on-photo { fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.45); stroke-width: 3px; }
.ring-svg .rc-big { font-size: 26px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.ring-svg .rc-sub { font-size: 12px; fill: var(--sub); font-family: var(--font); }
.ring-stats { display: block; text-align: center; font-size: 1rem; font-weight: 600; margin-top: 6px; color: var(--ink); text-decoration: none; }

/* 둥근 글꼴: 제목·큰 숫자·단추·탭에만 */
h1, h2, h3, .top-title, .band-text small, .moment h2, .btn, .care-chip, .seg a, .tab, .ring-year { font-family: var(--font-round); }
h1, h2, h3, .top-title, .moment h2, .seg a.on, .ring-year { font-weight: 800; }
.btn, .care-chip, .tab, .seg a, .band-text small { font-weight: 700; }
.band-text h2 { font-weight: 800; letter-spacing: -0.01em; }
.ring-svg .rc-big, .ring-svg .rq-name { font-family: var(--font-round); font-weight: 800; }
.char-current { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
