/* 아정 용환 해피하우스 — 절제된 Apple 스타일 */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --field: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, .06);
  --fill: rgba(0, 0, 0, .05);
  --blue: #0071e3;
  --link: #0066cc;
  --a: #e3366b;        /* 아정 */
  --y: #0071e3;        /* 용환 */
  --both: #8e5bd8;     /* 같이 */
  --green: #1d9a50;
  --bar-goal: #0071e3;
  --bar-asset: #34c759;
  --nav: rgba(251, 251, 253, .8);
  --bubble-other: #e9e9eb;
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1d1d1f;
    --field: #2c2c2e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #86868b;
    --line: #424245;
    --hair: rgba(255, 255, 255, .08);
    --fill: rgba(255, 255, 255, .08);
    --blue: #2997ff;
    --link: #2997ff;
    --a: #ff6482;
    --y: #2997ff;
    --both: #bf5af2;
    --green: #30d158;
    --bar-goal: #2997ff;
    --bar-asset: #30d158;
    --nav: rgba(22, 22, 23, .8);
    --bubble-other: #2c2c2e;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--a); min-height: 1.4em; margin: 14px 0 0; font-size: 13px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h2 { font-size: 21px; font-weight: 600; line-height: 1.2; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -.005em; }

/* ---------- 버튼 & 입력 ---------- */
.btn {
  border: 0;
  background: var(--fill);
  color: var(--ink);
  padding: 7px 15px;
  border-radius: 980px;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .2s, opacity .2s;
}
.btn:hover { text-decoration: none; opacity: .88; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; color: var(--link); }
.btn.danger { color: #e30000; background: transparent; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn.link { background: none; color: var(--link); padding: 0; font-size: 14px; }
.btn.link:hover { text-decoration: underline; opacity: 1; }
.btn.link::after { content: "›"; margin-left: 2px; font-size: 1.15em; line-height: 1; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 13px; padding: 3px 5px; color: var(--faint); border-radius: 6px; }
.icon-btn:hover { background: var(--fill); }

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; background: var(--card); border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"] {
  width: 20px; height: 20px; flex: none; padding: 0; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; cursor: pointer; display: inline-grid; place-items: center;
}
input[type="checkbox"]:checked { background: var(--blue); border-color: var(--blue); }
input[type="checkbox"]:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: translateY(-1px) rotate(45deg); }
input[type="range"] { padding: 0; accent-color: var(--blue); background: none; border: 0; box-shadow: none; appearance: auto; -webkit-appearance: auto; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }

/* ---------- 입장 화면 ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; background: var(--bg); }
.gate-inner { width: 100%; max-width: 380px; }
.gate-house { font-size: 40px; line-height: 1; margin-bottom: 16px; }
.gate-title { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.gate-sub { font-size: 17px; color: var(--muted); margin: 10px 0 28px; line-height: 1.45; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who-card { border: 0; background: var(--card); border-radius: var(--r); padding: 22px 12px 18px; display: grid; justify-items: center; gap: 0; cursor: pointer; font: inherit; color: var(--ink); transition: transform .3s cubic-bezier(.25,.1,.25,1), box-shadow .3s; }
.who-card:hover { transform: scale(1.02); box-shadow: 0 8px 28px rgba(0,0,0,.08); }
.who-emoji { font-size: 34px; line-height: 1.2; margin-bottom: 8px; }
.who-card b { font-size: 17px; font-weight: 600; }
.who-card small { color: var(--muted); font-size: 13px; }

/* ---------- 내비게이션 ---------- */
.globalnav {
  position: sticky; top: 0; z-index: 20; isolation: isolate;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--hair);
}
/* 블러는 가상 요소에 — 헤더 자체에 걸면 모바일 하단 탭바(fixed)가 헤더에 갇혀요 */
.globalnav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.globalnav-inner { max-width: 980px; margin: 0 auto; height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--ink); font-weight: 600; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.me-btn { border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; border-radius: 980px; padding: 4px 10px 4px 6px; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.me-btn:hover { background: var(--fill); }

/* 모바일: iOS 탭바 */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hair);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { display: grid; justify-items: center; gap: 2px; padding: 7px 0 5px; color: var(--faint); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.tabs a:hover { text-decoration: none; }
.tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.active { color: var(--blue); }
.tabs a.active svg { stroke-width: 2; }

.view { max-width: 980px; margin: 0 auto; padding: 4px 16px 104px; animation: fadeUp .5s cubic-bezier(.25,.1,.25,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

@media (min-width: 820px) {
  .tabs { position: static; display: flex; gap: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; padding: 0; }
  .tabs a { display: block; padding: 0 14px; font-size: 13px; font-weight: 400; color: var(--ink); opacity: .8; }
  .tabs a:hover { opacity: 1; }
  .tabs svg { display: none; }
  .tabs a.active { color: var(--ink); opacity: 1; font-weight: 600; }
  .view { padding: 12px 22px 64px; }
}

/* ---------- 섹션 & 카드 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 36px 0 12px; }
.section-head:first-child { margin-top: 24px; }
.section-head h2 .count { color: var(--faint); font-weight: 500; margin-left: 2px; }
@media (min-width: 820px) { h2 { font-size: 24px; } }
.section-desc { margin: -4px 0 14px; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 560px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; column-gap: 14px; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--card); border-radius: var(--r); padding: 18px 20px; min-width: 0; transition: transform .35s cubic-bezier(.25,.1,.25,1), box-shadow .35s; }
.card.click { cursor: pointer; }
.card.click:hover { transform: scale(1.01); box-shadow: 0 6px 24px rgba(0, 0, 0, .07); }
.card h3 { margin-bottom: 4px; }
.empty { text-align: center; color: var(--muted); padding: 34px 20px; background: var(--card); border-radius: var(--r); line-height: 1.6; font-size: 14px; }
.empty .big { font-size: 28px; display: block; margin-bottom: 8px; }

/* ---------- 공통 요소 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--fill); color: var(--muted); white-space: nowrap; }
.chip.ajeong { color: var(--a); background: color-mix(in srgb, var(--a) 9%, transparent); }
.chip.yonghwan { color: var(--y); background: color-mix(in srgb, var(--y) 9%, transparent); }
.chip.both { color: var(--both); background: color-mix(in srgb, var(--both) 9%, transparent); }
.filter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; margin-bottom: 14px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter button { flex: none; background: var(--card); }
.filter button.on { background: var(--ink); color: var(--bg); }

.bar { height: 4px; background: var(--fill); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--bar-goal); border-radius: 4px; transition: width .8s cubic-bezier(.25,.1,.25,1); }
.bar.good > div { background: var(--bar-asset); }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.small { font-size: 13px; }
.big-num { font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pct { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 홈 ---------- */
.hero { padding: 28px 0 4px; }
.headline { font-size: 28px; font-weight: 700; letter-spacing: -.028em; line-height: 1.18; }
.subhead { font-size: 17px; color: var(--muted); margin: 6px 0 0; font-weight: 400; }
@media (min-width: 820px) { .hero { padding-top: 44px; } .headline { font-size: 40px; } .subhead { font-size: 19px; } }
.dday-list { display: flex; gap: 10px; overflow-x: auto; margin: 20px -16px 0; padding: 0 16px 4px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
.dday-list::-webkit-scrollbar { display: none; }
.dday { flex: none; width: 150px; background: var(--card); border-radius: var(--r); padding: 14px 16px; cursor: pointer; scroll-snap-align: start; display: grid; gap: 1px; transition: transform .3s cubic-bezier(.25,.1,.25,1); }
.dday:hover { transform: scale(1.02); }
.dday-emoji { font-size: 18px; line-height: 1.2; margin-bottom: 6px; }
.dday b { font-size: 22px; font-weight: 600; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dday small { font-size: 12px; color: var(--muted); }
.dday small.muted { color: var(--faint); }
.dday.add { background: transparent; border: 1px dashed var(--line); color: var(--link); align-content: center; justify-items: center; width: 110px; }
.dday.add small { color: var(--link); }
.dday-plus { font-size: 22px; font-weight: 300; line-height: 1; margin-bottom: 4px; }

/* ---------- 목표 ---------- */
.goal-card .top { display: flex; align-items: flex-start; gap: 12px; }
.goal-card .emoji { font-size: 20px; line-height: 1; width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--field); border-radius: 10px; }
.goal-card .title { font-weight: 600; font-size: 16px; letter-spacing: -.015em; line-height: 1.35; }
.goal-card.done .title { text-decoration: line-through; color: var(--muted); }
.steps { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--hair); display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.steps li.done span { text-decoration: line-through; color: var(--faint); }

/* ---------- 자산 ---------- */
.chart { width: 100%; height: 180px; display: block; }
.chart .ln { fill: none; stroke: var(--bar-asset); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .ar { fill: url(#chartFill); }
.chart .gl { stroke: var(--hair); stroke-width: 1; }
.chart .gt { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 4; }
.chart text { fill: var(--faint); font-size: 11px; font-family: inherit; }
.chart circle { fill: var(--card); stroke: var(--bar-asset); stroke-width: 2; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list td, table.list th { padding: 10px 4px; border-bottom: 1px solid var(--hair); text-align: left; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { color: var(--faint); font-size: 12px; font-weight: 500; }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--green) !important; }
.down { color: var(--a) !important; }

/* ---------- 달력 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.cal-head h2 { font-size: 21px; }
.cal-card { background: var(--card); border-radius: var(--r); padding: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--faint); font-weight: 500; padding: 4px 0 6px; }
.cal .dow:first-child, .cal .day.sun .n { color: var(--a); }
.cal .day { border-radius: 10px; min-height: 60px; padding: 4px 2px; cursor: pointer; overflow: hidden; min-width: 0; transition: background .15s; }
.cal .day:hover { background: var(--fill); }
.cal .day.out { opacity: .3; }
.cal .day .n { font-size: 13px; font-weight: 400; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 1px; font-variant-numeric: tabular-nums; }
.cal .day.today .n { background: var(--a); color: #fff !important; font-weight: 600; }
.cal .day.sel { background: var(--fill); }
.cal .ev { font-size: 10px; line-height: 1.45; border-radius: 4px; padding: 0 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.ajeong { background: color-mix(in srgb, var(--a) 12%, transparent); color: var(--a); }
.cal .ev.yonghwan { background: color-mix(in srgb, var(--y) 12%, transparent); color: var(--y); }
.cal .ev.both { background: color-mix(in srgb, var(--both) 12%, transparent); color: var(--both); }
.cal .more { font-size: 10px; color: var(--faint); text-align: center; }
@media (min-width: 640px) { .cal .day { min-height: 90px; padding: 6px; } .cal .ev { font-size: 11.5px; } }
.ev-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.ev-item:first-child { padding-top: 0; }
.ev-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ev-item .dot { width: 3px; height: 30px; border-radius: 3px; flex: none; }
.dot.ajeong { background: var(--a); } .dot.yonghwan { background: var(--y); } .dot.both { background: var(--both); }
.ev-item .time { font-variant-numeric: tabular-nums; min-width: 44px; font-size: 13px; color: var(--muted); }

/* ---------- 한마디 (메시지 앱 느낌) ---------- */
.composer { display: grid; gap: 10px; }
.composer .types { display: flex; gap: 6px; flex-wrap: wrap; }
.composer .types label input { display: none; }
.composer .types label span { display: inline-block; padding: 4px 11px; border-radius: 980px; background: var(--field); font-size: 13px; cursor: pointer; }
.composer .types label input:checked + span { background: var(--ink); color: var(--bg); }
.composer .moods { gap: 2px; }
.composer .moods label span { padding: 3px 5px; font-size: 17px; background: none; opacity: .4; transition: opacity .15s; }
.composer .moods label input:checked + span { background: var(--field); opacity: 1; }
.memo-day { margin: 24px 0 8px; font-size: 11px; font-weight: 500; color: var(--faint); text-align: center; }
.bubble-row { display: flex; margin: 3px 0; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: 78%; }
.bubble .meta { display: flex; gap: 5px; align-items: center; font-size: 11px; color: var(--faint); margin: 0 8px 2px; flex-wrap: wrap; }
.bubble .meta .chip { font-size: 10.5px; padding: 0 6px; }
.bubble-row.mine .meta { justify-content: flex-end; }
.bubble .text { white-space: pre-wrap; word-break: break-word; background: var(--bubble-other); padding: 7px 13px; border-radius: 18px; display: inline-block; font-size: 15px; line-height: 1.38; }
.bubble-row.mine .bubble { text-align: right; }
.bubble-row.mine .text { background: var(--blue); color: #fff; text-align: left; }
.bubble.resolved .text { text-decoration: line-through; opacity: .5; }
.card .bubble .text { background: var(--field); }
.card .bubble-row.mine .text { background: var(--blue); }

/* ---------- 리스트 ---------- */
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.check-item:last-child { border-bottom: 0; }
.check-item .t { flex: 1; min-width: 0; word-break: break-word; }
.check-item.done .t { text-decoration: line-through; color: var(--faint); }
.inline-add { display: flex; gap: 8px; margin-top: 10px; }
.inline-add input { flex: 1; min-width: 0; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ---------- 모달 ---------- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100vw - 24px)); background: var(--card); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.22); }
dialog[open] { animation: sheet .3s cubic-bezier(.25,.1,.25,1); }
@keyframes sheet { from { opacity: 0; transform: translateY(12px) scale(.985); } }
dialog::backdrop { background: rgba(0, 0, 0, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog form { padding: 22px 20px 18px; max-height: 86vh; overflow-y: auto; }
dialog h3 { margin-bottom: 18px; font-size: 19px; font-weight: 600; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; position: sticky; bottom: -18px; background: var(--card); padding: 10px 0; }
.spacer { flex: 1; }
.step-edit { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.step-edit input[type=text] { flex: 1; padding: 8px 11px; }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(12px); background: rgba(29, 29, 31, .92); color: #f5f5f7; padding: 10px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .3s cubic-bezier(.25,.1,.25,1); z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 820px) { .toast { bottom: 36px; } }

/* =====================================================================
   카드 시스템 — 아이콘 타일 · 굵은 제목 · 회색 설명 · 알약 칩 · 구분선 · 상태/바로가기
   (iPhone 16 Pro 402pt / iPhone Duo 바깥 화면 · 펼친 화면 기준으로 조율)
   ===================================================================== */
:root {
  --t-blue: #e8f0fc;   --t-pink: #fceaea;   --t-green: #e6f5ea;  --t-orange: #fdf0e0;
  --t-purple: #f1ebfb; --t-yellow: #fdf6d8; --t-gray: #f2f2f7;
  --chip: #f2f2f7;     --chip-ink: #48484a;
  --card-shadow: 0 1px 2px rgba(0,0,0,.03), 0 6px 22px rgba(0,0,0,.05);
  --card-border: rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --t-blue: rgba(10,132,255,.18); --t-pink: rgba(255,69,58,.16); --t-green: rgba(48,209,88,.16); --t-orange: rgba(255,159,10,.16);
    --t-purple: rgba(191,90,242,.18); --t-yellow: rgba(255,214,10,.15); --t-gray: rgba(255,255,255,.08);
    --chip: #2c2c2e; --chip-ink: #d1d1d6;
    --card-shadow: none; --card-border: rgba(255,255,255,.06);
  }
}
.tint-blue { background: var(--t-blue); } .tint-pink { background: var(--t-pink); } .tint-green { background: var(--t-green); }
.tint-orange { background: var(--t-orange); } .tint-purple { background: var(--t-purple); } .tint-yellow { background: var(--t-yellow); }
.tint-gray { background: var(--t-gray); }

/* 페이지 큰 제목 */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 26px 2px 18px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.22; }
.page-desc { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.page-head .btn { flex: none; margin-top: 4px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 4px; }

/* 카드 */
.pcard { background: var(--card); border: 1px solid var(--card-border); border-radius: 24px; padding: 22px 20px 18px; box-shadow: var(--card-shadow); min-width: 0; display: flex; flex-direction: column; transition: transform .35s cubic-bezier(.25,.1,.25,1), box-shadow .35s; }
.pcard.click { cursor: pointer; }
.pcard.click:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.03), 0 12px 32px rgba(0,0,0,.08); }
.pc-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; line-height: 1; flex: none; margin-bottom: 18px; }
.pc-icon.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; margin-bottom: 12px; }
.pc-title { font-size: 20px; font-weight: 700; letter-spacing: -.022em; line-height: 1.3; margin: 0; }
.pc-desc { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.pc-desc b { color: var(--ink); font-weight: 600; }
.pc-body { margin-top: 16px; }
.pc-sub { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pc-chip { display: inline-flex; align-items: center; gap: 3px; padding: 5px 11px; border-radius: 980px; background: var(--chip); color: var(--chip-ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--hair); }
.pc-chips + .pc-foot, .pc-body + .pc-foot, .pc-desc + .pc-foot, .pc-title + .pc-foot { margin-top: 18px; }
.pc-status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--ink); }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #34c759; }
.sdot.green { background: #34c759; } .sdot.orange { background: #ff9f0a; } .sdot.blue { background: #0a84ff; }
.sdot.red { background: #ff3b30; } .sdot.gray { background: #c7c7cc; }
.pc-link { border: 0; background: none; padding: 0; font: inherit; font-size: 15px; font-weight: 500; color: var(--link); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.pc-link:hover { text-decoration: none; opacity: .75; }
.pc-num { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.pc-num span { font-size: 14px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.pc-num.lg { font-size: 30px; margin: 4px 0 2px; }
.pc-goals { display: grid; gap: 12px; }
.pc-goal-t { font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-goal-p { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.pc-goals .bar { margin-top: 6px; }
.pcard .inline-add { margin-top: 16px; }
.pcard .bubble-row:first-child { margin-top: 0; }
.pc-summary { background: var(--card); border: 1px solid var(--card-border); border-radius: 24px; padding: 22px 20px; box-shadow: var(--card-shadow); margin-bottom: 14px; }
.pc-summary .pc-desc { margin: 0; }

.bar { height: 6px; border-radius: 6px; }
.bar > div { border-radius: 6px; }

/* 목표 카드 */
.goal-card.done .pc-title { text-decoration: line-through; color: var(--muted); }
.pcard .steps { margin-top: 14px; padding-top: 0; border-top: 0; gap: 10px; }
.pcard .steps li { font-size: 15px; }

/* D-day */
.dday-list { margin: 0 -16px 22px; padding: 2px 16px 6px; gap: 10px; }
.dday { width: 152px; border-radius: 20px; padding: 16px; border: 1px solid var(--card-border); box-shadow: var(--card-shadow); gap: 0; }
.dday-t { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dday b { font-size: 22px; font-weight: 700; margin: 2px 0; color: var(--ink); }
.dday-s { margin: 0; font-size: 12px; color: var(--faint); }
.dday.add { font: inherit; font-size: 14px; font-weight: 500; color: var(--link); background: transparent; border: 1.5px dashed var(--line); box-shadow: none; display: grid; place-content: center; justify-items: center; gap: 4px; width: 112px; cursor: pointer; }
.dday.add span { font-size: 24px; font-weight: 300; line-height: 1; }

/* 다른 페이지의 일반 카드도 같은 톤 */
.card, .cal-card, .empty { border-radius: 24px; border: 1px solid var(--card-border); box-shadow: var(--card-shadow); }
.card { padding: 20px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.home-grid { gap: 14px; }
.filter button { background: var(--chip); color: var(--chip-ink); font-weight: 500; }
.filter button.on { background: var(--ink); color: var(--bg); }

/* ---- 화면 크기별 ----
   ~559px : iPhone 16 Pro(402pt), iPhone Duo 접은 화면 — 한 줄 카드
   560~819: iPhone Duo 펼친 화면 — 두 줄 카드, 하단 탭바 유지
   820~   : PC */
@media (max-width: 380px) {
  .page-title { font-size: 26px; }
  .pcard { padding: 20px 18px 16px; }
  .pc-title { font-size: 19px; }
}
@media (min-width: 560px) and (max-width: 819px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .page-head { padding-top: 32px; }
  .page-title { font-size: 30px; }
  .dday-list { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; scroll-padding: 0 24px; }
  .tabs a { font-size: 11px; }
}
@media (min-width: 820px) {
  .page-head { padding-top: 48px; padding-bottom: 24px; }
  .page-title { font-size: 34px; }
  .page-desc { font-size: 17px; }
  .dday-list { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; scroll-padding: 0; }
  .pcard { padding: 28px 26px 22px; }
}

/* 비밀번호 단계 */
.gate-pw { display: grid; gap: 10px; justify-items: center; }
.gate-pw.hidden { display: none !important; }
.gate-pw .gate-sub { margin: 0 0 12px; }
.pw-who { display: grid; justify-items: center; gap: 2px; }
.pw-who span { width: 64px; height: 64px; border-radius: 20px; background: var(--card); display: grid; place-items: center; font-size: 32px; box-shadow: var(--card-shadow); margin-bottom: 8px; }
.pw-who b { font-size: 19px; font-weight: 700; }
.gate-pw input[type=password] { max-width: 300px; text-align: center; font-size: 17px; padding: 13px 14px; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; letter-spacing: .1em; }
.gate-pw .btn.primary { max-width: 300px; padding: 12px; font-size: 16px; font-weight: 500; border-radius: 14px; }
.gate-pw .btn.ghost { font-size: 14px; }
.gate-pw .btn:disabled { opacity: .5; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* =====================================================================
   추가 기능 화면 (가계부 · 식단 · 경조사 · 회고 · 앨범 · 전체 메뉴)
   ===================================================================== */
.month-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin: -4px 0 14px; }
.month-nav b { font-size: 17px; font-weight: 600; min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; }
.icon-round { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: var(--card-shadow); display: grid; place-items: center; flex: none; padding: 0 0 2px; }
.icon-round.sm { width: 30px; height: 30px; font-size: 18px; background: var(--field); box-shadow: none; }
.icon-round:active { transform: scale(.94); }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats3.two { grid-template-columns: 1fr 1fr; }
.stats3 p, .stats4 p { margin: 0 0 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.stats3 b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; word-break: keep-all; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stats4 b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats4 p { margin: 2px 0 0; }
@media (max-width: 380px) { .stats3 b { font-size: 15px; } }

.cat-list { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hair); }
.cat-row { display: grid; grid-template-columns: 104px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-amt { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.cat-row .bar > div { background: #ff9f0a; }

.txn-day { margin: 18px 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.card > .txn-day:first-child { margin-top: 0; }
.txn { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.txn:last-child { border-bottom: 0; }
.txn-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--field); display: grid; place-items: center; font-size: 18px; flex: none; }
.txn-t { flex: 1; min-width: 0; }
.txn-t > div:first-child { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.row-click { cursor: pointer; }
.warn { color: #ff9f0a; font-weight: 600; }
.down { font-weight: 600; }

.pill { flex: none; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 980px; white-space: nowrap; background: var(--chip); color: var(--chip-ink); }
.pill.orange { background: rgba(255, 159, 10, .15); color: #c66a00; }
.pill.red { background: rgba(255, 59, 48, .12); color: #d70015; }
@media (prefers-color-scheme: dark) { .pill.orange { color: #ffb340; } .pill.red { color: #ff6961; } }

/* 식단 */
.card.week { padding: 6px 16px; }
.week-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.week-row:last-child { border-bottom: 0; }
.week-day { width: 34px; flex: none; display: grid; justify-items: center; line-height: 1.2; }
.week-day b { font-size: 12px; color: var(--muted); font-weight: 600; }
.week-day span { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.week-row.today .week-day span { color: #fff; background: var(--a); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.week-meals { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.meal { border: 0; font: inherit; font-size: 14px; background: var(--field); color: var(--ink); padding: 6px 11px; border-radius: 10px; cursor: pointer; text-align: left; }

/* 회고 */
.rv-sec { padding: 10px 0; border-top: 1px solid var(--hair); }
.rv-sec:first-child { border-top: 0; padding-top: 0; }
.rv-sec p { margin: 0 0 3px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rv-sec div { font-size: 15px; white-space: pre-wrap; word-break: break-word; }

/* 앨범 */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 18px; overflow: hidden; }
@media (min-width: 560px) { .album-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 820px) { .album-grid { grid-template-columns: repeat(5, 1fr); } }
.ph { position: relative; border: 0; padding: 0; aspect-ratio: 1; background: var(--field); cursor: pointer; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s cubic-bezier(.25,.1,.25,1); }
.ph:hover img { transform: scale(1.04); }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 11px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-big { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 14px; background: var(--field); margin-bottom: 14px; display: block; }
.upload-btn { cursor: pointer; }

/* 홈 알림 */
.alert-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--ink); border-bottom: 1px solid var(--hair); }
.alert-row:last-child { border-bottom: 0; padding-bottom: 0; }
.alert-row:first-child { padding-top: 0; }
.alert-row:hover { text-decoration: none; }
.alert-t { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .row { flex: none; margin-top: 4px; gap: 6px; }
.page-head .row .btn { margin-top: 0; }
#fridge-form { flex-wrap: wrap; }
#fridge-form input[name=name] { flex: 1 1 100%; }
#fridge-form input[name=expiry] { max-width: none !important; flex: 1; }

/* 연속 일정: 달력에서 이어진 막대처럼 */
.cal .ev.span.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -2px; padding-left: 6px; }
.cal .ev.span.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -2px; }
@media (min-width: 640px) { .cal .ev.span.cont-l { margin-left: -6px; padding-left: 10px; } .cal .ev.span.cont-r { margin-right: -6px; } }
.cal { column-gap: 0; }
.cal .day { margin: 0 1px; }

.cal { --cellgap: 6px; }
@media (min-width: 640px) { .cal { --cellgap: 14px; } }
.cal .day { overflow: visible; }
.cal .ev.span.label { position: relative; z-index: 2; pointer-events: none; width: calc(var(--span) * 100% + (var(--span) - 1) * var(--cellgap)); }
.cal .ev.span.label.cont-l { width: calc(var(--span) * 100% + (var(--span) - 1) * var(--cellgap) + 2px); }
@media (min-width: 640px) { .cal .ev.span.label.cont-l { width: calc(var(--span) * 100% + (var(--span) - 1) * var(--cellgap) + 6px); } }
.cal .ev.span:not(.label) { visibility: hidden; } /* 제목 막대가 덮으니 자리만 차지 */

/* =====================================================================
   홈 — 한눈에 보기 (오늘 일정 → 7일 → 챙길 것 → 숫자 위젯 → 한마디)
   ===================================================================== */
.home-head { padding: 22px 2px 14px; }
.home-head .eyebrow { margin-bottom: 2px; }
.home-layout { display: grid; gap: 12px; }
.home-col { display: grid; gap: 12px; align-content: start; min-width: 0; }
@media (min-width: 560px) { .home-layout { grid-template-columns: 1.15fr 1fr; align-items: start; } }

.hcard { background: var(--card); border: 1px solid var(--card-border); border-radius: 22px; padding: 16px 18px 18px; box-shadow: var(--card-shadow); min-width: 0; }
.h-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.h-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.h-head h2 .count { color: var(--faint); font-weight: 500; margin-left: 2px; }
.h-more { font-size: 14px; color: var(--link); }
.h-empty { margin: 2px 0 0; font-size: 15px; color: var(--muted); }

/* 오늘 일정 타임라인 */
.today-card { padding-bottom: 14px; }
.tl { display: grid; }
.tl-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.tl-item:first-child { padding-top: 2px; }
.tl-item:last-child { border-bottom: 0; }
.tl-time { width: 50px; flex: none; display: grid; line-height: 1.2; }
.tl-time b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-time small { font-size: 11px; color: var(--faint); }
.tl-bar { width: 4px; align-self: stretch; min-height: 34px; border-radius: 4px; flex: none; }
.tl-bar.ajeong { background: var(--a); } .tl-bar.yonghwan { background: var(--y); } .tl-bar.both { background: var(--both); }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 16px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--field); color: var(--ink); font-size: 14px; }
.meal-line:hover { text-decoration: none; }
.meal-line .sep { color: var(--faint); }

/* 앞으로 7일 */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 -4px; }
.ws-day { border: 0; background: none; font: inherit; color: var(--ink); display: grid; justify-items: center; gap: 3px; padding: 6px 0 7px; border-radius: 12px; cursor: pointer; }
.ws-day:hover { background: var(--fill); }
.ws-dow { font-size: 11px; font-weight: 600; color: var(--faint); }
.ws-day.sun .ws-dow { color: var(--a); } .ws-day.sat .ws-dow { color: var(--y); }
.ws-n { font-size: 17px; font-weight: 600; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.ws-day.today .ws-n { background: var(--ink); color: var(--bg); }
.ws-day.today .ws-dow { color: var(--ink); }
.ws-dots { display: flex; gap: 3px; height: 5px; }
.ws-dots i { width: 5px; height: 5px; border-radius: 50%; }
.ws-dots i.ajeong, .dot-s.ajeong { background: var(--a); } .ws-dots i.yonghwan, .dot-s.yonghwan { background: var(--y); } .ws-dots i.both, .dot-s.both { background: var(--both); }
.up-list { margin-top: 10px; border-top: 1px solid var(--hair); padding-top: 4px; }
.up-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; font-size: 15px; }
.up-date { width: 62px; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot-s { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.up-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-t small { color: var(--faint); }
.up-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 챙길 것들 */
.hcard .alert-row { padding: 9px 0; }
.hcard .alert-row .txn-ico { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.chev { color: var(--faint); font-size: 18px; }

/* 숫자 위젯 2x2 */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.widget { border: 1px solid var(--card-border); background: var(--card); box-shadow: var(--card-shadow); border-radius: 22px; padding: 14px 16px 15px; display: grid; gap: 2px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; min-width: 0; transition: transform .25s cubic-bezier(.25,.1,.25,1); }
.widget:active { transform: scale(.97); }
.w-top { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-ico { font-size: 15px; }
.w-val { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-val.green { color: #1d9a50; } .w-val.blue { color: var(--blue); } .w-val.pink { color: var(--a); }
@media (prefers-color-scheme: dark) { .w-val.green { color: #30d158; } }
.w-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 한마디 */
.memo-mini { margin-bottom: 10px; }
.memo-mini .bubble .text { background: var(--field); }
.memo-mini .bubble-row.mine .text { background: var(--blue); }
.hcard .inline-add { margin-top: 0; }

/* =====================================================================
   홈 꾸미기 — 큰 칸(L)은 한 줄, 작은 칸(S)은 반 칸. 꾹 누르면 편집(흔들림)
   ===================================================================== */
.hgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; grid-auto-flow: row dense; align-items: start; min-height: 120px; }
.hb { position: relative; min-width: 0; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.hb.L { grid-column: span 2; }
.hb.S { grid-column: span 1; }
.hb .widget { width: 100%; height: 100%; }
@media (min-width: 560px) { .hgrid { grid-template-columns: repeat(4, 1fr); } }
.w-val.sm { font-size: 19px; margin-top: 10px; }
.w-val.orange { color: #ff9f0a; }
.album-grid.mini { grid-template-columns: repeat(3, 1fr); border-radius: 14px; }

.home-space { text-align: center; font-size: 12px; color: var(--faint); padding: 22px 0 8px; min-height: 80px; cursor: pointer; }

/* 편집 모드 */
.edit-bar { position: sticky; top: calc(49px + env(safe-area-inset-top)); z-index: 15; display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 8px 8px 16px; border-radius: 980px; background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 4px 20px rgba(0,0,0,.08); border: 1px solid var(--card-border); }
.edit-bar span { flex: 1; font-size: 14px; font-weight: 600; }
.hgrid.editing .hb-inner { pointer-events: none; }
.hb.jiggle .hb-inner { animation: jiggle .32s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.08s); }
@keyframes jiggle { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
@media (prefers-reduced-motion: reduce) { .hb.jiggle .hb-inner { animation: none; } }
.hb-del { position: absolute; top: -7px; left: -7px; z-index: 5; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #8e8e93; color: #fff; font-size: 20px; font-weight: 600; line-height: 1; display: grid; place-items: center; padding: 0 0 2px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.hb-move { position: absolute; top: -7px; right: -4px; z-index: 5; display: flex; gap: 4px; }
.hb-move button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font-size: 17px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.hb-add { grid-column: span 2; min-height: 88px; border: 1.5px dashed var(--line); border-radius: 22px; background: transparent; color: var(--link); font: inherit; font-size: 15px; font-weight: 500; display: grid; place-content: center; justify-items: center; gap: 2px; cursor: pointer; }
.hb-add span { font-size: 26px; font-weight: 300; line-height: 1; }

/* 추가 시트 */
.sheet-list { display: grid; }
.sheet-item { display: flex; align-items: center; gap: 12px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; padding: 10px 2px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.sheet-item:last-child { border-bottom: 0; }
.sheet-item:active { opacity: .6; }
.sheet-t { flex: 1; min-width: 0; display: grid; }
.sheet-t b { font-size: 15px; font-weight: 600; }
.sheet-t small { font-size: 13px; color: var(--muted); }
.sheet-plus { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 17px; flex: none; }

/* =====================================================================
   인생 목표 — 나무길 타임라인 (흙길 + 나무 + 해마다 이정표)
   ===================================================================== */
:root { --path: #eadfca; --path-edge: #dccfb4; --leaf: #34c759; --leaf-soft: #e3f5e7; --bark: #a08a6a; }
@media (prefers-color-scheme: dark) { :root { --path: #3a3226; --path-edge: #4a4030; --leaf: #30d158; --leaf-soft: rgba(48,209,88,.14); --bark: #8c7a5e; } }

.trail-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.trail-sum span { font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 980px; background: var(--card); border: 1px solid var(--card-border); color: var(--chip-ink); }

.trail { position: relative; padding: 6px 0 10px 64px; }
/* 흙길 */
.trail::before { content: ""; position: absolute; left: 30px; top: 22px; bottom: 26px; width: 14px; border-radius: 14px;
  background: var(--path); box-shadow: inset 2px 0 0 var(--path-edge), inset -2px 0 0 var(--path-edge); }
/* 길 가운데 발자국 점선 */
.trail::after { content: ""; position: absolute; left: 36px; top: 30px; bottom: 34px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--bark) 0 5px, transparent 5px 13px); opacity: .45; }
.trail-start, .trail-end { position: relative; z-index: 1; margin-left: -62px; width: 88px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.trail-start { margin-bottom: 14px; }
.trail-end { margin-top: 6px; font-size: 14px; color: var(--ink); }

.ty { position: relative; padding: 4px 0 26px; }
.ty-tree { position: absolute; left: -66px; top: 2px; font-size: 22px; line-height: 1; filter: saturate(.9); }
.ty:nth-of-type(even) .ty-tree { left: -62px; top: 30px; font-size: 18px; }
.ty-node { position: absolute; left: -38px; top: 8px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 3px solid var(--bark); display: grid; place-items: center; font-size: 12px; }
.ty.now .ty-node { width: 30px; height: 30px; left: -42px; top: 4px; border-color: var(--leaf); background: var(--leaf-soft); font-size: 15px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--leaf) 15%, transparent); }
.ty.past { opacity: .55; }

.ty-head { margin-bottom: 10px; }
.ty-year { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.ty.now .ty-year { color: var(--green); }
.ty-here { font-size: 12px; font-weight: 700; letter-spacing: 0; color: #fff; background: var(--leaf); padding: 3px 9px; border-radius: 980px; }
.ty-ages { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--muted); }
.ty-ages .ajeong { color: var(--a); } .ty-ages .yonghwan { color: var(--y); }
.ty-ms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ty-ms span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 980px; background: var(--t-yellow); color: #9a6b00; }
@media (prefers-color-scheme: dark) { .ty-ms span { color: #ffd60a; } }

.ty-goals { display: grid; gap: 10px; }
@media (min-width: 560px) { .ty-goals { grid-template-columns: 1fr 1fr; } .ty-plant { grid-column: 1 / -1; } }
.tg { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 14px 14px 14px 16px; box-shadow: var(--card-shadow); min-width: 0; }
.tg-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.tg-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; flex: none; }
.tg-main { flex: 1; min-width: 0; }
.tg-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; line-height: 1.35; }
.tg-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tg-date { font-size: 12px; color: var(--faint); }
.tg-why { margin: -2px 0 10px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.tg .steps { margin-top: 10px; gap: 7px; }
.tg .steps li { font-size: 14px; }
.tg.done { background: var(--leaf-soft); border-color: transparent; box-shadow: none; }
.tg.done .tg-title { color: var(--muted); }
.tg-done { font-size: 14px; font-weight: 700; color: var(--green); }
.ty-plant { border: 1.5px dashed var(--path-edge); background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; border-radius: 14px; padding: 10px; cursor: pointer; text-align: center; }
.ty-plant:hover { color: var(--green); border-color: var(--leaf); }
.ty.ty-empty .ty-plant { padding: 8px; }
.ty.someday .ty-year { font-size: 22px; color: var(--both); }
.ty.someday .ty-node { border-color: var(--both); }

/* 목표 한 줄 버전 */
.ty-goals { grid-template-columns: 1fr !important; gap: 8px; }
.tg-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 14px 0 9px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card); box-shadow: var(--card-shadow); font: inherit; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; }
.tg-row:active { transform: scale(.99); }
.tg-row .tg-ico { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.tg-row .tg-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.tg-who { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.tg-who.ajeong { color: var(--a); background: color-mix(in srgb, var(--a) 10%, transparent); }
.tg-who.yonghwan { color: var(--y); background: color-mix(in srgb, var(--y) 10%, transparent); }
.tg-who.both { color: var(--both); background: color-mix(in srgb, var(--both) 10%, transparent); }
.tg-pct { flex: none; min-width: 34px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.tg-pct small { font-size: 12px; color: var(--muted); font-weight: 600; }
.tg-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--fill); }
.tg-bar i { display: block; height: 100%; background: var(--bar-goal); }
.tg-row.done { background: var(--leaf-soft); border-color: transparent; box-shadow: none; }
.tg-row.done .tg-title { color: var(--muted); text-decoration: line-through; }
.ty-plant { padding: 8px; font-size: 13px; border-radius: 12px; }
