/* Installed CRM: keep the full screen usable in portrait, landscape and Split View. */
.crm-pwa-standalone body { padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px); padding-left:env(safe-area-inset-left,0px); padding-right:env(safe-area-inset-right,0px); min-height:100dvh; box-sizing:border-box; }
.crm-pwa-tools { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 12px; background:#172e3c; color:#fff; }
.crm-pwa-tools a,.crm-pwa-tools button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:6px 10px; margin:0; border:0; border-radius:8px; color:#fff; background:transparent; font:inherit; font-size:14px; text-decoration:none; cursor:pointer; }
.crm-pwa-tools button:hover,.crm-pwa-tools a:hover { background:#294456; }
.crm-pwa-install-link { display:inline-flex; align-items:center; min-height:44px; box-sizing:border-box; padding:8px 12px; border-radius:8px; text-decoration:none; font-weight:600; color:#215e77; background:#e5f3f7; }
.crm-pwa-connection { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 14px; background:#fff0cf; color:#5b3b05; font:500 14px/1.4 system-ui,sans-serif; }
.crm-pwa-connection span { flex:1 1 220px; }
.crm-pwa-connection button { min-height:44px; border:1px solid #bc9146; border-radius:8px; background:transparent; color:inherit; padding:6px 10px; font:inherit; cursor:pointer; }
body.crm-pwa-info { margin:0; padding:24px max(16px,env(safe-area-inset-left)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-right)); font:16px/1.55 system-ui,-apple-system,sans-serif; color:#1c2e3b; background:#f4f7fa; box-sizing:border-box; min-height:100vh; min-height:100dvh; }
.crm-pwa-card { max-width:620px; margin:0 auto; padding:28px; border:1px solid #dce4eb; border-radius:20px; background:#fff; box-sizing:border-box; }
.crm-pwa-logo { display:block; border-radius:18px; width:80px; height:80px; }
.crm-pwa-eyebrow { margin:20px 0 8px; font-size:12px; font-weight:700; letter-spacing:.09em; color:#627786; }
.crm-pwa-card h1 { font-size:clamp(25px,4vw,32px); line-height:1.18; margin:0 0 16px; }
.crm-pwa-card p { margin:0 0 18px; }
.crm-pwa-steps { padding-left:25px; margin:24px 0; }
.crm-pwa-steps li { padding-left:6px; margin-bottom:18px; }
.crm-pwa-steps span { display:block; color:#546a7a; margin-top:4px; }
.crm-pwa-card button,.crm-pwa-primary { display:flex; justify-content:center; align-items:center; width:100%; min-height:48px; padding:12px 16px; box-sizing:border-box; border:0; border-radius:10px; color:#fff; background:#233084; text-decoration:none; font:600 16px/1.4 system-ui,sans-serif; cursor:pointer; margin:10px 0; }
.crm-pwa-secondary { display:block; padding:12px 0; color:#233084; text-align:center; }
.crm-pwa-card .crm-pwa-note { color:#546a7a; font-size:14px; margin:18px 0; }
.crm-pwa-card summary { min-height:44px; cursor:pointer; font-weight:600; }
.crm-pwa-card details p { color:#546a7a; font-size:14px; }
.crm-pwa-success { padding:12px; border-radius:8px; color:#145342; background:#dff1eb; }
.crm-pwa-card [hidden] { display:none!important; }
@media (max-width:430px) { body.crm-pwa-info { padding-top:16px; } .crm-pwa-card { padding:20px; border-radius:16px; } }
@media (prefers-color-scheme:dark) {
 body.crm-pwa-info { color:#edf3f8; background:#111c25; }
 .crm-pwa-card { background:#1a2935; border-color:#344a5b; }
 .crm-pwa-steps span,.crm-pwa-card .crm-pwa-note,.crm-pwa-card details p,.crm-pwa-eyebrow { color:#b6c6d2; }
 .crm-pwa-secondary { color:#bfcbff; }
}
@media print { #crmPwaTools,#crmPwaConnection,#crmPwaInstallLink { display:none!important; } .crm-pwa-standalone body { padding:0; } }

/* Device picker: native dialog keeps focus inside and supports Escape. */
.crm-install-dialog{box-sizing:border-box;width:min(560px,calc(100vw - 32px));max-width:560px;max-height:calc(100dvh - 32px);padding:24px;border:1px solid #dce4eb;border-radius:18px;background:#fff;color:#1c2e3b;font:16px/1.5 system-ui,-apple-system,sans-serif;overflow:auto}
.crm-install-dialog::backdrop{background:#08131db3}
.crm-install-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.crm-install-heading h2{font-size:24px;line-height:1.2;margin:0}
.crm-install-dialog .crm-install-close{display:grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;padding:0;margin:0;background:transparent;color:inherit;border:1px solid #8095a5;border-radius:10px;font-size:26px;cursor:pointer}
.crm-install-description{margin:0 0 20px}
.crm-install-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
.crm-install-options .crm-install-choice{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:5px;box-sizing:border-box;min-width:0;padding:20px 16px;border:1px solid #bdccda;border-radius:12px;text-decoration:none;color:inherit;background:#edf3f8;line-height:1.4}
.crm-install-choice strong{font-size:23px}
.crm-install-choice span{font-size:14px}
.crm-install-choice small{font-size:13px;line-height:1.45;color:inherit;opacity:.85;overflow-wrap:anywhere}
.crm-install-options .crm-install-choice:hover{border-color:#5279b7;background:#e2ecf7}
.crm-install-options .crm-install-choice:focus-visible,.crm-install-close:focus-visible{outline:3px solid #5d91e9;outline-offset:3px}
@media(max-width:480px){.crm-install-options{grid-template-columns:1fr}.crm-install-dialog{padding:20px}.crm-install-heading h2{font-size:21px}.crm-install-options .crm-install-choice{padding:16px}.crm-install-choice strong{font-size:22px}}
:root[data-crm-theme="dark"] .crm-install-dialog{background:#1b2532;color:#e7edf5;border-color:#46576b}
:root[data-crm-theme="dark"] .crm-install-choice{background:#243747;color:#e7edf5;border-color:#52687b}
:root[data-crm-theme="dark"] .crm-install-choice:hover{background:#2d455a;border-color:#8bb8f3}
@media(prefers-color-scheme:dark){
 :root:not([data-crm-theme="light"]) .crm-install-dialog{background:#1b2532;color:#e7edf5;border-color:#46576b}
 :root:not([data-crm-theme="light"]) .crm-install-choice{background:#243747;color:#e7edf5;border-color:#52687b}
 :root:not([data-crm-theme="light"]) .crm-install-choice:hover{background:#2d455a;border-color:#8bb8f3}
}
