/* Memory is home; Nearby keeps deliberately chosen folios within reach. */
.memory-list .empty{grid-column:1/-1;padding-inline:0}
.memory-copy .match-label{color:var(--blue)}
.setting-value{font-size:11px;color:var(--muted)}
.nearby-heading,.nearby-grid{max-width:900px;margin-inline:auto;padding:30px 23px 0}
.app-shell[data-screen="nearby"] main::before{display:none}
.nearby-heading .section-heading{margin-bottom:10px}
.nearby-heading>p{font:15px/1.5 var(--serif);color:var(--muted)}
.nearby-grid{display:grid;gap:24px;padding-top:24px}
.nearby-grid .folio-cover{width:100%;margin:0}
.nearby-grid .cover-copy h2{font-size:32px}
.nearby-grid .empty{padding:20px 0}
.nearby-grid .cover-art:empty{display:none}

/* Search and selection keep the same identity and a stable place in the list. */
.sheet[data-mode="gather"]{overflow:hidden}
.sheet[data-mode="gather"] .sheet-content{display:flex;flex-direction:column;height:min(700px,85dvh,calc(var(--keyboard-height,100dvh) - 28px));max-height:calc(var(--keyboard-height,100dvh) - 28px)}
.sheet[data-mode="gather"] .sheet-header,.sheet[data-mode="gather"] .sheet-handle,.sheet[data-mode="gather"] .compare-caption,.sheet[data-mode="gather"] .sheet-bottom,.gather-search{flex:none}
.sheet[data-mode="gather"] .sheet-header{margin-bottom:10px}
.gather-search{margin-bottom:10px}
.sheet[data-mode="gather"] .gather-list{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior-y:contain;padding:3px 4px;margin:0 -8px}
.sheet[data-mode="gather"] .gather-row{gap:13px;padding:13px 4px;border-radius:3px;transition:background-color 120ms ease}
.sheet[data-mode="gather"] .gather-thumb{width:49px;height:58px;display:grid;place-items:center;flex:none;overflow:hidden;color:var(--muted)}
.sheet[data-mode="gather"] .gather-thumb>svg{width:20px;height:20px}
.sheet[data-mode="gather"] .gather-row .row-title>span:first-child{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sheet[data-mode="gather"] .gather-row .row-title small{font-size:11px;line-height:1.4}
.sheet[data-mode="gather"] .gather-match{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font:11px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;color:var(--muted);margin-top:6px}
.sheet[data-mode="gather"] .check{width:18px;height:18px}
.sheet[data-mode="gather"] .check svg{width:12px;height:12px}
.sheet[data-mode="gather"] .gather-row:focus-visible{background:#e5e9e2;outline:2px solid var(--blue);outline-offset:0}
.gather-empty{padding:24px 4px;font:17px/1.5 var(--serif);color:var(--muted)}
@media(hover:hover){.sheet[data-mode="gather"] .gather-row:not(:disabled):hover{background:#e5e9e2}.memory-list .memory-item:hover{background:#e5e9e260}}
@media(prefers-reduced-motion:reduce){.sheet[data-mode="gather"] .gather-row{transition:none}}
@media(min-width:760px){
 .nearby-heading{padding-top:40px}
 .nearby-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 .nearby-heading h1{font-size:48px}
 .sheet[data-mode="gather"] .sheet-content{max-height:calc(var(--keyboard-height,100dvh) - 48px)}
}
.sheet[data-mode="margin"] .sheet-bottom{align-items:flex-start;flex-wrap:wrap;gap:8px 20px}
.sheet[data-mode="margin"] .save-state{font-size:11px;min-height:44px;display:flex;align-items:center;flex:1 1 130px}
.margin-completion{display:flex;align-items:center;justify-content:flex-end;gap:20px;margin-left:auto;flex:none}
.margin-completion .earlier-words{font-size:11px;white-space:nowrap}
.margin-completion .margin-done{font-size:12px;white-space:nowrap;flex:none}
.margin-attach{font-size:11px}
.margin-files{display:grid;gap:12px;margin:12px 0;max-width:440px}
.margin-image{display:flex;flex-direction:column;align-items:stretch;width:100%;min-width:0;text-align:left;padding:0}
.margin-image .media-frame{height:auto;max-height:360px;flex:none}
.margin-image .media-frame>img{height:auto;max-height:360px;object-fit:contain}
.margin-image .media-action{display:flex;align-items:center;font-size:11px;min-height:44px;flex:none}
.source-note>.note-date,.folio-note>.note-date{display:block;margin-top:8px}
.history-note .margin-files,.history-note .text-action{font-family:-apple-system,BlinkMacSystemFont,sans-serif}
#margin-save-error .text-action{margin-right:20px;font-size:11px}

.trash-actions{display:flex;flex-wrap:wrap;gap:8px 24px}.trash-actions .text-action{min-height:44px}
