:root { color-scheme: dark; --accent: #a5a8ff; }
[hidden] { display: none !important; }
.pwa-panel { padding: 24px; border: 1px solid #344260; background: #151f30; border-radius: 16px; }
.pwa-panel > div:first-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pwa-panel h3 { font-size: 15px; font-weight: 700; color: #f8fafc; }
.pwa-panel > div > span { font-size: 12px; color: #a5a8ff; }
.pwa-panel p { font-size: 13px; line-height: 1.8; color: #94a3b8; margin-top: 12px; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pwa-actions button { margin-top: 16px; padding: 10px 16px; background: #6366f1; color: white; border-radius: 10px; }
html, body { height: 100%; height: 100dvh; }
body { background: #0b111c; font-size: 14px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid #a5a8ff; outline-offset: 4px; }
button:disabled { opacity: .45; cursor: not-allowed; }
body > header { min-height: 76px; padding: 16px 24px; padding-top: max(16px, env(safe-area-inset-top)); background: #101827; border-color: #253047; }
header h1 { font-size: 19px !important; letter-spacing: -.5px !important; }
header p { font-size: 11px !important; margin-top: 2px; }
header button { min-width: 42px; min-height: 42px; }
#month-toolbar { min-height: 64px; background: #10182780; padding: 10px 24px; }
#month-toolbar button, #month-toolbar select { min-height: 38px; }
.today-button { color: #b6b9ff; padding: 4px 10px; border-radius: 8px; }
.today-button:hover { background: #6366f120; }
#view-container { padding: 24px 20px calc(105px + env(safe-area-inset-bottom)); scroll-behavior: smooth; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 26px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: #999ee8; margin-bottom: 8px; }
#page-title { font-size: 27px; font-weight: 700; letter-spacing: -1px; color: #f8fafc; }
#page-description { color: #94a3b8; font-size: 13px; margin-top: 6px; line-height: 1.6; }
.local-status { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.local-status span { width: 6px; height: 6px; background: #34d399; border-radius: 50%; box-shadow: 0 0 0 4px #34d39910; }
#balance-overview { background: radial-gradient(ellipse at top right, #6366f11b, transparent 70%), linear-gradient(130deg, #1e2b42, #152033); padding: 26px; border: 1px solid #344260; box-shadow: 0 12px 40px #00000015; }
#dashboard-net-worth { font-size: clamp(32px, 4vw, 44px); font-weight: 600; margin: 18px 0 24px; font-variant-numeric: tabular-nums; letter-spacing: -1.5px; overflow-wrap: anywhere; }
#budget-percentage { white-space: nowrap; }
#dashboard-accounts-grid > div { padding: 12px 8px; background: #0d172966; }
#dashboard-accounts-grid > div > :last-child { margin-top: 7px; overflow-wrap: anywhere; }
#income-expense-summary > div { border-radius: 16px; background: #151f30; }
#income-expense-summary p:last-child { font-size: clamp(18px, 2vw, 26px); margin-top: 7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#income-expense-summary > div > div:last-child { min-width: 0; }
#recent-section { padding-top: 8px; }
#recent-section > div:first-child { margin-bottom: 16px; }
#recent-transactions-list > div, #ledger-comprehensive-list > div.relative { padding: 17px; background: #141e2e; border-color: #29354a; }
#recent-transactions-list > div > div:first-child { flex: 1; padding-right: 12px; }
#recent-transactions-list > .text-center { padding: 38px 24px; border: 1px dashed #334155; border-radius: 16px; background: #141e2e80; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #6366f115; color: #a5a8ff; margin: 0 auto 16px; }
.empty-icon svg { width: 23px; height: 23px; }
.text-center h3 { font-size: 16px; font-weight: 600; color: #e2e8f0; margin-bottom: 8px; }
.text-center p { font-size: 13px; color: #94a3b8; line-height: 1.8; }
.empty-action { color: #b7baff; font-size: 13px; font-weight: 600; min-height: 40px; padding: 8px 14px; background: #6366f119; border: 1px solid #6366f140; border-radius: 9px; margin-top: 16px; }
.empty-action:hover { background: #6366f135; }
.empty-hint { color: #94a3b8; font-size: 13px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.empty-hint .empty-action { margin-top: 0; }
.chart-empty { text-align: center; padding: 70px 16px; color: #94a3b8; }
main .text-slate-500 { color: #94a3b8; }
main .text-brand-primary { color: #a5a8ff; }
main [class*="text-[8px]"], main [class*="text-[9px]"], main [class*="text-[10px]"] { font-size: 11px; }
main .text-xs { font-size: 13px; }
main button { min-height: 36px; }
main button:has(> svg:only-child) { min-width: 36px; }
#ledger-comprehensive-list button { min-height: 42px; min-width: 38px; }
#accounts-debit-cards-grid > div { box-shadow: none; padding: 22px; min-width: 0; }
#accounts-debit-cards-grid > div > div { position: relative; }
#accounts-debit-cards-grid .flex.justify-between.items-baseline { flex-wrap: wrap; gap: 12px; }
#accounts-debit-cards-grid .text-xl { overflow-wrap: anywhere; min-width: 0; }
#accounts-debit-cards-grid .items-start > div { min-width: 0; }
#accounts-debit-cards-grid .items-start span { overflow-wrap: anywhere; }
#recent-transactions-list span.bg-brand-primary\/10, #ledger-comprehensive-list span.bg-brand-primary\/10 { max-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#calendar-days-grid > button { height: 72px; padding: 7px; min-width: 0; }
#calendar-days-grid [aria-current="date"] > div:first-child > span { background: #6366f1; color: white; border-radius: 50%; padding: 2px 6px; }
#calendar-days-grid [class*="text-[7.5px]"] { font-size: 10px; line-height: 1.35; }
nav { padding-bottom: max(8px, env(safe-area-inset-bottom)) !important; background: #111b2bf5 !important; }
nav > button { min-height: 52px; min-width: 44px; }
nav > button > svg { width: 20px; height: 20px; }
nav > button > span { font-size: 10px !important; }
nav .active-tab { color: #b7baff; }
nav .active-tab::after { background: #9c9fff; box-shadow: none; }
#new-record-button { width: 54px; height: 54px; transform: translateY(-10px); flex-shrink: 0; }
.desktop-record-label { display: none; }
[role="dialog"] { padding-bottom: env(safe-area-inset-bottom); }
[role="dialog"] > div { max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
[role="dialog"] input, [role="dialog"] select { min-height: 46px; font-size: 16px; }
[role="dialog"] label { font-size: 12px; }
[role="dialog"] button { min-height: 42px; }
#quick-amount { font-size: 36px; min-height: 74px; }
#quick-record-modal > div { padding: 26px; }
#custom-toast { z-index: 100; pointer-events: none; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; }
#custom-toast button { min-width: 36px; min-height: 36px; }
#custom-toast .text-xs { font-size: 13px; line-height: 1.6; }
#storage-banner { padding: 16px; color: #fde68a; background: #78350f40; border: 1px solid #b4530980; border-radius: 12px; }
#storage-banner button { text-decoration: underline; margin-left: 16px; }
@media (min-width: 960px) {
    body > header { min-height: 84px; padding: 18px 32px; }
    #month-toolbar { margin-left: 208px; padding: 12px 36px; }
    #view-container { margin-left: 208px; padding: 32px 36px 48px; }
    #view-container > div { max-width: 1180px; margin-left: auto; margin-right: auto; }
    nav { top: 84px; width: 208px; right: auto !important; flex-direction: column; align-items: stretch !important; justify-content: flex-start !important; gap: 8px; padding: 28px 16px 24px !important; border-top: 0 !important; border-right: 1px solid #253047; box-shadow: none !important; }
    nav > button { width: 100% !important; height: 48px !important; flex-direction: row !important; justify-content: flex-start !important; gap: 13px; padding: 12px 16px; border-radius: 10px; }
    nav > button > span { font-size: 13px !important; margin-top: 0 !important; }
    nav > button:hover { background: #ffffff05; }
    nav > .active-tab { background: #6366f11c; }
    nav .active-tab::after { display: none; }
    #new-record-button { margin-top: auto; transform: none; order: 9; border: 0; justify-content: center !important; box-shadow: none; }
    .desktop-record-label { display: inline; }
    #view-dashboard:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
    #view-dashboard > * { margin-top: 0; }
    #income-expense-summary { grid-template-columns: 1fr; gap: 16px; }
    #income-expense-summary > div { padding: 24px; }
    #recent-section { grid-column: 1 / -1; }
    #view-analytics:not(.hidden) { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
    #view-analytics > div { margin-top: 0; padding: 24px; }
    #view-analytics > div:first-child { grid-column: 1 / -1; }
    #view-settings > div { padding: 24px; }
    #quick-record-modal { align-items: center; }
    #quick-record-modal > div { border-radius: 24px; border: 1px solid #344260; }
    #custom-toast { left: 230px; bottom: 24px; }
}
@media (max-width: 600px) {
    body > header { padding-left: 16px; padding-right: 16px; }
    #month-toolbar { padding: 8px 16px; }
    #month-toolbar > div { gap: 4px; }
    #month-toolbar select { padding-left: 7px; }
    #view-container { padding: 22px 16px calc(100px + env(safe-area-inset-bottom)); }
    .local-status { display: none; }
    #page-title { font-size: 24px; }
    .page-heading { margin-bottom: 22px; }
    #balance-overview { padding: 20px; }
    #balance-overview .space-y-1\.5 > div:first-child { flex-wrap: wrap; gap: 8px; }
    #income-expense-summary > div { padding: 16px 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
    #calendar-days-grid > button { height: 66px; padding: 4px; }
    #quick-record-modal > div { padding: 20px; }
    #ledger-comprehensive-list .gap-3 { gap: 6px; }
    #recent-transactions-list > div, #ledger-comprehensive-list > div.relative { padding: 12px; }
    #recent-transactions-list span.shrink-0, #ledger-comprehensive-list span.shrink-0 { max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
