* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; color: #1a1a2e; }

/* Header */
.header { background: linear-gradient(135deg, #0f4c75, #1b262c); color: white; padding: 10px 20px; position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.header-brand h1 { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.header-metrics { display: flex; gap: 16px; align-items: center; flex: 1; justify-content: center; }
.header-metric { text-align: center; position: relative; }
.header-metric-value { font-size: 18px; font-weight: 700; color: white; line-height: 1.2; }
.header-metric-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; margin-top: 2px; }
.tbb-metric { padding-bottom: 4px; }
.tbb-slab { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; border-radius: 2px; }
.slab-red { background: #e63946; }
.slab-amber { background: #ff9f1c; }
.slab-green { background: #00b894; }
.metric-red { color: #ff6b6b !important; }
.metric-green { color: #55efc4 !important; }
.metric-amber { color: #ffeaa7 !important; }
@media (max-width: 480px) {
    .header { flex-wrap: wrap; gap: 8px; }
    .header-metrics { gap: 12px; }
    .header-metric-value { font-size: 13px; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 200px; }
    .sidebar .sidebar-label { opacity: 1; width: auto; }
    .sidebar.open { transform: translateX(0); }
    .main-content, .main-content.sidebar-collapsed { margin-left: 0 !important; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; top: 52px; background: rgba(0,0,0,0.4); z-index: 14; }
    body.sidebar-open .sidebar-overlay { display: block; }
    body.sidebar-open .sidebar { transform: translateX(0); }
}

/* Sidebar */
.sidebar { position: fixed; top: 52px; left: 0; bottom: 0; width: 200px; background: #1b262c; display: flex; flex-direction: column; justify-content: space-between; z-index: 15; transition: width 0.2s ease; overflow: hidden; }
.sidebar.collapsed { width: 56px; }
.sidebar-nav { display: flex; flex-direction: column; padding: 8px 0; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.15s; white-space: nowrap; border-left: 3px solid transparent; }
.sidebar-link:hover { color: white; background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: #3fc1c9; border-left-color: #3fc1c9; background: rgba(63,193,201,0.08); }
.sidebar-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.sidebar-label { overflow: hidden; transition: opacity 0.2s; }
.sidebar.collapsed .sidebar-label { opacity: 0; width: 0; }
.sidebar-bottom { padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-toggle { background: none; border: none; color: white; font-size: 20px; cursor: pointer; padding: 4px 8px; opacity: 0.8; }
.sidebar-toggle:hover { opacity: 1; }
.header-left { display: flex; align-items: center; gap: 10px; }

/* User dropdown (sidebar) */
.user-dropdown { position: relative; }
.user-dropdown-btn { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 13px; padding: 12px 16px; cursor: pointer; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.user-dropdown-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.user-dropdown-menu { display: none; position: absolute; left: 0; bottom: 100%; background: white; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); min-width: 160px; z-index: 30; overflow: hidden; margin-bottom: 4px; }
.user-dropdown.open .user-dropdown-menu { display: block; }
.user-dropdown-menu a { display: block; padding: 12px 16px; color: #1a1a2e; text-decoration: none; font-size: 14px; }
.user-dropdown-menu a:hover { background: #f0f2f5; }

/* Main content area */
.main-content { margin-left: 200px; padding-top: 52px; min-height: 100vh; transition: margin-left 0.2s ease; }
.main-content.sidebar-collapsed { margin-left: 56px; }
.container { max-width: 640px; margin: 0 auto; padding: 20px 16px; }

/* Search */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; padding: 12px 16px; border: 1px solid #ddd; border-radius: 12px; font-size: 15px; background: white; transition: border-color 0.2s; }
.search-bar input:focus { outline: none; border-color: #3fc1c9; box-shadow: 0 0 0 3px rgba(63,193,201,0.1); }
.search-bar button { padding: 12px 18px; background: #0f4c75; color: white; border: none; border-radius: 12px; font-size: 15px; cursor: pointer; }

/* Cards */
.card { background: white; border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.15s; }
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.card h3 { font-size: 16px; margin-bottom: 4px; color: #1a1a2e; }
.card .meta { font-size: 13px; color: #666; margin-bottom: 4px; }
.card .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Metric cards */
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 28px; }
@media (min-width: 768px) { .metrics-grid { grid-template-columns: repeat(3, 1fr); } }
.metric-card { background: white; border-radius: 16px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: relative; overflow: hidden; }
.metric-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.metric-card.tbb::before { background: linear-gradient(90deg, #0f4c75, #3fc1c9); }
.metric-card.musthave::before { background: #e63946; }
.metric-card.lifestyle::before { background: #ff9f1c; }
.metric-card.future::before { background: #2ec4b6; }
.metric-card.networth::before { background: linear-gradient(90deg, #6c5ce7, #a29bfe); }
.metric-card.freecash::before { background: #00b894; }
.metric-card .icon { font-size: 28px; margin-bottom: 6px; }
.metric-card .value { font-size: 24px; font-weight: 700; color: #1a1a2e; line-height: 1.2; }
.metric-card .label { font-size: 12px; color: #888; margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* Progress bar */
.progress-bar { height: 6px; background: #e9ecef; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.fill-green { background: linear-gradient(90deg, #00b894, #2ec4b6); }
.fill-amber { background: linear-gradient(90deg, #ff9f1c, #fdcb6e); }
.fill-red { background: linear-gradient(90deg, #e63946, #ff6b6b); }

/* Bucket cards */
.bucket-card { background: white; border-radius: 16px; padding: 20px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.bucket-card .bucket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bucket-card .bucket-name { font-size: 16px; font-weight: 700; }
.bucket-card .bucket-amount { font-size: 20px; font-weight: 700; }
.bucket-card .bucket-detail { display: flex; justify-content: space-between; font-size: 13px; color: #666; margin-bottom: 4px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-green { background: #d4edda; color: #155724; }
.badge-red { background: #f8d7da; color: #721c24; }
.badge-amber { background: #fff3cd; color: #856404; }
.badge-blue { background: #d1ecf1; color: #0c5460; }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 12px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: #0f4c75; color: white; }
.btn-primary:hover { background: #0d3d5f; }
.btn-success { background: #00b894; color: white; }
.btn-success:hover { background: #00a382; }
.btn-danger { background: #e63946; color: white; }
.btn-outline { background: white; color: #0f4c75; border: 1px solid #0f4c75; }
.btn-outline:hover { background: #f0f7ff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* FAB */
.fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; background: linear-gradient(135deg, #0f4c75, #3fc1c9); color: white; border: none; border-radius: 50%; font-size: 28px; cursor: pointer; box-shadow: 0 4px 16px rgba(15,76,117,0.4); z-index: 10; transition: transform 0.2s; }
.fab:hover { transform: scale(1.1); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #444; }
.form-group input, .form-group select { width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 12px; font-size: 15px; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #3fc1c9; box-shadow: 0 0 0 3px rgba(63,193,201,0.1); }

/* Transaction feed */
.txn-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: white; border-radius: 12px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.txn-card .txn-info { }
.txn-card .txn-category { font-weight: 600; font-size: 14px; }
.txn-card .txn-meta { font-size: 12px; color: #888; margin-top: 2px; }
.txn-card .txn-amount { font-weight: 700; font-size: 16px; }
.txn-amount.debit { color: #e63946; }
.txn-amount.credit { color: #00b894; }

/* Misc */
.empty { text-align: center; padding: 48px 16px; color: #999; font-size: 15px; }
.back-link { display: inline-block; margin-bottom: 16px; color: #0f4c75; text-decoration: none; font-size: 14px; font-weight: 500; }
.count { font-size: 13px; color: #888; margin-bottom: 14px; }
.success-card { background: #d4edda; border-left: 4px solid #28a745; border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.success-card h3 { color: #155724; margin-bottom: 8px; }
.error-card { background: #f8d7da; border-left: 4px solid #dc3545; border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.error-card h3 { color: #721c24; margin-bottom: 8px; }

/* Login */
.login-container { max-width: 380px; margin: 80px auto; padding: 16px; }
.login-card { background: white; border-radius: 20px; padding: 40px 28px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.login-card h2 { text-align: center; margin-bottom: 8px; color: #0f4c75; font-size: 22px; }
.login-card .tagline { text-align: center; color: #888; font-size: 13px; margin-bottom: 28px; }
.error { background: #f8d7da; color: #721c24; padding: 10px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; text-align: center; }

/* Currency formatting */
.rupee { font-family: 'Segoe UI', sans-serif; }

/* Section headers */
.section-header { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* Category list item */
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.cat-item:last-child { border-bottom: none; }
.cat-item .cat-name { font-weight: 600; font-size: 14px; }
.cat-item .cat-type { font-size: 11px; color: #888; text-transform: uppercase; }
.cat-item .cat-amounts { text-align: right; }
.cat-item .cat-remaining { font-weight: 700; font-size: 16px; }
.cat-item .cat-budget { font-size: 12px; color: #888; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; justify-content: center; align-items: flex-start; padding: 60px 16px 16px; overflow-y: auto; }
.modal-content { background: white; border-radius: 20px; padding: 24px; width: 100%; max-width: 500px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); animation: modalSlideIn 0.25s ease; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Entry screen (v1) ---- */
.entry-form { padding-bottom: 0; }
.entry-row { padding: 10px 4px; }
.entry-label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; font-weight: 600; }
.entry-row .meta { color: #b0b0b0; text-transform: none; letter-spacing: 0; font-weight: 500; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 999px; border: 1.5px solid #e2e2e8; background: #fafafc; color: #2a2a3a; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.chip:hover { background: #f0f0f4; }
.chip-selected:hover { background: #36b0b8; }
.chip-selected { background: #3fc1c9; border-color: #3fc1c9; color: white; box-shadow: 0 2px 6px rgba(63,193,201,0.25); }
.chip-selected::before { content: "● "; }
.chip-more { color: #6b6b7b; background: transparent; border-style: dashed; }
.more-list { display: none; flex-direction: column; gap: 6px; padding: 8px 0 0; }
.more-list.open { display: flex; }
.more-list .chip { justify-content: flex-start; width: 100%; box-sizing: border-box; }
.more-list input[type=text], .more-list select { width: 100%; padding: 12px; border: 1.5px solid #e2e2e8; border-radius: 12px; font-size: 15px; box-sizing: border-box; background: white; }

.entry-amount-row { background: #fafafc; border: 1.5px solid #e2e2e8; border-radius: 14px; padding: 14px; margin: 10px 0; cursor: pointer; }
.amount-display { display: flex; align-items: baseline; gap: 6px; font-weight: 700; }
.amount-currency { font-size: 22px; color: #888; }
.amount-value { font-size: 36px; color: #1a1a2e; font-variant-numeric: tabular-nums; }
.amount-value.amount-empty { color: #ccc; }

.keypad { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 4px 0 12px; }
.key { padding: 18px 0; font-size: 22px; font-weight: 600; background: white; border: 1.5px solid #e2e2e8; border-radius: 14px; cursor: pointer; color: #1a1a2e; transition: background 0.08s; user-select: none; }
.key:active { background: #ececf2; }
.key-back { color: #c44; }

.sticky-action { position: sticky; bottom: 0; padding: 8px 0; background: linear-gradient(to top, white 70%, rgba(255,255,255,0)); z-index: 10; }
.btn-next, .btn-record { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; border-radius: 12px; }
.btn-next:disabled { background: #ccc; cursor: not-allowed; box-shadow: none; }

#review-mode #note-input { width: 100%; padding: 12px; border: 1.5px solid #e2e2e8; border-radius: 12px; font-size: 15px; box-sizing: border-box; }

@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.shake { animation: shake 0.4s; }

.chip-search { background: transparent; border-style: dashed; color: #6b6b7b; }
/* chip-extra inherits chip-selected styling — no override needed */
.search-pop { display: none; position: relative; margin-top: 6px; padding: 8px; background: white; border: 1.5px solid #e2e2e8; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.search-pop.open { display: block; }
.search-pop input { width: 100%; padding: 10px 12px; border: 1px solid #e2e2e8; border-radius: 8px; font-size: 15px; box-sizing: border-box; outline: none; }
.search-pop input:focus { border-color: #3fc1c9; }
.search-results { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-height: 240px; overflow-y: auto; }
.search-result { text-align: left; padding: 10px 12px; background: white; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; color: #1a1a2e; }
.search-result:hover { background: #f4f4f8; }
.search-new { color: #2a9d8f; font-weight: 600; }
.search-empty { padding: 8px 12px; color: #aaa; font-size: 13px; }
.search-result { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.search-meta { color: #999; font-size: 12px; font-weight: 500; }

/* ---- Sync pill + pending/error txn states ---- */
.sync-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; margin: 0 0 8px 0; }
.sync-ok { background: #d4f5e0; color: #1f7a3a; }
.sync-pending { background: #fff3cd; color: #8a6d00; }
.sync-offline { background: #ffe0e0; color: #b21f1f; }
.sync-error { background: #ffe0e0; color: #b21f1f; }
.txn-pending { opacity: 0.7; border-left: 3px solid #ff9f1c; }
.txn-error { opacity: 0.85; border-left: 3px solid #e63946; background: #fff5f5; }

/* ---- Entry pills row ---- */
.entry-pills { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.today-pill { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e6f4ff; color: #0f4c75; border: 1px solid #c0e0f7; cursor: pointer; }
.today-pill:hover { background: #d6ecfb; }

/* ---- Bottom sheet ---- */
.sheet-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 60; align-items: flex-end; justify-content: center; }
.sheet-overlay.open { display: flex; animation: fadeIn 0.15s ease; }
.sheet { background: white; width: 100%; max-width: 640px; max-height: 80vh; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,0.18); display: flex; flex-direction: column; animation: sheetSlideUp 0.2s ease; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }
.sheet-header h3 { margin: 0; font-size: 16px; }
.sheet-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #888; padding: 4px 8px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sheet-footer { padding: 8px 16px 14px; font-size: 11px; color: #999; border-top: 1px solid #f0f0f0; }
body.sheet-open { overflow: hidden; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Today rows */
.today-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid #f5f5f5; }
.today-row:last-child { border-bottom: none; }
.today-info { flex: 1; min-width: 0; }
.today-top { display: flex; gap: 8px; align-items: baseline; }
.today-amount { font-weight: 700; font-size: 15px; color: #1a1a2e; }
.today-cat { font-size: 13px; color: #555; }
.today-sub { font-size: 12px; color: #888; margin-top: 2px; word-break: break-word; }
.today-action { padding: 6px 12px; border-radius: 8px; border: 1px solid #e2e2e8; background: white; font-size: 12px; cursor: pointer; flex-shrink: 0; }
.today-delete { color: #c44; border-color: #f5c6cb; }
.today-delete:hover { background: #fff5f5; }
.today-cancel { color: #856404; border-color: #ffeaa7; }
.today-cancel:hover { background: #fff8e1; }
.today-action:disabled { opacity: 0.5; cursor: not-allowed; }

/* Logo as home anchor */
a.header-brand { color: white; text-decoration: none; cursor: pointer; }
a.header-brand:hover { opacity: 0.85; }

/* Mode toggle (Spend / Inflow) */
.mode-toggle { display: flex; gap: 4px; padding: 4px; background: #ececf2; border-radius: 14px; margin: 0 0 14px; }
.mode-btn { flex: 1; padding: 10px 12px; background: transparent; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; color: #6b6b7b; cursor: pointer; transition: background 0.12s, color 0.12s; }
.mode-btn:hover { color: #1a1a2e; }
.mode-btn.mode-active { background: white; color: #1a1a2e; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* Search popup section heading */
.search-heading { padding: 6px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #999; font-weight: 700; }

/* Statement v2 — sub-toggle inside Insights (slightly muted vs main mode-toggle) */
.mode-toggle-sub { background: transparent; padding: 0; gap: 6px; }
.mode-toggle-sub .mode-btn { background: #f4f4f8; padding: 7px 10px; font-size: 13px; }
.mode-toggle-sub .mode-btn.mode-active { background: #e6f4ff; color: #0f4c75; box-shadow: none; border: 1px solid #c0e0f7; }

/* Statement v2 — compact filter pill row (L2) */
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; position: relative; }
.fpill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 4px 5px 10px; border-radius: 999px; background: #e6f4ff; color: #0f4c75; border: 1px solid #c0e0f7; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; line-height: 1.2; }
.fpill:hover { background: #d6ecfb; }
.fpill-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.fpill-x { padding: 2px 7px; border-radius: 999px; color: #0f4c75; text-decoration: none; font-weight: 700; opacity: 0.7; }
.fpill-x:hover { background: rgba(15,76,117,0.12); opacity: 1; }
.fpill-add { background: transparent; border-style: dashed; color: #6b6b7b; padding: 5px 12px; }
.fpill-add:hover { background: #f4f4f8; }

.fpill-add-wrap { position: relative; display: inline-block; }
.filter-add-menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; background: white; border: 1px solid #e2e2e8; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.1); padding: 4px; min-width: 140px; z-index: 30; white-space: nowrap; }
.filter-add-menu.open { display: block; }
.filter-add-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; background: transparent; border: none; border-radius: 8px; font-size: 14px; color: #1a1a2e; cursor: pointer; }
.filter-add-menu button:hover { background: #f4f4f8; }

.filter-picker { display: none; margin: 6px 0 4px; padding: 8px; background: white; border: 1px solid #e2e2e8; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.filter-picker.open { display: block; }
.picker-search { width: 100%; padding: 9px 12px; border: 1px solid #e2e2e8; border-radius: 8px; font-size: 14px; box-sizing: border-box; outline: none; margin-bottom: 6px; }
.picker-search:focus { border-color: #3fc1c9; }
.picker-items { display: flex; flex-direction: column; gap: 1px; max-height: 280px; overflow-y: auto; }
.picker-item { display: block; padding: 9px 12px; color: #1a1a2e; text-decoration: none; border-radius: 8px; font-size: 14px; }
.picker-item:hover { background: #f4f4f8; }
.picker-current { background: #e6f4ff; color: #0f4c75; font-weight: 600; }
.picker-current::before { content: "● "; }

/* Statement v2 — hide-from-view feature (L3-L5) */
.hide-controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; align-items: center; }
.fpill-peek { background: #fff7e6; border-color: #ffd591; color: #ad6800; cursor: pointer; text-decoration: none; padding: 5px 12px; }
.fpill-peek:hover { background: #ffe8b3; }
.fpill-restore { background: transparent; border: 1px dashed #c0e0f7; color: #0f4c75; padding: 5px 12px; cursor: pointer; }
.fpill-restore:hover { background: #e6f4ff; }

.stmt-row { position: relative; touch-action: pan-y; }
.stmt-row .row-action { position: absolute; top: 50%; right: -2px; transform: translateY(-50%); background: transparent; border: none; padding: 8px 10px; font-size: 18px; line-height: 1; color: #c44; cursor: pointer; opacity: 0; transition: opacity 0.12s; border-radius: 6px; }
.stmt-row:hover .row-action { opacity: 1; }
.stmt-row .row-action:hover { background: rgba(196,68,68,0.1); }
.stmt-row .row-unhide { color: #2a9d8f; }
.stmt-row .row-unhide:hover { background: rgba(42,157,143,0.1); }
.stmt-row-hidden { opacity: 0.45; background: repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(0,0,0,0.025) 8px, rgba(0,0,0,0.025) 12px); }
.stmt-row-hidden .row-unhide { opacity: 1; }
.stmt-row-fading { opacity: 0.3; pointer-events: none; transition: opacity 0.18s; }

@media (max-width: 768px) {
    /* On phone, gestures are primary; the × button is hidden until row is held */
    .stmt-row .row-action { opacity: 0.4; }
}

/* Swipe-reveal layers (sit behind the row; revealed as the row translates) */
.stmt-row-wrap { position: relative; overflow: hidden; margin-bottom: 8px; border-radius: 12px; }
.stmt-row-wrap > .stmt-row { margin-bottom: 0; }
.stmt-row-wrap.swiping > .stmt-row { transition: none; }

.row-reveal { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 18px; font-weight: 700; font-size: 14px; letter-spacing: 0.5px; color: white; opacity: 0; pointer-events: none; transition: opacity 0.12s, filter 0.12s; border-radius: 12px; }
.row-reveal-hide   { right: 0; background: linear-gradient(90deg, #f4979a, #e63946); justify-content: flex-end; }
.row-reveal-unhide { left: 0;  background: linear-gradient(90deg, #2a9d8f, #5cd2c4); justify-content: flex-start; }

/* Reveal becomes visible while swiping, brighter once threshold is crossed. */
.stmt-row-wrap.swiping .row-reveal { opacity: 0.55; }
.stmt-row-wrap.swiping-armed .row-reveal { opacity: 1; filter: brightness(1.05); }
.stmt-row-wrap.swiping-armed .row-reveal span { transform: scale(1.06); transition: transform 0.1s; }

/* Statement v2 — two-line row layout (L7) */
.stmt-row { display: block !important; padding: 12px 14px; }
.stmt-meta-line { font-size: 12px; color: #888; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.stmt-date { font-weight: 600; color: #555; }
.stmt-account { color: #0f4c75; font-weight: 500; }
.stmt-sep { color: #ccc; }
.stmt-note { color: #999; font-style: italic; }

.stmt-body-line { display: flex; align-items: baseline; gap: 12px; }
.stmt-payee-cat { flex: 1 1 auto; min-width: 0; font-size: 14px; color: #1a1a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stmt-payee { font-weight: 600; }
.stmt-cat { color: #555; }

.stmt-amount { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 92px; text-align: right; }
.stmt-amount.debit { color: #e63946; }
.stmt-amount.credit { color: #2a9d8f; }
.stmt-amount.neutral { color: #888; }

.stmt-balance { font-size: 15px; font-weight: 600; color: #1a1a2e; font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 88px; text-align: right; padding-left: 8px; border-left: 1px solid #eee; }
.stmt-balance-na { color: #ccc; font-weight: 400; }

.stmt-row-hidden .stmt-balance-na { color: rgba(0,0,0,0.3); }

@media (max-width: 480px) {
    .stmt-amount { font-size: 15px; min-width: 80px; }
    .stmt-balance { font-size: 13px; min-width: 76px; }
    .stmt-payee-cat { font-size: 13px; }
}

/* Statement v2 — summary card layout + filter-context line */
.stmt-summary { margin-bottom: 14px; }
.stmt-summary-numbers { display: flex; justify-content: space-around; text-align: center; }
.stmt-summary-context { margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f0f0; text-align: center; font-size: 12px; color: #999; }

/* Negative running balance — for Definition B "you owe more than you have" case */
.stmt-balance-negative { color: #e63946; }

.stmt-pension-note { color: #b58900; font-size: 11px; }

/* Period picker — custom date range section */
.picker-divider { margin: 6px 0; border-top: 1px solid #f0f0f0; }
.picker-custom { padding: 6px 4px 4px; }
.picker-custom-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: #999; font-weight: 600; margin-bottom: 6px; }
.picker-custom-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.picker-custom-row input[type=date] { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid #e2e2e8; border-radius: 8px; font-size: 13px; box-sizing: border-box; outline: none; }
.picker-custom-row input[type=date]:focus { border-color: #3fc1c9; }
.picker-custom-arrow { color: #aaa; flex: 0 0 auto; }
.picker-custom-btn { width: 100%; padding: 8px; background: #3fc1c9; color: white; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.picker-custom-btn:hover { background: #36b0b8; }

/* By Category view (Insights) */
.bycat-row { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); cursor: pointer; transition: box-shadow 0.12s; }
.bycat-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.bycat-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bycat-name { font-size: 15px; font-weight: 600; color: #1a1a2e; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bycat-numbers { display: flex; align-items: baseline; gap: 10px; flex: 0 0 auto; }
.bycat-amount { font-size: 16px; font-weight: 700; color: #e63946; font-variant-numeric: tabular-nums; }
.bycat-pct { font-size: 12px; color: #888; font-weight: 500; min-width: 32px; text-align: right; }
.bycat-bar { height: 6px; background: #f4f4f8; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.bycat-bar-fill { height: 100%; background: linear-gradient(90deg, #e63946, #ff6b6b); border-radius: 3px; transition: width 0.3s; }
.bycat-txns { display: none; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.bycat-row.bycat-expanded .bycat-txns { display: block; }
.bycat-txn { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; font-size: 13px; }
.bycat-txn:not(:last-child) { border-bottom: 1px solid #f8f8f8; }
.bycat-txn-meta { color: #555; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bycat-txn-date { color: #888; font-weight: 500; }
.bycat-txn-sep { color: #ccc; margin: 0 4px; }
.bycat-txn-note { color: #999; font-style: italic; }
.bycat-txn-amount { color: #e63946; font-weight: 600; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
