/* Shared navigation, footer, account dialog and legal pages. */
.login-button { display: inline-flex; min-height: 44px; }
.mobile-login { margin-top: 10px; }
.faq-answer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 851px) {
  .site-header { position: sticky; top: 0; box-shadow: 0 3px 16px rgb(39 58 53 / 3%); }
  .upload-column, .reader { scroll-margin-top: 100px; }
}

/* Footer */
.site-footer { display: block; padding-top: 42px; padding-bottom: 24px; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; align-items: start; }
.footer-column h2 { color: var(--ink); font-size: 14px; font-weight: 650; letter-spacing: 0; margin-bottom: 12px; }
.site-footer .footer-column a { font-size: 14px; min-height: 36px; display: inline-flex; align-items: center; width: fit-content; line-height: 1.4; }
.site-footer .footer-column a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.site-footer .footer-brand p { font-size: 13px; margin-top: 13px; }
.google-play-badge { display: block; width: 170px; max-width: 100%; margin-top: 17px; }
.google-play-badge img { display: block; width: 100%; height: auto; }
.site-footer .footer-column p { font-size: 13px; margin-top: 3px; }
.site-footer .footer-legal { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: 0; }
.site-footer .footer-legal h2 { margin-bottom: 9px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; margin-top: 32px; border-top: 1px solid var(--border); }
.footer-bottom small, .site-footer .footer-bottom p { font-size: 11px; line-height: 1.6; margin: 0; }
.contact-link, .legal-help a { overflow-wrap: anywhere; }

/* Account dialog: the native backdrop also makes the page inert. */
body.has-modal { overflow: hidden; }
.auth-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 32px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 25px 100px rgb(24 43 34 / 22%); }
.auth-dialog::backdrop { background: rgb(31 48 40 / 32%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.auth-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.auth-heading { text-align: center; margin-bottom: 24px; padding-top: 2px; }
.auth-mark { display: grid; place-items: center; width: 68px; height: 60px; margin: 0 auto 18px; border-radius: 18px; background: var(--sage); }
.auth-mark .brand-mark { width: 43px; height: 31px; }
.auth-heading h2 { font-size: 30px; line-height: 1.13; letter-spacing: -.045em; }
.auth-dialog.is-document-gate .auth-heading h2 { font-size: 26px; line-height: 1.18; }
.auth-heading p { font-size: 14px; color: var(--muted); line-height: 1.5; margin-top: 9px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--sage); border-radius: 10px; margin-bottom: 22px; }
.auth-tabs button { border: 0; background: transparent; border-radius: 7px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 2px 5px rgb(39 58 53 / 6%); }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: 14px; font-weight: 600; }
.google-button:hover { background: var(--canvas); border-color: #a4b7ab; }
.google-button svg { flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 19px 0; font-size: 12px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-field { margin-top: 16px; }
.auth-field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.auth-field input { display: block; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--border); background: var(--canvas); color: var(--ink); border-radius: 8px; font-size: 16px; line-height: 1.4; }
.auth-field input::placeholder { color: #68776f; opacity: 1; }
.auth-field input[aria-invalid="true"] { border-color: var(--error); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 72px; }
.password-toggle { position: absolute; right: 5px; top: 3px; height: 44px; padding: 0 10px; background: transparent; border: 0; border-radius: 6px; color: var(--accent); font-size: 12px; font-weight: 650; }
.password-toggle:hover { background: var(--sage); }
.field-hint, .field-error { font-size: 12px; line-height: 1.45; margin-top: 6px; }
.field-hint { color: var(--muted); }
.field-error { color: var(--error); }
.auth-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 19px; font-size: 12px; line-height: 1.55; color: var(--muted); cursor: pointer; }
.auth-consent input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.auth-consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.auth-submit { width: 100%; min-height: 50px; margin-top: 22px; font-size: 15px; }
.auth-preview { color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; margin-top: 19px; }
.auth-status { margin-top: 15px; padding: 12px 14px; background: var(--sage); border-radius: 8px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.auth-status:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.google-button:disabled { cursor: wait; opacity: .6; }
.auth-google-terms { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); text-align: center; }
.auth-google-terms a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.account-profile { padding: 22px; margin: 20px 0; border-radius: 12px; background: var(--sage); text-align: center; }
.account-profile strong { display: block; font-size: 19px; overflow-wrap: anywhere; }
.account-profile p { color: var(--muted); margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.account-description { color: var(--muted); font-size: 13px; line-height: 1.6; }
.account-toast { position: fixed; z-index: 60; top: 96px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 13px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 30px #273a351a; font-size: 14px; }
.document-audio-status { flex-basis: 100%; font-size: 13px; color: var(--ink); line-height: 1.5; padding: 10px 14px; border-radius: 8px; background: var(--sage); }

/* Legal pages */
.legal-main { padding-top: 30px; padding-bottom: 72px; }
.legal-back { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: 13px; color: var(--muted); }
.legal-back .icon { width: 17px; height: 17px; }
.legal-back:hover { color: var(--accent); }
.legal-heading { padding: 30px 0 40px; max-width: 830px; }
.legal-heading h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; margin-top: 17px; letter-spacing: -.045em; }
.legal-intro { font-size: 18px; color: var(--muted); margin-top: 18px; max-width: 600px; }
.legal-date { font-size: 12px; color: var(--muted); margin-top: 20px; }
.legal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px; align-items: start; border-top: 1px solid var(--border); padding-top: 36px; }
.legal-sidebar { position: sticky; top: 114px; }
.legal-sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.legal-sidebar nav a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; min-height: 48px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.legal-sidebar nav a .icon { width: 16px; height: 16px; }
.legal-sidebar nav a:hover { background: #edf1eb; }
.legal-sidebar nav a[aria-current="page"] { color: var(--accent); background: var(--sage); font-weight: 650; }
.legal-help { margin: 25px 15px 0; padding-top: 23px; border-top: 1px solid var(--border); }
.legal-help h2 { font-size: 16px; }
.legal-help p { margin: 7px 0 3px; font-size: 13px; color: var(--muted); }
.legal-help a { display: inline-block; padding-block: 9px; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.legal-article { max-width: 780px; min-width: 0; font-size: 15px; line-height: 1.75; color: #465a50; }
.legal-article section { margin-bottom: 33px; scroll-margin-top: 115px; }
.legal-article h2 { color: var(--ink); font-size: 22px; line-height: 1.3; margin-bottom: 14px; letter-spacing: -.025em; }
.legal-article p + p { margin-top: 13px; }
.legal-article strong { color: var(--ink); font-weight: 650; }
.legal-article ul, .legal-article ol { list-style: disc; padding-left: 22px; margin: 13px 0; }
.legal-article ol { list-style: decimal; }
.legal-article li { padding-left: 3px; margin-bottom: 9px; }
.legal-article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-article a:hover { color: var(--accent-hover); }
.policy-example, .legal-contact { background: var(--sage); padding: 22px 24px; border-radius: 12px; margin-top: 20px; font-size: 14px; }
.policy-example p, .legal-contact p { margin-top: 9px; }
.legal-article blockquote { margin: 16px 0; padding: 20px 24px; border-left: 3px solid var(--accent); background: var(--surface); font-size: 14px; }
.legal-page .site-footer { border-top: 1px solid var(--border); }

@media (max-width: 850px) {
  .footer-main { grid-template-columns: 1.2fr 1fr 1fr; gap: 26px; }
  .legal-layout { grid-template-columns: 1fr; gap: 29px; }
  .legal-sidebar { position: static; }
  .legal-sidebar nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .legal-sidebar nav a { padding: 12px; border: 1px solid var(--border); }
  .legal-sidebar nav .icon { display: none; }
  .legal-help { display: none; }
  .legal-article { max-width: none; }
}
@media (max-width: 640px) {
  .header-actions { gap: 8px; }
  .header-actions .language { display: none; }
  .login-button { display: inline-flex; padding: 10px 16px; font-size: 13px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px 22px; }
  .footer-brand { grid-column: 1 / -1; }
  .site-footer { padding-top: 31px; }
  .site-footer .footer-column a { font-size: 13px; min-height: 42px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 23px; padding-top: 20px; }
  .footer-column h2 { margin-bottom: 7px; }
  .site-footer .footer-column p { font-size: 12px; }
  .auth-dialog { padding: 28px 22px 22px; border-radius: 18px; }
  .auth-heading { margin-bottom: 21px; }
  .auth-heading h2 { font-size: 28px; }
  .auth-dialog.is-document-gate .auth-heading h2 { font-size: 23px; }
  .auth-heading p { font-size: 13px; }
  .auth-mark { width: 61px; height: 54px; margin-bottom: 16px; }
  .auth-close { top: 7px; right: 7px; }
  .auth-tabs { margin-bottom: 19px; }
  .legal-main { padding-top: 17px; padding-bottom: 43px; }
  .legal-heading { padding-top: 23px; padding-bottom: 29px; }
  .legal-heading h1 { font-size: 38px; line-height: 1.08; overflow-wrap: break-word; }
  .legal-intro { font-size: 16px; margin-top: 14px; }
  .legal-layout { padding-top: 23px; }
  .legal-sidebar nav { display: flex; gap: 7px; }
  .legal-sidebar nav a { min-height: 44px; padding: 10px 14px; }
  .legal-sidebar nav .icon { display: block; }
  .legal-article { font-size: 15px; line-height: 1.7; }
  .legal-article h2 { font-size: 21px; }
  .legal-article section { margin-bottom: 28px; }
  .policy-example, .legal-contact, .legal-article blockquote { padding: 18px; }
}
@media (max-width: 359px) {
  .header-actions { gap: 4px; }
  .login-button { padding-inline: 12px; }
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand { grid-column: auto; }
  .auth-dialog { padding-inline: 18px; width: calc(100% - 24px); }
  .auth-heading h2 { font-size: 26px; }
  .legal-heading h1 { font-size: 34px; }
}
@media print {
  .auth-dialog, .legal-sidebar, .legal-back { display: none; }
  .legal-layout { display: block; }
  .legal-main { padding: 0; }
  .legal-heading { padding-top: 0; }
  .legal-article { max-width: none; color: black; }
  .legal-article section { break-inside: avoid; }
}




/* Benefits shown at the document preview registration gate. */
.auth-benefits { list-style:none; padding:0; margin:20px 0 0; text-align:left; display:grid; gap:11px; }
.auth-benefits[hidden], #auth-description[hidden] { display:none; }
.auth-benefits li { position:relative; padding-left:27px; font-size:14px; line-height:1.45; color:var(--ink); }
.auth-benefits li::before { content:'✓'; position:absolute; left:0; top:1px; color:var(--accent); font-weight:700; }
