/* The account panel - shared by dash.html, admin.html and reset.html.
 *
 * ⚠️ THIS FILE EXISTS BECAUSE THESE RULES LIVED IN admin.css, which the
 * dashboard does not load. The panel built fine there and rendered as raw
 * unstyled HTML: a browser file picker, bare inputs, a "?" where the
 * picture goes. A shared component cannot keep its styling in one page's
 * stylesheet; every page that calls accountPanel() links this one.
 */
.acctbox{display:grid;gap:var(--s2);max-width:460px}
.acctbox label{display:block;font-size:var(--fs-xs);color:var(--mut);
               margin-bottom:2px}
.acctbox input{width:100%}
.acctbox button{justify-self:start}
.acctwho{font-size:var(--fs-sm);color:var(--mut)}

/* A section heading inside the panel. The panel is four separate jobs -
   picture, name, password, recovery codes - and without headings they read
   as one long undifferentiated form. */
.accthd{font-size:var(--fs-xs);font-weight:600;letter-spacing:.06em;
        text-transform:uppercase;color:var(--mut);
        padding-top:var(--s3);margin-top:var(--s2);
        border-top:1px solid var(--line)}
.accthd:first-child{border-top:0;padding-top:0;margin-top:0}
.acctnote{font-size:var(--fs-sm);color:var(--mut);line-height:1.5;
          margin-top:calc(var(--s2) * -1)}

/* ⚠️ Stated, not nagged. The account works; the password is just one that
   somebody else chose, and the panel says so once. */
.acctwarn{border:1px solid var(--warn);border-radius:var(--r);
          padding:var(--s3);font-size:var(--fs-sm);line-height:1.45}
.acctwarn b{color:var(--warn)}
.acctmsg{font-size:var(--fs-sm)}
.acctmsg:empty{display:none}
.acctmsg.bad{color:var(--bad)}
.acctmsg.ok{color:var(--ok)}

.acctpicwrap{display:flex;gap:var(--s3);align-items:center}
.acctpic{width:72px;height:72px;border-radius:50%;overflow:hidden;
         background:var(--acc-soft);display:grid;place-items:center;
         flex:0 0 auto;border:1px solid var(--line)}
.acctpic img{width:100%;height:100%;object-fit:cover;display:block}
.acctpic img[hidden]{display:none}
.acctinit{font-size:28px;font-weight:600;color:var(--acc);line-height:1}
.acctinit[hidden]{display:none}
/* The real <input type=file> is never shown: its own widget says
   "Choose File / no file selected" in the browser's styling, which is the
   one control on the page that cannot be made to look like the rest. */
.acctfile{display:none}
.acctpicwrap .row{display:flex;gap:var(--s2);flex-wrap:wrap}
.acctpicwrap .row button{margin:0}

.acctrule{border:0;border-top:1px solid var(--line);margin:var(--s2) 0}
.acctrec{display:grid;gap:var(--s2);justify-items:start}
.acctcodes:empty{display:none}
.acctcodes{font-size:var(--fs-sm);line-height:1.6}
.codelist{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
          gap:var(--s1);margin-top:var(--s2)}
.codelist code{font-family:var(--mono);user-select:all;
               background:var(--bg);padding:2px 6px;border-radius:var(--r-sm)}

/* The header button, when there is a picture to put in it. */
#acct img{width:24px;height:24px;border-radius:50%;object-fit:cover;display:block}
#acct img[hidden]{display:none}
#acct svg[hidden]{display:none}

/* ---- the panel as a sheet over the page --------------------------------
 *
 * ⚠️ IT WAS A BANNER THAT REPLACED THE PAGE, and that was wrong twice over:
 * on the dashboard it hid whatever you were reading, and on the map - which
 * IS the page, full bleed, with no space above it - there was nowhere to put
 * it at all, so the map simply had no account control. A sheet sits over
 * whatever you were doing and gives it back when you close it. The same
 * component now works on both.
 */
.acctmodal{position:fixed;inset:0;z-index:4000;display:grid;
           place-items:center;padding:var(--s4);
           background:#0f1626a8;backdrop-filter:blur(3px)}
.acctmodal[hidden]{display:none}
.acctsheet{background:var(--card);border:1px solid var(--line);
           border-radius:var(--r-lg);width:min(520px,100%);max-height:86vh;
           display:flex;flex-direction:column;box-shadow:var(--sh-lg)}
.acctsheethd{display:flex;align-items:center;justify-content:space-between;
             gap:var(--s3);padding:var(--s4) var(--s5);
             border-bottom:1px solid var(--line);flex:none}
.acctsheethd h2{margin:0;font-size:var(--fs-md);font-weight:600}
.acctsheet .acctbody{padding:var(--s5);overflow:auto;max-width:none}
.acctmodal .acctbox{max-width:none}

/* The identity block: picture, address and the two buttons that change it,
   on one line. "SIGNED IN AS" above an address on its own line was a label
   for a value the panel then showed nowhere near it. */
.acctid{display:flex;gap:var(--s4);align-items:center}
.acctid .who{display:grid;gap:var(--s1);min-width:0}
.acctid .em{font-size:var(--fs-md);font-weight:600;color:var(--fg);
            overflow-wrap:anywhere}
.acctid .row{display:flex;gap:var(--s2);flex-wrap:wrap}
.acctid .row button{margin:0}

@media (max-width:560px){
  .acctmodal{padding:0;place-items:stretch}
  .acctsheet{width:100%;max-height:100%;border:0;border-radius:0}
}
