:root {
  --ink: #14161d;
  --surface: #1d212c;
  --line: #2b3040;
  --paper: #ede9e0;
  --muted: #767d91;
  --plus: #d94f4f;
  --minus: #4f7fd9;
  --faint: #414859;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans KR', system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #f2ede2;
    --surface: #faf7ee;
    --line: #ddd3bd;
    --paper: #211f1f;
    --muted: #7a7364;
    --plus: #b23a3a;
    --minus: #2f5aa8;
    --faint: #c9bfa6;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; overflow-x: hidden; background: var(--ink); }
body { min-width: 0; min-height: 100vh; margin: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); overflow-x: hidden; background: var(--ink); color: var(--paper); font-family: var(--sans); font-weight: 300; }
body.is-scroll-locked { overflow: hidden; touch-action: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--plus); outline-offset: 2px; }
a { color: inherit; }
h1, h2, h3, p { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.boot-loading-overlay { position: fixed; z-index: 40; inset: 0; display: grid; min-height: 100dvh; place-items: center; padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); overflow: hidden; overscroll-behavior: none; background: var(--ink); touch-action: none; transition: opacity 200ms ease-out; }
.boot-loading-overlay[data-boot-state="leaving"] { opacity: 0; }
.boot-loading-content { display: flex; width: min(100%, 320px); max-height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.boot-loading-illustration { display: block; width: min(66vw, 240px); max-height: min(34dvh, 240px); object-fit: contain; }
.boot-loading-message { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.boot-loading-spinner { flex: none; margin: 0; }

.auth-shell { width: 100%; max-width: 440px; min-height: 100vh; margin: 0 auto; padding: clamp(28px, 8vh, 76px) 22px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.auth-card { width: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.auth-illustration { display: block; width: min(72vw, 272px); height: auto; margin: -10px auto 16px; object-fit: contain; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
h1 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.auth-description { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.pin-form { display: grid; gap: 10px; margin-top: 22px; }
#pinGateInput { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 16px; letter-spacing: .16em; text-align: center; }
#pinGateInput::placeholder { color: var(--faint); letter-spacing: .08em; }
.save { width: 100%; min-height: 52px; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--plus); color: #fff; font-size: 16px; font-weight: 500; }
.status-message { min-height: 1.5em; margin: 12px 0 0; color: var(--plus); font-size: 13px; line-height: 1.5; }
.state-card { display: flex; flex-direction: column; align-items: center; }
.state-card .save { margin-top: 20px; }
.spinner { width: 28px; height: 28px; margin-bottom: 16px; border: 3px solid var(--line); border-top-color: var(--plus); border-radius: 50%; animation: spin .8s linear infinite; }
.legacy-link-area { padding: 0 10px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.legacy-link-area p { margin: 0 0 5px; }
.legacy-link-area a { font-family: var(--mono); text-underline-offset: 3px; }

.app-shell { width: 100%; max-width: 440px; min-height: 100vh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom)); overflow-x: clip; }
.app-header { padding: 6px 6px 20px; }
.app-header h1, .app-panel h2 { font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.app-header-date, .setting-description, .management-action p, .logout-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.app-status { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; }
.app-panel { display: grid; min-width: 0; gap: 18px; }
.summary-card, .entry-card, .settings-card, .management-section, .analysis-card, .source-card, .logout-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.summary-card h2, .entry-card h2, .settings-card h2, .analysis-card h2, .source-card h2, .logout-card h2 { margin: 0; }
.summary-card .eyebrow { margin-bottom: 6px; }
.section-heading, .summary-heading-row, .sheet-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading > span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.compact-heading { align-items: baseline; }
.compact-heading h3 { margin: 0; font-size: 14px; font-weight: 500; }

.date-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.date-today-button { grid-column: 1 / -1; justify-self: center; }
.icon-button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--paper); font-size: 28px; line-height: 1; }
.period-picker-button { display: flex; min-width: 0; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--paper); }
.period-picker-button span:first-child { min-width: 0; overflow: hidden; font-family: var(--mono); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.period-picker-button span:last-child { color: var(--muted); font-size: 11px; }
.text-button { min-height: 44px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.text-button.centered { justify-self: center; }

.summary-heading-row { align-items: flex-start; }
.streak-pill { flex: none; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.balance-value { margin: 18px 0 0; color: var(--plus); font-family: var(--mono); font-size: clamp(32px, 10vw, 44px); font-weight: 600; line-height: 1.05; }
.balance-value.is-minus, .balance-delta.is-minus, .recommended-row strong.is-minus { color: var(--minus); }
.balance-delta { min-height: 1.4em; margin: 7px 0 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.budget-track { height: 5px; margin-top: 18px; overflow: hidden; border-radius: 99px; background: var(--line); }
.budget-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--plus); transition: width .25s ease; }
.budget-track span.is-minus { background: var(--minus); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.summary-grid div { min-width: 0; padding: 12px; border-radius: 10px; background: var(--ink); }
.summary-grid dt { color: var(--muted); font-size: 12px; }
.summary-grid dd { min-height: 1.5em; margin: 5px 0 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 15px; font-weight: 500; }
.recommended-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.recommended-row strong { flex: none; color: var(--plus); font-family: var(--mono); font-size: 16px; }

.entry-card form, .settings-card form, .sheet-form { display: grid; gap: 8px; margin-top: 16px; }
.entry-card label, .settings-card label, .search-section label, .sheet-form label { color: var(--muted); font-size: 13px; }
.entry-card input, .settings-card input, .settings-card textarea, .settings-card select, .search-control input, .sheet-form input { width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--ink); color: var(--paper); font-size: 16px; }
.settings-card textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.entry-card input:focus-visible, .settings-card input:focus-visible, .settings-card textarea:focus-visible, .settings-card select:focus-visible, .search-control input:focus-visible, .sheet-form input:focus-visible { border-color: var(--plus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plus) 24%, transparent); }
.form-status { min-height: 1.4em; margin: 1px 0; color: var(--muted); font-size: 13px; }
.quick-section { min-width: 0; margin-top: 4px; }
.chip-grid { display: flex; min-height: 1px; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.chip-grid:empty { display: none; }
.chip { min-height: 44px; max-width: 100%; padding: 8px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--paper); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.no-spend-button { min-height: 44px; margin-top: 4px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--plus); font-size: 14px; }
.calendar-preview { margin-top: 8px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--ink); }
.calendar-preview p:not(.eyebrow) { margin: 4px 0 0; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.calendar-preview .preview-budget { color: var(--muted); }
.delete-link { min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.quick-section h2, .list-section h2 { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.record-list { display: grid; gap: 8px; padding: 0; margin: 10px 0 0; list-style: none; }
.record-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.record-open { min-width: 0; min-height: 62px; padding: 12px 8px 12px 14px; border: 0; border-radius: inherit; background: transparent; color: var(--paper); text-align: left; }
.record-copy { display: grid; min-width: 0; gap: 3px; }
.record-amount { overflow-wrap: anywhere; font-family: var(--mono); font-size: 15px; font-weight: 500; }
.record-memo { overflow: hidden; color: var(--paper); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.record-time { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.record-delete { min-width: 52px; min-height: 44px; margin-right: 4px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.empty-state, .loading-state { padding: 22px 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; font-size: 13px; }
.empty-state p, .loading-state p { margin: 0; }
.empty-state .text-button { margin-bottom: -12px; }
.loading-state { display: grid; justify-items: center; gap: 9px; }
.loading-state .spinner { margin: 0; }
.inline-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--plus) 60%, var(--line)); border-radius: 10px; color: var(--plus); font-size: 13px; }
.inline-error p { margin: 0; }
.inline-error button, .secondary-button, .danger-button { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--paper); font-size: 14px; }

.month-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.period-heading { min-width: 0; text-align: center; }
.period-heading h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period-open-button { min-height: 28px; padding: 2px 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.search-section { display: grid; gap: 7px; }
.search-control { position: relative; }
.search-control input { padding-right: 72px; }
.search-control button { position: absolute; top: 2px; right: 2px; min-height: 44px; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--line); color: var(--paper); font-size: 13px; }
.search-help, .comparison-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.analysis-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.analysis-metrics article { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.analysis-metrics span { display: block; color: var(--muted); font-size: 12px; }
.analysis-metrics strong { display: block; margin-top: 7px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 16px; font-weight: 500; }
.analysis-card { position: relative; }
.analysis-card h2 { font-size: 17px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-top: 14px; padding: 3px; border-radius: 10px; background: var(--ink); }
.segmented-control button { min-height: 40px; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.segmented-control button[aria-pressed="true"] { background: var(--surface); color: var(--paper); font-weight: 500; }
.chart-viewport { display: flex; min-height: 166px; align-items: end; gap: 3px; margin-top: 16px; padding: 12px 4px 0; border-bottom: 1px solid var(--line); }
.chart-bar { flex: 1 1 0; min-width: 2px; max-width: 12px; border-radius: 3px 3px 0 0; background: var(--plus); }
.chart-bar.is-minus { background: var(--minus); }
.chart-summary { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.calendar-legend { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.calendar-legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend-plus { background: var(--plus); }
.legend-minus { margin-left: 5px; background: var(--minus); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays { margin-top: 16px; color: var(--muted); font-family: var(--mono); font-size: 10px; text-align: center; }
.calendar-grid { margin-top: 8px; }
.calendar-day { position: relative; min-width: 0; min-height: 44px; padding: 6px 2px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--paper); font-family: var(--mono); font-size: 11px; }
.calendar-day.is-outside { color: var(--faint); }
.calendar-day.is-selected { border-color: var(--paper); background: var(--ink); }
.calendar-day-state { position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; border-radius: 50%; transform: translateX(-50%); }
.calendar-day.is-plus .calendar-day-state { background: var(--plus); }
.calendar-day.is-minus .calendar-day-state { background: var(--minus); }
.calendar-day-preview { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--ink); }
.calendar-day-preview h3 { margin: 0; font-size: 14px; font-weight: 500; }
.calendar-day-preview dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.calendar-day-preview dt { color: var(--muted); font-size: 11px; }
.calendar-day-preview dd { margin: 4px 0 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13px; }
.calendar-day-preview > p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.settings-card { display: grid; gap: 10px; }
.settings-card .secondary-button { width: 100%; }
.schedule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.schedule-grid label { display: grid; min-width: 0; gap: 6px; }
.history-disclosure { margin-top: 8px; border-top: 1px solid var(--line); }
.history-disclosure summary { min-height: 48px; padding: 15px 0 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.history-list { display: grid; gap: 1px; margin-top: 8px; overflow: hidden; border-radius: 10px; background: var(--line); }
.history-item { display: flex; min-width: 0; justify-content: space-between; gap: 12px; padding: 12px; background: var(--ink); font-size: 13px; }
.history-item time { color: var(--muted); }
.history-item strong { overflow-wrap: anywhere; font-family: var(--mono); }
.empty-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.source-card, .logout-card { display: grid; gap: 14px; }
.source-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.source-links a { display: grid; min-height: 44px; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--paper); font-size: 13px; text-align: center; text-decoration: none; }
.management-section { padding: 0; overflow: hidden; }
.accordion-button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border: 0; background: transparent; color: var(--paper); font-size: 15px; text-align: left; }
.accordion-button[aria-expanded="true"] > span:last-child { transform: rotate(180deg); }
#managementContent { display: grid; gap: 14px; padding: 0 18px 18px; border-top: 1px solid var(--line); }
.management-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.management-action { padding-top: 14px; border-top: 1px solid var(--line); }
.management-action:first-of-type { border-top: 0; }
.management-action h3 { margin: 0; font-size: 14px; font-weight: 500; }
.management-action .danger-button { width: 100%; margin-top: 12px; border-color: color-mix(in srgb, var(--plus) 60%, var(--line)); color: var(--plus); }
.logout-card .secondary-button { width: 100%; }

.tab-bar { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 440px); margin: 0 auto; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 94%, transparent); backdrop-filter: blur(14px); }
.tab-button { min-width: 0; min-height: 48px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; }
.tab-button[aria-selected="true"] { background: var(--surface); color: var(--paper); font-weight: 500; }

.toast, .undo-toast { position: fixed; z-index: 12; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 16px; max-width: 408px; margin: 0 auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--paper); box-shadow: 0 12px 30px rgb(0 0 0 / .24); font-size: 14px; }
.undo-toast { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; overflow: hidden; }
.undo-toast button { min-height: 44px; padding: 5px 6px; border: 0; background: transparent; color: var(--plus); font-weight: 500; }
.undo-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; transform-origin: left; background: var(--plus); animation: undo-countdown 6s linear forwards; }
.dialog-backdrop, .sheet-backdrop { position: fixed; z-index: 20; inset: 0; background: rgb(0 0 0 / .56); }
.dialog-backdrop { display: grid; place-items: end center; padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
.confirm-dialog { width: min(100%, 408px); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 50px rgb(0 0 0 / .35); outline: 0; }
.confirm-dialog h2 { margin: 0; font-size: 19px; }
.confirm-dialog > p:not(.eyebrow):not(.form-status) { margin: 10px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.confirm-meta { display: grid; gap: 6px; margin: 12px 0 0; padding: 12px; border-radius: 10px; background: var(--ink); font-size: 13px; }
.confirm-meta div { display: flex; justify-content: space-between; gap: 12px; }
.confirm-meta dt { color: var(--muted); }
.confirm-meta dd { margin: 0; font-family: var(--mono); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.dialog-actions .danger-button { border-color: var(--plus); background: var(--plus); color: #fff; }

.sheet-backdrop { display: grid; align-items: end; padding-top: max(12vh, env(safe-area-inset-top)); }
.bottom-sheet { width: min(100%, 440px); max-height: 88vh; margin: 0 auto; padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--surface); box-shadow: 0 -16px 40px rgb(0 0 0 / .32); outline: 0; }
.sheet-handle { width: 42px; height: 4px; margin: 2px auto 14px; border-radius: 99px; background: var(--line); }
.sheet-heading { align-items: flex-start; }
.sheet-heading h2 { margin: 0; font-size: 19px; font-weight: 500; }
.sheet-close { min-width: 44px; min-height: 44px; margin: -8px -8px 0 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 25px; }
.sheet-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.date-picker-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; margin-top: 14px; text-align: center; }
.date-picker-nav strong { font-family: var(--mono); font-size: 14px; }
.month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.month-grid button { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--paper); font-size: 14px; }
.month-grid button[aria-selected="true"] { border-color: var(--plus); background: var(--ink); }
.manager-list { display: grid; gap: 8px; margin-top: 18px; }
.manager-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px; min-height: 52px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.manager-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.manager-row button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

.pull-refresh { position: fixed; z-index: 1; top: 0; right: 0; left: 0; height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); align-items: center; justify-content: center; background: var(--ink); color: var(--muted); font-family: var(--mono); font-size: 12px; }
.pull-refresh:not([hidden]) { display: flex; }
.pull-refresh-idle, .pull-refresh-busy { align-items: center; gap: 8px; }
.pull-refresh-idle { display: flex; }
.pull-refresh-busy { display: none; }
.pull-refresh.is-armed .pull-refresh-arrow { transform: rotate(180deg); }
.pull-refresh.is-refreshing .pull-refresh-idle { display: none; }
.pull-refresh.is-refreshing .pull-refresh-busy { display: flex; }
.pull-refresh .spinner { width: 20px; height: 20px; margin: 0; border-width: 2px; }
.app-shell.is-pulling { position: relative; z-index: 2; background: var(--ink); transition: none; }
.app-shell.is-refreshing { transform: translateY(52px); transition: transform .25s ease; }

@media (max-width: 360px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .summary-grid, .schedule-grid, .analysis-metrics, .source-links { grid-template-columns: 1fr; }
  .balance-value { font-size: 32px; }
  .tab-bar { padding-right: 8px; padding-left: 8px; }
  .tab-button { font-size: 13px; }
}

@media (max-height: 540px) {
  .boot-loading-overlay { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .boot-loading-content { gap: 12px; }
  .boot-loading-illustration { width: min(54vw, 190px); max-height: 28dvh; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes undo-countdown { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .boot-loading-overlay { transition: none; }
}
