/* ---------------------------------------------------------
   IgWallet — Apple-inspired tokens (design-references/.../apple)
   + LiquidGlass panels (vendor/liquidglass.js, wired in glass.js)
--------------------------------------------------------- */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: rgba(0, 0, 0, 0.045);
  --fill-strong: rgba(0, 0, 0, 0.08);
  --hairline: rgba(0, 0, 0, 0.08);

  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #86868b;

  --primary: #0071e3;
  --primary-press: #0062c4;
  --on-primary: #ffffff;

  --expense: #d70015;
  --expense-tint: rgba(255, 59, 48, 0.1);
  --income: #1d8a3a;
  --income-tint: rgba(52, 199, 89, 0.13);
  --danger: #d70015;

  --nav-bg: rgba(245, 245, 247, 0.62);
  --glass-fallback: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.75);
  --chip-bg: rgba(255, 255, 255, 0.55);
  --chip-border: rgba(255, 255, 255, 0.8);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --pill: 9999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.22);

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;

  /* Strong, deliberate curves — plain CSS ease/linear read as sluggish on UI motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --nav-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --surface: #161618;
    --fill: rgba(255, 255, 255, 0.07);
    --fill-strong: rgba(255, 255, 255, 0.12);
    --hairline: rgba(255, 255, 255, 0.08);

    --ink: #f5f5f7;
    --ink-2: #c7c7cc;
    --ink-3: #8e8e93;

    --primary: #0a84ff;
    --primary-press: #0071e3;

    --expense: #ff6961;
    --expense-tint: rgba(255, 105, 97, 0.15);
    --income: #30d158;
    --income-tint: rgba(48, 209, 88, 0.15);
    --danger: #ff6961;

    --nav-bg: rgba(11, 11, 13, 0.62);
    --glass-fallback: rgba(40, 40, 46, 0.5);
    --glass-border: rgba(255, 255, 255, 0.12);
    --chip-bg: rgba(255, 255, 255, 0.08);
    --chip-border: rgba(255, 255, 255, 0.12);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.022em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }

/* ---------- Global nav (frosted) ---------- */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hairline);
}
.global-nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(140deg, #0a84ff 0%, #5e5ce6 55%, #bf5af2 100%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35);
}
.nav-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--pill);
  border: none;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--ink);
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.92); }
#blurToggle.active { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--fill-strong); }
  #blurToggle.active:hover { background: var(--ink); }
}

/* ---------- Stage (LiquidGlass root) ---------- */
.stage {
  position: relative;
  margin-top: calc(var(--nav-h) * -1); /* run the aurora up behind the frosted nav */
  padding: calc(var(--nav-h) + 36px) 24px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.aurora {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Glass panels. Defaults below are the CSS fallback (no WebGL / reduced transparency);
   once LiquidGlass is running, `.lg-ready` hands the surface over to the shader canvas. */
.glass {
  position: relative;
  z-index: 1;
  isolation: isolate;
  border-radius: var(--radius-xl);
  background: var(--glass-fallback);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}
.lg-ready > .glass {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--surface);
    border-color: var(--hairline);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.stage > .glass { width: min(1100px, 100%); }

/* Hero */
.hero-card {
  padding: 40px 32px 28px;
  text-align: center;
}
.hero-caption {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}
.hero-balance {
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 8px 0 28px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.account-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  font-size: 13px;
  color: var(--ink-2);
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.account-chip b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.account-chip.add { color: var(--primary); font-weight: 500; padding-left: 14px; }
.account-chip:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .account-chip:hover { background: var(--fill-strong); }
}

/* Summary */
.summary-card { padding: 20px 28px 26px; }
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.month-switcher { display: flex; align-items: center; gap: 6px; }
.month-label {
  min-width: 140px;
  white-space: nowrap;
  text-align: center;
  font-size: 19px;
  font-weight: 600;
}
.month-nav { width: 32px; height: 32px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stat-tile { padding: 2px 24px; border-left: 1px solid var(--hairline); }
.stat-tile:first-child { padding-left: 0; border-left: none; }
.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}
.stat-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.stat-tile.income .dot { background: var(--income); }
.stat-tile.expense .dot { background: var(--expense); }
.stat-tile.net .dot { background: var(--primary); }
.stat-value {
  margin-top: 6px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.stat-tile.income .stat-value { color: var(--income); }
.stat-tile.expense .stat-value { color: var(--expense); }
.stat-tile.net.positive .stat-value { color: var(--ink); }
.stat-tile.net.negative .stat-value { color: var(--expense); }

/* Direction-aware entrance when switching months */
@keyframes contentInRight { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes contentInLeft  { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes contentInUp    { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.month-anim-next { animation: contentInRight 260ms var(--ease-out); }
.month-anim-prev { animation: contentInLeft 260ms var(--ease-out); }

/* NumberFlow-style rolling digits — see setFlowSlot/flowNumber in app.js */
.num-flow { display: inline-flex; align-items: baseline; font-variant-numeric: tabular-nums; }
.num-slot { display: inline-block; position: relative; vertical-align: baseline; }
.num-slot.animating { overflow: hidden; }
.num-char-inner { display: inline-block; white-space: pre; }
.num-slot.animating .num-char-inner {
  position: absolute;
  left: 0;
  top: 0;
  transition: transform 420ms var(--ease-out), opacity 420ms var(--ease-out);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--pill);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 18px rgba(0, 113, 227, 0.28);
}
.btn-secondary { background: var(--fill); color: var(--ink); }
.stage .btn-secondary { background: var(--chip-bg); box-shadow: inset 0 0 0 1px var(--chip-border); }
.btn-text { background: transparent; color: var(--primary); padding: 8px 10px; }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-small { padding: 8px 14px; font-size: 13px; }
.file-btn { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--primary-press); }
  .btn-secondary:hover { background: var(--fill-strong); }
}

/* ---------- Column header ---------- */
.col-header {
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 49px;
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 24px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.col-header-cell {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* ---------- Ledger ---------- */
.ledger {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.day-group {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 24px;
  align-items: start;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  animation: contentInUp 320ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.day-date { padding-top: 2px; }
.day-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}
.day-name { margin-top: 8px; font-size: 15px; font-weight: 600; }
.day-full { font-size: 13px; color: var(--ink-3); }

.day-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.col-label-mobile { display: none; }

.tx-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 -10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.tx-card:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .tx-card:hover { background: var(--fill); }
}
.tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.tx-card.expense .tx-icon { background: var(--expense-tint); }
.tx-card.income .tx-icon { background: var(--income-tint); }
.tx-body { min-width: 0; }
.tx-title, .tx-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-title { font-size: 15px; font-weight: 500; }
.tx-meta { font-size: 13px; color: var(--ink-3); }
.tx-amount {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tx-card.expense .tx-amount { color: var(--expense); }
.tx-card.income .tx-amount { color: var(--income); }

.empty-col-hint { font-size: 13px; color: var(--ink-3); padding: 9px 0; }

/* ---------- Blur privacy mode ---------- */
body.blur-on .money {
  filter: blur(8px);
  user-select: none;
  transition: filter 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  body.blur-on .money:hover { filter: blur(0); }
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  animation: contentInUp 320ms var(--ease-out) both;
}
.empty-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.empty-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 22px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 28px 24px 48px; font-size: 12px; color: var(--ink-3); }

/* ---------- Print-only header ---------- */
.print-header { display: none; }

/* ---------- Modals (sheet on phones, dialog on larger screens) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 220ms var(--ease-out);
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-modal);
  transform: translateY(32px);
  opacity: 0;
  transition: transform 320ms var(--ease-drawer), opacity 220ms var(--ease-out);
}
.modal-backdrop.open .modal { transform: translateY(0); opacity: 1; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 28px; transform: translateY(16px) scale(0.98); }
  .modal-backdrop.open .modal { transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 14px;
}
.modal-head h2 { font-size: 21px; font-weight: 600; }
.close-btn { width: 32px; height: 32px; }
.modal-body { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.field input, .field select, .field textarea, .pin-form input {
  width: 100%;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--fill);
  outline: none;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus, .pin-form input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
}
.field textarea { resize: vertical; }
.amount-input { font-size: 28px !important; font-weight: 600 !important; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-icon { grid-template-columns: 76px 1fr; }
.field-checkbox { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.field-checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Segmented control */
.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 12px;
  background: var(--fill);
}
.type-btn {
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.type-btn.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.type-btn.active[data-type="expense"] { color: var(--expense); }
.type-btn.active[data-type="income"] { color: var(--income); }

.modal-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.modal-actions-right { display: flex; gap: 10px; margin-left: auto; }

.settings-section { padding-bottom: 18px; border-bottom: 1px solid var(--hairline); }
.settings-section:last-child { border-bottom: none; padding-bottom: 0; }
.settings-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.settings-hint { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.danger-heading { color: var(--danger); }

.account-manage-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.account-manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--fill);
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .account-manage-row:hover { background: var(--fill-strong); }
}
.account-manage-row .acc-icon { font-size: 18px; }
.account-manage-row .acc-name { flex: 1; font-size: 14px; font-weight: 600; }
.account-manage-row .acc-balance { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.pin-status { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.pin-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pin-form input { flex: 1; min-width: 150px; width: auto; }
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Lock screen (LiquidGlass root) ---------- */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #07070a;
  color: #fff;
  opacity: 0;
  transition: opacity 260ms var(--ease-out);
}
.lock-screen.open { opacity: 1; }
.lock-card {
  width: min(360px, 100%);
  padding: 36px 28px 26px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}
.lock-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}
.lock-title { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.lock-sub { font-size: 14px; color: rgba(255, 255, 255, 0.68); margin-bottom: 22px; }
.lock-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 13px;
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.4em;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  outline: none;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.lock-input::placeholder { letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.4); }
.lock-input:focus { border-color: #0a84ff; box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.25); }
.lock-error { color: #ff6961; font-size: 13px; margin-bottom: 12px; }
.lock-error.shake { animation: shake 320ms var(--ease-in-out); }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}
.lock-note { font-size: 11px; color: rgba(255, 255, 255, 0.42); margin-top: 18px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 833px), print {
  .col-header { display: none; }
  .day-group { grid-template-columns: 1fr; gap: 6px; padding: 18px 18px 12px; }
  .day-date {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
  }
  .day-num { font-size: 28px; }
  .day-name { margin-top: 0; }
  .col-label-mobile {
    display: block;
    margin: 10px 0 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
  }
}

@media (max-width: 640px) {
  .stage { padding: calc(var(--nav-h) + 20px) 16px 28px; gap: 14px; }
  .glass { border-radius: 28px; }
  .hero-card { padding: 30px 20px 22px; }
  .hero-balance { margin-bottom: 22px; }
  .summary-card { padding: 16px 20px 18px; }
  .summary-head { margin-bottom: 8px; }
  .month-label { min-width: 0; font-size: 17px; padding: 0 4px; }
  .summary-grid { grid-template-columns: 1fr; }
  .stat-tile {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 0;
    border-left: none;
    border-top: 1px solid var(--hairline);
  }
  .stat-tile:first-child { border-top: none; }
  .stat-value { margin-top: 0; font-size: 20px; }
  .ledger { padding: 4px 16px 16px; }
  .global-nav-inner { padding: 0 16px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-wrap: nowrap; gap: 8px; }
  .hero-actions .btn { flex: 1; padding: 12px 10px; font-size: 14px; }
  /* Chips become one swipeable row instead of a tall stack */
  .account-chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin: 22px -20px 0;
    padding: 18px 20px 2px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  }
  .account-chips::-webkit-scrollbar { display: none; }
  .account-chip { flex: 0 0 auto; }
  #exportPdfBtn { width: 36px; height: 36px; padding: 0; }
  #exportPdfBtn .btn-label { display: none; }
  .field-row:not(.field-row-icon) { grid-template-columns: 1fr; }
}

/* ---------- Print (Ekspor PDF) ---------- */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --fill: rgba(0, 0, 0, 0.04);
    --hairline: #dcdce0;
    --ink: #1d1d1f;
    --ink-2: #424245;
    --ink-3: #6e6e73;
    --expense: #c40012;
    --expense-tint: #fff0ef;
    --income: #157a35;
    --income-tint: #ecf9f0;
    --glass-fallback: #ffffff;
    --glass-border: #dcdce0;
  }
  html, body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.blur-on .money { filter: none !important; }
  .global-nav, .aurora, .glass > canvas, .hero-actions, .account-chips, .month-nav,
  #exportPdfBtn, .footer, .modal-backdrop, .lock-screen { display: none !important; }
  .print-header { display: block; text-align: center; padding: 8px 0 4px; }
  .print-brand { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
  .print-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
  .stage { margin-top: 0; padding: 16px 0; gap: 12px; }
  .glass, .lg-ready > .glass {
    background: #fff;
    border: 1px solid var(--hairline);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .hero-card { padding: 20px; }
  .hero-balance { margin-bottom: 0; font-size: 40px; }
  .day-group, .empty-state { box-shadow: none; animation: none; break-inside: avoid-page; page-break-inside: avoid; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}
