/* ==========================================================================
   FINKU GEN-Z — MOBILE RESPONSIVE SYSTEM (mobile.css)
   Breakpoints: xs < 480px | sm < 640px | md < 768px | lg < 1024px
   ========================================================================== */

/* --------------------------------------------------------------------------
   BOTTOM NAV — LAINNYA SHEET (base: hidden on desktop)
   -------------------------------------------------------------------------- */
.bottom-nav-more-sheet {
  display: none !important;
}

.bottom-nav-more-sheet.open {
  /* mobile media query below enables flex; keep desktop closed */
  display: none !important;
}

/* --------------------------------------------------------------------------
   TOUCH TARGETS — Minimum 44px per Apple/Google HIG
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .btn, .nav-item, .bottom-nav-item,
  select, input[type=text], input[type=number],
  input[type=password], input[type=date] {
    min-height: 44px;
  }

  /* --------------------------------------------------------------------------
     SIDEBAR — Slide-in drawer on mobile
     -------------------------------------------------------------------------- */
  .app-sidebar {
    transform: translateX(-100%) !important;
    width: 280px !important;
    z-index: 200 !important;
    box-shadow: 4px 0 40px rgba(0,0,0,0.6) !important;
  }
  .app-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Overlay backdrop when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199 !important;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active {
    display: block !important;
  }

  /* --------------------------------------------------------------------------
     HEADER — Mobile compact (icon-first, ≥44px touch)
     -------------------------------------------------------------------------- */
  .app-header {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    gap: 8px;
    overflow: visible;
  }
  .header-title {
    font-size: 15px;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: visible;
  }
  .header-title-stack {
    min-width: 0;
    flex: 1;
    overflow: visible;
  }
  .header-subtitle,
  #main-header-subtitle {
    display: none !important;
  }
  #main-header-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    font-size: 15px;
    line-height: 1.3;
    max-height: none;
  }
  #mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 20px;
    color: var(--text-primary);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
  }
  .header-actions {
    gap: 4px !important;
    flex-shrink: 0;
  }
  .header-actions .header-icon-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    margin-right: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
  }
  .header-action-label {
    display: none !important;
  }
  .header-currency-badge {
    display: none !important;
  }
  #header-lock-badge {
    display: none !important;
  }
  #header-lock-badge:not(.hidden) {
    display: none !important; /* keep header uncrowded; lock state still in Guard page */
  }

  /* --------------------------------------------------------------------------
     MAIN CONTENT — Full width, bottom nav + FAB spacing
     -------------------------------------------------------------------------- */
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    padding-bottom: 88px;
  }
  .content-body {
    padding: 16px 16px 140px 16px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Global mobile readability — labels may wrap; MONEY never mid-breaks */
  html {
    font-size: 16px;
  }
  .tx-title,
  .wcard-name,
  .sub-title,
  .goal-card h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .money-value,
  .tx-amount,
  .stat-value.money-value,
  .forecast-amount,
  .wcard-balance.money-value {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-variant-numeric: tabular-nums;
  }

  /* --------------------------------------------------------------------------
     KPI DASHBOARD GRID — 2x2 on mobile (was 4-column)
     -------------------------------------------------------------------------- */
  .dashboard-grid-kpi {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .stat-value {
    font-size: 18px !important;
  }
  .stat-label {
    font-size: 11px !important;
  }
  .kpi-card-networth .stat-value,
  .kpi-card-burnrate .stat-value,
  .kpi-card-bnpl .stat-value,
  .kpi-card-guiltfree .stat-value {
    font-size: 18px !important;
  }

  /* Page KPI (BNPL / Langganan / etc.) — 1 col on phone */
  .page-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }
  .page-kpi-grid .stat-value {
    font-size: 20px !important;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  /* --------------------------------------------------------------------------
     SUMMARY STRIP — Stack vertically on mobile (legacy inline + class)
     -------------------------------------------------------------------------- */
  [style*='grid-template-columns:1fr 1fr 1fr'],
  [style*='grid-template-columns:repeat(3,1fr)'] {
    grid-template-columns: 1fr !important;
  }

  /* --------------------------------------------------------------------------
     DASHBOARD MAIN SPLIT — Stack vertically
     -------------------------------------------------------------------------- */
  .dashboard-main-split {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* --------------------------------------------------------------------------
     CARDS — Reduced padding on mobile
     -------------------------------------------------------------------------- */
  .card {
    padding: 16px;
    border-radius: 14px;
  }
  .card-header {
    margin-bottom: 14px;
  }
  .card-title {
    font-size: 14px;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    min-width: 0;
  }

  /* --------------------------------------------------------------------------
     MODALS — Full screen on mobile
     -------------------------------------------------------------------------- */
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 92dvh !important;
    overflow-y: auto !important;
  }
  .modal-backdrop {
    align-items: flex-end !important;
  }

  /* --------------------------------------------------------------------------
     FORM GRIDS — Single column on mobile
     -------------------------------------------------------------------------- */
  [style*='grid-template-columns: 1fr 1fr'] {
    grid-template-columns: 1fr !important;
  }
  .form-control, .form-select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }

  /* --------------------------------------------------------------------------
     FAB — raised gold “+” in .bottom-nav-fab-slot (center; Beranda beside it)
     -------------------------------------------------------------------------- */
  .bottom-nav-fab-slot {
    flex: 1 1 0;
    min-width: 56px;
    max-width: 72px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    position: relative;
    overflow: visible;
  }
  .bottom-nav-fab-slot .fab-quick-add,
  .bottom-nav-fab-slot .fab-quick-add.fab-nav-center {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateY(-10px) !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    padding: 0 !important;
    margin-top: -28px !important;
    border-radius: 50% !important;
    background: var(--accent-yellow) !important;
    color: #1a1200 !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45) !important;
    border: 3px solid var(--bg-secondary) !important;
    z-index: 2;
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .bottom-nav-fab-slot .fab-quick-add:hover {
    transform: translateY(-13px) scale(1.04) !important;
  }
  .bottom-nav-fab-slot .fab-quick-add span {
    display: none !important;
  }
  .bottom-nav-fab-slot .fab-quick-add i,
  .bottom-nav-fab-slot .fab-quick-add .finku-icon {
    display: none !important;
  }
  .bottom-nav-fab-slot .fab-quick-add .fab-plus {
    display: block !important;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #1a1200;
  }
  /* Must match .btn-header-catat specificity (layout.css flex rule lost the race in v83) */
  #btn-header-quick-add,
  #btn-header-quick-add.btn-header-catat {
    display: none !important;
  }

  /* --------------------------------------------------------------------------
     BOTTOM NAV — left|left | raised + | right|right + Lainnya
     -------------------------------------------------------------------------- */
  .bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 55;
    height: 78px;
    padding: 6px 2px 0;
    gap: 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    overflow: visible;
  }
  .bottom-nav-item {
    flex: 1;
    gap: 3px;
    font-size: 10.5px;
    line-height: 1.15;
    padding: 8px 1px;
    min-height: 52px;
    border-radius: 10px;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
  }
  .bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 1px;
  }
  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
    stroke: var(--text-secondary);
    flex-shrink: 0;
  }
  .bottom-nav-item.active svg {
    stroke: var(--accent-green);
  }
  .bottom-nav-item.active {
    color: var(--accent-green);
    background: rgba(0, 229, 160, 0.08);
  }

  /* Lainnya sheet — require .open (not only removing [hidden]) */
  .bottom-nav-more-sheet.open {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex !important;
    align-items: flex-end;
    justify-content: center;
  }
  .bottom-nav-more-sheet[hidden],
  .bottom-nav-more-sheet:not(.open) {
    display: none !important;
  }
  .bottom-nav-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
  }
  .bottom-nav-more-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: min(72dvh, 560px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    transform: translateY(18px);
    opacity: 0.92;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .bottom-nav-more-sheet.open .bottom-nav-more-panel {
    transform: translateY(0);
    opacity: 1;
  }
  .bottom-nav-more-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-color);
    margin: 4px auto 10px;
  }
  .bottom-nav-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 4px 0 8px;
    border-bottom: 1px solid var(--border-color);
  }
  .bottom-nav-emoji {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
  }
  .bottom-nav-atur-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    background: rgba(0, 229, 160, 0.06);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
  }
  .bottom-nav-atur-btn:active {
    background: rgba(0, 229, 160, 0.12);
  }

  /* Customize bottom-nav modal — Style B / A73 (~412px) */
  .bottom-nav-custom-modal {
    max-width: 420px;
    width: calc(100% - 24px);
    max-height: min(88dvh, 640px);
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 16px;
  }
  .bottom-nav-custom-hint {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
  }
  .bottom-nav-custom-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 10px;
  }
  .bottom-nav-custom-count.is-invalid {
    color: #f59e0b;
  }
  .bottom-nav-custom-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    padding-right: 2px;
    margin-bottom: 12px;
  }
  .bottom-nav-custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    cursor: pointer;
  }
  .bottom-nav-custom-option:has(input:checked) {
    border-color: rgba(0, 229, 160, 0.45);
    background: rgba(0, 229, 160, 0.08);
  }
  .bottom-nav-custom-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--accent-green);
  }
  .bottom-nav-custom-emoji {
    font-size: 18px;
    flex-shrink: 0;
  }
  .bottom-nav-custom-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .bottom-nav-custom-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .bottom-nav-custom-sub {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bottom-nav-custom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .bottom-nav-custom-actions .btn {
    min-height: 44px;
    font-size: 13px;
    padding: 10px 8px;
  }
  .bottom-nav-more-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .bottom-nav-more-close {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
  }
  .bottom-nav-more-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .bottom-nav-more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card, var(--bg-tertiary));
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
  }
  .bottom-nav-more-item:active,
  .bottom-nav-more-item.active {
    border-color: var(--accent-green);
    background: rgba(0, 229, 160, 0.08);
    color: var(--accent-green);
  }
  .bottom-nav-more-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
  }

  /* --------------------------------------------------------------------------
     BUDGET SLIDERS — Full width
     -------------------------------------------------------------------------- */
  .slider-group {
    flex-direction: column !important;
  }

  /* --------------------------------------------------------------------------
     SUBSCRIPTIONS — Cards stack properly
     -------------------------------------------------------------------------- */
  .sub-item {
    border-radius: 14px !important;
  }
  .sub-actions {
    flex-wrap: wrap !important;
  }
  .sub-actions .btn {
    flex: 1 !important;
    min-width: 120px !important;
  }

  /* --------------------------------------------------------------------------
     CHART CONTAINERS — Full width on mobile
     -------------------------------------------------------------------------- */
  .chart-container-wrapper {
    height: 200px !important;
  }

  /* --------------------------------------------------------------------------
     QUICK ADD FORM SHORTCUTS
     -------------------------------------------------------------------------- */
  .qa-shortcut {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* --------------------------------------------------------------------------
     LITERACY CARDS — Stack on mobile
     -------------------------------------------------------------------------- */
  .literacy-grid {
    grid-template-columns: 1fr !important;
  }

  /* --------------------------------------------------------------------------
     BNPL ITEMS
     -------------------------------------------------------------------------- */
  .bnpl-item-actions {
    flex-wrap: wrap !important;
  }

  /* --------------------------------------------------------------------------
     GOALS GRID
     -------------------------------------------------------------------------- */
  .goals-list {
    grid-template-columns: 1fr !important;
  }

  /* --------------------------------------------------------------------------
     TYPOGRAPHY SCALING
     -------------------------------------------------------------------------- */
  h2 { font-size: 20px !important; }
  h3 { font-size: 16px !important; }
  .font-mono { letter-spacing: -0.01em; }
}

/* Extra small phones (< 380px) */
@media (max-width: 380px) {
  .dashboard-grid-kpi {
    grid-template-columns: 1fr !important;
  }
  .stat-value {
    font-size: 16px !important;
  }
  .bottom-nav-item {
    font-size: 9px;
  }
  .bottom-nav-item i {
    font-size: 20px;
  }
  .content-body {
    padding: 12px 12px 140px;
  }
  .card {
    padding: 14px;
  }
}

/* Large phones / small tablets: optional 2-col KPI */
@media (min-width: 481px) and (max-width: 768px) {
  .page-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .page-kpi-grid .stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .dashboard-grid-kpi {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .page-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content-body {
    padding: 20px 24px;
  }
}

/* --------------------------------------------------------------------------
   iOS PWA Safe Area — notch + home indicator
   -------------------------------------------------------------------------- */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-header {
    padding-top: env(safe-area-inset-top);
  }
  .bottom-nav {
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 55;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    height: calc(72px + env(safe-area-inset-bottom));
  }
  /* FAB stays in-slot; no viewport-fixed override on safe-area devices */
}

/* --------------------------------------------------------------------------
   SCROLL IMPROVEMENTS
   -------------------------------------------------------------------------- */
.sidebar-nav,
.content-body,
.modal-content {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Remove tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}


/* --------------------------------------------------------------------------
   AI CHAT PANEL — Mobile Adjustments
   -------------------------------------------------------------------------- */
#ai-chat-fab {
  bottom: 32px;
  left: 36px;
}

@media (max-width: 768px) {
  #ai-chat-fab {
    bottom: 90px !important;
    left: 16px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .chat-quick-btn {
    font-size: 11px !important;
    padding: 6px 12px !important;
    min-height: 36px;
  }

  /* --------------------------------------------------------------------------
     M3 — Frequent pages readability
     -------------------------------------------------------------------------- */
  .tx-item {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 14px;
    align-items: flex-start;
  }
  .tx-left {
    flex: 1;
    min-width: 0;
    gap: 12px;
  }
  .tx-title {
    font-size: 15px;
    overflow-wrap: anywhere;
  }
  .tx-meta {
    font-size: 12px;
    flex-wrap: wrap;
  }
  .tx-right {
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    margin-top: 2px;
    padding-left: 0;
    gap: 10px;
  }
  .tx-amount {
    font-size: 16px;
    white-space: nowrap;
    overflow: visible;
    word-break: normal;
    overflow-wrap: normal;
    flex-shrink: 0;
  }
  .tx-delete-btn {
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
  .filter-tabs-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 6px;
  }
  .filter-tab-btn {
    min-height: 44px;
    font-size: 13px;
    padding: 10px 14px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Smart Cut — card stack (readable, no badge overlap) */
  #view-budget .card-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }
  #view-budget .card-header .badge {
    flex-shrink: 0;
    align-self: flex-start;
  }
  .smart-cut-table {
    display: block;
    width: 100%;
    overflow: visible;
  }
  .smart-cut-table thead {
    display: none;
  }
  .smart-cut-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .smart-cut-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-glass, var(--bg-tertiary));
  }
  .smart-cut-row td {
    display: block;
    padding: 0;
    border: none;
    width: 100%;
  }
  .smart-cut-row td:first-child {
    font-size: 15px;
    margin-bottom: 2px;
  }
  .smart-cut-row td .badge {
    display: inline-flex;
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    text-align: left;
    height: auto;
    padding: 6px 10px;
  }
  .smart-cut-row .accept-cut-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
  }
  .smart-cut-tip {
    flex-wrap: wrap;
  }
  .smart-cut-tip #btn-dismiss-puasa {
    width: 100%;
    min-height: 44px;
  }
  .custom-budget-header {
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }

  .goals-grid,
  .sub-grid-items {
    grid-template-columns: 1fr !important;
  }
  .goal-card,
  .sub-item {
    padding: 16px;
  }
  .goal-icon-badge {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .allocation-header {
    font-size: 14px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .forecast-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 16px;
  }
  .forecast-left {
    flex-wrap: wrap;
    gap: 12px;
  }
  .forecast-amount-block {
    text-align: left;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
  }
  .forecast-amount,
  .forecast-amount.money-value {
    font-size: 22px !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .alloc-preview-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .alloc-preview-amt {
    width: 100%;
    text-align: left;
    font-size: 13px;
  }
  .bnpl-ratio-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }
  .bnpl-banner-body {
    flex-direction: column;
    gap: 10px;
  }
  .bnpl-banner-actions {
    width: 100%;
  }
  .bnpl-banner-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
    justify-content: center;
  }
  .tx-filter-row {
    flex-direction: column;
    gap: 10px;
  }
  .tx-filter-search,
  .tx-filter-select {
    width: 100%;
    min-width: 0;
  }
  .tx-date-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tx-date-input {
    width: 100%;
    font-size: 16px;
  }
  .top-cat-item {
    flex-wrap: wrap;
    gap: 6px 8px;
  }
  .top-cat-label {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .top-cat-bar-track {
    flex: 1 1 calc(100% - 8px);
    order: 2;
  }
  .top-cat-amt {
    flex: 1 1 100%;
    text-align: left;
    order: 3;
  }

  .wallets-cards-grid,
  .wallets-list {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .wcard,
  .wrow {
    padding: 12px 12px 12px 14px;
  }
  .wcard-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    overflow-wrap: anywhere;
  }
  .wcard-balance {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: unset !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 15px !important;
  }

  .stat-value {
    font-size: 18px !important;
  }
  .stat-value:not(.money-value) {
    overflow-wrap: anywhere;
  }
  .stat-label {
    font-size: 12px !important;
  }
}

/* Tablet landscape (Poco Pad etc.) — readable, no bottom-nav crowding */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: landscape) {
  .content-body {
    padding: 20px 24px 40px;
  }
  .bottom-nav-more-sheet {
    display: none !important;
  }
}

/* Loading dots animation */
.chat-loading-dots::after {
  content: '';
  animation: chatDots 1.2s infinite;
}
@keyframes chatDots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

/* Sync Settings card */
#sync-settings-panel .card {
  margin-bottom: 0;
}
