/* Shared title baseline and compact saved-item summaries. */
#content .saved-page-header { display: block; margin: 0 0 18px; }
.saved-page-header .overview-heading { width: 100%; min-width: 0; }
/* The invisible longest caption shares the same grid cell, so all four page
   titles align at any language/width without clipping or a guessed line count. */
.saved-page-header .overview-heading > .overview-eyebrow { display: grid; width: 100%; line-height: 1.8; margin: 0 0 2px; }
.overview-eyebrow > span { grid-area: 1 / 1; min-width: 0; overflow-wrap: anywhere; }
.overview-eyebrow .overview-eyebrow-sizing { visibility: hidden; pointer-events: none; user-select: none; }
.overview-heading-row { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 42px; }
.saved-page-header .overview-heading-row > h2 { margin: 0; line-height: 1.5; }
.saved-page-header .overview-heading > p { margin-top: 7px; }
.overview-filter-menu { flex-shrink: 0; }
.overview-filter-menu > .overview-filter-button { display: inline-flex; min-height: 36px; padding: 7px 10px; gap: 5px; font-size: 13px; line-height: 1.4; list-style: none; }
.overview-filter-menu[open] > summary { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.overview-filter-menu[open] > summary svg { transform: rotate(180deg); }
.overview-filters { position: absolute; z-index: 8; inset: calc(100% + 8px) auto auto 0; display: grid; gap: 12px; box-sizing: border-box; width: min(340px, 100%); max-height: min(420px, 65dvh); overflow-y: auto; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px #0002; }
.overview-filters > label { display: grid; gap: 5px; min-width: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.overview-filters select { box-sizing: border-box; width: 100%; min-width: 0; height: 42px; padding: 8px 11px; font-size: 14px; }
#content .overview-card { display: grid; gap: 4px; padding: 9px 16px; margin: 0 0 12px; border-width: 2px; box-shadow: none; }
#content .overview-card + .overview-card { margin-top: 0; }
#content .highlight-overview-card { border-color: var(--highlight-border, #f4db70); }
.overview-card .card-head { margin: 0; height: 28px; min-height: 28px; gap: 12px; flex-wrap: nowrap; }
.overview-card .card-head .ref-link { min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; padding: 3px 0; border: 0; }
.overview-card .card-head time { flex-shrink: 0; font-size: 12px; }
.overview-excerpt-toggle { display: block; border: 0; background: transparent; color: var(--text); cursor: pointer; width: 100%; min-width: 0; padding: 0; text-align: start; font: inherit; }
.overview-card .overview-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; height: 1.7em; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 17px; line-height: 1.7; letter-spacing: normal; }
.overview-card .overview-excerpt.chinese { font-family: var(--serif); }
.overview-card .overview-excerpt.english { font-family: Georgia, 'Times New Roman', serif; }
.overview-card[data-expanded="true"] .overview-excerpt { display: block; height: auto; min-height: 1.7em; -webkit-line-clamp: unset; overflow: visible; }
.overview-card[data-expanded="true"] .overview-expand-label svg { transform: rotate(180deg); }
.overview-card .daily-note-range { display: none; margin: 0 0 4px; font-size: 13px; line-height: 1.6; }
.overview-card[data-expanded="true"] .daily-note-range { display: block; }
.overview-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; min-height: 28px; }
.overview-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.overview-card-actions .text-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 3px 0; font-size: 13px; line-height: 1.5; white-space: nowrap; }
.overview-card-actions .overview-expand-label { justify-content: flex-start; font-size: 12px; color: var(--text-secondary); }
.overview-excerpt-toggle:focus-visible, .overview-filter-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.search-scopes { display: flex; flex-wrap: wrap; gap: 8px 15px; border: 0; padding: 0; margin: 16px 0 10px; min-width: 0; }
.search-scopes label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 15px; min-height: 32px; }
.search-scopes input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
#search-results .search-result { padding: 18px 22px; }
#search-results .search-result .card-head { margin-bottom: 10px; }
#search-results .search-result :is(.source-prose, .english) { overflow-wrap: anywhere; margin: 0; font-size: 17px; line-height: 1.85; }
#search-results .search-result .source-prose + .english { margin-top: 8px; }
#search-results .search-type-badge { font-size: 12px; font-weight: 600; border: 0; flex-shrink: 0; padding: 5px 10px; line-height: 1.4; }
/* Category hues deliberately stay independent of the reader's accent. */
#search-results .search-type-verse { background: #deeee5; color: #285e42; }
#search-results .search-type-note { background: #e7e1f3; color: #654580; }
#search-results .search-type-outline { background: #e0eafb; color: #355889; }
#search-results .search-type-intro { background: #f9e9cd; color: #805924; }
[data-theme="dark"] #search-results .search-type-verse { background: #254238; color: #b6e4cc; }
[data-theme="dark"] #search-results .search-type-note { background: #42354e; color: #dcc6ef; }
[data-theme="dark"] #search-results .search-type-outline { background: #293b53; color: #bfd6fb; }
[data-theme="dark"] #search-results .search-type-intro { background: #4b3c27; color: #f3d4a1; }
@media(max-width:600px) {
  .overview-heading-row { gap: 10px; }
  .overview-filters { width: min(340px, 100%); padding: 12px; }
  #content .overview-card { padding: 8px 12px; }
  .overview-edit-actions { gap: 10px; }
  .overview-card-actions { gap: 6px; }
  .overview-card-actions .text-btn { font-size: 12px; }
  .overview-card .card-head { flex-wrap: nowrap; gap: 6px; }
  .overview-card .card-head time { font-size: 10px; }
  .overview-card .card-head .ref-link { font-size: 13px; }
  #search-results .search-result { padding: 14px 16px; }
  .search-scopes { gap: 5px 11px; }
  .search-scopes label { font-size: 14px; }
}

/* Pagination follows the last saved card without a surrounding card panel. */
.overview-pagination { display: flex; justify-content: center; margin: 18px 0 24px; }
.overview-pagination .button { min-height: 40px; padding: 8px 18px; }
.overview-pagination .button[aria-busy="true"] { cursor: progress; opacity: .65; }
