/* account: styles that only this screen uses. Shared pieces live in app.css.
   (.acc-rules, .acc-totp*, .acc-hidden are also used by the setup link.) */

/* A section: its name and one line about it on the left, its control on the right. */
.card.acc-sec{display:grid;grid-template-columns:minmax(0,300px) minmax(0,1fr);gap:var(--s-5) var(--s-10);padding:var(--s-6);align-items:start;scroll-margin-top:calc(var(--topbar-h) + var(--s-4))}
.acc-sec-head{display:flex;align-items:flex-start;gap:12px;min-width:0}
.acc-sec-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--surface-2);color:var(--text-2);box-shadow:inset 0 0 0 1px var(--border);flex:none}
.acc-sec-mark svg{width:16px;height:16px}
.acc-sec-head h2{font-size:var(--fs-14);font-weight:600;letter-spacing:-.005em;line-height:1.4;padding-top:1px}
.acc-sec-head p{font-size:var(--fs-13);line-height:1.5;color:var(--text-2);margin-top:2px;text-wrap:pretty}
.acc-sec-body{position:relative;display:flex;flex-direction:column;gap:var(--s-4);min-width:0}
.acc-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;padding:0;opacity:0;pointer-events:none}

/* Profile: the account's facts, then the deal's terms, as cells of label over value. */
.acc-facts-group{display:flex;flex-direction:column;gap:10px}
.acc-facts-group+.acc-facts-group{padding-top:var(--s-4);border-top:1px solid var(--border)}
.acc-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--s-4) var(--s-5)}
.acc-facts>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.acc-facts dt{font-size:var(--fs-12);color:var(--text-3);line-height:1.4}
.acc-facts dd{display:flex;align-items:center;min-height:22px;font-size:var(--fs-13);font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.acc-id{gap:2px}
.acc-id code{font-size:var(--fs-12);font-weight:500;color:var(--text)}
.acc-id .iconbtn{width:22px;height:22px}

/* A field with its button on the same line. */
.acc-inline{max-width:420px}
.acc-inline-row{display:flex;gap:var(--s-2);min-width:0}
.acc-handle{flex:1 1 auto}
.acc-lang{display:flex;transition:opacity .15s}

/* Password rules: ticked off quietly as they are met. */
.acc-rules{display:flex;flex-direction:column;gap:6px;font-size:var(--fs-13);color:var(--text-3)}
.acc-rules li{display:flex;align-items:center;gap:8px;line-height:1.4;transition:color .12s}
.acc-rules svg{width:14px;height:14px;flex:none;color:var(--text-disabled)}
.acc-rules .is-ok{color:var(--text)}
.acc-rules .is-ok svg{color:var(--good-text);stroke-width:2.6}
.acc-rules .is-miss,.acc-rules .is-miss svg{color:var(--critical-text)}

/* Lines of a section: what it is on the left, its state or button on the right. */
.acc-rows{display:flex;flex-direction:column}
.acc-row{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3) var(--s-6);padding:14px 0;border-bottom:1px solid var(--border)}
.acc-row:first-child{padding-top:2px}
.acc-row:last-child{border-bottom:0;padding-bottom:2px}
.acc-row-main{min-width:0;font-size:var(--fs-13)}
.acc-row-main p{color:var(--text-2);line-height:1.5;margin-top:1px;max-width:520px;text-wrap:pretty}
.acc-row-act{flex:none}

/* A new authenticator secret: the QR code and the key to type by hand. */
.acc-totp{display:grid;grid-template-columns:auto minmax(0,1fr);gap:var(--s-5);align-items:center;padding:var(--s-4);border-radius:var(--r-lg);background:var(--bg-subtle);box-shadow:inset 0 0 0 1px var(--border)}
.acc-totp-key{display:flex;flex-direction:column;gap:6px;min-width:0;align-items:flex-start}
.acc-totp-code{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:var(--fs-14);font-weight:600;letter-spacing:.04em;line-height:1.5;color:var(--text);user-select:all}
.acc-totp-acts{display:flex;flex-wrap:wrap;gap:var(--s-2);margin-top:4px}
.acc-totp-open,.acc-totp-toggle,.acc-totp-hint-phone{display:none}
.acc-totp-toggle{margin-top:2px}
.acc-totp-toggle:hover svg{transform:none}

/* API keys */
.acc-keys-bar{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);min-height:var(--h-md)}
.acc-keys-count{font-size:var(--fs-13);font-weight:500;color:var(--text-2);font-variant-numeric:tabular-nums}
.acc-keys{border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden}
.acc-keys .tbl-wrap{border-radius:0}
.acc-keys .tbl th{border-top:0}
.acc-keys .tbl th:first-child,.acc-keys .tbl td:first-child{padding-left:var(--s-4)}
.acc-keys .tbl th:last-child,.acc-keys .tbl td:last-child{padding-right:var(--s-2)}
.acc-keys .tbl td{height:46px}
.acc-keys code{color:var(--text-2)}
.acc-keyname{display:block;max-width:260px;overflow:hidden;text-overflow:ellipsis}
.acc-howto{display:flex;flex-direction:column;gap:var(--s-2);padding-top:var(--s-4);border-top:1px solid var(--border);font-size:var(--fs-13);color:var(--text-2)}
.acc-howto .section-title{margin-bottom:2px}
.acc-snippet{position:relative;display:flex;align-items:flex-start;gap:var(--s-2);padding:10px 8px 10px 14px;border-radius:var(--r-md);background:var(--bg-subtle);box-shadow:inset 0 0 0 1px var(--border)}
.acc-snippet pre{flex:1 1 auto;min-width:0;margin:0;overflow-x:auto;padding:3px 0;scrollbar-width:thin}
.acc-snippet code{font-size:var(--fs-12);line-height:1.6;color:var(--text);white-space:pre}

/* Dialogs */
.acc-modal-in{display:flex;flex-direction:column;gap:var(--s-4);min-width:0}
.acc-modal-lead{font-size:var(--fs-13);line-height:1.5;color:var(--text-2)}
.acc-secret{padding:12px 14px;border-radius:var(--r-md);background:var(--bg-subtle);box-shadow:inset 0 0 0 1px var(--border-strong)}
.acc-secret code{display:block;font-size:var(--fs-13);line-height:1.6;word-break:break-all;color:var(--text);user-select:all}
.acc-keycard{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);padding:10px 14px;border-radius:var(--r-md);background:var(--bg-subtle);box-shadow:inset 0 0 0 1px var(--border);font-size:var(--fs-13);min-width:0}
.acc-keycard b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.acc-keycard code{color:var(--text-2);flex:none}
.acc-done{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:var(--s-4) var(--s-2) var(--s-2)}
.acc-done-mark{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:var(--good-soft);color:var(--good-text);margin-bottom:8px}
.acc-done-mark svg{width:24px;height:24px}
.acc-done b{font-size:var(--fs-16)}
.acc-done p{font-size:var(--fs-13);line-height:1.5;color:var(--text-2);max-width:340px}

.acc-copyrow{display:flex;margin-top:calc(var(--s-2)*-1)}

/* The code under the password fields, and the button with its one line beside it. */
.acc-codefield{padding-top:var(--s-4);border-top:1px solid var(--border)}
.acc-codefield .code input{height:48px;font-size:20px}
.acc-submit{display:flex;align-items:center;gap:var(--s-3) var(--s-4);flex-wrap:wrap}
.acc-submit .card-note{flex:1 1 180px}

/* The keys as a list, for a phone. */
.acc-keys-narrow{display:none}
.acc-keys-narrow li{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);padding:12px var(--s-2) 12px var(--s-3);border-bottom:1px solid var(--border)}
.acc-keys-narrow li:last-child{border-bottom:0}
.acc-key-main{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:var(--fs-13)}
.acc-key-main b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-key-main code{font-size:var(--fs-12)}
.acc-key-main span{font-size:var(--fs-12);color:var(--text-3);line-height:1.4}

@media (max-width:1100px){
  .card.acc-sec{grid-template-columns:minmax(0,240px) minmax(0,1fr);gap:var(--s-5) var(--s-8)}
}
@media (max-width:860px){
  .card.acc-sec{grid-template-columns:minmax(0,1fr);gap:var(--s-4);padding:var(--s-5)}
}
@media (max-width:700px){
  .card.acc-sec{padding:var(--s-4)}
  .acc-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .acc-keys-wide{display:none}
  .acc-keys-narrow{display:block}
  .acc-inline{max-width:none}
  .acc-lang .seg{display:flex;width:100%}
  .acc-lang .seg button{flex:1 1 0;height:32px;text-align:center}
  .acc-row{flex-direction:column;align-items:stretch}
  .acc-row-act .btn{display:flex;width:100%}
  .acc-keys-bar{flex-wrap:wrap}
  .acc-copyrow .btn{flex:1 1 auto;height:var(--h-lg);font-size:var(--fs-14)}
}
/* On a phone the authenticator is on the same device: the key leads, the QR waits behind a link. */
@media (max-width:700px),(pointer:coarse){
  .acc-totp{grid-template-columns:minmax(0,1fr);gap:var(--s-4)}
  .acc-totp-qr{display:none;order:2;justify-self:center}
  .acc-totp-showqr .acc-totp-qr{display:block}
  .acc-totp-key{align-items:stretch}
  .acc-totp-code{font-size:var(--fs-16);gap:4px 12px}
  .acc-totp-hint-wide{display:none}
  .acc-totp-hint-phone{display:block}
  .acc-totp-acts{flex-direction:column;margin-top:6px}
  .acc-totp-acts .btn{display:flex;width:100%;height:var(--h-lg);font-size:var(--fs-14);border-radius:10px}
  .acc-totp-open{display:flex}
  .acc-totp-toggle{display:inline-flex;align-self:center;margin-top:6px;min-height:32px}
}
