/* My account pane (account.js). The section carries .stg, so the header
   (.top), tabs (.tabs), blocks (.blk), buttons (.btn) and inputs (input.tx,
   select) come from Settings (settings.css, settings-modern.css). This file
   adds the pane frame, the tab bar under the header and the few pieces
   Settings has no class for. Colors are the desk tokens (desk.src.css :root),
   so light and dark both work. Every rule is scoped under #accountView. */

section.stg#accountView{flex:1;min-height:0;display:flex;flex-direction:column;font:400 14px/1.5 var(--ui);color:var(--ink);font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased;background:var(--ground)}
section.stg#accountView[hidden]{display:none}

/* The page shell (security.html) reuses the Desk's .app grid and rail; the
   account block in the rail is a label here, not the Desk's account menu. */
/* The page fills the window below the preview bar, like the Desk. */
body.acct-page{margin:0;background:var(--ground);display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}
#appShell.acct-shell{flex:1;min-height:0;height:auto}
#appShell.acct-shell .main{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
/* Below 900px the Desk pads .main for its fixed preview bar; here the bar sits above the shell. */
#appShell.acct-shell>.main{padding-top:0}
#accountView .acct-back{display:none}
#appShell.acct-shell .rail .me .who.acct-me{cursor:default}
#appShell.acct-shell .rail .me .who.acct-me::after{display:none}
#appShell.acct-shell .rail .me .who.acct-me:hover{background:none}

/* Header: the same bar Settings uses (#sTop) */
#accountView #acctTop{min-height:78px;height:auto;gap:16px;padding:16px 28px;background:var(--sheet);border-bottom:0}
#accountView #acctTop h1{font-size:21px;font-weight:600;letter-spacing:-.5px;flex-shrink:0}
#accountView .acct-sp{flex:1}
#accountView .acct-who{display:flex;align-items:center;gap:10px;min-width:0}
#accountView .acct-who[hidden]{display:none}
#accountView .acct-avatar{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--sign-wash);color:var(--sign);font-size:12px;font-weight:700;flex-shrink:0}
#accountView .acct-who-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}
#accountView .acct-who-text b{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#accountView .acct-who-text small{font-size:12px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Tabs across the top, under the header */
#accountView .acct-tabbar{flex-shrink:0;padding:0 28px;background:var(--sheet);border-bottom:1px solid var(--rule-soft)}
#accountView .acct-tabbar .tabs{margin:0;border-bottom:0;gap:6px;overflow-x:auto;scrollbar-width:none}
#accountView .acct-tabbar .tabs::-webkit-scrollbar{display:none}
#accountView .acct-tabbar .tabs button{padding:11px 4px;margin:0 8px 0 0;font-size:13.5px;white-space:nowrap;border-bottom-width:2px;margin-bottom:0}
#accountView .acct-tabbar .tabs button[aria-selected="true"]{color:var(--sign);border-bottom-color:var(--sign)}

/* Body */
#accountView .acct-body{flex:1;min-height:0;overflow:auto;padding:24px 28px 56px}
#accountView .acct-col{max-width:760px}
#accountView .acct-panel:focus-visible{outline:0}
#accountView .blk h4{flex-wrap:wrap}
#accountView .blk h5{margin:18px 0 4px;font-size:13.5px;font-weight:700}
#accountView .blk ul{margin:0 0 12px;padding-left:20px;font-size:13px}
#accountView .blk > p:last-child{margin-bottom:0}

/* Fields */
#accountView .acct-form{margin:0}
#accountView .acct-field{display:flex;flex-direction:column;gap:6px;margin:14px 0 0;font-size:13px;font-weight:600;color:var(--ink)}
#accountView .acct-field:first-of-type{margin-top:4px}
#accountView .acct-field input.tx,#accountView .acct-field select,#accountView .acct-field textarea.tx{width:100%;max-width:440px;height:34px;font-weight:400;font-size:13.5px}
#accountView textarea.tx{font:inherit;font-weight:400;color:var(--ink);background:var(--sheet);border:1px solid var(--rule);border-radius:4px;padding:6px 8px;min-height:76px;resize:vertical}
#accountView textarea.tx:focus-visible{outline:0;border-color:var(--sign);box-shadow:0 0 0 3px color-mix(in srgb,var(--sign) 18%,transparent)}
#accountView .acct-field textarea.tx{height:auto}
#accountView input.tx:disabled,#accountView textarea.tx:disabled{background:var(--sheet-2);color:var(--ink-3)}
#accountView .acct-hint{margin:0;font-size:12.5px;font-weight:400;color:var(--ink-3);line-height:1.45;max-width:64ch}
#accountView .blk > .acct-hint{margin-top:12px}
#accountView .acct-optional{margin-left:6px;padding:1px 7px;border-radius:999px;background:var(--sheet-2);color:var(--ink-3);font-size:11px;font-weight:600}
#accountView .acct-readonly{margin:4px 0 0;font-size:13.5px;color:var(--ink-2);font-family:var(--code)}
#accountView .acct-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
#accountView .acct-inline{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}
#accountView .acct-inline .acct-field{flex:1;min-width:200px}
#accountView .acct-check{display:flex;align-items:flex-start;gap:8px;margin:14px 0 0;font-size:13px;color:var(--ink-2)}
#accountView .acct-check input{margin-top:3px;accent-color:var(--sign)}

/* "Customers see" preview */
#accountView .acct-preview{display:flex;align-items:flex-start;gap:12px;margin-top:6px;padding:12px 14px;max-width:440px;border-radius:8px;background:var(--sheet-2);font-weight:400}
#accountView .acct-preview-label{flex-shrink:0;padding-top:2px;font-size:11px;font-weight:600;color:var(--ink-3);text-transform:uppercase;letter-spacing:.06em}
#accountView .acct-bubble{display:flex;flex-direction:column;gap:2px;min-width:0;padding:8px 12px;border-radius:10px 10px 10px 2px;background:var(--sheet);border:1px solid var(--rule-soft);font-size:13px;color:var(--ink-2)}
#accountView .acct-bubble b{font-size:12.5px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}

/* Actions and messages */
#accountView .acct-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:16px}
#accountView .acct-form > .acct-actions{margin:4px 0 0}
#accountView .acct-message{margin:0;font-size:13px;color:var(--ink-3)}
#accountView .acct-message:empty,#accountView .acct-failure:empty{display:none}
#accountView .acct-failure{margin:8px 0 0;font-size:13px;color:var(--a1)}
#accountView .acct-panel > .acct-message,#accountView .acct-panel > .acct-failure{margin:0 0 12px}
#accountView .btn.danger{color:var(--a1);border-color:color-mix(in srgb,var(--a1) 45%,var(--rule))}
#accountView .btn.danger:hover:not(:disabled){background:color-mix(in srgb,var(--a1) 8%,var(--sheet))}
#accountView .acct-danger{margin-top:18px;padding-top:14px;border-top:1px solid var(--rule-soft)}
#accountView .acct-danger .btn{margin-top:10px}
#accountView .acct-pill{padding:1px 8px;border-radius:999px;background:var(--sheet-2);color:var(--ink-3);font-size:11.5px;font-weight:600}
#accountView .acct-pill.on{background:var(--sign-wash);color:var(--sign)}
#accountView .acct-count{padding:0 7px;border-radius:999px;background:var(--sheet-2);color:var(--ink-3);font-size:12px;font-weight:600}

/* Setup key, QR and recovery codes */
#accountView .acct-secret{border-color:color-mix(in srgb,var(--sign) 40%,var(--rule))}
#accountView .acct-qr{display:block;width:200px;height:200px;margin:4px 0 12px;padding:8px;background:#fff;border:1px solid var(--rule);border-radius:6px;image-rendering:pixelated}
#accountView pre{margin:0 0 4px;padding:12px 14px;overflow-x:auto;background:var(--sheet-2);border-radius:6px;font:500 13px/1.7 var(--code);color:var(--ink);white-space:pre-wrap;word-break:break-all}

/* Sessions */
#accountView .blk .acct-sessions{list-style:none;margin:4px 0 0;padding:0;border:1px solid var(--rule-soft);border-radius:8px;overflow:hidden}
#accountView .acct-session{display:flex;align-items:center;gap:14px;padding:12px 14px;border-top:1px solid var(--rule-soft)}
#accountView .acct-session:first-child{border-top:0}
#accountView .acct-session.current{background:color-mix(in srgb,var(--sign-wash) 55%,transparent)}
#accountView .acct-session-main{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
#accountView .acct-session-main strong{font-size:13px}
#accountView .acct-ua{font-size:13px;color:var(--ink-2);overflow-wrap:anywhere}

/* Phone width */
@media (max-width:760px){
  /* On a phone the Desk's rail is a drawer driven by the Desk's own scripts;
     this page drops it and offers a way back instead. */
  #appShell.acct-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
  #appShell.acct-shell > .gx{display:none}
  #accountView #acctTop{flex-wrap:wrap}
  #accountView .acct-back{display:inline-flex;align-items:center;gap:6px;flex-basis:100%;font-size:13px;font-weight:600;color:var(--ink-3);text-decoration:none}
  #accountView .acct-back:hover{color:var(--ink)}
  #accountView #acctTop{min-height:0;padding:12px 16px;gap:10px}
  #accountView #acctTop h1{font-size:19px}
  #accountView .acct-who-text{display:none}
  #accountView .acct-tabbar{padding:0 16px}
  #accountView .acct-body{padding:16px 16px 40px}
  #accountView .blk{padding:16px}
  #accountView .acct-grid{grid-template-columns:minmax(0,1fr)}
  #accountView .acct-preview{flex-direction:column;gap:6px}
  #accountView .acct-session{flex-direction:column;align-items:flex-start}
}
