/* ── MOBILE BOTTOM NAV ── */
.bottom-nav,
.mobile-more-backdrop,
.mobile-more-sheet {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --bottom-nav-content-h: 66px;
    --bottom-nav-h: calc(var(--bottom-nav-content-h) + env(safe-area-inset-bottom, 0px));
  }

  .sidebar { display: none; }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) minmax(0, 1fr);
  }

  .main {
    padding: 20px 16px;
    padding-bottom: calc(28px + var(--bottom-nav-h));
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    min-height: var(--bottom-nav-h);
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    box-shadow: 0 -16px 34px rgba(26, 23, 18, 0.08);
    backdrop-filter: blur(16px);
  }

  .bottom-nav-item {
    min-width: 0;
    height: 54px;
    display: grid;
    grid-template-rows: 28px 14px;
    place-items: center;
    gap: 2px;
    padding: 5px 2px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--ink-muted);
    font-family: 'Inter', 'Poppins', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: currentColor;
    font-size: 22px;
    line-height: 1;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  }

  .bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    color: currentColor;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-nav-item.active {
    color: var(--ink);
  }

  .bottom-nav-item.active i {
    background: var(--ink);
    color: var(--bg);
    transform: translateY(-1px);
  }

  .bottom-nav-item:focus-visible,
  .mobile-more-close:focus-visible,
  .mobile-more-item:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ink) 42%, transparent);
    outline-offset: 2px;
  }

  .mobile-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    background: rgba(26, 23, 18, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .mobile-more-backdrop[hidden],
  .mobile-more-sheet[hidden] {
    display: none;
  }

  body.mobile-more-open .mobile-more-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-sheet {
    position: fixed;
    right: 10px;
    bottom: calc(8px + var(--bottom-nav-h));
    left: 10px;
    z-index: 1002;
    display: block;
    max-height: min(66vh, 560px);
    padding: 8px 12px 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--bg);
    box-shadow: 0 24px 70px rgba(26, 23, 18, 0.18);
    overflow: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.mobile-more-open .mobile-more-sheet {
    transform: translateY(0);
  }

  .mobile-more-handle {
    width: 42px;
    height: 4px;
    margin: 4px auto 10px;
    border-radius: 999px;
    background: var(--border);
  }

  .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 12px;
    border-bottom: 1px solid var(--border-light);
  }

  .mobile-more-eyebrow {
    color: var(--ink-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .mobile-more-title {
    margin-top: 2px;
    color: var(--ink);
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
  }

  .mobile-more-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--ink);
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-more-close i { font-size: 18px; }

  .mobile-more-list {
    max-height: calc(min(66vh, 560px) - 96px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 0 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-more-list::after {
    content: "";
    position: sticky;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    height: 1px;
    grid-column: 1 / -1;
  }

  .mobile-more-item {
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: var(--card-bg);
    color: var(--ink);
    font-family: 'Inter', 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-more-item.active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
  }

  .mobile-more-item .nav-icon,
  .mobile-more-item .nav-icon i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: currentColor;
    flex: 0 0 22px;
    font-size: 18px;
  }

  .mobile-more-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-stats-grid,
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-balance-card { font-size: 14px; }

  .toast {
    right: 16px;
    bottom: calc(16px + var(--bottom-nav-h));
    left: 16px;
    text-align: center;
  }

  .toast.show { transform: translateY(0); }
}
