/* 글꼴: 인터넷 없이도 보이도록 파일을 직접 보관 (Pretendard, SIL OFL 1.1 라이선스 → fonts/ 폴더에 라이선스 파일 포함) */
@font-face {
  font-family: "Pretendard";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations"), url("../fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920; font-style: normal; font-display: swap;
}

/* ===== 디자인 토큰 (색·간격·모서리·그림자) =====
   테마: a(유자 눈꽃, 기본) / b(하카타 야경) / c(온천 안개)
   모드: 라이트 / 다크 (기기 설정을 따르고, 설정에서 직접 고를 수도 있음) */

:root {
  --font: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --r-sm: 12px; --r-md: 20px; --r-lg: 28px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 24px; --fs-2xl: 44px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabbar-h: 64px;
}

/* 테마 A: 유자 눈꽃 (--on-accent = 포인트색 위에 올리는 글자색) */
:root, [data-theme="a"] {
  --on-accent: #2B1808;
  --bg: #FBF7F0; --surface: #FFFFFF; --text: #2B2A28; --muted: #8C857A; --line: #F0E9DD;
  --accent: #E8975F; --accent-soft: #FCE7D6; --accent-text: #B3622C;
  --hero: linear-gradient(160deg, #F7C9A3, #F0A877); --hero-text: #4A2A12;
  --shadow: 0 4px 16px rgba(120, 90, 50, .08); --sidebar: #F5EEE2;
}
[data-theme="a"][data-mode="dark"] {
  --bg: #1D1B19; --surface: #2A2724; --text: #F3EEE6; --muted: #A59D90; --line: #3A3631;
  --accent: #F0A877; --accent-soft: #4A3626; --accent-text: #F7C9A3;
  --hero: linear-gradient(160deg, #6B4528, #4E3320); --hero-text: #FBEBDD;
  --shadow: 0 4px 16px rgba(0, 0, 0, .35); --sidebar: #242120;
}

/* 테마 B: 하카타 야경 */
[data-theme="b"] {
  --on-accent: #2B1808;
  --bg: #F4F1EC; --surface: #FFFFFF; --text: #1B2236; --muted: #7C8499; --line: #E6E1D8;
  --accent: #D9972E; --accent-soft: #F8E7C8; --accent-text: #8F5E10;
  --hero: linear-gradient(160deg, #2D3E73, #1C2848); --hero-text: #FFFFFF;
  --shadow: 0 4px 16px rgba(30, 40, 70, .1); --sidebar: #ECE7DE;
}
[data-theme="b"][data-mode="dark"] {
  --bg: #0F1626; --surface: #182036; --text: #EDEFF5; --muted: #8B94AB; --line: #243049;
  --accent: #F2B45A; --accent-soft: #3A3020; --accent-text: #F2B45A;
  --hero: linear-gradient(160deg, #22305A, #16213F); --hero-text: #FFFFFF;
  --shadow: 0 4px 16px rgba(0, 0, 0, .3); --sidebar: #131B2E;
}

/* 테마 C: 온천 안개 */
[data-theme="c"] {
  --on-accent: #10261E;
  --bg: #F3F5F6; --surface: #FFFFFF; --text: #1F2527; --muted: #7D898D; --line: #E8ECEE;
  --accent: #6FA592; --accent-soft: #DDEDE6; --accent-text: #3D7561;
  --hero: #FFFFFF; --hero-text: #1F2527;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06); --sidebar: #EAEEF0;
}
[data-theme="c"][data-mode="dark"] {
  --bg: #14191B; --surface: #1C2326; --text: #EAF0F1; --muted: #8A989D; --line: #2A3336;
  --accent: #8FB8A8; --accent-soft: #243630; --accent-text: #A9D0C0;
  --hero: #1C2326; --hero-text: #EAF0F1;
  --shadow: none; --sidebar: #181E20;
}

/* ===== 기본 ===== */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.5;
  color: var(--text); background: var(--bg);
  padding-top: env(safe-area-inset-top);
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; } /* 다른 display 스타일이 있어도 hidden 이면 항상 숨김 */

/* ===== 앱 틀: 모바일은 하단 탭, PC는 왼쪽 사이드바 ===== */
.app { min-height: 100dvh; }
.nav {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around;
  padding: var(--s-2) var(--s-2) calc(var(--s-2) + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.nav-brand { display: none; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px; min-height: 48px; padding: 4px 8px; justify-content: center;
  font-size: 11px; color: var(--muted); border-radius: var(--r-sm);
  transition: color .2s var(--ease);
}
.nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item[aria-current="page"] { color: var(--accent); }

.main { padding: var(--s-5) var(--s-4) calc(var(--tabbar-h) + var(--s-6) + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.view[hidden] { display: none; }
.view { animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== 공통 부품 ===== */
.eyebrow { font-size: var(--fs-sm); color: var(--muted); }
.title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; margin-bottom: var(--s-4); }
.section { display: flex; justify-content: space-between; align-items: baseline; margin: var(--s-5) 2px var(--s-3); font-size: 14px; font-weight: 700; }
.section span { font-weight: 500; font-size: var(--fs-xs); color: var(--muted); }
.card { background: var(--surface); border-radius: var(--r-md); padding: var(--s-4); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s-3); }
.hero { background: var(--hero); color: var(--hero-text); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow); }
[data-theme="c"] .hero { border: 1px solid var(--line); }
[data-theme="c"] .dday { color: var(--accent); }
.grid > .hero { margin-bottom: var(--s-3); }
.hero small { font-size: var(--fs-xs); opacity: .8; }
.dday { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px; }
.hero .meta { font-size: var(--fs-xs); opacity: .85; }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.chip {
  min-height: 44px; padding: 0 var(--s-4); border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); font-size: var(--fs-sm);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }

/* ===== PC (넓은 화면) ===== */
@media (min-width: 900px) {
  .nav {
    top: 0; right: auto; bottom: 0; width: 220px; flex-direction: column; justify-content: flex-start; gap: var(--s-1);
    padding: var(--s-5) var(--s-3); background: var(--sidebar); border-top: 0;
  }
  .nav-brand { display: block; font-size: var(--fs-lg); font-weight: 700; padding: 0 var(--s-3) var(--s-4); letter-spacing: -.02em; }
  .nav-item { flex-direction: row; gap: var(--s-3); width: 100%; font-size: var(--fs-md); padding: 0 var(--s-3); justify-content: flex-start; min-height: 44px; }
  .nav-item:hover { background: var(--surface); }
  .nav-item[aria-current="page"] { background: var(--surface); color: var(--accent-text); font-weight: 600; }
  .main { margin: 0 0 0 220px; max-width: none; padding: var(--s-6) var(--s-6) var(--s-6); }
  .grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s-4); align-items: start; max-width: 1000px; }
  .grid .card + .card { margin-top: var(--s-3); }
  .grid > .hero { margin-bottom: 0; }
}

/* ===== 일정 ===== */
.daytabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--s-4) * -1); padding: 0 var(--s-4) 2px; scrollbar-width: none; }
.daytabs::-webkit-scrollbar { display: none; }
.daytabs .chip { flex: none; }
.timeline { padding-top: var(--s-2); padding-bottom: var(--s-2); }
.ev { display: flex; gap: var(--s-3); padding: var(--s-3) 0; }
.ev + .ev { border-top: 1px solid var(--line); }
.ev-time { width: 56px; flex: none; font-size: var(--fs-sm); color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
.ev-body { min-width: 0; flex: 1; }
.ev-title { font-weight: 600; }
.tag { display: inline-block; margin-left: var(--s-2); padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--accent-soft); color: var(--accent-text); vertical-align: 1px; }
.maplink { display: inline-flex; align-items: center; min-height: 36px; margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--accent-text); text-decoration: none; font-weight: 600; }
.home-sched { margin-top: var(--s-2); }
.mini-ev { display: flex; gap: var(--s-3); font-size: var(--fs-sm); padding: 3px 0; }
.mini-time { width: 44px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== 비용 ===== */
.rate { display: grid; gap: var(--s-3); }
.rate-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.rate-val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.rate-conv { display: flex; align-items: center; gap: var(--s-2); background: var(--bg); border-radius: var(--r-sm); padding: 0 var(--s-3); min-height: 52px; }
.rate-conv input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; min-height: 48px; }
.rate-conv b { font-variant-numeric: tabular-nums; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-3); }
.summary .mini { background: var(--surface); border-radius: var(--r-md); padding: var(--s-4); box-shadow: var(--shadow); }
.summary .mini small { display: block; margin-bottom: 2px; }
.summary .mini b { font-size: var(--fs-lg); letter-spacing: -.02em; }
/* E티켓 */
.offline-card[data-state="ok"] b { color: var(--accent-text); }
.offline-card p { margin-top: 2px; }
.ticket { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left; margin-top: var(--s-2); min-height: 72px; transition: transform .15s var(--ease); }
.ticket:active { transform: scale(.985); }
.ticket-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.ticket-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ticket-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ticket-title { font-weight: 600; }
.ticket-sub { overflow-wrap: anywhere; }
.chev { color: var(--muted); font-size: 24px; flex: none; }
dialog.viewer {
  border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  background: #fff; color: #111; /* 티켓 화면은 라이트·다크와 상관없이 항상 흰 배경, 높은 대비 */
}
dialog.viewer[open] { display: flex; flex-direction: column; animation: fade .2s var(--ease); }
dialog.viewer::backdrop { background: #fff; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: calc(var(--s-2) + env(safe-area-inset-top)) var(--s-4) var(--s-2); border-bottom: 1px solid #e5e5e5; }
.viewer-bar b { font-size: var(--fs-md); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-tools { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.zoom { display: flex; background: #f1f1f1; border-radius: 999px; padding: 3px; gap: 2px; }
.zoom button { min-width: 44px; min-height: 40px; border-radius: 999px; font-size: var(--fs-sm); color: #444; }
.zoom button[aria-pressed="true"] { background: #111; color: #fff; font-weight: 700; }
.viewer-close { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #111; }
.viewer-close svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.viewer-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: #fff; }
.viewer-scroll img { display: block; width: 100%; height: auto; max-width: none; }
.viewer-tip { margin: 0; padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom)); font-size: var(--fs-xs); color: #555; background: #fafafa; border-top: 1px solid #e5e5e5; }

/* 내 지출 */
.who-chips { margin: 0 0 var(--s-3); }
.cat-row + .cat-row { margin-top: var(--s-3); }
.cat-row .bar { margin: var(--s-2) 0 0; }
.cat-amt b { font-variant-numeric: tabular-nums; }
.date-head.exp-head { align-items: baseline; }
#mine-flow { margin-top: 0; }
#mine-flow .mini { min-width: 0; }
#mine-flow .mini b { font-size: var(--fs-md); }

/* 정산 */
.top-seg { margin-bottom: var(--s-4); max-width: 420px; }
.settle-hero { padding: var(--s-5); }
.settle-big { font-size: 34px; }
.settle-hero .meta + .meta { margin-top: 2px; }
.route { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.route-main { min-width: 0; }
.route-main b { font-size: var(--fs-lg); letter-spacing: -.02em; }
.route-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); flex: none; }
.route-amt { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.person { margin-top: var(--s-2); }
.person.me { outline: 2px solid var(--accent-soft); }
.net { font-variant-numeric: tabular-nums; }
.net.pos { color: var(--accent-text); }
.net.neg { color: #B5483A; }
[data-mode="dark"] .net.neg { color: #FF9A8A; }
.net.zero { color: var(--muted); font-weight: 600; }
.tr { margin-top: var(--s-2); }
.danger-chip { margin-top: var(--s-2); color: #B5483A; min-height: 36px; font-size: var(--fs-xs); }
[data-mode="dark"] .danger-chip { color: #FF9A8A; }
.hint-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: calc(var(--s-2) * -1) 0 var(--s-4); }
.hint-row .chip { flex: none; }
.field select { width: 100%; min-height: 48px; padding: 0 var(--s-4); border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.home-link { display: block; color: inherit; text-decoration: none; }
.home-big { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; margin-top: var(--s-2); }
.home-link .muted { margin-top: 2px; }
.tag.estimate { background: none; border: 1px dashed var(--accent); color: var(--accent-text); margin-left: var(--s-2); }
.note-wide { grid-column: 1 / -1; }
.estimate-note { margin-top: var(--s-2); padding: var(--s-3); border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); }
#view-money { padding-bottom: 72px; } /* 떠 있는 '비용 추가' 버튼이 마지막 카드를 가리지 않게 */
.date-head { margin: var(--s-4) 2px var(--s-2); font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.exp { display: block; width: 100%; text-align: left; margin-top: var(--s-2); transition: transform .15s var(--ease); }
.exp:active { transform: scale(.985); }
.exp-head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: flex-start; }
.exp-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.exp-amt { text-align: right; flex: none; }
.exp-amt b { display: block; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--line); margin: var(--s-3) 0 var(--s-1); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.prog.done { color: var(--accent-text); font-weight: 600; }
.pad { margin-top: var(--s-2); }
.d-sum { margin-bottom: var(--s-2); }
.d-big { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.row { display: flex; justify-content: space-between; padding: var(--s-2) 0; }
.row + .row { border-top: 1px solid var(--line); }

.fab {
  position: fixed; z-index: 9; right: var(--s-4); bottom: calc(var(--tabbar-h) + var(--s-4) + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 52px; padding: 0 var(--s-5);
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); transition: transform .15s var(--ease);
}
.fab:active { transform: scale(.96); }
.fab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

/* ===== 입력 창 (모바일: 아래에서 올라오는 시트 / PC: 가운데 창) ===== */
dialog.sheet {
  border: 0; padding: 0; color: var(--text); background: var(--bg);
  width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow-y: auto; box-shadow: 0 -8px 40px rgba(0, 0, 0, .2);
}
dialog.sheet[open] { animation: sheet-up .28s var(--ease); }
dialog.sheet::backdrop { background: rgba(20, 16, 12, .45); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.sheet > form, dialog.sheet > div { padding-left: var(--s-5); padding-right: var(--s-5); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1; background: var(--bg); padding-top: var(--s-4); padding-bottom: var(--s-3); font-size: var(--fs-lg); }
#expense-form .sheet-head { margin: 0 calc(var(--s-5) * -1); padding-left: var(--s-5); padding-right: var(--s-5); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.field { display: block; margin-bottom: var(--s-4); }
.field > span { display: block; font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s-2); font-weight: 600; }
.field input, .rate-conv input {
  width: 100%; min-height: 48px; padding: 0 var(--s-4); border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field .chips { margin-top: 0; }
.field .chips + .chips, .seg + .chips, .seg ~ #f-custom, .seg ~ small { margin-top: var(--s-3); }
.inline { display: flex; gap: var(--s-2); align-items: center; }
.inline input { flex: 1; min-width: 0; }
.inline .chip { flex: none; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 42px; border-radius: 999px; font-size: var(--fs-sm); color: var(--muted); transition: background .2s var(--ease), color .2s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.crow { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.crow span { width: 56px; flex: none; }
.crow input { flex: 1; }
.error { color: #C0392B; font-size: var(--fs-sm); margin-bottom: var(--s-3); }
[data-mode="dark"] .error { color: #FF8A7A; }
.sheet-actions { display: flex; gap: var(--s-3); position: sticky; bottom: 0; background: var(--bg); padding-top: var(--s-3); padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom)); }
.sheet-actions p { margin: 0; }
#expense-form .sheet-actions { margin: 0 calc(var(--s-5) * -1); padding-left: var(--s-5); padding-right: var(--s-5); }
.btn { flex: 1; min-height: 52px; border-radius: var(--r-sm); font-weight: 700; transition: transform .15s var(--ease), opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); }
.btn.danger { color: #C0392B; }
[data-mode="dark"] .btn.danger { color: #FF8A7A; }
#d-body { padding-bottom: var(--s-2); }

@media (min-width: 900px) {
  .fab { bottom: var(--s-6); right: var(--s-6); }
  dialog.sheet { margin: auto; border-radius: var(--r-lg); box-shadow: 0 24px 80px rgba(0, 0, 0, .3); }
  #money-list-wrap, #expense-list { max-width: 720px; }
  #pane-list, #pane-settle, #pane-mine, #money-seg { max-width: 720px; } /* PC에서도 읽기 좋은 폭 */
}

@media (prefers-reduced-motion: reduce) { .view { animation: none; } * { transition: none !important; } }

/* 티켓 잠금 */
.ticket.locked .ticket-icon { background: var(--line); color: var(--muted); }
.ticket.locked .ticket-title { color: var(--text); }
.lock-tag { flex: none; margin-left: 0; }
#ticket-admin .row { align-items: center; gap: var(--s-3); }
#ticket-admin .row span { min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); }
#ticket-admin .danger-chip { margin-top: 0; flex: none; }
#ticket-admin input[type="file"] { padding: var(--s-3) var(--s-4); min-height: 48px; }
#adm-msg:empty { display: none; }

/* 일정 편집 */
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.title-row .chip { flex: none; margin-top: 2px; }
.day-title-edit { margin: calc(var(--s-1) * -1) 0 var(--s-3); }
.day-title-edit input { flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--s-4); border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.ev-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.ev-actions .chip { min-height: 36px; font-size: var(--fs-xs); margin-top: 0; }
#sch-form .sheet-head, #sch-form .sheet-actions { margin-left: calc(var(--s-5) * -1); margin-right: calc(var(--s-5) * -1); padding-left: var(--s-5); padding-right: var(--s-5); }

#view-schedule { padding-bottom: 72px; } /* 떠 있는 "일정 추가" 버튼이 마지막 일정을 가리지 않게 */

/* 더보기 메뉴, 하위 화면 */
.back { display: inline-flex; align-items: center; min-height: 44px; margin: calc(var(--s-2) * -1) 0 var(--s-1); color: var(--muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; }
.menu { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.menu-item { display: flex; align-items: center; gap: var(--s-3); color: inherit; text-decoration: none; min-height: 72px; transition: transform .15s var(--ease); }
.menu-item + .menu-item { margin-top: 0; }
.menu-item:active { transform: scale(.985); }
.menu-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.menu-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* 일본어 카드 */
:root { --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Noto Sans JP", sans-serif; }
[lang="ja"] { font-family: var(--font-ja); }
.place { margin-top: var(--s-3); }
.place-ja { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; margin-top: 2px; }
.place-addr { margin-top: var(--s-1); }
.place-sentence { margin-top: var(--s-3); }
.place-actions { display: flex; gap: var(--s-2); align-items: center; margin-top: var(--s-3); flex-wrap: wrap; }
.place-actions .btn { flex: 1; min-width: 160px; }
.place-actions .chip { display: inline-flex; align-items: center; text-decoration: none; }
.phrase-card { padding-top: var(--s-1); padding-bottom: var(--s-1); }
.phrase { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: var(--s-3) 0; min-height: 64px; }
.phrase + .phrase { border-top: 1px solid var(--line); }
.phrase-ko { font-size: var(--fs-sm); color: var(--muted); }
.phrase-ja { font-size: 19px; font-weight: 700; line-height: 1.4; }
.phrase-read { font-size: var(--fs-xs); }
dialog.show { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; background: #fff; color: #111; }
dialog.show[open] { display: flex; flex-direction: column; animation: fade .2s var(--ease); }
dialog.show::backdrop { background: #fff; }
.show-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--s-5); padding: calc(var(--s-6) + env(safe-area-inset-top)) var(--s-5) var(--s-4); text-align: center; overflow: auto; }
.show-body p { margin: 0; overflow-wrap: anywhere; }
.show-big { font-size: clamp(30px, 9vw, 64px); font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.show-mid { font-size: clamp(22px, 6vw, 40px); font-weight: 700; line-height: 1.4; }
.show-small { font-size: var(--fs-md); color: #555; }
.show-close { margin: 0 var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom)); flex: none; width: auto; color: #111; border-color: #ddd; background: #f5f5f5; }

/* 준비물 */
.pk-team { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.pk-member { background: var(--surface); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); font-size: var(--fs-sm); }
.pk-member.me { outline: 2px solid var(--accent-soft); }
.pk-member b { font-variant-numeric: tabular-nums; }
.pk-card { padding-top: var(--s-1); padding-bottom: var(--s-1); }
.pk-row { display: flex; align-items: center; gap: var(--s-2); }
.pk-row + .pk-row { border-top: 1px solid var(--line); }
.pk-check { display: flex; align-items: center; gap: var(--s-3); flex: 1; min-width: 0; text-align: left; min-height: 56px; padding: var(--s-2) 0; }
.chk { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); background: var(--bg); display: grid; place-items: center; flex: none; transition: background .2s var(--ease), border-color .2s var(--ease); }
.chk svg { width: 18px; height: 18px; stroke: var(--on-accent); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--ease); }
.pk-check[aria-checked="true"] .chk { background: var(--accent); border-color: var(--accent); }
.pk-check[aria-checked="true"] .chk svg { opacity: 1; transform: none; }
.pk-check[aria-checked="true"] .pk-title { color: var(--muted); text-decoration: line-through; }
.pk-text { display: flex; flex-direction: column; min-width: 0; }
.pk-title { font-weight: 600; overflow-wrap: anywhere; }
.pk-note { font-size: var(--fs-xs); }
.pk-row .danger-chip { margin-top: 0; flex: none; }
#view-packing { padding-bottom: 72px; }
#pk-form .sheet-head, #pk-form .sheet-actions { margin-left: calc(var(--s-5) * -1); margin-right: calc(var(--s-5) * -1); padding-left: var(--s-5); padding-right: var(--s-5); }

a.chip { color: inherit; text-decoration: none; } /* 링크 모양 버튼도 다른 버튼과 같은 글자색 */

/* 쇼핑·연락처·맛집 */
.sh-rate { display: block; margin-top: 2px; }
.contact-card { padding-top: var(--s-1); padding-bottom: var(--s-1); }
.contact { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; }
.contact + .contact { border-top: 1px solid var(--line); }
.contact-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-main b { font-size: var(--fs-md); }
.contact-phone { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.contact-main .muted { font-size: var(--fs-xs); }
.contact-actions { display: flex; gap: var(--s-2); align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.contact-actions .chip { display: inline-flex; align-items: center; min-height: 44px; }
.contact-actions .danger-chip { margin-top: 0; }
#view-contacts, #view-shopping, #view-food { padding-bottom: 72px; }
.food { margin-top: var(--s-2); }
.food-reserve { margin-top: var(--s-1); color: var(--accent-text); font-weight: 600; }
.food-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: var(--s-1); }
.food-skipped .exp-title { color: var(--muted); text-decoration: line-through; }
.status { flex: none; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--line); color: var(--muted); }
.status-reserved { background: var(--accent); color: var(--on-accent); }
.status-wishlist { background: var(--accent-soft); color: var(--accent-text); }
.status-visited { background: none; border: 1px solid var(--accent); color: var(--accent-text); }
#sh-form .sheet-head, #sh-form .sheet-actions, #ct-form .sheet-head, #ct-form .sheet-actions, #fd-form .sheet-head, #fd-form .sheet-actions { margin-left: calc(var(--s-5) * -1); margin-right: calc(var(--s-5) * -1); padding-left: var(--s-5); padding-right: var(--s-5); }
.pk-check:disabled { opacity: .55; }

/* 비용 마감 */
.dl { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.dl-badge { flex: none; width: 76px; text-align: center; padding: var(--s-2) 0; border-radius: var(--r-sm); font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.02em; background: var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-urgent .dl-badge { background: var(--accent); color: var(--on-accent); }
.dl-soon .dl-badge { background: var(--accent-soft); color: var(--accent-text); }
.dl-past .dl-badge { background: none; border: 1px dashed var(--muted); color: var(--muted); font-size: var(--fs-sm); }
.dl-done .dl-title { color: var(--muted); text-decoration: line-through; }
.dl-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dl-title { overflow-wrap: anywhere; }
.dl-note { font-size: var(--fs-xs); }
.dl-check { flex: none; width: 44px; min-height: 44px; justify-content: center; }
#view-deadlines { padding-bottom: 72px; }
#dl-form .sheet-head, #dl-form .sheet-actions { margin-left: calc(var(--s-5) * -1); margin-right: calc(var(--s-5) * -1); padding-left: var(--s-5); padding-right: var(--s-5); }

.card > .chip { margin-top: var(--s-2); }
