/* 가족 가계부 — 모바일 퍼스트 디자인 시스템 (테마 6종 + 폰트 선택) */

@font-face {
  font-family: "Pretendard Variable";
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-stack: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", sans-serif;
}

@font-face {
  font-family: "NanumSquareRound";
  src: url("/static/fonts/NanumSquareRoundL.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "NanumDaHaengChe";
  src: url("/static/fonts/NanumDaHaengChe.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "NanumAmsterdam";
  src: url("/static/fonts/NanumAmsterdam.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

[data-font="pretendard"] {
  --font-stack: "Pretendard Variable", system-ui, -apple-system,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

[data-font="roundneo"] {
  --font-stack: "NanumSquareRound", system-ui, -apple-system,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

[data-font="dahaeng"] {
  --font-stack: "NanumDaHaengChe", system-ui, -apple-system,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

[data-font="amsterdam"] {
  --font-stack: "NanumAmsterdam", system-ui, -apple-system,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface2: #f2f4f7;
  --text: #1a1d21;
  --text2: #5a6270;
  --muted: #8a919c;
  --border: #e3e7ec;
  --primary: #1a1d21;
  --on-primary: #ffffff;
  --income: #2f6fde;
  --expense: #e5484d;
  --accent: #2f6fde;
  --accent-bg: #e9f0fc;
  --danger: #c62f35;
  --danger-bg: #fdecec;
  --success: #1a7f4e;
  --success-bg: #e6f5ec;
  --warn: #9a6a10;
  --warn-bg: #fbf1dc;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 20, 28, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131519;
    --surface: #1d2026;
    --surface2: #262a31;
    --text: #eceded;
    --text2: #a6acb8;
    --muted: #7c828d;
    --border: #2e333b;
    --primary: #eceded;
    --on-primary: #17191d;
    --income: #6fa8ff;
    --expense: #ff8a8f;
    --accent: #6fa8ff;
    --accent-bg: #1f3050;
    --danger: #ff8a8f;
    --danger-bg: #3a2225;
    --success: #5ecf96;
    --success-bg: #1c3328;
    --warn: #e8b458;
    --warn-bg: #3a3120;
    --shadow: none;
  }
}

[data-theme="light"] { /* 기본값과 동일 — 명시 선택용 */ }

[data-theme="dark"] {
  --bg: #131519;
  --surface: #1d2026;
  --surface2: #262a31;
  --text: #eceded;
  --text2: #a6acb8;
  --muted: #7c828d;
  --border: #2e333b;
  --primary: #eceded;
  --on-primary: #17191d;
  --income: #6fa8ff;
  --expense: #ff8a8f;
  --accent: #6fa8ff;
  --accent-bg: #1f3050;
  --danger: #ff8a8f;
  --danger-bg: #3a2225;
  --success: #5ecf96;
  --success-bg: #1c3328;
  --warn: #e8b458;
  --warn-bg: #3a3120;
  --shadow: none;
}

[data-theme="pastel"] {
  --bg: #fbf7f2;
  --surface: #fffdfa;
  --surface2: #f3eae0;
  --text: #5c4b40;
  --text2: #8c7a6c;
  --muted: #a08b7c;
  --border: #eadfd2;
  --primary: #b5c9a5;
  --on-primary: #2f3f26;
  --income: #6e93bf;
  --expense: #c97b84;
  --accent: #4e76a3;
  --accent-bg: #dce7f2;
  --danger: #b25f68;
  --danger-bg: #f7e3e5;
  --success: #6e9460;
  --success-bg: #e7efe1;
  --warn: #a5834a;
  --warn-bg: #f5ecd9;
  --radius: 14px;
  --radius-lg: 20px;
}

[data-theme="cute"] {
  --bg: #fff5f8;
  --surface: #ffffff;
  --surface2: #ffe7ef;
  --text: #6b3a4e;
  --text2: #a96b80;
  --muted: #b98a9b;
  --border: #f5d6e0;
  --primary: #f06292;
  --on-primary: #ffffff;
  --income: #4e93d9;
  --expense: #e36b8d;
  --accent: #d94f7e;
  --accent-bg: #ffd9e5;
  --danger: #d14a6a;
  --danger-bg: #fde3ea;
  --success: #57a773;
  --success-bg: #e3f3e9;
  --warn: #c58f3b;
  --warn-bg: #faeed7;
  --radius: 16px;
  --radius-lg: 22px;
}

[data-theme="vivid"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --text: #0e1116;
  --text2: #3c434e;
  --muted: #5a6270;
  --border: #c6cbd4;
  --primary: #4318d1;
  --on-primary: #ffffff;
  --income: #0057e0;
  --expense: #e01e37;
  --accent: #4318d1;
  --accent-bg: #e3dbfb;
  --danger: #cf1b32;
  --danger-bg: #fbdde1;
  --success: #0f8a4c;
  --success-bg: #d9f2e4;
  --warn: #a06a00;
  --warn-bg: #f8ecd2;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }
[hidden], .check-row[hidden], .seg-btn[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

/* 글자 크기 — 모든 글자 크기가 rem이라 루트 크기(10~30px, 슬라이더)만 바꾸면 전체 적용 */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 4px; border-radius: 2px;
  background: var(--border); outline: none; padding: 0; border: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}
.size-val { font-size: 0.8125rem; color: var(--text2); min-width: 34px; text-align: right; }
body {
  margin: 0;
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.25rem; margin: 0; font-weight: 700; }
h2 { margin: 0; }
p { margin: 0; }
input, select, button, textarea { font: inherit; color: inherit; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}
.content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.page-pad { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 12px; }

/* 헤더 */
.page-head, .home-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-head .muted { font-size: 0.8125rem; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.month-head { display: flex; align-items: center; justify-content: space-between; }
.month-head h1 { font-size: 1.0625rem; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.125rem; color: var(--text2); background: transparent; border: none; cursor: pointer;
}
.icon-btn:active { background: var(--surface2); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: 0.8125rem; }

/* 카드 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.section-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.sm-link { font-size: 0.8125rem; }

.hero { text-align: left; }
.hero .label { margin-bottom: 2px; }
.big-num { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.5px; }
.big-num .unit, .stat-num .unit { font-size: 0.875rem; font-weight: 400; color: var(--muted); margin-left: 2px; }
.hero-sub { display: flex; gap: 16px; margin-top: 6px; font-size: 0.8125rem; color: var(--text2); }
.sub-note { font-size: 0.8125rem; margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat .stat-num { font-size: 1.25rem; font-weight: 700; margin-top: 2px; }
.label { font-size: 0.75rem; color: var(--muted); }

/* 배너 */
.banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-lg); padding: 12px 14px;
  border: 1px solid var(--border);
}
.banner.danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.banner strong { display: block; font-size: 0.875rem; }
.banner small { font-size: 0.75rem; opacity: .9; }
.banner-icon { font-size: 1.25rem; }
.chev { color: var(--muted); font-size: 1.125rem; }

/* 리스트 행 */
.tx-row, .row-line {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--border);
}
.tx-row:first-of-type, .row-line:first-of-type { border-top: none; }
.row-icon { font-size: 1.25rem; width: 28px; text-align: center; flex-shrink: 0; }
.grow { flex: 1; min-width: 0; }
.tx-title { display: block; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row small, .row-line small { display: block; font-size: 0.75rem; }
.amount { font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.amount.income, .income { color: var(--income); }
.amount.expense, .expense { color: var(--expense); }
.b { font-weight: 700; }
.ta-right { text-align: right; }
.ta-right small { display: block; font-size: 0.6875rem; }
.date-cell { font-size: 0.75rem; width: 42px; flex-shrink: 0; }

/* 배지 */
.badge {
  display: inline-block; font-size: 0.625rem; padding: 1px 7px; border-radius: 999px;
  background: var(--surface2); color: var(--text2); vertical-align: 1px; margin-left: 4px;
}
.badge.accent { background: var(--accent-bg); color: var(--accent); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 0.875rem; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text2); }
.btn.sm { padding: 6px 12px; font-size: 0.8125rem; border-radius: 8px; }
.btn.block { width: 100%; }

/* 폼 */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8125rem; color: var(--text2); }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface2); color: var(--text); font-size: 0.9375rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.inline-form .btn { white-space: nowrap; flex-shrink: 0; }
.inline-form input, .inline-form select { min-width: 0; }
.inline-form label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--text2); }
.amount-input { font-size: 1.25rem !important; font-weight: 700; }
.icon-input { width: 56px !important; text-align: center; flex-shrink: 0; }
.day-label { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--text2); white-space: nowrap; }
.inline-form .day-label { flex: 0 0 auto; flex-direction: row; align-items: center; }

.check-row {
  display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer;
}
.check-row input { margin-top: 3px; accent-color: var(--accent); }
.check-row strong { font-size: 0.875rem; color: var(--text); display: block; }
.check-row small { display: block; }
.check-row.slim { padding: 6px 10px; align-items: center; white-space: nowrap; }
.option-rows { display: flex; flex-direction: column; gap: 8px; }
.share-hint { font-size: 0.75rem; padding: 2px 2px 0; margin: 0; }
.sm-note { font-size: 0.75rem; margin: 0 0 6px; }

/* 세그먼트 토글 */
.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1; text-align: center; padding: 8px 0; font-size: 0.8125rem; font-weight: 600;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.seg-btn.on, .seg-btn:has(input:checked) { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }

/* 칩 */
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip {
  font-size: 0.75rem; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text2); background: var(--surface);
}
.chip.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip-spacer { flex: 1; }
.sub-chips { margin-top: -6px; padding-left: 10px; }
.sub-chips .chip { font-size: 0.71875rem; padding: 4px 10px; }
.sub-chips .chip.on { background: var(--accent-bg); color: var(--accent); }

/* 월 요약 바 */
.summary-bar { display: flex; padding: 10px 0; }
.summary-bar > div { flex: 1; text-align: center; border-left: 1px solid var(--border); }
.summary-bar > div:first-child { border-left: none; }
.summary-bar .b { font-size: 0.875rem; margin-top: 1px; }

/* 날짜 그룹 — 날짜 줄 클릭으로 접기/펼치기 */
.day-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.day-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0 4px; font-size: 0.8125rem; font-weight: 700;
  border-bottom: 1px solid var(--border);
  cursor: pointer; list-style: none; user-select: none;
}
.day-head::-webkit-details-marker { display: none; }
.day-caret {
  display: inline-block; font-size: 0.6875rem; color: var(--muted);
  transition: transform .15s ease;
}
.day-group:not([open]) .day-caret { transform: rotate(-90deg); }
.day-group:not([open]) { padding-bottom: 6px; }
.day-group:not([open]) .day-head { border-bottom: none; padding-bottom: 8px; }
.day-sums { display: flex; gap: 8px; font-size: 0.75rem; font-weight: 600; }
.tx-row.readonly { opacity: .75; }

/* 달력 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-dow { font-size: 0.75rem; color: var(--muted); padding: 6px 0; }
.cal-dow.sun { color: var(--expense); }
.cal-dow.sat { color: var(--income); }
.cal-cell {
  min-height: 52px; padding: 4px 1px; border-top: 1px solid var(--border);
  font-size: 0.75rem; cursor: pointer; border-radius: 8px;
}
.cal-cell .d { font-weight: 600; }
.cal-cell.out { opacity: .35; cursor: default; }
.cal-cell.today .d { color: var(--accent); }
.cal-cell.sel { background: var(--accent-bg); }
.cal-cell .ci { display: block; font-size: 0.625rem; color: var(--income); line-height: 1.3; }
.cal-cell .ce { display: block; font-size: 0.625rem; color: var(--expense); line-height: 1.3; }

/* 그래프 (막대) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; margin-top: 12px; }
.bars.tall { height: 140px; }
.bars.dense { gap: 3px; }
.bars.dense .bar-val { font-size: 0.5625rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.bar { width: 100%; background: var(--border); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.hl { background: var(--accent); }
.bar-col small { font-size: 0.625rem; }
.bar-val { color: var(--text2); }

/* 도넛 */
.donut-wrap { display: flex; align-items: center; gap: 16px; padding: 6px 0 10px; }
.donut {
  width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.donut-hole {
  width: 78px; height: 78px; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-hole b { font-size: 0.9375rem; }
.legend { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.legend-row { display: flex; align-items: center; gap: 7px; font-size: 0.8125rem; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.rank-no { width: 18px; text-align: center; font-size: 0.8125rem; }
.hbar { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; margin: 4px 0 8px; }
.hbar-fill { height: 100%; border-radius: 4px; }
.member-stat + .member-stat { margin-top: 4px; }

/* 정산 */
.pay-route { border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px 10px; margin: 4px 0; }
.pay-route .inline-form { margin-top: 4px; }
.member-card summary { list-style: none; cursor: pointer; }
.member-card summary::-webkit-details-marker { display: none; }
.member-detail { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.member-detail form { margin: 4px 0; }

/* 메뉴 */
.menu { padding: 8px 16px; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 0; border-top: 1px solid var(--border); font-size: 0.875rem;
  width: 100%; background: none; border-left: none; border-right: none; border-bottom: none;
  text-align: left; cursor: pointer;
}
.menu .section-title { padding-top: 8px; }
.menu .section-title + .menu-row { border-top: none; }
.theme-row select { width: auto; padding: 6px 10px; font-size: 0.8125rem; }
.install-hint { font-size: 0.75rem; padding: 8px 0 10px; }

.invite-code { font-size: 1.625rem; font-weight: 800; letter-spacing: 4px; margin: 4px 0; }
.center { text-align: center; }
.fixed-item summary { list-style: none; cursor: pointer; }
.fixed-item summary::-webkit-details-marker { display: none; }
.fixed-item.inactive { opacity: .55; }
.fixed-edit { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 4px; }
.row-block .danger-zone { padding: 8px 0; }

/* 하단 내비게이션 */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; align-items: center;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}

.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 0.625rem; color: var(--muted); padding: 3px 0;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent); font-weight: 700; }
.nav-add {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.nav-add svg {
  width: 44px; height: 44px; padding: 10px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
}

/* 인증 페이지 */
.auth-page {
  min-height: 90dvh; display: flex; flex-direction: column; justify-content: center;
  padding: 24px; gap: 10px; text-align: center;
}
.auth-logo { font-size: 2.75rem; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; text-align: left; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8125rem; color: var(--text2); }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 20px 0; font-size: 0.8125rem; }

/* 플래시 */
.flash-wrap { position: sticky; top: 8px; z-index: 20; padding: 8px 16px 0; }
.flash {
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--radius); padding: 10px 14px; font-size: 0.8125rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); margin-bottom: 6px;
  animation: flash-in .25s ease;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* PC에서 살짝 앱 느낌 유지 */
@media (min-width: 520px) {
  body { padding: 0 12px; }
  .app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* 금액 계산기 패드 */
#calc-pad {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}
.calc-disp {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 10px;
  padding: 4px 6px 10px; min-height: 34px;
  font-size: 1.375rem; font-weight: 700; letter-spacing: .5px;
  overflow-x: auto; white-space: nowrap;
}
.calc-disp .muted { font-size: 0.9375rem; font-weight: 500; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.calc-keys button {
  padding: 12px 0; font-size: 1.125rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface2); color: var(--text); cursor: pointer;
}
.calc-keys button:active { transform: scale(.96); }
.calc-keys .calc-ok { background: var(--primary); color: var(--on-primary); border-color: transparent; }

/* 2분할 복귀 버튼 — 홈 헤더(그룹명 ↔ 설정 사이), 2분할을 꺼둔 넓은 화면에서만 표시 */
#dual-btn.dual-icon {
  border: 1px solid var(--border); background: var(--surface);
  font-size: 1rem; font-weight: 700;
}

/* 2분할(듀얼) 화면 — 폴드 펼침 / 와이드 PC
   높이를 100dvh로 잡으면 안드로이드 엣지투엣지에서 제스처 바 아래까지
   포함되어 패널 하단이 잘림 → 고정 배치(bottom:0)로 단일 화면 메뉴와
   같은 기준선을 사용 */
.dual-body { margin: 0; padding: 0 !important; background: var(--bg); }
.dual-wrap {
  display: flex;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
}
.dual-wrap iframe {
  flex: 1; min-width: 0; height: 100%; border: none;
  background: var(--bg);
}
.dual-div {
  width: 14px; flex-shrink: 0; position: relative;
  background: var(--surface2); border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.dual-div button {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 48px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); font-size: 0.8125rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
