.mobile-budget-app,
.cloud-auth-overlay {
  display: none;
}

.cloud-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 9px;
  color: #9fc1cc;
  background: transparent;
  border: 1px solid #23475a;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}

.cloud-sync-pill::before {
  width: 7px;
  height: 7px;
  content: "";
  background: #78909a;
  border-radius: 50%;
}

.cloud-sync-pill[data-state="ready"]::before { background: #59d991; }
.cloud-sync-pill[data-state="saving"]::before { background: #e8b84e; }
.cloud-sync-pill[data-state="error"]::before { background: #ff746e; }

.cloud-auth-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 12, 19, .92);
  backdrop-filter: blur(10px);
}

.cloud-auth-overlay.is-visible { display: flex; }

.cloud-auth-panel {
  width: min(390px, 100%);
  padding: 26px;
  color: #edf9fb;
  background: #0b1b27;
  border: 1px solid #285166;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .48);
}

.cloud-auth-kicker {
  margin: 0 0 7px;
  color: #78dceb;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cloud-auth-panel h1 { margin: 0; font-size: 25px; letter-spacing: 0; }
.cloud-auth-panel p { margin: 9px 0 20px; color: #93aab3; font-size: 13px; line-height: 1.5; }
.cloud-auth-panel form { display: grid; gap: 12px; }
.cloud-auth-panel label { display: grid; gap: 6px; color: #9fc1cc; font-size: 11px; font-weight: 700; }
.cloud-auth-panel input {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  color: #eef8fa;
  background: #071722;
  border: 1px solid #23475a;
  border-radius: 5px;
  font: inherit;
}
.cloud-auth-panel input:focus { outline: 2px solid rgba(120, 220, 235, .3); border-color: #78dceb; }
.cloud-auth-panel button {
  min-height: 42px;
  margin-top: 5px;
  color: #071a1f;
  background: #59d991;
  border: 1px solid #7ce7a8;
  border-radius: 5px;
  font: inherit;
  font-weight: 800;
}
.cloud-auth-panel button.cloud-auth-offline {
  margin-top: 0;
  color: #c5d9df;
  background: #17303e;
  border-color: #31566a;
}
.cloud-auth-error { min-height: 18px; margin: 0; color: #ff8b85; font-size: 12px; }

@media (max-width: 720px), (pointer: coarse) and (orientation: landscape) and (max-width: 960px) {
  html, body { width: 100%; height: 100%; min-height: 0; overflow: hidden; overscroll-behavior: none; background: #07131d; }
  body { position: fixed; inset: 0; }
  body > .app { display: none; }

  .mobile-budget-app {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    color: #edf8fa;
    background: #07131d;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(68px + env(safe-area-inset-top));
    padding: calc(12px + env(safe-area-inset-top)) 18px 11px;
    background: rgba(7, 19, 29, .94);
    border-bottom: 1px solid #183444;
    backdrop-filter: blur(12px);
  }

  .mobile-brand small { display: block; margin-bottom: 2px; color: #78dceb; font-size: 10px; font-weight: 700; text-transform: uppercase; }
  .mobile-brand h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: 0; }

  .mobile-content { display: grid; align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-bottom: calc(92px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .mobile-overview {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    border-bottom: 1px solid #183444;
  }
  .mobile-overview-primary { grid-row: span 2; display: grid; align-content: center; min-height: 126px; padding: 20px 18px; border-right: 1px solid #183444; }
  .mobile-overview-secondary { display: grid; align-content: center; min-height: 63px; padding: 10px 14px; }
  .mobile-overview-secondary + .mobile-overview-secondary { border-top: 1px solid #183444; }
  .mobile-stat-label { color: #83a6b3; font-size: 10px; font-weight: 700; text-transform: uppercase; }
  .mobile-stat-value { margin-top: 5px; color: #eef8fa; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
  .mobile-overview-primary .mobile-stat-value { font-size: clamp(26px, 8vw, 34px); }
  .mobile-stat-value.negative { color: #ff746e; }
  .mobile-stat-value.positive { color: #59d991; }

  .mobile-trend,
  .mobile-day { padding: 18px; border-bottom: 1px solid #183444; }
  .mobile-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-section-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0; }
  .mobile-segments { display: inline-grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #23475a; border-radius: 5px; overflow: hidden; }
  .mobile-segments button { min-height: 30px; padding: 0 9px; color: #8eabb6; background: transparent; border: 0; border-right: 1px solid #23475a; font-size: 10px; font-weight: 700; }
  .mobile-segments button:last-child { border-right: 0; }
  .mobile-segments button[aria-pressed="true"] { color: #07131d; background: #78dceb; }
  .mobile-segments button[data-mode="shopping"][aria-pressed="true"] { background: #ff746e; }
  .mobile-segments button[data-mode="fuel"][aria-pressed="true"] { background: #d8b45d; }
  .mobile-trend-meta { display: flex; align-items: baseline; justify-content: space-between; margin-top: 13px; }
  .mobile-trend-meta strong { font-size: 23px; font-variant-numeric: tabular-nums; }
  .mobile-trend-meta span { color: #83a6b3; font-size: 10px; }
  .mobile-trend-chart { display: block; width: 100%; height: 132px; margin-top: 5px; overflow: visible; touch-action: manipulation; }
  .mobile-chart-grid { stroke: rgba(75, 135, 154, .17); stroke-width: 1; }
  .mobile-chart-baseline { stroke-width: 1.2; }
  .mobile-chart-bar { cursor: pointer; }
  .mobile-chart-marker { fill: #eafcff; }
  .mobile-chart-label { fill: #83a6b3; font: 600 9px Inter, sans-serif; }

  .mobile-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-day-heading h2 { margin: 0; font-size: 16px; }
  .mobile-day-selected-date { display: grid; justify-items: end; gap: 1px; color: #73e4e8; text-align: right; }
  .mobile-day-selected-date strong { font-size: 12px; font-variant-numeric: tabular-nums; }
  .mobile-day-selected-date > span:not(.mobile-stat-label) { color: #83a6b3; font-size: 10px; }
  .mobile-day-selected-date .mobile-stat-label:empty { display: none; }
  .mobile-date-picker-backdrop { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); background: rgba(2, 9, 14, .74); }
  .mobile-date-picker-backdrop[hidden] { display: none; }
  .mobile-date-picker { width: min(380px, 100%); max-height: 100%; padding: 18px; overflow: auto; color: #edf8fa; background: #0b1b27; border: 1px solid #285166; border-radius: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
  .mobile-date-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
  .mobile-date-picker-head h2 { margin: 0; font-size: 18px; }
  .mobile-date-picker-head button { width: 34px; height: 34px; padding: 0; color: #9fc1cc; background: transparent; border: 1px solid #23475a; border-radius: 5px; font-size: 22px; line-height: 1; }
  .mobile-date-picker .mobile-section-head { gap: 6px; }
  .mobile-date-picker .mobile-month-nav { gap: 5px; }
  .mobile-date-picker .mobile-month-nav strong { min-width: 108px; font-size: 12px; }
  .mobile-date-picker .mobile-weekdays { margin-top: 15px; }
  .mobile-date-picker-grid { grid-template-rows: repeat(var(--calendar-week-count, 6), 39px); margin-top: 6px; }
  .mobile-date-picker .mobile-calendar-day { padding-inline: 4px; font-size: 12px; }
  .mobile-date-picker .mobile-calendar-dots { right: 4px; }
  .mobile-entry-list { display: grid; margin-top: 13px; border-top: 1px solid #183444; }
  .mobile-entry {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 66px;
    padding: 12px 4px 11px 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #183444;
    text-align: left;
  }
  .mobile-entry::before { position: absolute; top: 13px; bottom: 13px; left: 0; width: 3px; content: ""; background: #ff746e; }
  .mobile-entry.income::before { background: #59d991; }
  .mobile-entry.planned::before { background: radial-gradient(circle, #ff746e 0 1.35px, transparent 1.5px) center top / 3px 20% repeat-y; }
  .mobile-entry-copy { min-width: 0; }
  .mobile-entry-copy strong { display: block; overflow: hidden; color: #edf8fa; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-entry-copy span { display: block; margin-top: 3px; overflow: hidden; color: #83a6b3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-entry-amount { color: #ff746e; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .mobile-entry.income .mobile-entry-amount { color: #59d991; }
  .mobile-entry-empty { padding: 28px 0 8px; color: #83a6b3; font-size: 12px; text-align: center; }
  .mobile-day-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; padding-right: 66px; color: #9fc1cc; font-size: 11px; }
  .mobile-day-total strong { color: #edf8fa; font-size: 17px; font-variant-numeric: tabular-nums; }

  .mobile-add-button {
    position: fixed;
    z-index: 25;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: auto;
    min-width: 112px;
    height: 50px;
    padding: 0 20px;
    color: #1d0d0c;
    background: #ff746e;
    border: 1px solid #ff928d;
    border-radius: 7px;
    box-shadow: 0 10px 25px rgba(255, 90, 82, .25);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
  }

  .mobile-sheet-backdrop { position: fixed; z-index: 39; inset: 0; display: none; background: rgba(0, 0, 0, .58); }
  .mobile-sheet-backdrop.is-open { display: block; }
  .mobile-entry-sheet {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(88dvh, 720px);
    max-height: calc(100dvh - env(safe-area-inset-top) - 10px);
    padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    color: #edf8fa;
    background: #0b1b27;
    border-top: 1px solid #2c5a70;
    transform: translateY(105%);
    transition: transform .22s ease;
  }
  .mobile-entry-sheet.is-open { transform: translateY(0); }
  .mobile-sheet-handle { width: 38px; height: 4px; margin: 2px auto 15px; background: #3e6575; border-radius: 2px; }
  .mobile-sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .mobile-sheet-head h2 { margin: 0; font-size: 18px; }
  .mobile-sheet-close { width: 36px; height: 36px; padding: 0; color: #9fc1cc; background: transparent; border: 1px solid #23475a; border-radius: 50%; font-size: 22px; }
  .mobile-entry-form { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 11px; min-height: 0; margin-top: 16px; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-entry-form label { display: grid; gap: 5px; color: #9fc1cc; font-size: 10px; font-weight: 700; }
  .mobile-entry-form label.wide { grid-column: 1 / -1; }
  .mobile-entry-form input,
  .mobile-entry-form select { width: 100%; min-height: 41px; padding: 0 10px; color: #edf8fa; background: #071722; border: 1px solid #23475a; border-radius: 5px; font: inherit; font-size: 13px; }
  .mobile-form-error { grid-column: 1 / -1; margin: 0; color: #ff8b85; font-size: 12px; }
  .mobile-form-error[hidden] { display: none; }
  .mobile-form-choice { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #23475a; border-radius: 5px; overflow: hidden; }
  .mobile-form-choice button { min-height: 40px; color: #9fc1cc; background: transparent; border: 0; border-right: 1px solid #23475a; font-size: 11px; font-weight: 700; }
  .mobile-form-choice button:last-child { border-right: 0; }
  .mobile-form-choice button[aria-pressed="true"][data-value="income"] { color: #06130d; background: #59d991; }
  .mobile-form-choice button[aria-pressed="true"][data-value="expense"] { color: #1b0c0b; background: #ff746e; }
  .mobile-form-choice button[aria-pressed="true"][data-value="actual"] { color: #06141a; background: #78dceb; }
  .mobile-form-choice button[aria-pressed="true"][data-value="planned"] { color: #1b0c0b; background: #ff746e; }
  .mobile-sheet-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 5px; }
  .mobile-sheet-actions button { min-height: 43px; padding: 0 16px; border-radius: 5px; font-weight: 800; }
  .mobile-save { color: #07131d; background: #59d991; border: 1px solid #83edaf; }
  .mobile-delete { color: #ff8b85; background: transparent; border: 1px solid #6b3738; }
  .mobile-delete[hidden] { display: none; }
}

@media (max-width: 380px) {
  .mobile-overview-primary { padding-inline: 14px; }
  .mobile-overview-secondary { padding-inline: 10px; }
  .mobile-segments button { padding-inline: 6px; }
  .mobile-entry-form { grid-template-columns: 1fr; }
  .mobile-entry-form label.wide,
  .mobile-sheet-actions { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-entry-sheet { transition: none; }
}

@media (max-width: 720px), (pointer: coarse) and (orientation: landscape) and (max-width: 960px) {
  html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
  }
  body { position: fixed; inset: 0; }
  .mobile-budget-app, .mobile-budget-app * { box-sizing: border-box; }
  .mobile-budget-app {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
  .mobile-budget-app button { touch-action: manipulation; }
  .mobile-budget-app input, .mobile-budget-app select { touch-action: auto; -webkit-user-select: text; user-select: text; }
  .mobile-topbar {
    min-width: 0;
    min-height: calc(62px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    gap: 12px;
    background: #07131d;
    backdrop-filter: none;
  }
  .mobile-brand { min-width: 0; }
  .mobile-brand h1 { overflow: hidden; font-size: 18px; white-space: nowrap; text-overflow: ellipsis; }
  .cloud-sync-pill { flex: 0 1 auto; max-width: 45%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .mobile-content {
    display: block;
    min-height: 0;
    width: 100%;
    padding: 0 0 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: none;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-content:has(.mobile-entry-page:not([hidden])) { padding: 0; overflow: hidden; }
  .mobile-page { display: block; min-width: 0; }
  .mobile-page[hidden], .mobile-view-button[hidden], .mobile-save-fixed[hidden] { display: none !important; }
  .mobile-overview { display: block; }
  .mobile-overview-primary { min-width: 0; min-height: 0; padding: 15px 16px 16px; border-right: 0; }
  .mobile-overview-primary .mobile-stat-value { margin-top: 6px; font-size: 27px; white-space: nowrap; }
  .mobile-balance-chart-section, .mobile-calendar, .mobile-trend-breakdown {
    padding: 18px 16px;
    border-bottom: 1px solid #183444;
  }
  .mobile-section-head { min-width: 0; }
  .mobile-section-head h2 { font-size: 16px; }
  .mobile-chart-date { flex: 0 0 auto; color: #83a6b3; font-size: 11px; font-variant-numeric: tabular-nums; }
  .mobile-balance-chart-window { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); width: calc(100% + 16px); aspect-ratio: 320 / 156; margin: 10px 0 0 -16px; overflow: hidden; touch-action: pan-y; }
  .mobile-balance-axis { z-index: 2; display: block; width: 34px; height: 100%; overflow: visible; background: #07131d; }
  .mobile-balance-axis-label { fill: #83a6b3; font: 600 9px Inter, sans-serif; }
  .mobile-balance-track { position: relative; min-width: 0; height: 100%; overflow: hidden; }
  .mobile-balance-chart { position: absolute; top: 0; left: 0; display: block; max-width: none; height: 100%; margin: 0; overflow: visible; transition: transform 560ms cubic-bezier(.22, .61, .36, 1); will-change: transform; }
  .mobile-balance-chart-window.is-dragging .mobile-balance-chart,
  .mobile-balance-chart-window.is-dragging + .mobile-balance-month-window .mobile-balance-months { transition: none; }
  .mobile-balance-month-window { width: calc(100% - 18px); height: 16px; margin: 1px 0 0 18px; overflow: hidden; }
  .mobile-balance-months { display: flex; align-items: center; height: 100%; margin: 0; color: #83a6b3; font-size: 10px; font-weight: 700; text-align: center; white-space: nowrap; transition: transform 560ms cubic-bezier(.22, .61, .36, 1); will-change: transform; }
  .mobile-balance-months span { flex: 0 0 auto; }
  .mobile-balance-months .current { color: #73e4e8; }
  .mobile-balance-grid { stroke: rgba(75, 135, 154, .17); stroke-width: .7; }
  .mobile-balance-minor-grid { stroke: rgba(75, 135, 154, .09); stroke-width: .7; }
  .mobile-balance-month-line { stroke: rgba(75, 135, 154, .29); stroke-width: 1; }
  .mobile-balance-focus-month { fill: rgba(115, 228, 232, .035); }
  .mobile-balance-area { fill: url(#mobileBalanceFill); }
  .mobile-balance-line { fill: none; stroke: #73e4e8; stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
  .mobile-balance-today-line { stroke: #73e4e8; stroke-width: 1; stroke-dasharray: 3 5; opacity: .68; }
  .mobile-balance-today-halo { fill: rgba(115, 228, 232, .16); }
  .mobile-balance-today-ring { fill: #091621; stroke: #73e4e8; stroke-width: 2.2; }
  .mobile-balance-selected-point { fill: #effcfd; stroke: #2a7480; stroke-width: .9; }
  .mobile-month-nav { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .mobile-month-nav strong { min-width: 106px; color: #edf8fa; font-size: 11px; font-weight: 700; text-align: center; }
  .mobile-month-nav button { width: 30px; height: 30px; padding: 0; color: #78dceb; background: transparent; border: 1px solid #23475a; border-radius: 5px; font-size: 19px; }
  .mobile-month-nav button:disabled { opacity: .35; }
  .mobile-weekdays, .mobile-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .mobile-weekdays { margin-top: 16px; color: #83a6b3; font-size: 10px; font-weight: 700; text-align: center; }
  .mobile-calendar-grid { position: relative; grid-template-rows: repeat(var(--calendar-week-count, 6), 42px); margin-top: 7px; }
  .mobile-calendar { touch-action: pan-y; }
  .mobile-calendar-grid-line { position: absolute; z-index: 0; display: block; pointer-events: none; background: rgba(32, 62, 78, .8); }
  .mobile-calendar-grid-line--vertical { top: 0; bottom: 0; width: 1px; transform: translateX(-.5px); }
  .mobile-calendar-grid-line--horizontal { right: 0; left: 0; height: 1px; transform: translateY(-.5px); }
  .mobile-calendar-day { position: relative; z-index: 1; display: flex; align-items: center; min-width: 0; min-height: 0; padding: 0 6px; color: #dce9ef; background: transparent; border: 0; border-radius: 0; font-size: 13px; font-weight: 700; line-height: 1; text-align: left; }
  .mobile-calendar-day-top { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 100%; }
  .mobile-calendar-day.selected { z-index: 1; color: #edf8fa; background: #153447; box-shadow: inset 0 0 0 2px #78dceb; }
  .mobile-calendar-day:disabled { opacity: .28; }
  .mobile-calendar-dots { position: absolute; top: 50%; right: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; transform: translateY(-50%); }
  .mobile-calendar-dots i { box-sizing: border-box; width: 7px; height: 7px; border-radius: 50%; }
  .mobile-calendar-dots .expense { background: #ff746e; }
  .mobile-calendar-dots .income { background: #59d991; }
  .mobile-calendar-dots .planned { background: transparent; border: 1px solid #ff746e; }
  .mobile-day, .mobile-trend { padding: 18px 16px; }
  .mobile-day-date input { font-size: 16px; }
  .mobile-day-total { padding-right: 0; }
  .mobile-trend-page .mobile-trend { border-bottom: 1px solid #183444; }
  .mobile-trend-page .mobile-section-head { flex-wrap: wrap; }
  .mobile-trend-page .mobile-section-head h2 { width: 100%; }
  .mobile-trend-page .mobile-segments { width: 100%; }
  .mobile-trend-page .mobile-segments button { min-height: 39px; font-size: 12px; }
  .mobile-trend-meta { margin-top: 20px; }
  .mobile-trend-chart { height: auto; aspect-ratio: 320 / 132; margin-top: 16px; overflow: hidden; }
  .mobile-trend-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .mobile-trend-breakdown div { display: grid; gap: 5px; min-width: 0; }
  .mobile-trend-breakdown span { color: #83a6b3; font-size: 11px; }
  .mobile-trend-breakdown strong { font-size: 18px; font-variant-numeric: tabular-nums; }
  .mobile-trend-breakdown div:first-child strong { color: #ff746e; }
  .mobile-trend-breakdown div:last-child strong { color: #d8b45d; }
  .mobile-trend-breakdown .mobile-transport-forecast { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid #183444; }
  .mobile-trend-breakdown .mobile-transport-forecast span { color: #d8b45d; }
  .mobile-transport-forecast b { font-weight: 700; }
  .mobile-trend-breakdown .mobile-transport-forecast strong { color: #d8b45d; }
  .mobile-view-button, .mobile-add-button {
    position: static;
    width: 106px;
    height: 46px;
    min-width: 0;
    padding: 0 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
  }
  .mobile-action-bar { display: flex; align-items: center; justify-content: space-between; min-height: calc(70px + env(safe-area-inset-bottom)); padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); background: #07131d; border-top: 1px solid #183444; }
  .mobile-view-button { color: #78dceb; background: #0b2230; border: 1px solid #337081; }
  .mobile-add-button { margin-left: auto; color: #1d0d0c; background: #ff746e; border: 1px solid #ff928d; }
  .mobile-budget-app[data-page="entry"] .mobile-add-button { order: -1; margin: 0; color: #9fc1cc; background: #0b2230; border-color: #337081; box-shadow: none; }
  .mobile-save-fixed { width: 106px; height: 46px; margin-left: auto; padding: 0 12px; color: #07131d; background: #59d991; border: 1px solid #83edaf; border-radius: 5px; font-size: 14px; font-weight: 800; }
  .mobile-entry-page { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 16px 16px 12px; overflow: hidden; }
  .mobile-entry-head { display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin-bottom: 18px; }
  .mobile-entry-head h2 { margin: 0; font-size: 19px; }
  .mobile-entry-head .mobile-delete { min-height: 30px; padding: 0 11px; font-size: 12px; }
  .mobile-entry-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 17px 12px; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
  .mobile-entry-form label { min-width: 0; gap: 7px; font-size: 11px; }
  .mobile-entry-form label.wide, .mobile-form-error { grid-column: 1 / -1; }
  .mobile-entry-form input, .mobile-entry-form select { display: block; min-width: 0; max-width: 100%; width: 100%; height: 46px; min-height: 46px; padding: 0 12px; font-size: 16px; line-height: normal; }
  #mobileFormStatus { font-size: 14px; }
  #mobileFormAmount { color: #edf8fa; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .mobile-form-date-control { display: block; min-width: 0; }
  .mobile-form-date-control button { display: block; width: 100%; height: 46px; padding: 0 8px; color: #edf8fa; background: #071722; border: 1px solid #23475a; border-radius: 5px; font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; text-align: center; }
  .mobile-entry-form input[type="hidden"] { display: none; }
  .mobile-form-choice button { min-height: 44px; font-size: 14px; }
  .mobile-form-error { margin: -5px 0 0; }
  .mobile-entry-page ~ .mobile-sheet-backdrop, .mobile-entry-sheet { display: none; }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .mobile-balance-chart, .mobile-balance-months { transition: none; }
}

@media (pointer: coarse) and (orientation: landscape) and (min-width: 680px) and (max-width: 960px) {
  .mobile-topbar { min-height: 48px; padding-block: 6px; }
  .mobile-brand h1 { font-size: 16px; }
  .mobile-action-bar { min-height: calc(54px + env(safe-area-inset-bottom)); padding-block: 5px; }
  .mobile-view-button, .mobile-add-button { height: 38px; }
  .mobile-balance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; }
  .mobile-overview, .mobile-day { grid-column: 1 / -1; }
  .mobile-overview-primary { padding-block: 9px; }
  .mobile-balance-chart-section { min-width: 0; border-right: 1px solid #183444; }
  .mobile-calendar { min-width: 0; }
  .mobile-balance-chart-window { aspect-ratio: 320 / 156; }
  .mobile-calendar-grid { grid-template-rows: repeat(var(--calendar-week-count, 6), 29px); }
  .mobile-calendar-day { padding-inline: 4px; font-size: 11px; }
  .mobile-calendar-dots { right: 3px; }
  .mobile-weekdays { margin-top: 9px; }
  .mobile-entry-page { padding-block: 9px; }
  .mobile-entry-head { min-height: 24px; margin-bottom: 9px; }
  .mobile-entry-head h2 { font-size: 16px; }
  .mobile-entry-form { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
  .mobile-entry-form label.wide { grid-column: span 2; }
  .mobile-entry-form input, .mobile-entry-form select { height: 40px; min-height: 40px; }
  .mobile-form-choice button { min-height: 40px; }
  .mobile-form-error { grid-column: 1 / -1; }
  .mobile-save-fixed { height: 38px; }
}

@media (max-height: 650px) and (orientation: portrait) {
  .mobile-entry-page { padding-block: 10px; }
  .mobile-entry-head { margin-bottom: 10px; }
  .mobile-entry-form { gap: 10px; }
  .mobile-entry-form input, .mobile-entry-form select { height: 40px; min-height: 40px; }
  .mobile-form-choice button { min-height: 40px; }
}

@media (max-width: 380px) {
  #mobileFormStatus { padding-inline: 8px; font-size: 13px; }
}

@media (max-height: 450px) {
  .mobile-content:has(.mobile-entry-page:not([hidden]):focus-within) { overflow-y: auto; }
  .mobile-entry-page:focus-within { height: auto; overflow: visible; }
  .mobile-entry-form:focus-within { overflow: visible; }
}
