/* Cover selection is non-destructive; removal has its own full-size target. */
html body .memory-cover-picker {
  box-sizing: border-box; width: min(600px, calc(100vw - 32px)); max-height: min(820px, calc(100dvh - 48px));
  padding: 24px; border: 1px solid #b4d9dc; border-radius: 26px;
  color: #00243f; background: linear-gradient(135deg, #f5fbff, #ecfaf4);
  box-shadow: 0 24px 80px #001b3440; overflow-y: auto; overscroll-behavior: contain;
}
html body .memory-cover-picker::backdrop { background: #001b3499; }
html body .memory-cover-picker header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
html body .memory-cover-picker h2 { margin: 4px 0; font-size: 1.55rem; }
html body .memory-cover-picker p { line-height: 1.5; color: #385767; }
html body .memory-cover-picker button { font: inherit; color: #00243f; cursor: pointer; min-height: 44px; min-width: 44px; border: 1px solid #aacbcc; border-radius: 14px; background: #fff; }
html body .memory-cover-picker button:focus-visible { outline: 3px solid #258b8b; outline-offset: 3px; }
html body .memory-cover-picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
html body .memory-cover-picker-grid button { padding: 5px; min-width: 0; overflow: hidden; }
html body .memory-cover-picker-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #dcefed; }
html body .memory-cover-picker-grid span { display: block; padding: 8px 2px; font-size: .85rem; font-weight: 700; }
html body .memory-cover-picker-grid [aria-pressed="true"] { border-color: #00243f; box-shadow: 0 0 0 2px #00243f; background: #00243f; color: #fff; }
html body .memory-cover-picker footer { position: sticky; bottom: -24px; display: flex; gap: 10px; padding: 16px 0 6px; background: #ecfaf4; }
html body .memory-cover-picker footer button { flex: 1; padding: 12px; font-weight: 750; }
html body .memory-cover-picker [data-cover-apply], html body .app-shell #memoryForm .memory-change-cover-button { color: #fff; background: #00243f; }
html body .app-shell #memoryForm .memory-change-cover-button { display: block; border: 0; border-radius: 14px; padding: 12px 20px; min-height: 44px; margin-top: 12px; font: inherit; font-weight: 750; }
html body .app-shell #memoryForm .memory-change-cover-button[hidden] { display: none; }
html body .app-shell #memoryForm .memory-cover-help { color: #385767; font-size: .86rem; line-height: 1.5; }
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media > .memory-media-thumb,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media > .memory-media-video.is-pending { flex: 0 0 104px !important; width: 104px !important; height: 156px !important; position: relative !important; }
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-image { width: 104px !important; height: 104px !important; }
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls { inset: auto 0 0 !important; height: 44px !important; }
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-media-thumb-controls button:last-child,
html body main.app-shell #memoryForm#memoryForm .memory-media-preview.has-scrollable-media .memory-pending-remove { position: absolute !important; inset: auto 0 0 !important; width: 100% !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; border-radius: 12px !important; border: 1px solid #d4cccc !important; background: #fff !important; color: #713737 !important; font: inherit; font-size: .8rem !important; box-shadow: none; }
html body main.app-shell #memoryForm#memoryForm .memory-media-video.is-pending > img { height: 104px !important; object-fit: cover; }
html body .memory-editor-photo-unavailable { display: none; }
html body .memory-editor-cover-preview[data-photo-state="unavailable"] > img,
html body .memory-cover-picker [data-photo-state="unavailable"] > img { visibility: hidden; }
html body .memory-editor-cover-preview[data-photo-state="unavailable"] > .memory-editor-photo-unavailable {
  display: grid; position: absolute; inset: 60px 20px; place-content: center; text-align: center;
  color: #fff; font-size: .95rem; line-height: 1.5;
}
html body .memory-cover-picker [data-photo-state="unavailable"] > .memory-editor-photo-unavailable {
  display: block; color: inherit; font-size: .8rem; padding: 6px;
}
html body .app-shell #memoryForm .memory-media-thumb.is-broken .memory-media-broken-label {
  color: #fff; padding: 8px; font-size: .7rem; font-weight: 650; text-align: center; line-height: 1.3;
}
@media (max-width: 400px) {
  html body .memory-cover-picker { padding: 16px; }
  html body .memory-cover-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body .memory-cover-picker footer { bottom: -16px; }
}
