/* Ahorrito 12.1: installed PWA interaction, native gestures and dark-mode accessibility. */
#pwaBootGate.hidden,#installGuide.hidden,#offlinePrepBanner.hidden,#modalRoot.hidden{display:none!important;visibility:hidden!important;pointer-events:none!important;z-index:-1!important}
#pwaBootGate:not(.hidden),#installGuide:not(.hidden){z-index:1950!important;pointer-events:auto!important}
#authScreen:not(.hidden),#lockScreen:not(.hidden){position:relative!important;z-index:4!important;pointer-events:auto!important;isolation:isolate}
#authScreen .auth-card,#lockScreen .auth-card{position:relative!important;z-index:5!important;pointer-events:auto!important}
#authScreen form,#authScreen .field,#authScreen .auth-links,#lockScreen form,#lockScreen .field{position:relative!important;pointer-events:auto!important}
#authScreen :is(input,textarea,select),#lockScreen :is(input,textarea,select),#modalRoot :is(input,textarea,select){
  position:relative;pointer-events:auto!important;touch-action:auto!important;-webkit-user-select:text!important;user-select:text!important;opacity:1!important;
  font-size:16px!important;min-height:48px;caret-color:#079d86;-webkit-appearance:none;appearance:none;
}
#authScreen :is(input,textarea,select):focus,#lockScreen :is(input,textarea,select):focus{outline:2px solid #12a986!important;outline-offset:1px!important}
body[data-mode="app"] :is(input,textarea,select,[contenteditable="true"]){touch-action:auto!important}
.pwa-boot-locale{display:flex;justify-content:center;position:relative;z-index:3;margin:0 0 15px}
.pwa-boot-locale select{min-width:165px!important;font-size:16px!important;min-height:43px;background:#fff!important;color:#143a34!important;border:1px solid #cde5d9!important;border-radius:12px}
html[data-theme="dark"] .pwa-boot-locale select{background:#19372d!important;color:#f1fff7!important;border-color:#45685b!important}
/* Dark overlays: every close icon must be visible and remain a real tap target. */
html[data-theme="dark"] #modalRoot .modal,html[data-theme="dark"] #modalRoot .modal.wide{background:#10261f!important;color:#f1fff8!important;border:1px solid #38594b!important}
html[data-theme="dark"] #modalRoot :is(.modalhead h2,.modal h2,.modal h3,.modalhead,.field label,.small,.k,.muted,.hint,p){color:#e4f5ed!important;opacity:1!important}
html[data-theme="dark"] #modalRoot :is(.iconbtn,[data-close],.v5-notification-close){background:#214539!important;border:1px solid #648677!important;color:#ffffff!important;opacity:1!important;fill:#ffffff!important;stroke:#ffffff!important;display:inline-flex;align-items:center;justify-content:center;min-height:42px;min-width:42px;flex-shrink:0}
html[data-theme="dark"] #modalRoot [data-close] svg{stroke:currentColor!important;fill:none!important}
html[data-theme="dark"] #modalRoot :is(input,select,textarea){background:#19382c!important;color:#f4fff9!important;border-color:#547969!important;caret-color:#8affd8!important}
html[data-theme="dark"] #modalRoot :is(input,textarea)::placeholder{color:#b4d0c2!important}
html[data-theme="dark"] #modalRoot .modal-backdrop{background:rgba(0,14,12,.74)!important}
html[data-theme="dark"] #modalRoot .modal table,html[data-theme="dark"] #appScreen :is(.panel,.table-wrap) table{color:#ecfff5!important}
html[data-theme="dark"] #modalRoot .modal table :is(th,td),html[data-theme="dark"] #appScreen :is(.panel,.table-wrap) table :is(th,td){color:#e4f7ed!important;background:#163328!important;border-color:#3e5e4e!important}
html[data-theme="dark"] #appScreen .table-wrap tbody tr:nth-child(even) td{background:#1e4234!important}
html[data-theme="dark"] #modalRoot .notice,html[data-theme="dark"] #modalRoot .empty{background:#234335!important;color:#e9fff4!important;border-color:#446751!important}
html[data-theme="dark"] #modalRoot .btn.ghost,html[data-theme="dark"] #modalRoot .btn.light{background:#21483a!important;color:#f4fff8!important;border:1px solid #426c58!important}
html[data-theme="dark"] #authScreen .auth-card,html[data-theme="dark"] #lockScreen .auth-card{background:#112920!important;color:#f2fff9!important;border:1px solid #426353!important}
html[data-theme="dark"] #authScreen .field label,html[data-theme="dark"] #lockScreen .field label{color:#def1e6!important}
html[data-theme="dark"] #authScreen :is(input,textarea,select),html[data-theme="dark"] #lockScreen :is(input,textarea,select){background:#193a2e!important;color:#ffffff!important;border-color:#648673!important;caret-color:#85ffce!important}
html[data-theme="dark"] .pwa-boot-gate{background:#0b2119!important;color:#f2fff8!important}
html[data-theme="dark"] .pwa-boot-card{background:#143428!important;color:#effff7!important;border-color:#446957!important}
html[data-theme="dark"] .pwa-boot-card :is(h1,p,.muted){color:#e1f3e8!important}
/* Do not steal native Android back/edge gestures or horizontal wallet scrolling. */
html,body{overscroll-behavior-x:auto}
body[data-mode="app"] .v10-wallet-rail{touch-action:pan-x pan-y!important;-webkit-overflow-scrolling:touch}
@media(max-width:750px){#authScreen,#lockScreen{padding:calc(20px + env(safe-area-inset-top)) 15px calc(24px + env(safe-area-inset-bottom));min-height:100dvh}#authScreen .auth-card,#lockScreen .auth-card{max-width:100%;margin-inline:auto}}

/* 12.1.1: real text fields and native keyboard, no touch interception. */
#authScreen:not(.hidden),#lockScreen:not(.hidden){z-index:1!important;transform:none!important}
#authScreen .auth-card,#lockScreen .auth-card{transform:none!important;filter:none!important;backdrop-filter:none!important}
#authScreen .field,#lockScreen .field{z-index:auto!important}
#authScreen :is(input[type="email"],input[type="password"],input[type="text"],input[inputmode="numeric"]),
#lockScreen :is(input,textarea),#modalRoot :is(input,textarea){
  -webkit-user-select:text!important;user-select:text!important;touch-action:manipulation!important;
  pointer-events:auto!important;position:relative;z-index:2;
  font-size:16px!important;caret-color:#0eb59b!important;
}
#authScreen:not(.hidden)~#modalRoot.hidden{pointer-events:none!important}
body:has(#authScreen:not(.hidden)) #pwaBootGate,
body:has(#authScreen:not(.hidden)) #installGuide,
body:has(#lockScreen:not(.hidden)) #pwaBootGate,
body:has(#lockScreen:not(.hidden)) #installGuide{display:none!important;pointer-events:none!important}
@supports (-webkit-touch-callout:none){
  #authScreen :is(input,textarea),#lockScreen :is(input,textarea){-webkit-appearance:none;appearance:none;}
}

/* V12.1.3: hierarchy without decorative pre-headings */
#appScreen .v9-insight-head h2 { margin-top: 0; }
#appScreen .v101-category-head h2 { margin-top: 0; }
#appScreen .v101-categories > .heading h1 { margin-top: 0; }
