/* Shared readability and interaction layer; loaded after the existing portal styles. */
[hidden] { display: none !important; }
:root { --ink: #f5f1e9; --muted-readable: #b8c5d8; }
html { scroll-padding-top: 1rem; }
body { font-size: 16px; }
button, input, select, textarea { font: inherit; }
button, .add-button, .collection-actions a, .portal-nav nav a { min-height: 44px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #e7bd72 !important; outline-offset: 4px; }
.portal-main { min-width: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 1000; transform: translateY(-180%); padding: 12px 18px; border: 1px solid #e7bd72; border-radius: 8px; color: #f5f1e9; background: #141a29; }
.skip-link:focus { transform: none; }
.insight-metric-rail { scroll-padding-inline: 8px; }
.insight-metric-rail:focus-visible { outline-offset: -3px; }
.insight-page .insight-metric > span { font-size: 1rem; line-height: 1.4; }
.insight-page .insight-metric > small { font-size: .875rem; line-height: 1.5; color: var(--muted-readable); }
.portal-main p, .workspace>p, .collection-heading p, .tracking-book p { font-size: 1rem; line-height: 1.65; }
.portal-top p, .portal-stats small, .book-card small, .book-status-badge, .portal-nav nav a, .sync-status, .sync-status small { font-size: .875rem; line-height: 1.5; }
.library-controls { gap: 16px; flex-wrap: wrap; }
.library-controls .search { flex: 1 1 250px; }
.library-controls input { width: 100%; min-height: 44px; font-size: 1rem; }
#library-result-count, [data-collection-count] { color: var(--muted-readable); font-size: .875rem; }
.library-filter-note { font-size: .95rem; line-height: 1.6; }
#library-value-coverage { margin: 18px 0 0; }
.library-grid .book-card b { font-size: 1.05rem; line-height: 1.35; }
.collection-feedback:empty { display: none; }
.collection-card p, .collection-card label, .collection-state, .collection-actions button, .target-price-form input, .target-price-form button, .scanner-status, .scanner-intro p, .isbn-entry button { font-size: .95rem; line-height: 1.5; }
.book-form label, .book-form input, .auth-card label, .auth-card input, .auth-card p { font-size: 1rem; }
.auth-card { max-width: 540px; }
.auth-switch a { display: inline-block; padding-block: 8px; }
.portal-footer { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 32px 0 12px; border-top: 1px solid #ffffff20; margin-top: 40px; }
.portal-footer a { color: #d5c29d; min-height: 44px; display: inline-flex; align-items: center; font-size: .875rem; }
.auth-page { gap: 32px; background-image: linear-gradient(110deg,rgba(2,6,14,.83),rgba(2,7,17,.48)),url('assets/site/library-atmosphere.webp'); }
.auth-page .portal-footer { width: 100%; justify-content: center; }
.undo-notice { padding: 18px; border: 1px solid #e7bd7255; background: #13213a; border-radius: 8px; grid-column: 1/-1; }
.undo-notice button { margin-left: 12px; }
.manual-confirm { margin: 10px 0 16px; }
.library-detail { width: min(680px, calc(100vw - 28px)); }
.detail-content { padding: 58px 32px 30px; }
.detail-loading { width: min(320px, 80%); margin: 0; transform: translate(-50%,-50%); font-size: 1rem; line-height: 1.6; }
.detail-close { width: 44px; height: 44px; }
.detail-heading { min-width: 0; overflow-wrap: anywhere; }
.detail-cover.detail-title { overflow: hidden; overflow-wrap: anywhere; }
.detail-ratings { grid-template-columns: 1fr 1fr; }
.rating-block { gap: 8px; padding: 18px 12px; }
.personal-rating { grid-column: 1/-1; border-top: 1px solid var(--line); border-left: 0 !important; padding-left: 0 !important; }
.rating-picker { gap: 6px; flex-wrap: wrap; }
.rating-picker button { width: 44px; height: 44px; font-size: 26px; flex: 0 0 44px; }
.rating-block small, .detail-facts dt, .detail-value small, .detail-copy small, .detail-reading small, .detail-kicker, .detail-section>p, .detail-series>p { font-size: .8rem; line-height: 1.6; color: #bac8dd; letter-spacing: .06em; }
.rating-save-status, .value-status, .reading-save-status, .copy-save-status { font-size: .875rem; line-height: 1.6; color: #c4e7dc; }
.detail-author, .detail-status, .detail-facts dd, .detail-description div, .detail-notes blockquote, .detail-value b, .detail-copy b, .detail-reading b { font-size: 1rem; line-height: 1.6; }
.detail-value>div>small, .detail-copy>div:first-child>small, .detail-reading>div:first-child>small { font-size: .875rem; line-height: 1.6; color: var(--muted-readable); }
.manage-copy-toggle { font-size: 1rem; }
.detail-facts { gap: 18px; }
.detail-value, .detail-reading, .detail-copy { gap: 18px; }
.detail-value { display: block; }
.value-form { margin-top: 16px; }
.valuation-details { margin-block: 14px; }
.valuation-details p { font-size: .9rem; line-height: 1.6; margin: 8px 0; color: #c7d1e0; }
.valuation-source { display: inline-flex; align-items: center; min-height: 44px; color: #e6bd72; text-decoration: underline; }
.value-form input, .value-form button, .copy-movement-form input, .copy-movement-form textarea, .copy-movement-form select, .copy-movement-form label, .copy-movement-form button, .reading-status-picker button { font-size: 1rem; min-height: 44px; }
.clear-rating { font-size: .875rem; min-height: 44px; padding: 8px 12px; }
.detail-links a, .edition-rail a, .detail-footer a { font-size: .95rem; min-height: 44px; }
.detail-footer { flex-wrap: wrap; gap: 16px; }
.detail-sources, .price-note, .edition-rail small, .detail-topics span { font-size: .8rem; line-height: 1.6; color: var(--muted-readable); }
.detail-cover-shine, .detail-status i { animation: none; }
.library-detail[data-state="error"] .detail-content { display: none; }
@media(max-width: 760px) {
  .library-controls .search { flex-basis: auto; }
  .library-detail { width: 100%; }
  .detail-ratings { grid-template-columns: minmax(0,1fr); }
  .rating-block { grid-template-columns: minmax(0,1fr); }
  .rating-block b { grid-row: auto; }
}
@media(max-width: 600px) {
  .detail-content { padding: 58px 20px 28px; }
  .detail-hero { grid-template-columns: 90px minmax(0,1fr); gap: 18px; min-height: auto; align-items: start; }
  .detail-cover-wrap { width: 90px; }
  .detail-cover.detail-title { padding: 8px; font-size: 1rem; line-height: 1.2; }
  .library-detail h2 { font-size: 2rem; line-height: 1.08; }
  .detail-ratings { margin-top: 24px; }
  .detail-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .value-form, .copy-date-row { display: flex; flex-wrap: wrap; }
  .value-form label { flex: 1 1 150px; }
  .reading-status-picker { display: flex; flex-wrap: wrap; }
  .portal-stats { flex-wrap: wrap; }
  .collection-actions { flex-wrap: wrap; }
}
@media(max-width: 420px) {
  .detail-hero { grid-template-columns: minmax(0,1fr); }
  .detail-cover-wrap { width: 108px; }
  .detail-facts { grid-template-columns: minmax(0,1fr); }
  .detail-value, .detail-reading, .detail-copy { padding: 18px 14px; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.library-search-form { display:flex; flex:1; align-items:center; gap:10px; }
.library-search-form .search { flex:1; }
.library-search-form button, .library-pagination a { min-height:44px; border:1px solid #6b603f; border-radius:9px; background:#141a29; color:#f4e4b6; padding:10px 14px; font:inherit; }
.library-pagination { display:flex; align-items:center; justify-content:center; gap:20px; margin:20px 0; }
@media(max-width:560px) { .library-search-form { flex-wrap:wrap; width:100%; } .library-search-form .search { flex-basis:100%; } }

.organization-filter-form input { min-height:44px; width:100%; min-width:0; border:1px solid #6b603f; border-radius:9px; background:#141a29; color:#f4e4b6; padding:10px; font:inherit; }
.library-pagination { flex-wrap:wrap; text-align:center; }

/* Review pass 2026-10-06: tracking legibility, header button, mobile stats, cover text. */
.tracking-list button, .tracking-list p, .tracking-title span, .tracking-empty { font-size: .875rem; line-height: 1.5; }
.collection-heading .add-button, .collection-heading .share-wishlist { align-self: flex-start; }
.book-cover span, .collection-cover-fallback { overflow: hidden; overflow-wrap: anywhere; }
@media(max-width: 480px) {
  .portal-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .portal-stats b { min-width: 0; }
}
