.reader-account { position: relative; flex-shrink: 0; }
.reader-avatar { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--sage); color: var(--accent); border: 1px solid var(--border); font-size: 19px; font-weight: 700; overflow: hidden; }
.reader-avatar img { width: 100%; height: 100%; object-fit: cover; }
.reader-account-menu { position: absolute; right: 0; top: 54px; width: min(285px, calc(100vw - 32px)); padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 15px 40px #273a3526; }
.reader-menu-identity { padding: 9px 12px 15px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.reader-menu-identity strong, .reader-menu-identity small { display: block; overflow-wrap: anywhere; }
.reader-menu-identity small { color: var(--muted); font-size: 12px; margin-top: 5px; }
.reader-account-menu [role=menuitem] { display: block; width: 100%; padding: 12px; border: 0; border-radius: 6px; background: transparent; text-align: left; color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; }
.reader-account-menu [role=menuitem]:hover, .reader-account-menu [role=menuitem]:focus { background: var(--sage); }
#reader-menu-status { font-size: 12px; color: var(--error); padding-inline: 12px; }
.rp-dialog { position: fixed; inset: 0; width: min(640px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 34px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #273a3540; }
.rp-dialog::backdrop { background: rgb(24 40 34 / 35%); backdrop-filter: blur(7px); }
.rp-dialog h2 { font-size: 30px; margin: 14px 30px 12px 0; }
.rp-dialog h3 { font-size: 18px; margin: 24px 0 10px; }
.rp-dialog p { line-height: 1.65; overflow-wrap: anywhere; }
.rp-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; font-size: 30px; background: var(--canvas); color: var(--muted); }
.rp-balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--sage); border-radius: 12px; margin: 22px 0 14px; padding: 20px; }
.rp-balance strong { font-size: 23px; }
.rp-help, .rp-status { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.rp-recording { border-bottom: 1px solid var(--border); padding: 13px 0; }
.rp-recording > p { font-weight: 600; font-size: 14px; }
.rp-recording small { color: var(--muted); font-size: 12px; }
.rp-recording-actions { display: flex; gap: 8px; margin-top: 8px; }
.rp-recording button { border: 1px solid var(--border); border-radius: 7px; min-height: 42px; background: var(--canvas); color: var(--accent); padding: 8px 16px; }
.rp-recording audio { width: 100%; margin-top: 10px; }
.document-progress { width: 100%; accent-color: var(--accent); margin: 9px 0 0; height: 16px; }
.document-audio-time { display: block; text-align: right; color: var(--muted); font-size: 10px; }
.document-cost { color: var(--muted); font-size: 11px; margin: 8px 0 0; line-height: 1.5; }
.document-workspace { padding-bottom: 260px; }
@media(max-width:700px) { .rp-dialog { padding: 28px 20px; } .rp-balance { padding: 16px; } .rp-balance strong { font-size: 20px; } .document-workspace { padding-bottom: 300px; } .document-heading p { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
/* A shared account menu for the homepage, reader, pay page and legal pages. */
.reader-menu-status { font-size: 12px; color: var(--error); padding-inline: 12px; }
.nav-upload { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: 13px; background: var(--surface); }
.nav-upload .icon { width: 19px; height: 19px; }
.nav-upload:hover { background: var(--sage); }
@media(max-width:700px) { .nav-upload { min-width: 42px; min-height: 42px; padding: 9px; } .nav-upload span { display: none; } .site-header .reader-avatar { width: 42px; height: 42px; } .site-header .header-actions { gap: 10px; } }

/* Profile is a full page, with the shared header and footer. */
.rp-profile-page { min-height: calc(100dvh - 87px); background: var(--canvas); padding: 42px 24px 72px; }
.rp-profile-inner { max-width: 880px; margin: 0 auto; padding: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.rp-profile-back { display: inline-block; margin-bottom: 28px; }
.rp-profile-page h1 { font-size: clamp(32px, 5vw, 44px); margin: 12px 0; }
.rp-profile-page h3 { font-size: 21px; margin: 32px 0 12px; }
.rp-profile-page p { line-height: 1.65; overflow-wrap: anywhere; }
.rp-profile-page [data-purchases] { border-top: 1px solid var(--border); margin-bottom: 28px; }
.rp-profile-page [data-purchases] p { padding: 14px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 600px) { .rp-profile-page { padding: 22px 12px 42px; } .rp-profile-inner { padding: 22px 16px; } .rp-profile-page .rp-balance { flex-wrap: wrap; } }
