:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172b49;background:#f4f7fc;font-size:16px}*{box-sizing:border-box}body{margin:0}main{max-width:760px;margin:0 auto;padding:32px 24px 60px}header{display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid #d8e2ef;padding-bottom:24px;margin-bottom:32px}header a{font-size:28px;font-weight:700;color:#17489b;text-decoration:none}header span,.note,footer{font-size:14px;color:#52647c;line-height:1.6}h1{font-size:32px;letter-spacing:-.03em;margin:0 0 12px}h2{font-size:21px;font-weight:600;margin:0 0 18px}h3{font-size:18px;margin-top:28px}.intro,p{line-height:1.6}.intro{color:#52647c;margin-bottom:28px}section{background:white;border:1px solid #d8e2ef;border-radius:16px;padding:28px;margin:20px 0;box-shadow:0 6px 20px #142f5610}label{display:block;font-size:14px;font-weight:600;margin:18px 0 7px}input,textarea{width:100%;font:inherit;background:#fff;color:inherit;border:1px solid #9bacbf;border-radius:8px;padding:12px;min-height:46px}input:focus-visible,textarea:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid #83b8ff;outline-offset:3px}button{font:inherit;font-weight:600;background:#1758bd;color:white;border:1px solid #1758bd;border-radius:8px;padding:12px 20px;cursor:pointer;min-height:46px;margin-top:20px}button.secondary{background:white;color:#17489b;border-color:#b8c9de}button:disabled{opacity:.55;cursor:wait}.actions{display:flex;gap:12px;flex-wrap:wrap}.account{display:flex;align-items:center;justify-content:space-between;gap:16px;overflow-wrap:anywhere}.account button{margin:0;flex-shrink:0}details{margin-top:24px;border-top:1px solid #d8e2ef;padding-top:20px}summary{cursor:pointer;color:#17489b}textarea{font-family:ui-monospace,monospace;line-height:1.8;resize:vertical}#status:empty{display:none}#status{padding:14px 18px;background:#e5eefc;border-radius:8px}#status.error{background:#fff0ee;color:#912a26}ul{padding:0;list-style:none}li{padding:14px 0;border-bottom:1px solid #e3eaf3;overflow-wrap:anywhere;line-height:1.6}footer{margin-top:28px}[hidden]{display:none!important}@media(max-width:520px){main{padding:20px 16px 40px}section{padding:20px}header{align-items:flex-start}header span{max-width:145px;text-align:right}h1{font-size:28px}.account{flex-wrap:wrap}}

.password-field{position:relative}.password-field input{padding-right:58px}.password-toggle{position:absolute;right:3px;top:3px;margin:0;padding:8px;width:44px;height:40px;min-height:40px;border:0;border-radius:6px;background:transparent;color:#52647c;display:flex;align-items:center;justify-content:center}.password-toggle:hover{background:#e5eefc;color:#17489b}.password-toggle svg{width:23px;height:23px;pointer-events:none}

.check{display:flex;gap:10px;align-items:center;font-weight:400}.check input{width:20px;min-height:20px;flex-shrink:0}#mfa-qr{display:block;background:white;max-width:100%;height:auto;margin:20px 0}.account>div{display:flex;gap:8px;flex-wrap:wrap}

body.finance-open>main{display:none}#finance-host{height:100dvh;display:flex;flex-direction:column;background:#f4f7fc}#finance-host iframe{border:0;flex:1;width:100%;min-height:0}.finance-sync{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 20px;border-bottom:1px solid #d8e2ef;font-size:14px;background:#fff}.finance-sync button{margin:0;padding:6px 12px;font-size:14px;min-height:36px}#finance-host[data-sync="error"] .finance-sync{background:#fff0ee;color:#912a26}#finance-host[data-sync="saved"] .finance-sync{color:#24654e}

.pair-code{display:block;font-family:ui-monospace,monospace;font-size:1.4rem;letter-spacing:.1em;line-height:1.6;color:#245d73;background:#edf5f7;padding:14px;border-radius:10px;overflow-wrap:anywhere;margin:12px 0}#legacy-security{margin-top:20px;padding-top:12px;border-top:1px solid #dce5eb}#security-tools h3{margin-top:24px}#unified-state{font-weight:600}#pair-compare{margin-top:20px}

#data-restore-form .check{align-items:flex-start;line-height:1.5;margin:16px 0;font-weight:400}#data-restore-form .check input{width:20px;height:20px;min-height:20px;padding:0;margin:1px 0 0;flex:0 0 20px;accent-color:#1758bd}

header .brand-link{display:block;background:#102b3a;padding:12px 16px;border-radius:10px;width:300px;max-width:65%;flex-shrink:1}header .brand-logo{display:block;width:100%;height:auto}@media(max-width:520px){header{gap:12px}header .brand-link{max-width:68%;padding:10px}header span{flex:1;min-width:0}}

/* Avoid flashing login content while the server validates the saved session. */
body.session-loading>main>:not(header):not(#status){display:none!important}
body.session-loading #status{margin:64px auto;text-align:center;background:transparent;color:#52647c}


#pair-safety-new:empty{display:none}


/* Save status lives in the app header; recovery controls remain available on error. */
#finance-host .finance-sync{display:none}
#finance-host[data-sync="error"] .finance-sync{display:flex}
