/* =============================================================================
   ACCOUNTS (Session 14a, docs/handover/accounts/, Accounts-signin.dc.html)
   The windows (features/account.js), the account pair in every top bar and the reading screen's
   toast. The avatar opens the Account window (Session 14b, account-window.css). Loaded in the head beside intro-flow.css, so the splash has it;
   the fonts are intro-flow.css's.
   ============================================================================= */

/* ── Who sees what: <html data-signed-in>, set by js/boot.js before paint, then session.js ── */
html:not([data-signed-in]) [data-acc="papers"],
html:not([data-signed-in]) [data-acc="avatar"],
html:not([data-signed-in]) #historyBtn { display: none !important; }
html[data-signed-in] [data-acc="signin"],
html[data-signed-in] [data-acc="create"] { display: none !important; }

/* ── The account pair. In the lead-in (splash to reading): 16 px, sentence case ── */
.acc-pair { display: flex; align-items: center; gap: 28px; flex: none; }
.acc-pair button { margin: 0; cursor: pointer; font-family: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; }
.acc-si {
    display: inline-flex; align-items: center; box-sizing: border-box; height: 40px; padding: 0 4px;
    border: 0; border-radius: 4px; background: none;
    font: 600 16px/24px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #4A4A55;
}
/* Quieter than Create account: ink and underlined on hover, the 2 px ring on keyboard focus */
.acc-si:hover { color: #1A1A2E; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.acc-pair .acc-si:focus-visible { outline: 2px solid #544FF0; outline-offset: 2px; }
.acc-ca {
    display: inline-flex; align-items: center; box-sizing: border-box; height: 40px; padding: 0 18px;
    border: 2px solid #C9C7F5; border-radius: 10px; background: #fff;
    font: 700 16px/24px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #3F3AB8;
}
.acc-ca:hover { border-color: #544FF0; }
.acc-av {
    width: 40px; height: 40px; padding: 0; margin-left: -8px; border: 0; border-radius: 50%;
    background: #1A1A2E; color: #fff; display: grid; place-items: center;
    font: 700 15px/1 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
}

/* In the suite and the example: the top bar's 12 px capitals */
.acc-pair--bar .acc-si,
.acc-pair--bar .acc-ca,
.topbar .acc-si,
.topbar .acc-ca { font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; }
.topbar .acc-si { margin-left: 20px; }
.topbar .acc-ca { margin-left: 28px; }
.acc-pair--bar .acc-av { width: 40px; height: 40px; margin-left: 0; font-size: 13px; letter-spacing: .04em; box-shadow: 0 1px 2px rgba(26,26,46,.2); }
.acc-pair--bar .acc-papers {
    display: inline-flex; align-items: center; box-sizing: border-box; height: 40px; padding: 0 16px;
    border: 0; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px rgba(26,26,46,.14);
    font: 700 12px/16px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #544FF0;
}
/* The suite's Papers and avatar: 40 px (README Part 2) */
.topbar #historyBtn { height: 40px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.topbar .tb-avatar { width: 40px; height: 40px; padding: 0; border: 0; cursor: pointer; }

/* ── The windows: the app-wide frame (README Part 2), 452 px, content 32 px in ──
   Sizes from the window tokens (peelback-design-system.css), each with its value as the fallback,
   as that file isn't loaded over the splash (Session 15b phase 4) */
dialog.aw {
    position: fixed; inset: 0; margin: auto;
    width: min(452px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
    box-sizing: border-box; padding: 24px 32px 32px; border: 0; border-radius: 16px;
    background: #fff; color: #1A1A2E; text-align: left;
    box-shadow: 0 24px 60px rgba(26,26,46,.22), 0 0 0 1px rgba(26,26,46,.06);
    font: 400 15px/22px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
}
dialog.aw::backdrop { background: rgba(26,26,46,.42); }
.aw button { font: inherit; border: 0; margin: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.aw a { color: #544FF0; font-weight: 700; text-decoration: none; }
.aw a:hover, .aw .aw-link:hover, .aw .aw-lk:hover, .aw .aw-bk:hover { text-decoration: underline; }
.aw :focus-visible { outline: 2px solid #544FF0; outline-offset: 2px; }
.aw .aw-x {
    position: absolute; top: var(--pb-close-inset, 16px); right: var(--pb-close-inset, 16px); width: var(--pb-close, 36px); height: var(--pb-close, 36px); display: grid; place-items: center;
    color: #4B4B55; border-radius: var(--pb-win-btn-r, 6px); background: #fff;
    box-shadow: 0 0 0 1px rgba(26,26,46,.07), 0 1px 1px rgba(26,26,46,.06);
}
.aw-hd { margin-bottom: 8px; }
/* A back link mirrors the close: pinned 16 px from the top and left, 36 px tall; the title then
   starts 72 px from the window's top (Part 2). Its place in the code, and so the Tab order, is as before */
.aw .aw-bk { position: absolute; top: var(--pb-close-inset, 16px); left: var(--pb-close-inset, 16px); display: flex; align-items: center; gap: 6px; width: max-content; height: var(--pb-close, 36px); font: 700 14px/20px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #544FF0; margin: 0; }
.aw .aw-bk + h2 { margin-top: var(--pb-title-gap, 48px); }
.aw h2 { font: 600 24px/30px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; letter-spacing: -0.01em; margin: 0; padding-right: 40px; }
.aw h2:focus { outline: none; }
.aw-sub { margin: 0 0 20px; color: #6B6B72; }
.aw .aw-sub:last-child { margin-bottom: 0; }
.aw-sub .ink { color: #1A1A2E; font-weight: 700; overflow-wrap: anywhere; }
.aw-ps { display: flex; flex-direction: column; gap: 10px; }
.aw .aw-p {
    display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: var(--pb-win-btn-h, 40px); box-sizing: border-box; padding: 0 16px;
    border-radius: var(--pb-win-btn-r, 6px); background: #fff; box-shadow: 0 0 0 1px rgba(26,26,46,.18), 0 1px 2px rgba(26,26,46,.06);
    font: var(--pb-win-btn-font, 700 11px/14px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif); letter-spacing: var(--pb-btn-track, .08em); text-transform: uppercase; color: #1A1A2E; white-space: nowrap;
}
.aw-m { flex: none; width: var(--pb-mark, 20px); height: var(--pb-mark, 20px); border-radius: var(--pb-mark-r, 5px); background: #ECECF1; display: grid; place-items: center; font: 700 11px/1 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; font-style: normal; letter-spacing: 0; text-transform: none; color: #6B6B72; }
.aw-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; color: #6B6B72; font: 400 14px/20px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; }
.aw-or::before, .aw-or::after { content: ""; flex: 1; height: 1px; background: rgba(26,26,46,.12); }
.aw .aw-lk { display: block; width: 100%; text-align: center; font: 700 15px/22px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #544FF0; padding: 4px 0; }
.aw .aw-link { display: inline; font-weight: 700; color: #544FF0; white-space: nowrap; }
.aw-sp { margin: 18px 0 0; font: 400 14px/20px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #6B6B72; }
.aw-f { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(26,26,46,.08); text-align: center; color: #6B6B72; }
.aw-sx { margin: 8px 0 0; text-align: center; color: #6B6B72; }
.aw-fld { margin: 0 0 16px; }
.aw-fld label { display: block; font: 700 15px/22px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; margin-bottom: 4px; }
.aw input.aw-in {
    display: block; width: 100%; height: var(--pb-field-h, 40px); box-sizing: border-box; margin: 0; padding: 0 14px;
    border: 0; border-radius: var(--pb-field-r, 6px); box-shadow: inset 0 0 0 1.5px #8A8A94; background: #fff; color: #1A1A2E;
    font: 400 16px/24px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
}
.aw input.aw-in:focus, .aw input.aw-in:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #544FF0, 0 0 0 3px #DCDAFD; }
.aw input.aw-in.bad { box-shadow: inset 0 0 0 2px #B42318; }
.aw input.aw-in.bad:focus { box-shadow: inset 0 0 0 2px #B42318, 0 0 0 3px #FBD9D5; }
.aw-err { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; font: 400 14px/20px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #B42318; }
.aw-err[hidden] { display: none; }
.aw-err svg { flex: none; margin-top: 2px; }
.aw .aw-btn {
    display: flex; align-items: center; justify-content: center; width: 100%; height: var(--pb-win-btn-h, 40px); border-radius: var(--pb-win-btn-r, 6px);
    background: #544FF0; color: #fff; font: var(--pb-win-btn-font, 700 11px/14px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif);
    letter-spacing: var(--pb-btn-track, .08em); text-transform: uppercase; box-shadow: 0 1px 2px rgba(84,79,240,.3); margin-top: var(--pb-btn-gap, 10px);
}
/* 10 px above every button: whatever sits before one drops its own bottom margin (Part 2) */
dialog.aw :has(+ .aw-btn), dialog.aw :has(+ .pw-sub-acts) { margin-bottom: 0; }
.aw .aw-btn:hover { background: #4743D8; }
.aw .aw-btn[aria-busy="true"] { cursor: progress; opacity: .7; }
.aw-form .aw-fld + .aw-btn { margin-top: var(--pb-btn-gap, 10px); }
.aw-info { background: #F4F3FE; border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; }
.aw-info b { display: block; margin-bottom: 2px; overflow-wrap: anywhere; }

/* Window 8, the free paper used (phase 3; Barney's .aw-svl, .aw-opt, .pl-th, .aw-ot, .aw-tl) */
.aw-svl { margin: 4px 0 10px; font: 700 15px/22px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; }
.aw-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(26,26,46,.14); }
.aw-svl + .aw-opt { margin: 0 0 16px; }
.aw .pl-th { flex: none; width: 52px; height: 40px; border-radius: 6px; display: grid; place-items: center; overflow: hidden; background: #544FF0; color: #E7FD7D; }
.aw-ot { min-width: 0; }
.aw-ot b { display: block; font: 600 14px/20px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-ot small { display: block; font: 400 14px/20px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #6B6B72; }
.aw .aw-tl { display: block; text-align: center; margin: 16px 0 0; font: 700 15px/22px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; color: #1A1A2E; }

@media (max-width: 479px) {
    dialog.aw { padding: 24px 20px 24px; }
}

/* ── The reading screen's toast (frame C): in the wait line's place, a status that takes no focus ── */
#iflReadingStep .ifl-toast {
    display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; box-sizing: border-box;
    margin: 32px auto 0; padding: 12px 18px 12px 14px; border-radius: 10px;
    background: #1A1A2E; color: #fff; box-shadow: 0 12px 30px rgba(26,26,46,.3);
    font: 400 16px/24px 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
}
#iflReadingStep .ifl-toast b { font-weight: 700; }
#iflReadingStep .ifl-toast .ifl-toast-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #E7FD7D; color: #1A1A2E; display: grid; place-items: center; }
#iflReadingStep .ifl-toast[hidden] { display: none; }

/* The steps' top bar: the pair at its end, level with the step bar's keys */
#introFlow .ifl-bar .acc-pair { margin: 4px 0 0 12px; }
@media (max-width: 719px) {
    .ifl-top .acc-pair, #introFlow .ifl-bar .acc-pair { gap: 12px; }
    .acc-pair .acc-ca { padding: 0 12px; }
}
