:root {
    /* 선분홍 테마 */
    --bg: #fff5f8;
    --card: #ffffff;
    --text: #2e2a2c;
    --muted: #9a8b90;
    --line: #f5dfe6;
    --soft: #fcedf2;
    --accent: #e05c86;           /* 선분홍 — 채우기·테두리 */
    --accent-strong: #c7426e;    /* 글자용 (흰 바탕에서 잘 읽히도록 조금 진하게) */
    --accent-soft: #fde6ee;
    --accent-grad: linear-gradient(135deg, #f794b3 0%, #e05c86 100%);
    --shadow: 0 2px 12px rgba(224, 92, 134, .07);
    --groom: #3d6fb6;
    --bride: #e05c86;
    --danger: #c0392b;
    /* 달력 항목 색 */
    --c-wed: #e05c86;
    --c-ev: #3d6fb6;
    --c-todo: #d08a1e;
    --c-pay: #2e8b57;
    --radius: 12px;
}

* { box-sizing: border-box; }
/* hidden 속성은 display 를 준 요소(label 등)에서도 항상 숨김 */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-strong); text-decoration: none; }
h1 { font-size: 1.4rem; margin: 0 0 16px; }
h3 { margin: 0; font-size: 1rem; }

/* ---------------------------------------------------------------- 상단 메뉴 */
.nav {
    background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.nav-inner { max-width: 960px; margin: 0 auto; }
.nav-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 0; }
.nav .brand { font-weight: 700; color: var(--text); }
.env-badge {
    font-size: 0.7rem; font-weight: 700; vertical-align: middle; margin-left: 6px;
    padding: 2px 8px; border-radius: 999px; background: #f0a020; color: #fff;
}
.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-actions button.link { font-size: inherit; }
.notice-card { background: var(--accent-soft); border-color: var(--accent); }
.notice-card p { margin: 6px 0 0; }
.flash { background: #eaf6ee; border: 1px solid #b9dfc5; color: #276b3d; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
/* 앱으로 설치해 실행하면 아이폰 상단(노치) 영역만큼 여백 */
.nav { padding-top: env(safe-area-inset-top); }
.tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    padding: 10px 12px; white-space: nowrap; color: var(--muted);
    border-bottom: 2px solid transparent;
}
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- 레이아웃 */
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.container.narrow { max-width: 480px; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.section-title { font-size: 1rem; margin: 20px 0 8px; }
.card > .section-title:first-child { margin-top: 0; }

.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
details.card summary, details.plain summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }
details.plain { margin-top: 12px; }
details.plain[open] summary { margin-bottom: 8px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row.compact > * { flex: 0 1 auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- 폼 */
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
label.check, label.radio { flex-direction: row; align-items: center; gap: 6px; color: var(--text); padding-bottom: 10px; }
.radio-group { display: flex; gap: 20px; }

input[type=text], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=month], textarea {
    font: inherit; color: var(--text); width: 100%;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button, .button {
    font: inherit; cursor: pointer; text-align: center; display: inline-block;
    padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; color: var(--text);
}
.button.small, button.small { padding: 6px 12px; font-size: 0.85rem; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.link.danger { color: var(--danger); }
button.link.muted { color: var(--muted); }
form.inline { display: inline; }

.error { color: var(--danger); margin: 0; font-size: 0.9rem; }
.notice { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.danger-text { color: var(--danger); }

/* ---------------------------------------------------------------- 요약 카드 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px; display: flex; flex-direction: column; color: var(--text); min-width: 0;
}
.stat strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.stat.total { border-color: var(--accent); }
a.stat:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- 홈 꾸미기 사진 */
.home-photo { margin-bottom: 16px; }
.photo-tile {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius);
    background: var(--soft); cursor: zoom-in; outline: none;
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;   /* 아이폰 기본 길게 누르기 메뉴 끄기 */
    touch-action: manipulation; transition: transform .15s;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-tile.pressing { transform: scale(.98); }          /* 꾹 누르는 중 살짝 눌림 */
.photo-tile.busy { opacity: .6; pointer-events: none; }
.photo-tile:focus-visible { box-shadow: 0 0 0 3px #f7a8c1; }

/* 전체 화면 보기 */
.photo-viewer {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    background: rgba(28, 16, 22, .94); opacity: 0; transition: opacity .18s; cursor: zoom-out;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.photo-viewer.open { opacity: 1; }
.photo-viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.photo-viewer-close {
    position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 12px;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.1rem;
}
body.no-scroll { overflow: hidden; }

/* 꾹 눌렀을 때 아래에서 올라오는 메뉴 */
.photo-sheet-backdrop {
    position: fixed; inset: 0; z-index: 90; background: rgba(40, 20, 30, .35);
    display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .15s;
}
.photo-sheet-backdrop.open { opacity: 1; }
.photo-sheet {
    width: min(420px, 100%); margin: 0 8px calc(env(safe-area-inset-bottom) + 10px);
    display: flex; flex-direction: column; gap: 8px; transform: translateY(20px); transition: transform .18s;
}
.photo-sheet-backdrop.open .photo-sheet { transform: none; }
.sheet-btn {
    padding: 15px; border: 0; border-radius: 14px; background: #fff; font-size: 1rem; font-weight: 600;
    color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.sheet-btn.danger { color: var(--danger); }
.sheet-btn.cancel { color: var(--muted); font-weight: 500; }
.photo-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 64px; padding: 0; border: 2px dashed #d9cfc9; border-radius: var(--radius);
    background: #fffdfc; color: var(--muted); cursor: pointer;
}
.photo-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-add .plus { font-size: 1.8rem; line-height: 1; font-weight: 300; }
.photo-add.empty { aspect-ratio: 16 / 6; }
.photo-add-label { font-size: 0.9rem; }
@media (min-width: 700px) {   /* PC: 꾸미기 사진이 화면을 너무 차지하지 않도록 더 납작하게 */
    .photo-tile { aspect-ratio: 3 / 1; }
    .photo-add.empty { aspect-ratio: 21 / 5; }
}
.photo-add.busy { pointer-events: none; opacity: .7; }
.photo-add.busy .plus, .photo-add.busy .photo-add-label { display: none; }
.photo-add.busy::before { content: '올리는 중…'; font-size: 0.8rem; color: var(--accent); }

.hero { text-align: center; padding: 24px 16px; }
.dday { font-size: 2.4rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.hero details.plain { display: inline-block; }
.hero form { justify-content: center; margin-top: 4px; }

.progress { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress .bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }

/* ---------------------------------------------------------------- 표 */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 120px; }
td.actions { display: flex; gap: 12px; }
tr.row-done td { color: var(--muted); }

.tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; color: #fff; }
.tag.groom { background: var(--groom); }
.tag.bride { background: var(--bride); }
.chip { font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }

/* ---------------------------------------------------------------- 체크박스 버튼 */
button.checkbox {
    width: 26px; height: 26px; padding: 0; border-radius: 7px; flex: none;
    border: 2px solid #cfc7c1; background: #fff; color: #fff; font-weight: 700; line-height: 1;
}
button.checkbox.checked { background: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- 체크리스트 */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list.card { padding: 4px 16px; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-main { flex: 1; min-width: 0; }
.check-title { overflow-wrap: anywhere; }
.check-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; color: var(--muted); }
.check-item.done .check-title { text-decoration: line-through; color: var(--muted); }
.check-item.held .check-title, .check-item.held .check-meta { color: #a8a29d; }
.held-chip { background: #eceae7; color: #6f6a65; margin-right: 4px; }
.check-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.hold-btn {
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.hold-btn:hover { border-color: #b8b2ad; color: var(--text); }
.hold-btn.on { background: #f3f1ef; color: var(--text); }

/* ---------------------------------------------------------------- 체크리스트 일별 / 월별 */
.progress-card .progress-counts { display: flex; gap: 14px; margin-top: 8px; color: var(--muted); }
.progress-counts b { color: var(--text); }
.seg-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 14px;
    background: #efe9e5; border-radius: 10px;
}
.seg-tabs a { text-align: center; padding: 8px 0; border-radius: 8px; color: var(--muted); font-weight: 600; }
.seg-tabs a.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.date-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.date-nav .button { padding: 6px 14px; }
.date-title { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.3; }
.date-title strong { font-size: 1.15rem; }

.week-strip { display: flex; align-items: stretch; gap: 4px; margin-bottom: 16px; }
.week-arrow { display: flex; align-items: center; padding: 0 4px; color: var(--muted); font-size: 1.2rem; }
.week-day {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text);
}
.week-day .wd { font-size: 0.72rem; color: var(--muted); }
.week-day .dn { font-weight: 700; }
.week-day.sun .wd, .week-day.sun .dn { color: #d0453a; }
.week-day.sat .wd, .week-day.sat .dn { color: #3d6fb6; }
.week-day.today { border-color: var(--accent); }
.week-day.sel { background: var(--accent); border-color: var(--accent); }
.week-day.sel .wd, .week-day.sel .dn { color: #fff; }
.week-day .dots { height: 8px; display: flex; gap: 2px; }
.week-day .dot { margin: 0; width: 6px; height: 6px; }
.week-day .dot.open { background: var(--c-todo); }
.week-day .dot.done { background: var(--c-pay); }
.week-day.sel .dot { background: #fff; }

.overdue-box .check-list { border-color: #f1c9c5; }
.empty-note { padding: 18px 0; text-align: center; }
.done-note { margin: -6px 0 10px; }
.details.group, details.group { margin-top: 4px; }
.held-group summary { color: #6f6a65; }

.add-card { margin-top: 18px; }

/* 할 일 종류 고르기 (날짜 / 월 / 없음) */
.kind-picker { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kind-picker legend { font-size: 0.85rem; color: var(--muted); padding: 0 4px; }
.kind-options { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-option {
    flex-direction: row; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
    border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.88rem;
}
.kind-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.kind-option input { accent-color: var(--accent); }

/* 일별 화면의 '이번 달 할 일' 안내 */
.month-hint {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
    padding: 10px 14px; border-radius: var(--radius); background: #f3eefa; color: #6b4f93; font-weight: 600; font-size: 0.9rem;
}

/* 월별: 모든 달을 한 페이지에 */
.container.wide { max-width: 1240px; }
.month-jump {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px;
    position: sticky; top: calc(env(safe-area-inset-top) + 86px); z-index: 4; padding: 6px 0; background: var(--bg);
}
.month-jump::-webkit-scrollbar { display: none; }
.month-jump a {
    flex: none; display: flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem;
}
.month-jump a.current { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.month-jump a b { background: var(--c-todo); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 0 6px; }
.month-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.month-card { margin: 0; padding: 14px; scroll-margin-top: 140px; }
.month-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.month-card.wedding { background: #fff8fa; }
.month-card.past { background: #fbfaf9; }
.month-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.month-card-head strong { font-size: 1.15rem; margin-right: 4px; }
.month-year { display: block; font-size: 0.72rem; color: var(--muted); }
.wedding-chip { background: var(--accent-soft); color: var(--accent); }
.progress.thin { height: 5px; margin: 2px 0 6px; }
.check-list.compact .check-item { padding: 8px 0; gap: 10px; }
/* 달 카드 안: 월 할 일의 '10월 중' 은 반복이라 숨기고, 날짜 할 일은 날짜를 보여준다 */
.check-list.compact .is-monthly .due { display: none; }
.check-list.compact .check-actions { flex-direction: row; align-items: center; }
.month-empty { margin: 6px 0 8px; }
.quick-add { display: flex; gap: 6px; margin-top: 8px; }
.quick-add input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 0.9rem; }
.quick-add button { flex: none; width: 38px; padding: 0; font-size: 1.1rem; font-weight: 700; color: var(--accent); }

/* ---------------------------------------------------------------- 달력 항목 (공통) */
.badge { font-size: 0.72rem; padding: 1px 7px; border-radius: 999px; color: #fff; flex: none; }
.badge.wed, .dot.wed { background: var(--c-wed); }
.badge.ev, .dot.ev { background: var(--c-ev); }
.badge.todo, .dot.todo { background: var(--c-todo); }
.badge.pay, .dot.pay { background: var(--c-pay); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

.entry-list { list-style: none; margin: 0 0 8px; padding: 0; }
.entry-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.entry-list li.done a { text-decoration: line-through; color: var(--muted); }
.entry-list a { color: var(--text); overflow-wrap: anywhere; }

.upcoming-day { display: flex; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.upcoming-day:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.upcoming-date { flex: none; width: 72px; padding-top: 6px; font-weight: 600; font-size: 0.9rem; }

/* ---------------------------------------------------------------- 달력 */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head h1 { margin: 0 4px; font-size: 1.25rem; flex: 1; text-align: center; }
.cal-head .button { padding: 6px 14px; }
.cal-legend { display: flex; gap: 12px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }

.cal {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--line); gap: 1px; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
}
.cal-dow { background: var(--soft); text-align: center; font-size: 0.8rem; padding: 6px 0; color: var(--muted); }
.cal-dow.sun, .cal-cell.sun .cal-num { color: #d0453a; }
.cal-dow.sat, .cal-cell.sat .cal-num { color: #3d6fb6; }
.cal-cell {
    background: var(--card); min-height: 92px; padding: 4px; color: var(--text);
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.cal-cell.out { background: #fcfbfa; }
.cal-cell.out > * { opacity: .45; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-size: 0.8rem; font-weight: 600; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff !important; }
.cal-entry {
    font-size: 0.7rem; line-height: 1.35; padding: 0 4px; border-radius: 4px; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-entry.wed { background: var(--c-wed); }
.cal-entry.ev { background: var(--c-ev); }
.cal-entry.todo { background: var(--c-todo); }
.cal-entry.pay { background: var(--c-pay); }
.cal-entry.done { opacity: .45; text-decoration: line-through; }
.cal-more { font-size: 0.7rem; color: var(--muted); padding-left: 4px; }

/* ---------------------------------------------------------------- 메모 */
.memo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.memo { margin: 0; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.memo.pinned { border-color: var(--accent); background: #fffafb; }
.memo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.memo-head h3 { overflow-wrap: anywhere; }
.memo-body {
    margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #555; font-size: 0.92rem;
    display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.memo-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
button.pin { border: 0; background: none; padding: 0 2px; font-size: 1rem; opacity: .25; filter: grayscale(1); }
button.pin.on { opacity: 1; filter: none; }
.memo-head h3 a { color: var(--text); }
/* 목록의 서식 있는 메모 미리보기: 일정 높이까지만 보이고 아래는 흐리게 */
.memo-body.rich {
    display: block; white-space: normal; max-height: 11.5em; position: relative; font-size: 0.9rem;
    -webkit-line-clamp: unset;
}
.memo-body.rich::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5em;
    background: linear-gradient(transparent, var(--card));
}
.memo.pinned .memo-body.rich::after { background: linear-gradient(transparent, #fffafb); }
.memo-body.rich h1 { font-size: 1.1rem; margin: 0.4em 0 0.2em; }
.memo-body.rich h2 { font-size: 1.02rem; margin: 0.4em 0 0.2em; }
.memo-body.rich h3 { font-size: 0.95rem; margin: 0.3em 0 0.15em; }
.memo-body.rich input[type=checkbox] { pointer-events: none; }

/* ---------------------------------------------------------------- 서식 있는 글 (편집기·미리보기 공통) */
.rich { line-height: 1.65; overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich p { margin: 0 0 0.35em; min-height: 1em; }
.rich h1 { font-size: 1.6rem; margin: 0.8em 0 0.3em; line-height: 1.3; }
.rich h2 { font-size: 1.3rem; margin: 0.7em 0 0.3em; line-height: 1.3; }
.rich h3 { font-size: 1.1rem; margin: 0.6em 0 0.25em; }
.rich ul, .rich ol { padding-left: 1.5em; margin: 0.2em 0 0.5em; }
.rich li > p { margin: 0.1em 0; }
.rich blockquote { border-left: 3px solid var(--text); margin: 0.4em 0; padding: 0.1em 0 0.1em 0.9em; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.rich code { background: #f2eeeb; color: #eb5757; padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.88em;
             font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rich pre { background: #f7f6f3; border-radius: 6px; padding: 0.8em 1em; overflow-x: auto; }
.rich pre code { background: none; color: inherit; padding: 0; }
.rich mark { border-radius: 3px; padding: 0 0.1em; }
.rich a { color: var(--accent); text-decoration: underline; }
.rich ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
.rich ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 0.5em; }
.rich ul[data-type="taskList"] li > label { flex: none; margin-top: 0.3em; user-select: none; }
.rich ul[data-type="taskList"] li > label input { width: 16px; height: 16px; accent-color: var(--accent); }
.rich ul[data-type="taskList"] li > div { flex: 1; }
.rich ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--muted); text-decoration: line-through; }
/* 사진: 저장된 너비(width)를 쓰되 화면보다 크면 줄어든다, 가운데 정렬 */
.rich img { display: block; max-width: 100%; height: auto; margin: 0.6em auto; border-radius: 6px; }
.memo-body.rich img { max-height: 140px; width: auto; margin: 0.4em 0; }

/* ---------------------------------------------------------------- 편집기 안의 사진 */
.ed-image { margin: 0.6em 0; display: flex; justify-content: center; }
.ed-image-frame { position: relative; max-width: 100%; line-height: 0; }
.ed-image-frame img { width: 100%; margin: 0; border-radius: 6px; display: block; }
.ed-image.selected .ed-image-frame img, .ed-image.resizing .ed-image-frame img { outline: 3px solid #7ab8f5; outline-offset: 1px; }
.ed-image-handle {
    position: absolute; top: 50%; width: 8px; height: 48px; margin-top: -24px; border-radius: 4px;
    background: rgba(40, 40, 40, .55); border: 1px solid #fff; cursor: ew-resize; touch-action: none;
    opacity: 0; transition: opacity .15s;
}
.ed-image-handle.left { left: 6px; }
.ed-image-handle.right { right: 6px; }
.ed-image-del {
    position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; padding: 0; line-height: 26px;
    border: 0; border-radius: 6px; background: rgba(40, 40, 40, .65); color: #fff; font-size: 0.85rem;
    opacity: 0; transition: opacity .15s;
}
.ed-image:hover .ed-image-handle, .ed-image:hover .ed-image-del,
.ed-image.selected .ed-image-handle, .ed-image.selected .ed-image-del,
.ed-image.resizing .ed-image-handle { opacity: 1; }
@media (hover: none) {   /* 휴대폰: 사진을 누르면(선택) 손잡이와 ✕ 가 보인다. 손잡이를 더 크게 */
    .ed-image-handle { width: 14px; height: 60px; margin-top: -30px; }
    .ed-image-del { width: 34px; height: 34px; line-height: 32px; }
}
.ed-status { align-self: center; margin-left: auto; font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
.ed-status:empty { display: none; }

/* ---------------------------------------------------------------- 메모 편집기 */
.memo-page { max-width: 760px; }
.memo-page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.memo-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
             padding: 20px 20px 12px; margin-bottom: 12px; }
.memo-title-input {
    width: 100%; border: 0 !important; outline: none !important; padding: 0 !important; margin-bottom: 8px;
    font: inherit; font-size: 1.8rem !important; font-weight: 700; color: var(--text); background: transparent !important;
}
.memo-title-input::placeholder { color: #cfc9c4; }
.editor { position: relative; }
.editor-toolbar {
    position: sticky; top: calc(env(safe-area-inset-top) + 88px); z-index: 5;
    display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0; margin-bottom: 8px;
    background: var(--card); border-bottom: 1px solid var(--line);
}
.editor:not(.ready) .editor-toolbar { display: none; }
.ed-group { display: inline-flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.ed-group:last-child { border-right: 0; }
.ed-btn {
    min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: none;
    color: var(--text); font-size: 0.9rem; font-weight: 600; line-height: 32px;
}
.ed-btn:hover { background: var(--soft); }
.ed-btn.on { background: var(--accent-soft); color: var(--accent); }
.ed-btn.i { font-style: italic; font-family: Georgia, serif; }
.ed-btn.u { text-decoration: underline; }
.ed-btn.s { text-decoration: line-through; }
.ed-btn.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
.ed-color-btn { text-decoration: underline; text-decoration-color: #d44c47; text-decoration-thickness: 3px; }
.ed-color { position: relative; display: inline-block; }
.ed-palette {
    position: absolute; top: 36px; left: 0; z-index: 20; width: 292px; max-width: calc(100vw - 16px); padding: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.ed-palette-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.ed-palette-title { display: block; font-size: 0.75rem; color: var(--muted); margin: 4px 0; }
.ed-palette-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-bottom: 8px; }
.ed-swatch {
    aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 5px;
    background: #fff; font-weight: 700; font-size: 0.8rem; line-height: 1;
}
.ed-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.ed-swatch.none { color: var(--muted); background: repeating-linear-gradient(135deg, #fff 0 4px, #f1eeeb 4px 6px); }
.ed-custom {
    display: inline-flex; flex-direction: row; align-items: center; gap: 4px; cursor: pointer;
    font-size: 0.72rem; color: var(--text); padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px;
}
.ed-custom input[type=color] { width: 22px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.editor-content .ProseMirror { min-height: 50vh; outline: none; padding-bottom: 2em; }
.editor-content .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder); color: #c4bdb7; float: left; height: 0; pointer-events: none;
}
.editor textarea { width: 100%; font: inherit; }

.ed-bubble, .ed-slash {
    position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
}
.ed-bubble { display: flex; gap: 2px; padding: 4px; white-space: nowrap; }
.ed-bubble[hidden], .ed-slash[hidden], .ed-palette[hidden] { display: none; }
.ed-slash { width: 250px; max-height: 300px; overflow-y: auto; padding: 4px; }
.ed-slash-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px;
    background: none; text-align: left; color: var(--text);
}
.ed-slash-item.on, .ed-slash-item:hover { background: var(--soft); }
.ed-slash-icon {
    flex: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 6px; font-weight: 700; font-size: 0.85rem; background: #fff;
}
.ed-slash-label { font-weight: 600; }
.ed-slash-hint { margin-left: auto; font-size: 0.75rem; color: var(--muted); }
.ed-slash-empty { padding: 8px; color: var(--muted); font-size: 0.85rem; }
.memo-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.memo-actions button { flex: none; white-space: nowrap; }
@media (max-width: 640px) {
    .memo-form { padding: 16px 14px 10px; }
    .memo-title-input { font-size: 1.5rem !important; }
    .memo-actions .muted { display: none; }   /* 단축키 안내는 PC 에서만 */
    .memo-actions { justify-content: flex-end; }
    .editor-content .ProseMirror { min-height: 40vh; }
}

/* ---------------------------------------------------------------- 웨딩홀 */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.button.tiny { padding: 3px 8px; font-size: 0.75rem; border-radius: 6px; }
select {
    font: inherit; color: var(--text); width: 100%;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}

.status { display: inline-block; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; color: #fff; background: #9a948f; }
.status.st-contract { background: var(--accent); }
.status.st-visited { background: var(--c-pay); }
.status.st-planned { background: var(--c-ev); }
.status.st-candidate { background: var(--c-todo); }
.status.st-excluded { background: #b8b2ad; }

.compare { min-width: 100%; }
.compare th, .compare td { min-width: 150px; vertical-align: top; }
.compare td.wrap { white-space: normal; }
.compare td.pre { white-space: pre-wrap; }
.compare .sticky {
    position: sticky; left: 0; z-index: 1; background: var(--soft);
    min-width: 96px; max-width: 110px; white-space: normal; color: var(--muted); font-size: 0.8rem;
}
.compare thead .sticky { z-index: 2; }
.compare .hall-col { background: var(--card); color: var(--text); font-size: 0.9rem; }
.compare .hall-col.excluded { opacity: .5; }
.hall-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; white-space: normal; }
.hall-actions { display: flex; gap: 4px; margin-top: 6px; }
.compare td.stars { color: #e0a100; letter-spacing: 1px; }
.compare tr.custom th .remove { color: var(--muted); font-size: 1rem; margin-left: 2px; }
.add-criterion { display: flex; gap: 8px; }
.add-criterion input { flex: 1; min-width: 0; }
.add-criterion button { flex: none; }
.add-criterion-card p { margin: 8px 0 0; }

.place-list { list-style: none; margin: 8px 0; padding: 0; }
.place-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                 padding: 10px 0; border-bottom: 1px solid var(--line); }
.place-list li:last-child { border-bottom: 0; }
.search-row input { flex: 1 1 200px; }
.located { color: var(--c-pay); margin: 0; }
.add-criterion-box { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; }

.hall-map { height: 65vh; min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 8px; }
.map-popup { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.map-popup .status { align-self: flex-start; }
.popup-links { display: flex; gap: 10px; margin-top: 4px; }

/* ---------------------------------------------------------------- 휴대폰 */
@media (max-width: 640px) {
    .stats, .stats.four { grid-template-columns: 1fr 1fr; }
    .stats:not(.four) .stat.total { grid-column: span 2; }
    .cal-cell { min-height: 64px; padding: 2px; }
    .cal-entry { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }   /* 좁은 화면에선 색 막대만 */
    .cal-more { font-size: 0.65rem; padding: 0; }
}

/* ================================================================ 테마: 선분홍 꾸미기
   색은 :root 변수, 여기서는 그라데이션·그림자·분홍 테두리 같은 장식만 덧씌운다. */

/* 배경: 위쪽에 은은한 분홍빛 */
body {
    background:
        radial-gradient(900px 360px at 15% -80px, rgba(255, 196, 214, .45), transparent 70%),
        radial-gradient(800px 320px at 95% -60px, rgba(255, 214, 226, .5), transparent 70%),
        var(--bg);
    background-repeat: no-repeat;
}

/* 상단 메뉴: 반투명 흰색 + 분홍 밑줄 */
.nav {
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom-color: #f7d9e3;
}
.nav .brand { color: var(--accent-strong); letter-spacing: -0.2px; }
.tabs a.on { color: var(--accent-strong); border-bottom: 3px solid transparent; border-image: var(--accent-grad) 1; }

/* 카드류: 분홍빛 테두리 + 은은한 그림자 */
.card, .stat, .table-wrap, .cal, .memo, .month-card, .week-day, .photo-tile {
    border-color: var(--line);
    box-shadow: var(--shadow);
}
.stat { border-top: 3px solid #fbd0de; }
.stat.total { border-color: var(--accent); }
th { background: #fff9fb; }

/* 버튼: 선분홍 그라데이션 */
button.primary, .button.accent {
    background: var(--accent-grad); border: 0; color: #fff;
    box-shadow: 0 3px 10px rgba(224, 92, 134, .28);
}
button.primary:hover, .button.accent:hover { filter: brightness(1.04); }
button, .button { border-color: var(--line); }
input:focus, textarea:focus, select:focus { outline-color: #f08aac; }
button.checkbox.checked { background: var(--accent-grad); border-color: transparent; }

/* 진행률 막대 */
.progress { background: #fbe5ec; }
.progress .bar { background: var(--accent-grad); }

/* 홈: D-day 카드 */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #ffe1ea 0%, #fff4f7 55%, #ffffff 100%);
    border-color: #f8d0dd;
}
.hero::before, .hero::after {           /* 은은한 하트 장식 */
    content: "♥"; position: absolute; color: rgba(224, 92, 134, .10); pointer-events: none;
}
.hero::before { font-size: 90px; left: -10px; top: -26px; transform: rotate(-18deg); }
.hero::after { font-size: 60px; right: 6px; bottom: -18px; transform: rotate(14deg); }
.dday {
    background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
    color: transparent; font-size: 2.7rem;
}

/* 탭 모양 버튼 (체크리스트 일별/월별/전체) */
.seg-tabs { background: #fbe4ec; }
.seg-tabs a.on { color: var(--accent-strong); box-shadow: 0 2px 8px rgba(224, 92, 134, .15); }

/* 체크리스트 */
.week-day.sel { background: var(--accent-grad); border-color: transparent; }
.week-day.today { border-color: #f08aac; }
.month-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.month-card.wedding { background: linear-gradient(180deg, #fff0f5, #ffffff 60%); }
.month-hint { background: #fde9f0; color: var(--accent-strong); }
.month-jump a.current { border-color: var(--accent); color: var(--accent-strong); }
.chip { background: #fcedf2; color: #a86078; }
.held-chip { background: #eeeaeb; color: #6f6a6c; }

/* 달력: 오늘 표시 */
.cal-cell.today .cal-num { background: var(--accent-grad); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-dow { background: #fdf0f4; }

/* 홈 사진 + 칸 */
.photo-add { border-color: #f3c3d3; background: #fffafc; }
.photo-add:hover { border-color: var(--accent); color: var(--accent-strong); }

/* 메모 고정 */
.memo.pinned { border-color: #f3b3c8; background: #fff8fb; }

/* 체크박스·라디오도 분홍 */
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* 로그인 화면 */
.login-page { padding-top: 48px; }
.login-title { text-align: center; margin-bottom: 20px; }
.login-title .ring { font-size: 2.6rem; display: block; line-height: 1.2; }
.login-title h1 {
    margin: 6px 0 4px; font-size: 1.7rem;
    background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-title p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.login-title .heart { color: var(--accent); font-family: Arial, sans-serif; }
.login-page form.card { border-top: 4px solid #f7a8c1; padding: 20px; }
