/* Interaction comes last: shared behaviour, while each room keeps its own paper. */
:root {
  --interaction-radius: 8px;
  --interaction-focus: var(--accent, #385844);
  --interaction-fill: color-mix(in srgb, var(--accent, #385844) 8%, transparent);
  --interaction-pressed: color-mix(in srgb, var(--accent, #385844) 14%, transparent);
  --interaction-error: #923f30;
  scrollbar-gutter: stable;
}
html:has(dialog:modal) { overflow: hidden; }
[hidden] { display: none !important; }
button, a, summary, select, input, textarea { -webkit-tap-highlight-color: transparent; }
button, summary, select { touch-action: manipulation; }
button { transition: color 140ms, background-color 140ms, border-color 140ms, box-shadow 140ms, opacity 140ms; }
:where(button, a, summary, select, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--interaction-focus);
  outline-offset: 3px;
}
:where(button, input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: .52;
}
[aria-busy=true] { cursor: progress; }
button[aria-busy=true] { cursor: progress; }
button:not(:disabled):active { filter: brightness(.94); }
::selection { background: color-mix(in srgb, var(--accent, #385844) 22%, transparent); color: inherit; }

/* A calm action hierarchy: solid for committing, ink for navigation. */
:is(.primary, .audio-primary, .composer button[type=submit], .ending-save) {
  min-height: 48px;
  font-weight: 500;
  box-shadow: 0 1px 2px #18342512;
}
:is(.outline, .quiet-button, .text-link, .reader-nav-item, .reader-surface-close,
 .dialog-close, .focus-action, .auth-text-button, .book-read, .book-details > summary,
 .source-link, .source-download, .setting-links > a, .setting-links > button,
 .reset-appearance, .drawer-shortcuts > button, .typography-details > summary,
 .reading-extras > summary, .toc-sections > button, .toc-section-disclosure > summary,
 .panel-tabs > button, .panel-heading > button, .paragraph-tools button,
 .share-actions > button, #share-settings > summary, .type-stepper > button) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
:is(.reader-surface-close, .dialog-close, .focus-action, .type-stepper > button,
 .sidebar-icon-button, .sidebar-toggle, .site-theme) { min-width: 44px; justify-content: center; }
dialog :is(select, input:not([type=radio]):not([type=checkbox]):not([type=range])) { min-height: 44px; }
dialog :is(select, textarea, input) { accent-color: var(--accent, #385844); }
dialog :is(input, textarea, select):focus-visible { border-color: var(--interaction-focus); }
dialog :is(input, textarea)[aria-invalid=true] { border-color: var(--interaction-error); }
dialog, [popover] { overscroll-behavior: contain; }
dialog::backdrop { background: #15231942; backdrop-filter: blur(3px); }
dialog:focus { outline: none; }
dialog :is(h1, h2, h3) { text-wrap: pretty; }
dialog p, .form-status, .status { overflow-wrap: anywhere; }
dialog :is(.error, [role=alert]), .form-status[role=alert] { color: var(--interaction-error); }
dialog .status:empty { display: none; }

/* Keep the cover, source passage and reader's voice as the memorable objects. */
.home-hero .hero-copy h1 em { color: inherit; }
.home-section .section-number { display: none; }
.home-section .section-copy > p, .daily-copy > p { max-width: 32em; }
.sample-sheet { border: 0; box-shadow: 0 2px 0 #304b2e12, 0 20px 55px #304b2e08; }
.sample-footer a { border: 0; background: var(--interaction-fill); }
.hero-actions .text-link, .closing .primary { text-decoration: none; }
.site-header #account-button { border: 0; background: var(--interaction-fill); }
.site-footer > a:not(.brand) { display: inline-flex; align-items: center; min-height: 44px; }
.library-page .room-heading { align-items: baseline; }
.library-page #library-books .book-read { min-height: 44px; font-size: 13px; }
.library-page #library-books .book-details { font-size: 12px; }
.library-page #library-books .book-details > summary { padding: 0 8px; border-radius: 6px; }
.library-page .book-details-body { padding: 19px 21px; box-shadow: 0 12px 42px #172b221c; }
.library-page .book-details-body a { min-height: 44px; display: flex; align-items: center; }
.library-page .sidebar-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.library-page .sidebar-search:focus-within input { outline: none; }
.library-page .empty-shelf { padding: 36px 0; border: 0; }
.library-page .empty-shelf h2 { font-family: var(--serif); font-size: 25px; }
.library-page .empty-shelf p { max-width: 28em; line-height: 1.85; }
.library-page #library-retry { margin-bottom: 20px; }
.sidebar-secondary button, .shelf-tabs button, .library-settings { border-radius: 7px; }

/* Reader controls stay quiet until they are used. */
.settings-dialog .dialog-heading { border-bottom-color: color-mix(in srgb, var(--line) 65%, transparent); }
.settings-dialog .theme-swatches { flex-wrap: wrap; gap: 9px; }
.theme-swatches button { width: 44px; height: 44px; }
.type-stepper { gap: 5px; }
.type-stepper > button { width: 44px; height: 44px; border: 0; }
.settings-dialog .setting-row select { min-height: 44px; }
.settings-dialog .setting-row:has(input[type=checkbox]) { min-height: 44px; }
.settings-dialog .setting-row:has(input[type=checkbox]) label { display: flex; align-items: center; min-height: 44px; flex: 1; }
.font-choices button { min-height: 48px; border-color: transparent; background: var(--wash); }
.font-choices button[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.toc-dialog .toc-section-disclosure > summary { min-height: 44px; padding-block: 11px; }
.toc-dialog .toc-sections button { min-height: 44px; padding-block: 10px; }
.toc-title-original, .toc-current { opacity: 1; }
.toc-current { font-size: 10px; }
.book-info-footer a { min-height: 44px; }
.paragraph-tools { padding: 6px; gap: 2px; border-color: transparent; border-radius: 12px; box-shadow: 0 3px 10px #14271908, 0 12px 28px #1427190a; }
.paragraph-tools button { border-radius: 5px; padding: 8px 11px; }
.paragraph-more { border-color: transparent; }
.panel-tabs { gap: 0; }
.panel-tabs > button { justify-content: center; flex: 1; padding-inline: 8px; }
.panel-tabs button[aria-selected=true]::after { height: 2px; }
.panel-source { border: 0; border-radius: 6px; }
.panel-source-text { font-size: 15px; }
.panel-heading > button { padding: 0 10px; margin-right: -10px; }
.composer button[type=submit] { font-size: 13px; padding-inline: 19px; }
.composer textarea::placeholder { color: var(--muted); opacity: .85; }
.note-panel .record-anchor { min-height: 44px; }
.reading-progress-notice button { min-height: 44px; }
.book-page { text-rendering: optimizeLegibility; }
.passage:focus-visible { outline-offset: 8px; border-radius: 3px; }

/* Listening and sharing are continuations of the same page. */
.audio-dialog { border: 0; border-radius: 12px; }
.audio-choice { border-color: color-mix(in srgb, var(--line) 65%, transparent); border-radius: 5px; padding-inline: 10px; }
.audio-choice > span:last-child { transition: transform 140ms; }
.audio-secondary { border-color: transparent; background: var(--wash); }
.audio-setting:has(input[type=checkbox]), .audio-voice-option label { min-height: 44px; cursor: pointer; }
.audio-voice-option label { align-items: center; }
.audio-voice-option input { margin-top: 0; }
.audio-player .audio-player-icon { flex-basis: 44px; min-width: 44px; }
.audio-player input[type=range] { min-height: 44px; }
.audio-turn textarea { border: 1px solid var(--line); padding: 12px; border-radius: 6px; }
.audio-turn textarea[readonly] { border-color: transparent; padding-inline: 0; }
.share-dialog { border: 0; }
.share-actions button { min-height: 44px; }
.share-field select { min-height: 44px; }
.share-options label:has(input[type=checkbox]) { min-height: 44px; }
.share-stage { scrollbar-width: thin; }

@media (hover: hover) and (pointer: fine) {
  :is(.quiet-button, .reader-nav-item, .reader-surface-close, .dialog-close,
    .panel-heading > button, .paragraph-tools button, .panel-tabs > button,
    .sidebar-secondary button, .shelf-tabs button, .library-settings,
    .book-details > summary, .audio-choice, .audio-secondary, .type-stepper > button):hover:not(:disabled) {
    color: var(--ink); background-color: var(--interaction-fill);
  }
  :is(.text-link, .book-read, .source-link, .auth-text-button):hover:not(:disabled) { text-decoration: underline; text-underline-offset: 5px; }
  .audio-choice:hover > span:last-child { transform: translate(2px, -2px); }
  :is(.primary, .audio-primary):hover:not(:disabled) { filter: brightness(.94); }
}
:is(.quiet-button, .reader-nav-item, .panel-tabs > button, .paragraph-tools button,
 .audio-choice, .audio-secondary, .type-stepper > button):active:not(:disabled) {
  background-color: var(--interaction-pressed); transform: none;
}
.auth-dialog { --interaction-focus: var(--auth-green); }
.auth-dialog .auth-provider { border-color: transparent; background: #f1f2eb; }
.auth-dialog .auth-provider:disabled { opacity: 1; color: var(--auth-muted); background: #f3f3ed; }
.auth-dialog .auth-provider:disabled img { opacity: .55; }
.auth-dialog input:focus-visible { outline: 2px solid var(--auth-green); outline-offset: 2px; }
.auth-dialog #auth-status { min-height: 0; }
.auth-dialog[aria-busy=true] .primary { cursor: progress; }
:root:is([data-theme=night], [data-site-theme=night]) { --interaction-error: #f0b8a8; }
:root[data-site-theme=night] .auth-dialog {
  --auth-paper: #253127; --auth-ink: #e6ebde; --auth-muted: #bbc7b3;
  --auth-line: #65745e; --auth-green: #c0d0ad; color-scheme: dark;
  background: var(--auth-paper); color: var(--auth-ink); border-color: var(--auth-line);
}
:root[data-site-theme=night] .auth-dialog input { background: #202b23; color: var(--auth-ink); }
:root[data-site-theme=night] .auth-dialog :is(.primary, .primary:hover:enabled) { background: var(--auth-green); border-color: var(--auth-green); color: #203321; }
:root[data-site-theme=night] .auth-dialog .auth-provider { background: #202b23; color: var(--auth-muted); }
:root[data-site-theme=night] .auth-dialog .dialog-close:hover { background: #354332; }
:root[data-site-theme=night] .auth-dialog #auth-status.error { color: var(--interaction-error); }
@media (prefers-color-scheme: dark) {
  :root:not([data-site-theme=paper]):not([data-theme]) .auth-dialog {
    --auth-paper: #253127; --auth-ink: #e6ebde; --auth-muted: #bbc7b3;
    --auth-line: #65745e; --auth-green: #c0d0ad; --interaction-error: #f0b8a8;
    color-scheme: dark; background: var(--auth-paper); color: var(--auth-ink); border-color: var(--auth-line);
  }
  :root:not([data-site-theme=paper]):not([data-theme]) .auth-dialog input { background: #202b23; color: var(--auth-ink); }
  :root:not([data-site-theme=paper]):not([data-theme]) .auth-dialog :is(.primary, .primary:hover:enabled) { background: var(--auth-green); border-color: var(--auth-green); color: #203321; }
  :root:not([data-site-theme=paper]):not([data-theme]) .auth-dialog .auth-provider { background: #202b23; color: var(--auth-muted); }
}
@media (max-width: 760px) {
  dialog input:not([type=range]), dialog select, dialog textarea, .composer textarea { font-size: 16px; }
  .hero-actions { flex-wrap: wrap; gap: 12px 23px; }
  .library-page .book-details-body { max-width: calc(100vw - 40px); }
  .settings-dialog { width: min(390px, 100vw); }
  .settings-dialog .settings-content { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .paragraph-tools { max-width: calc(100vw - 20px); }
  .paragraph-tools > button { padding-inline: 10px; }
  .reading-header .reader-nav-item:first-child { width: 44px; }
  .book-info { max-height: calc(100dvh - var(--book-info-top, 80px) - 12px); }
  .audio-dialog-header { position: sticky; top: 0; z-index: 1; background: var(--panel); }
  .share-actions { gap: 8px; }
  .share-dialog { max-height: calc(100dvh - 20px); }
  .privacy-document { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  :is(.primary, .audio-primary, .font-choices button, .audio-secondary, .auth-provider) { border: 1px solid ButtonText; }
  button[aria-pressed=true], [role=tab][aria-selected=true] { outline: 2px solid Highlight; }
  dialog { border: 1px solid CanvasText; }
}

#atmosphere-dialog details > summary, .share-controls details > summary, .share-check { min-height: 44px; cursor: pointer; }
#atmosphere-dialog details > summary { display: flex; align-items: center; }
@media (max-width: 760px) {
  .reading-history-dialog { width: calc(100vw - 16px); max-width: none; }
  .calendar-main { padding-inline: 10px; }
  .calendar-day { min-height: 44px; }
}
@media (max-width: 360px) {
  .reading-history-dialog { width: calc(100vw - 8px); }
  .calendar-main { padding-inline: 2px; }
  .calendar-grid { gap: 0; }
}

.settings-heading .dialog-close { width: 44px; height: 44px; min-height: 44px; }
.settings-tabs button { min-height: 44px; }
.composer textarea:focus-visible { outline: 2px solid var(--interaction-focus); outline-offset: 3px; }
@media (max-width: 760px) {
  .library-settings-dialog .settings-layout { grid-template-rows: auto minmax(0, 1fr); }
  .library-settings-dialog .settings-tabs { align-items: center; }
  .library-settings-dialog .settings-tabs button { flex: 1; align-self: center; }
}
/* The conversation keeps the same touch contract as the reading page. */
.library-chat-dialog :is(button, select, summary), .library-chat-source-link { min-height: 44px; }
.library-chat-dialog button { min-width: 44px; }
.library-chat-dialog .library-chat-close { width: 44px; height: 44px; }
.library-chat-dialog .library-chat-send,
.library-chat-dialog .library-chat-menu > summary { min-width: 44px; min-height: 44px; }
.library-chat-source-link { display: flex; align-items: center; }
.library-chat-composer-bottom { min-height: 44px; }
.library-chat-dialog .library-chat-composer textarea { height: 3.6em; min-height: 3.6em; padding-block: 0; }
.audio-player-details button { min-width: 44px; }
.library-chat-dialog .library-chat-text-button { min-height: 44px; display: inline-flex; align-items: center; }
/* New settings and personal shelves share the same target sizes after integration. */
.settings-dialog .settings-panel .theme-swatches button { width: 44px; height: 44px; min-width: 44px; }
.settings-dialog :is(.settings-footer, .settings-sound-heading) button,
.settings-dialog .settings-volume input, .audio-role-details > summary { min-height: 44px; }
.library-page .library-footer > :is(.library-settings, .library-trash) { min-height: 44px; }
.library-page :is(.book-action-trigger, .book-drag-handle) { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.book-action-dialog .book-action-close { width: 44px; height: 44px; min-height: 44px; }
.book-action-menu .book-menu-item { min-height: 44px; }
.book-action-menu .book-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.profile-avatar-actions :is(.profile-avatar-upload, .profile-avatar-reset) { display: inline-flex; align-items: center; min-height: 44px; }
.library-page #library-books .source-link, .trash-book-row button { min-height: 44px; }
.settings-dialog .settings-sound-heading button { min-width: 44px; }
.gift-compose-dialog .gift-compose-included { min-height: 44px; }
.gift-compose-dialog .gift-history-row :is(a, button) { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }

:is(#retry-load, .records-retry) { min-width: 44px; min-height: 44px; }
#close-panel, .settings-dialog .dialog-heading > button { min-width: 44px; }
.term-definition > summary, .source-review > summary, .source-review a { display: inline-flex; align-items: center; min-height: 44px; }

.gift-page :is(.gift-brand, .gift-site-footer a, .gift-error > a) { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.reading-history-dialog > .dialog-close { position: sticky; top: 0; right: auto; left: calc(100% - 44px); display: flex; margin: -20px 0 0 calc(100% - 44px); z-index: 5; background: var(--paper); }
.reading-history-dialog > .reading-calendar { margin-top: 0; }

.library-page :is(.room-excerpt-toggle, .room-excerpt-retry, .room-question-link) { display: inline-flex; align-items: center; min-height: 44px; }
.site-header .home-navigation > a, .book-bottom > .source-link { min-width: 44px; }
.site-header .brand, .site-footer > a, .library-mobile-bar .brand { min-width: 44px; min-height: 44px; }
.library-page :is(.sidebar-toggle, .sidebar-icon-button) { min-width: 44px; min-height: 44px; }
.library-page .sidebar-search { min-height: 44px; }
.library-page #book-search { min-height: 44px; }
.term-definition > summary { min-width: 44px; }
.site-header > nav > a[href="/library"] { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.privacy-document a[href="/library"] { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.evals-page main > a, .evals-page details a, .evals-page footer > a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.evals-page details > summary { min-height: 44px; padding-block: 12px; }
.library-chat-recommendation { min-width: 44px; min-height: 44px; }

/* Keep the privacy document in the external stylesheet allowed by the site policy. */
.privacy-document{max-width:760px;margin:64px auto 88px;padding:0 24px;font-size:17px;line-height:1.85}.privacy-document h1{font-size:clamp(32px,6vw,46px);line-height:1.3;margin:12px 0 22px}.privacy-document h2{font-size:23px;margin:38px 0 12px}.privacy-document p{margin:12px 0}.privacy-document a{text-decoration:underline;text-underline-offset:4px}.privacy-date{font-size:14px;color:var(--muted)}.privacy-document .eyebrow{font-size:12px}.privacy-document address{font-style:normal}@media(max-width:600px){.privacy-document{margin-top:36px}.privacy-page .site-header{gap:16px}.privacy-page .site-header nav{display:block}}
