.mobile-nav { display: none; }
.mobile-home { max-width: 620px; margin: auto; }
.welcome p:last-child { color: var(--muted); margin-bottom: 22px; }
.quick-expense, .report-button { display: flex; align-items: center; text-decoration: none; border-radius: 22px; }
.quick-expense { min-height: 112px; background: linear-gradient(135deg,#0f766e,#115e59); color: #fff; padding: 24px; gap: 18px; box-shadow: 0 14px 30px #0f766e33; }
.quick-expense strong, .report-button strong { display: block; font-size: 20px; }
.quick-expense small, .report-button small { display: block; opacity: .8; margin-top: 3px; }
.quick-plus { display: grid; place-items: center; width: 58px; height: 58px; flex: none; border-radius: 50%; background: #ffffff24; font-size: 38px; line-height: 1; }
.report-button { justify-content: space-between; background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 18px 20px; margin-top: 13px; }
.report-button > span:last-child { color: var(--primary); font-size: 26px; }
.home-balance { background: #e7f5f2; border: 1px solid #b8ddd6; border-radius: 20px; padding: 20px; margin-top: 18px; }
.home-balance > span, .home-balance > small { display: block; color: var(--muted); }
.home-balance > strong { display: block; color: var(--primary); font-size: 30px; margin: 3px 0; }
.home-balance.danger { background: #fee2e2; border-color: #fecaca; }
.home-balance.danger strong { color: var(--over); }
.home-recent { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-top: 18px; }
.home-recent .section-title a { color: var(--primary); font-weight: 700; text-decoration: none; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.secondary { color: var(--primary); background: #e7f5f2; }
.admin-links { margin: 18px 4px; text-align: right; }
.admin-links a { color: var(--primary); font-weight: 700; }
.audit-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; border-top: 1px solid var(--line); padding: 14px 0; }
.audit-row:first-child { border-top: 0; }
.audit-row small { display: block; color: var(--muted); margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-link { color: #d7efec; text-decoration: none; font-weight: 700; }
.budget-hero { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 28px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: 0 10px 30px #173c340a; }
.donut { display: grid; place-items: center; flex: none; border-radius: 50%; background: conic-gradient(#dc2626 0 var(--spent), #22c55e var(--spent) 100%); }
.donut > div { display: grid; place-content: center; justify-items: center; border-radius: 50%; background: #fff; text-align: center; }
.donut-large { width: 172px; height: 172px; }
.donut-large > div { width: 112px; height: 112px; }
.donut-large strong { font-size: 28px; }
.donut-large small { color: var(--muted); }
.donut-small { width: 88px; height: 88px; }
.donut-small > div { width: 58px; height: 58px; }
.donut-small strong { font-size: 16px; }
.budget-hero-copy h2 { font-size: 26px; }
.hero-numbers { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.hero-numbers span, .budget-card-copy > span { display: block; color: var(--muted); font-size: 12px; }
.hero-numbers strong { display: block; font-size: 20px; margin-top: 3px; }
.spent-text, .over-text { color: #b91c1c; }
.available-text { color: #15803d; }
.chart-legend { display: flex; gap: 18px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 50%; }
.legend-spent { background: #dc2626; }.legend-available { background: #22c55e; }
.budget-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.budget-card { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 18px; padding: 16px; transition: transform .15s,box-shadow .15s; }
.budget-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #173c3414; }
.budget-card-copy { min-width: 0; }
.budget-card-copy > strong { display: block; margin-top: 5px; font-size: 13px; }
.category-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 22px; }
.category-admin-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.category-admin-card.inactive { opacity: .55; }
.category-admin-title { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; }
.category-admin-title h2 { font-size: 18px; }.category-admin-title small,.muted { color: var(--muted); }
.category-admin-title > a,.add-subcategory { color: var(--primary); font-weight: 700; text-decoration: none; }
.category-dot.large { width: 14px; height: 14px; }
.subcategory-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.subcategory-chip { color: #28524c; background: #e7f5f2; border-radius: 99px; padding: 7px 10px; text-decoration: none; font-size: 13px; }
.subcategory-chip.inactive { opacity: .45; text-decoration: line-through; }
.subcategory-chip small { color: var(--muted); }
.checkbox-form input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--primary); }
.schedule-link { display: block; color: #fff; background: var(--primary); border-radius: 11px; padding: 10px 12px; margin-top: 14px; text-align: center; text-decoration: none; font-weight: 700; }
.schedule-form fieldset { border: 0; padding: 0; margin: 0; }.schedule-form legend { font-weight: 800; margin-bottom: 12px; }
.schedule-form #id_months { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.schedule-form #id_months label { display: flex; align-items: center; gap: 8px; background: #f1f5f4; border: 1px solid var(--line); border-radius: 11px; padding: 10px; font-weight: 650; }
.schedule-form input[type="checkbox"] { width: 21px; height: 21px; accent-color: var(--primary); }
.schedule-help { margin-top: 18px; font-size: 13px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { height: 56px; padding: 0 16px; }
  .container { padding: 20px 14px calc(104px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; z-index: 20; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; left: 0; right: 0; bottom: 0; min-height: 72px; padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 28px #102f2914; }
  .mobile-nav a { display: grid; justify-items: center; gap: 2px; color: var(--muted); text-decoration: none; min-height: 48px; }
  .mobile-nav a > span { font-size: 24px; line-height: 1; }
  .mobile-nav small { font-size: 11px; font-weight: 750; }
  .mobile-nav .mobile-add { color: #fff; background: var(--primary); width: 70px; height: 70px; min-height: 70px; border-radius: 50%; margin: -30px auto 0; place-content: center; box-shadow: 0 7px 18px #0f766e55; }
  .mobile-nav .mobile-add > span { font-size: 32px; }
  .welcome h1 { font-size: 29px; }
  .quick-expense { min-height: 120px; }
  .form-card { margin: 4px auto; padding: 20px 17px; }
  .form-card h1 { font-size: 28px; }
  .form-control, .stack input, .stack select { font-size: 16px; min-height: 50px; }
  .stack .button { min-height: 54px; font-size: 17px; }
  .auth-card { margin: 24px auto; }
  .page-heading h1 { font-size: 27px; }
  .page-heading { align-items: flex-start; }
  .heading-actions { display: grid; justify-items: stretch; }
  .heading-actions .button { min-height: 44px; align-items: center; }
  .top-actions { gap: 12px; }.top-link { font-size: 12px; }
  .budget-hero { grid-template-columns: 1fr; justify-items: center; padding: 20px 16px; gap: 18px; }
  .budget-hero-copy { width: 100%; text-align: center; }
  .hero-numbers { gap: 7px; }.hero-numbers strong { font-size: 15px; }
  .chart-legend { justify-content: center; }
  .budget-card-grid,.category-admin-grid { grid-template-columns: 1fr; }
  .budget-card { padding: 14px; }
  .donut-small { width: 82px; height: 82px; }
  .schedule-form #id_months { grid-template-columns: repeat(2,1fr); }
}
