/* Account entry screens: readable themes, native page scrolling and touch input. */
html.standalone-auth {
  --auth-bg:#09090c; --auth-surface:#15141b; --auth-text:#f2f0f8;
  --auth-muted:#aaa5b7; --auth-link:#bea5ff; --auth-error:#ff8196;
  --auth-success:#63d8b0; --auth-warning:#e9c67b; --auth-border:#37323f;
  color-scheme:dark; background:var(--auth-bg); overflow-y:auto; scroll-padding-block:20px;
}
html.standalone-auth[data-theme=light] {
  --auth-bg:#f6f4fa; --auth-surface:#ffffff; --auth-text:#292332;
  --auth-muted:#655b70; --auth-link:#6541a7; --auth-error:#ad2949;
  --auth-success:#167653; --auth-warning:#805b18; --auth-border:#d9d1e3;
  --text:var(--auth-text); --muted:var(--auth-muted); --dim:var(--auth-muted);
  color-scheme:light;
}
html.standalone-auth body {
  display:flow-root; min-height:100svh; height:auto; overflow:visible; margin:0;
  color:var(--auth-text); background:var(--auth-bg)!important;
}
html.standalone-auth body::before,html.standalone-auth body::after { display:none; }
html.standalone-auth .lg { margin-block:clamp(28px,8vh,100px); padding-bottom:max(28px,env(safe-area-inset-bottom)); }
html.standalone-auth .lg h1,html.standalone-auth .f2a h2 { color:var(--auth-text); overflow-wrap:anywhere; }
html.standalone-auth .lg h1 span,html.standalone-auth .f2a-kick,
html.standalone-auth .lglink,html.standalone-auth .terms a { color:var(--auth-link); }
html.standalone-auth .lg .kick,html.standalone-auth .lg .sub,
html.standalone-auth .lg .f,html.standalone-auth .lg .lgnote,
html.standalone-auth .lg .cur,html.standalone-auth .lg .why,
html.standalone-auth .f2a p,html.standalone-auth .terms,
html.standalone-auth .trial span,html.standalone-auth .codes p { color:var(--auth-muted); }
html.standalone-auth .lgerr { color:var(--auth-error); line-height:1.5; }
html.standalone-auth .lg .inp {
  min-width:0; width:100%; min-height:44px; padding:10px 12px;
  color:var(--auth-text); background:var(--auth-surface); border-color:var(--auth-border);
  border-radius:10px; box-sizing:border-box; line-height:1.4; scroll-margin-block:24px;
}
html.standalone-auth .inp::placeholder { color:var(--auth-muted); opacity:1; }
html.standalone-auth .lg .btn { min-height:44px; height:auto; padding:12px 16px; line-height:1.3; white-space:normal; }
html.standalone-auth .lg .btn.primary { background:#7652c5; color:#fff; border-color:#7652c5; }
html.standalone-auth .lg .btn.primary:disabled { opacity:.6; cursor:wait; }
html.standalone-auth .lglink { min-height:44px; display:flex; align-items:center; justify-content:center; line-height:1.45; }
html.standalone-auth .trial,html.standalone-auth .f2a { background:color-mix(in srgb,var(--auth-link) 8%,var(--auth-bg)); border-color:var(--auth-border); }
html.standalone-auth .trial b,html.standalone-auth code { color:var(--auth-link); }
html.standalone-auth .ok { color:var(--auth-success); }
html.standalone-auth .codes,html.standalone-auth .warn { color:var(--auth-warning); background:color-mix(in srgb,var(--auth-warning) 8%,var(--auth-bg)); border-color:var(--auth-border); }
html.standalone-auth .codes h2,html.standalone-auth .warn a { color:var(--auth-warning); }
html.standalone-auth .codes ol { color:var(--auth-text); overflow-wrap:anywhere; }
html.standalone-auth .terms input { width:20px; height:20px; margin:1px 0 0; }
html.standalone-auth .terms span { min-width:0; }
html.standalone-auth .lg [style*="color:#6E6B76"] { color:var(--auth-muted)!important; }
html.standalone-auth .lg .note-success { color:var(--auth-success)!important; }
html.standalone-auth .lg .note-error { color:var(--auth-error)!important; }
html.standalone-auth :is(a,button,input,select,textarea):focus-visible { outline:none; }
html.standalone-auth .hid { display:none!important; }

/* Administration has its own page layout; tables scroll inside their region. */
html.standalone-auth[data-theme=light] .wrap :is(h1,h2,h3,b,.em,.pcode,.pane .line,td,.act button,.fpop label.ck) { color:var(--auth-text); }
html.standalone-auth[data-theme=light] .wrap :is(.kick,.ttl,.card>span,.mut,.no,.empty,.hint,.note,.kv span,.pane .ptitle,.frm label.f,.owehint),
html.standalone-auth[data-theme=light] .fpop :is(.ttl2,.cnt) { color:var(--auth-muted); }
html.standalone-auth[data-theme=light] :is(.scroll,.card,.kv>div,.pane,.act button,.degr,.fpop) { background:var(--auth-surface); border-color:var(--auth-border); }
html.standalone-auth[data-theme=light] .scroll table th { background:#eeebf3; color:var(--auth-muted); border-color:var(--auth-border); }
html.standalone-auth[data-theme=light] td { border-color:var(--auth-border); }
html.standalone-auth[data-theme=light] :is(.topact a,.lnk,.pk-i,.t-trial,.fpop .clr,.degr code) { color:var(--auth-link); }
html.standalone-auth[data-theme=light] :is(.yes,.ok,.pk-r,.t-active) { color:var(--auth-success); }
html.standalone-auth[data-theme=light] :is(.neg,.t-expired,.btn.sm.danger),
html.standalone-auth[data-theme=light] td.owe.neg,html.standalone-auth[data-theme=light] td.mn.neg { color:var(--auth-error); }
html.standalone-auth[data-theme=light] :is(.soon,.t-admin,.warn) { color:var(--auth-warning); }
html.standalone-auth[data-theme=light] .wrap .inp,html.standalone-auth[data-theme=light] .fpop .inp { color:var(--auth-text); background:var(--auth-surface); border-color:var(--auth-border); }
html.standalone-auth .scroll { max-width:100%; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
html.standalone-auth .fpop { max-width:calc(100vw - 24px); max-height:calc(100svh - 24px); overflow-y:auto; box-sizing:border-box; }
@media (max-width:600px),(pointer:coarse) {
  html.standalone-auth .lg { width:100%; max-width:460px; padding-inline:max(20px,env(safe-area-inset-left)); box-sizing:border-box; }
  html.standalone-auth .lg .f,html.standalone-auth .terms,html.standalone-auth .lg .lgnote,
  html.standalone-auth .lg .sub,html.standalone-auth .lgerr,html.standalone-auth .lg .cur { font-size:13px; line-height:1.6; }
  html.standalone-auth .inp,html.standalone-auth .lg .inp,html.standalone-auth .frm .inp,html.standalone-auth .fpop .inp { font-size:16px; min-height:44px; }
  html.standalone-auth .row2,html.standalone-auth .frm { grid-template-columns:minmax(0,1fr); }
  html.standalone-auth .wrap { padding:22px max(16px,env(safe-area-inset-left)) 44px; }
  html.standalone-auth .topact,html.standalone-auth .cact { margin-left:0; }
  html.standalone-auth .btn.sm,html.standalone-auth .act button,html.standalone-auth .lnk { min-height:44px; }
  html.standalone-auth .act { gap:6px; }
}
@media (max-width:359px) { html.standalone-auth .codes ol { columns:1; } }

/* Admin dialogs live outside .wrap. Keep their text and controls themed too. */
html.standalone-auth[data-theme=light] :is(.mdl,.fold,.fresh,.stopbox,.warnbox) { background:var(--auth-surface); border-color:var(--auth-border); color:var(--auth-text); }
html.standalone-auth[data-theme=light] :is(.mdl-head h3,.mdl label.f,.fpop label.ck,.fold>summary,.fresh b) { color:var(--auth-text); }
html.standalone-auth[data-theme=light] :is(.mdl .inp,.mdl-x) { color:var(--auth-text); background:var(--auth-surface); border-color:var(--auth-border); }
html.standalone-auth .mdl-back { padding: max(16px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)); }
html.standalone-auth .mdl { min-width:0; }
html.standalone-auth .mdl-head h3 { overflow-wrap:anywhere; }
html.standalone-auth .mdl-x { flex-shrink:0; min-width:44px; min-height:44px; }
html.standalone-auth .mdl-foot { flex-wrap:wrap; }

html.standalone-auth .verify-result { max-width:420px; padding-inline:20px; text-align:center; }
html.standalone-auth .verify-result .kick { font:600 11px/1.4 var(--mono); letter-spacing:.16em; margin-bottom:14px; }
html.standalone-auth .verify-result h1 { margin:0 0 10px; font:600 24px/1.3 var(--ui); }
html.standalone-auth .verify-result .lgnote { font:400 14px/1.6 var(--ui); }
html.standalone-auth .verify-result .lglink { margin-top:22px; font:500 14px/1.5 var(--ui); }
html.standalone-auth[data-theme=light] :is(.btn,.icobtn,.sbtn) {
  color:var(--auth-text); background:var(--auth-surface); border-color:var(--auth-border);
  box-shadow:0 2px 8px rgba(51,35,75,.06); backdrop-filter:none; -webkit-backdrop-filter:none;
}
html.standalone-auth[data-theme=light] :is(.btn,.icobtn,.sbtn):hover { color:var(--auth-text); background:#eeebf3; }
html.standalone-auth[data-theme=light] .btn.primary { background:#7652c5; color:#fff; border-color:#7652c5; }
html.standalone-auth[data-theme=light] .btn.seg.on { color:var(--auth-link); background:#eae2f7; border-color:#b49adf; }
html.standalone-auth[data-theme=light] .wrap :is(.degr,.lbar label.f.inline,.t-none,.cards .card b small.tsub,td.strike,tr.void td) { color:var(--auth-muted); }
html.standalone-auth[data-theme=light] .scroll table th:is(.on,.fon,.sortable:hover),
html.standalone-auth[data-theme=light] .fbtn { color:var(--auth-link); }
@media (max-width:600px),(pointer:coarse) {
  html.standalone-auth .fbtn { width:32px; height:44px; margin-right:4px; }
  html.standalone-auth .fpop :is(label.ck,.clr) { min-height:44px; }
  html.standalone-auth .fpop label.ck input { width:20px; height:20px; }
}
@media (prefers-reduced-motion:reduce) {
  html.standalone-auth *,html.standalone-auth *::before,html.standalone-auth *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
