/* ---- Auth ---- */
.auth-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5) var(--sp-4);
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-5); width: 100%; max-width: 400px;
}
.auth-card h1 { font-size: 22px; margin-bottom: var(--sp-1); }
.auth-card .sub { color: var(--text-dim); margin-bottom: var(--sp-5); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.auth-brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.auth-foot { text-align: center; margin-top: var(--sp-4); color: var(--text-dim); font-size: 13px; }
.password-rules { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: flex; flex-direction: column; gap: 4px; }
.password-rules li { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.password-rules li::before { content: "○"; }
.password-rules li.ok { color: var(--positive); }
.password-rules li.ok::before { content: "●"; }
.reset-notice { background: var(--surface-2); border-radius: var(--radius); padding: var(--sp-3); font-size: 12px; color: var(--text-dim); margin-top: var(--sp-4); }
.recovery-code-block { padding: var(--sp-4); text-align: center; background: var(--surface-2); border-radius: var(--radius); }
/* P1 — break-all let the code wrap mid-group ("JDZW-NM5H-WRT / Q-P8CG"),
   which risks a hand-transcribed mis-copy of the one string that must be
   copied perfectly. keep-all only breaks at existing whitespace/hyphen
   boundaries the browser treats as breakable, plus explicit wrapping so long
   groups still wrap between hyphens rather than through them. */
.recovery-code-text { font-size: 24px; letter-spacing: 0.08em; font-weight: 700; word-break: keep-all; overflow-wrap: break-word; }
.btn-row { display: flex; gap: var(--sp-3); margin: var(--sp-4) 0; }
.btn-row .btn { flex: 1; }
.load-description { max-width: 60%; }
.warn-card-btn { border-left: 3px solid var(--warn); margin-top: var(--sp-3); width: 100%; text-align: left; cursor: pointer; }
.warn-border-card { border-left: 3px solid var(--warn); }
.signed-in-as { margin-top: var(--sp-5); }
.next-service-name { font-weight: 600; }
.next-service-remaining { margin-top: 8px; }
.forgot-link-wrap { margin: -8px 0 var(--sp-4); }
.forgot-link { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Month / quarter selector ---- */
.period-selector { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.period-selector button.nav-btn { min-width: var(--tap); min-height: var(--tap); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 18px; cursor: pointer; }
.period-selector button.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.period-selector .period-label { min-width: 160px; min-height: var(--tap); text-align: center; font-weight: 700; font-size: 16px; background: none; border: none; color: var(--text); cursor: pointer; padding: var(--sp-2); border-radius: var(--radius); }
.period-selector .period-label:hover { background: var(--surface-2); }

/* ---- Filter row ---- */
.filter-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); align-items: center; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 140px; }
.search-box input { width: 100%; min-height: var(--tap); padding: 0 var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 16px; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); margin: var(--sp-5) 0 var(--sp-2); }
.section-title:first-child { margin-top: 0; }

.settings-group { margin-bottom: var(--sp-5); }
.settings-group h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); margin-bottom: var(--sp-3); }

.status-chip[data-status="overdue"] { background: rgba(224,84,78,0.15); color: var(--danger); }
.status-chip[data-status="due_soon"] { background: rgba(224,163,46,0.15); color: var(--warn); }
.status-chip[data-status="ok"] { background: var(--surface-2); color: var(--text-dim); }

.more-menu { display: flex; flex-direction: column; gap: var(--sp-2); }
.more-menu a, .more-menu button.menu-item, .more-menu .menu-item-static {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
  cursor: pointer; width: 100%; text-align: left;
}
.more-menu button.menu-item.danger-text { color: var(--danger); }
.more-menu .chev { color: var(--text-dim); }
/* SHARING.md §8.3 — 'documents' is listed (granted, but no standalone
   screen) as an inert row: same shape as a menu link, no chevron, no tap. */
.more-menu .menu-item-static { color: var(--text-dim); cursor: default; }

.scan-sheet-actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.scan-sheet-actions .btn { min-height: 56px; }

.receipt-preview-wrap { margin-bottom: var(--sp-4); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.receipt-preview-wrap img { width: 100%; max-height: 220px; object-fit: cover; }

.formula-sheet .formula-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); border-radius: var(--radius); padding: var(--sp-3); margin-top: var(--sp-2); white-space: pre-wrap; }

@media (min-width: 561px) {
  .app-header, main#view, .bottom-nav > .nav-inner { max-width: 560px; margin: 0 auto; }
}
