/* 우리 집 가계부 — 화면 공통 스타일. 색은 토큰으로만 쓴다 (다크 모드는 토큰만 바뀐다). 인라인 style 금지(CSP) */
@font-face {
  font-family: "Pretendard Variable"; font-style: normal; font-weight: 45 920; font-display: swap;
  src: url("/static/fonts/PretendardVariable.woff2?v=1.3.9") format("woff2");
}
:root {
  color-scheme: light dark;
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f3f4f6; --surface-3: #e5e8eb;
  --sheet: #ffffff; --seg-on: #ffffff; --seg-page: var(--surface-3); --press: rgb(0 0 0 / .05);
  --ink: #191c21; --ink-2: #4e5560; --ink-3: #656d78; --line: #e9ebee;
  --accent: #1b64da; --accent-fill: #1b64da; --accent-soft: #e8f1fd; --on-accent: #ffffff;
  --income: #0b7a52; --danger: #d92d33;
  --scrim: rgb(0 0 0 / .4); --shadow-pop: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .04);
  /* 차트 (dataviz 검증기 통과: 추이 all-pairs, 도넛 --ordinal) */
  --c-exp: #2a78d6; --c-inc: #1baf7a; --c-net: var(--ink);
  --d1: #104281; --d2: #1c5cab; --d3: #3987e5; --d4: #86b6ef; --d-rest: #d3d7dd; --d-uncat: #9aa1ab;
  --grid: #eef0f2; --axis: #d3d7dd;
  --r-card: 20px; --r-ctl: 14px; --r-tile: 16px; --r-sheet: 24px;
  --gutter: 20px; --tab-h: 56px;
  --font: "Pretendard Variable", -apple-system, BlinkMacSystemFont, system-ui,
          "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* surface-2는 시트 위 입력칸이 보일 만큼 밝게, ink-3은 그 위에서도 4.8 대비 */
    --bg: #101114; --surface: #1b1d21; --surface-2: #282b31; --surface-3: #363a41;
    --sheet: #1f2125; --seg-on: #3a3e45; --seg-page: var(--surface); --press: rgb(255 255 255 / .06);
    --ink: #eceef1; --ink-2: #b3b9c2; --ink-3: #9198a2; --line: #2a2d32;
    --accent: #6aa6f7; --accent-fill: #2a6fd9; --accent-soft: #1d2a3e;
    --income: #3ecf8e; --danger: #ff6b6b;
    --scrim: rgb(0 0 0 / .6); --shadow-pop: none;
    --c-exp: #3987e5; --c-inc: #199e70;
    --d1: #9ec5f4; --d2: #5598e7; --d3: #256abf; --d4: #184f95; --d-rest: #4a5059; --d-uncat: #7d8590;
    --grid: #26292e; --axis: #3a3e45;
  }
}
@media (max-width: 359px) { :root { --gutter: 16px; } }

/* 기본 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }                  /* 시트가 열리면 뒤 스크롤 막기 */
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font);
       -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a, button, input, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }

/* 레이아웃 */
.app { max-width: 480px; margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right))
           calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px)
           max(var(--gutter), env(safe-area-inset-left)); }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg);
  display: flex; align-items: center; gap: 2px; min-height: 56px;
  margin: 0 calc(-1 * var(--gutter)); padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px; }
.topbar h1 { font-size: 20px; line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; padding: 0 4px; }
.topbar .grow { flex: 1; }
.topbar > .icon-btn:first-child { margin-left: -12px; }
.stack > * + * { margin-top: 12px; }

/* 카드 */
.card { background: var(--surface); border-radius: var(--r-card); padding: 20px; }
.card.list { padding: 8px 20px; }
.card > h2 { font-size: 18px; line-height: 1.4; font-weight: 700; margin-bottom: 12px; }
.todo { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 14px 16px 14px 20px;
        border-radius: var(--r-card); background: var(--accent-soft); color: var(--accent);
        font-weight: 600; text-decoration: none; }
.todo span { flex: 1; }
.todo b { font-weight: 700; }
.todo svg.i { width: 20px; height: 20px; }

/* 금액 — 그 기간의 순수입(hero)이 화면에서 가장 크다 */
.label { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.hero  { font-size: 32px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.kvs { margin-top: 16px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; font-size: 15px; color: var(--ink-2); }
.kv b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.kv .btn { flex-shrink: 0; white-space: nowrap; }   /* 옆 글이 길어도 버튼 글자는 한 줄로 */
.amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.in, .kv b.in { color: var(--income); }
.amt.cancel, .amt.pending { color: var(--ink-3); font-weight: 500; }
/* 내역 합계 — 지금 필터의 합. 통계의 hero보다 한 단계 작게 */
.total { margin: 4px 4px 0; }
.total-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; } /* 두 줄이 되면 버튼은 첫 줄에 */
.total-head .label { min-width: 0; }
.total-head .label span { white-space: nowrap; }                 /* "주거·관리비"를 가운뎃점에서 자르지 않게 */
.total-amt { font-size: 26px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.total-sub { margin-top: 2px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { position: relative; flex: none; display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 10px 0 12px;
        border: 0; border-radius: 999px; background: var(--surface); color: var(--ink-2);
        font-size: 14px; font-weight: 600; cursor: pointer; }
.pill.on { background: var(--accent-soft); color: var(--accent); }
.pill svg.i { width: 16px; height: 16px; stroke-width: 2.5; }
.pill:active { filter: brightness(.95); }
.pill::after { content: ""; position: absolute; inset: -6px 0; }      /* 보이는 높이는 32, 누르는 높이는 44 */

/* 목록 행 */
.row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  width: calc(100% + 24px); min-height: 64px; margin: 0 -12px; padding: 8px 12px;
  border: 0; border-radius: 14px; background: none; text-align: left; text-decoration: none; cursor: pointer; }
.row:active { background: var(--press); }
@media (hover: hover) { .row:hover { background: var(--press); } }
.ico { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
       display: grid; place-items: center; font-size: 20px; line-height: 1; }
.ico.uncat { background: var(--accent-soft); color: var(--accent); font-size: 17px; font-weight: 700; }
.row .main { min-width: 0; }
.row .title, .row .meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title { font-weight: 600; }
.row .meta { font-size: 13px; color: var(--ink-3); }
.row .meta .need { color: var(--accent); font-weight: 600; }
.row > svg.i { width: 20px; height: 20px; color: var(--ink-3); }   /* 설정 줄의 › 는 흐리게 */
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--surface-2);
       color: var(--ink-3); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.day { display: flex; justify-content: space-between; padding: 20px 4px 8px;
       font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.empty { padding: 56px 0; text-align: center; font-size: 15px; color: var(--ink-3); }
.empty .e { display: block; font-size: 44px; line-height: 1; margin-bottom: 14px; }
.card .empty { padding: 20px 0 12px; }
.empty .btn { margin-top: 12px; }
.hint { margin-top: 4px; font-size: 13px; color: var(--ink-3); }

/* 칩·세그먼트 */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
         margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px;
        border-radius: 999px; background: var(--surface); color: var(--ink-2);
        font-size: 14px; font-weight: 600; text-decoration: none; }
.chip[aria-current="true"] { background: var(--ink); color: var(--surface); }
.chip .n { color: var(--accent); }
.chip[aria-current="true"] .n { color: inherit; }
.chip::after { content: ""; position: absolute; inset: -4px 0; }      /* 보이는 높이는 36, 누르는 높이는 44 */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px;
       border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.seg > a, .seg > label { display: grid; place-items: center; min-width: 64px; height: 38px; padding: 0 10px;
       border-radius: 9px; color: var(--ink-3); font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.seg > [aria-current="true"], .seg > label:has(:checked) { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow-pop); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.stack > .seg { background: var(--seg-page); }                  /* 카드 밖(페이지 바탕 위)이면 바탕과 구분되게 */
.stack > .seg > :not([aria-current="true"]) { color: var(--ink-2); }   /* 그 바탕 위 ink-3은 대비 4.3이라 한 단계 진하게 */

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 52px; padding: 0 20px;
       border: 0; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink);
       font: 600 17px/1 var(--font); text-decoration: none; cursor: pointer; transition: transform .1s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.primary:active { filter: brightness(.92); }
.btn.soft   { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: none; color: var(--danger); }
.btn.block  { width: 100%; }
.btn.sm     { height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px;
            background: none; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:active { background: var(--press); }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; }

/* 입력 */
.field { display: grid; gap: 8px; margin-top: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; height: 52px; padding: 0 16px; border: 0; border-radius: var(--r-ctl);
         background: var(--surface-2); color: var(--ink); font: 500 17px var(--font); }
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
input[type="date"].input { -webkit-appearance: none; appearance: none; display: flex; align-items: center; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }
input[type="date"].input::-webkit-calendar-picker-indicator { opacity: .5; }
.input[name="emoji"] { font-size: 24px; }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 20px; }
.inline .btn { height: 52px; padding: 0 18px; border-radius: var(--r-ctl); }   /* 옆 입력칸과 같은 높이 */
.money { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px;
         background: var(--surface-2); border-radius: var(--r-ctl); padding-right: 16px; }
.money .input { height: 64px; padding-right: 0; background: none; text-align: right; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.money > span { font-size: 22px; font-weight: 700; color: var(--ink-2); }
.err { margin-top: 8px; color: var(--danger); font-size: 13px; }

/* 스위치 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
              min-height: 56px; margin-top: 8px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0;
          border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background .15s; }
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px;
                  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .15s; }
.switch:checked { background: var(--accent-fill); }
.switch:checked::before { transform: translateX(20px); }
/* 카드 시트의 "항상" 스위치: 제목 칸이 비었으면(placeholder가 보이면) 가맹점, 채우면 제목을 기억한다 */
.card-form .if-title { display: none; }
.card-form:has(input[name="title"]:not(:placeholder-shown)) .if-title { display: inline; }
.card-form:has(input[name="title"]:not(:placeholder-shown)) .if-merchant { display: none; }
.card-form:has(input[name="title"]:placeholder-shown) .switch-row.title-only { display: none; }

/* 바텀시트 — padding은 안쪽 div에만 (배경 누름 판별: target이 dialog면 배경) */
dialog.sheet { width: 100%; max-width: 480px; max-height: 88dvh; margin: auto auto 0; padding: 0; border: 0;
               border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--sheet); color: var(--ink);
               overflow-y: auto; overscroll-behavior: contain; }
dialog.sheet::backdrop { background: var(--scrim); }
.sheet-body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-body::before { content: ""; display: block; width: 36px; height: 5px; margin: 0 auto 16px;
                      border-radius: 3px; background: var(--surface-3); }
.sheet-title { font-size: 18px; line-height: 1.4; font-weight: 700; letter-spacing: -0.01em; }
.big { margin-top: 2px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
dialog.sheet[open] { animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: var(--r-sheet); } .sheet-body::before { display: none; } }

/* 결제수단 고르기 — 고른 줄은 강조색 글자와 ✓ */
.picks { margin: 8px -12px 0; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 12px;
        border-radius: 14px; font-size: 17px; font-weight: 500; text-decoration: none; }
.pick:active { background: var(--press); }
@media (hover: hover) { .pick:hover { background: var(--press); } }
.pick[aria-current="true"] { color: var(--accent); font-weight: 700; }

/* 카테고리 고르기 — 새로 그려진 직후 0.35초는 누르지 못하게(다음 시트로 넘어갈 때 두 번 탭 방지) */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px -4px 0; animation: arm .35s; }
@keyframes arm { 0%, 99% { pointer-events: none; } }
.cat { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 76px; padding: 8px 2px;
       border: 0; border-radius: var(--r-tile); background: none; color: var(--ink-2);
       font: 600 12px/1.25 var(--font); text-align: center; cursor: pointer; }
.cat .e { font-size: 28px; line-height: 1; }
.cat:active { background: var(--press); }
.cat[aria-pressed="true"], .cat:has(:checked) { background: var(--accent-soft); color: var(--accent); }
.cat input { position: absolute; opacity: 0; pointer-events: none; }
@media (max-width: 359px) { .cats { grid-template-columns: repeat(3, 1fr); } }
.entry-form:has(input[name="type"][value="income"]:checked) :is(.cats.expense, .pays, .pays + .err),
.entry-form:has(input[name="type"][value="expense"]:checked) .cats.income { display: none; }

/* 하단 탭 */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; max-width: 480px; margin: 0 auto;
          display: grid; grid-template-columns: repeat(3, 1fr);
          height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
          background: var(--surface);
          background: color-mix(in srgb, var(--surface) 88%, transparent);
          -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
          box-shadow: 0 -1px 0 var(--line); }
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px;
            color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--ink); }

/* 차트 */
.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .sel { fill: var(--surface-2); }
.chart .hit { fill: transparent; }
.chart .bar-inc { fill: var(--c-inc); }
.chart .bar-exp { fill: var(--c-exp); }
.chart .net { fill: none; stroke: var(--c-net); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--c-net); stroke: var(--surface); stroke-width: 2; }
.chart .xl { font-size: 12px; text-anchor: middle; }
.chart .xl.on { fill: var(--ink); font-weight: 700; }
.chart .yl { text-anchor: end; }
.chart a:focus-visible .hit { stroke: var(--accent); stroke-width: 2; }
@media (hover: hover) { .chart a:hover .hit { fill: var(--press); } }
.trend { max-width: 440px; margin: 0 auto; }
.donut { width: 200px; margin: 8px auto 16px; }
.donut .s { fill: none; stroke: var(--k); stroke-width: 24; }
.donut a:hover .s, .donut a:focus-visible .s { stroke-width: 28; }
.donut .track { fill: none; stroke: var(--surface-2); stroke-width: 24; }
.donut .lbl { font-size: 13px; text-anchor: middle; }
.donut .total { font-size: 20px; font-weight: 700; fill: var(--ink); text-anchor: middle; letter-spacing: -0.02em; }
.d1 { --k: var(--d1); } .d2 { --k: var(--d2); } .d3 { --k: var(--d3); } .d4 { --k: var(--d4); }
.d-rest { --k: var(--d-rest); } .d-uncat { --k: var(--d-uncat); } .ki { --k: var(--c-inc); } .ke { --k: var(--c-exp); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--k); }
.key.line { width: 16px; height: 2px; border-radius: 1px; background: var(--c-net); }
.keys { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.keys li { display: flex; align-items: center; gap: 6px; }
.legend .row { grid-template-columns: 10px 24px 1fr auto; column-gap: 10px; min-height: 52px; }
.legend .title { font-weight: 500; }                                   /* 이름은 차분하게, 금액이 눈에 들어오게 */
.legend .e { font-size: 20px; text-align: center; }
.legend .q { color: var(--accent); font-weight: 700; text-align: center; }
.legend .pct { margin-left: 6px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
/* 카테고리별 수입: 지출 범례와 같은 칸(점 자리는 비움), 이름 줄 아래에 전체 수입 대비 막대 (이모지는 두 줄 가운데) */
.shares .row { row-gap: 8px; padding-block: 12px; }
.shares .row > :is(.e, .q) { grid-column: 2; grid-row: span 2; }
.meter { grid-column: 3 / -1; display: block; width: 100%; height: 6px; }
.meter .track { fill: var(--surface-2); fill: color-mix(in srgb, var(--c-inc) 14%, var(--surface)); }   /* 같은 초록의 옅은 단계 */
.meter .fill { fill: var(--c-inc); }
.tbl { margin-top: 8px; }
.tbl summary { display: flex; align-items: center; gap: 4px; width: max-content; min-height: 44px;
               font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; list-style: none; }
.tbl summary::-webkit-details-marker { display: none; }
.tbl summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 4px;
                      border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.tbl[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.tbl table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 6px 0 6px 8px; text-align: right; white-space: nowrap; }
.tbl th { color: var(--ink-3); font-weight: 600; }
.tbl :is(th, td):first-child { padding-left: 0; text-align: left; }
.tbl caption { caption-side: top; padding-bottom: 2px; text-align: right; font-size: 12px; color: var(--ink-3); }   /* 원은 칸마다 쓰지 않는다 (좁은 폰에서 한 줄에) */
@media (max-width: 374px) { .tbl table { font-size: 12px; } }                  /* 한 해 합계(8자리)도 360폭에 들어가게 */

/* 로그인 (탭 바 없음) */
.login { display: grid; gap: 12px; max-width: 360px; margin: 0 auto; padding-top: max(12vh, 40px); }
.login .logo { font-size: 40px; line-height: 1; text-align: center; }
.login h1 { margin-bottom: 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
.login .input { background: var(--surface); }                 /* 회색 바탕 위라 카드색으로 */
.login .err { margin-top: 0; }

@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } * { transition: none !important; } }

/* 요청 중: 누른 링크·버튼·폼을 흐리게 (빨리 끝나면 깜빡이지 않게 조금 늦게) */
.htmx-request { opacity: .5; transition: opacity .1s .15s; cursor: progress; }

/* 요청 실패 알림 (app.js toast). popover라 열린 시트 위에도 뜬다 */
.toast { position: fixed; inset: auto var(--gutter) calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)) var(--gutter);
         margin: 0 auto; max-width: 420px; padding: 14px 18px; border: 0; border-radius: var(--r-ctl);
         background: var(--ink); color: var(--surface); font: 600 15px/1.4 var(--font); text-align: center;
         box-shadow: 0 4px 16px rgb(0 0 0 / .2); }

/* 오류 화면 (화면 전체를 읽다가 실패했을 때) */
.error-page { padding: 72px var(--gutter) 0; text-align: center; }
.error-page .e { font-size: 48px; line-height: 1; margin-bottom: 16px; }
.error-page h1 { font-size: 20px; font-weight: 700; }
.error-actions { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
