/* Search and chronological browsing share one Memory Space. */
.bottom-nav { grid-template-columns: repeat(4, 1fr); }
.memory-world [hidden] { display: none !important; }
.memory-search-toolbar { position: sticky; top: 12px; z-index: 15; padding: 12px 0 4px; margin-bottom: 24px; background: var(--ds-bg-canvas); }
.memory-world .search-orbit { display: flex !important; gap: 12px; padding: 10px 18px; min-height: 58px; margin: 0; box-shadow: none !important; }
.memory-world .search-orbit::before, .memory-world .search-orbit::after, .memory-world .search-orbit .ambient-thread { display: none; }
.memory-world .search-orbit input { flex: 1; min-width: 0; width: 0; padding: 6px 0; border: 0; border-radius: 0; background: transparent; color: var(--ds-text-primary); font: 16px/1.6 var(--ds-font-ui); }
.memory-world .search-orbit input::placeholder { color: var(--ds-text-secondary); }
.memory-world .search-orbit button { flex-shrink: 0; min-width: 32px; min-height: 36px; padding: 4px; }
.memory-search-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin: 6px 14px 0; color: var(--ds-text-muted); font: 11px/1.6 var(--ds-font-ui); }
.memory-search-meta button { padding: 4px 0; border: 0; background: none; color: var(--ds-accent-memory-soft); font: 12px var(--ds-font-ui); }
.memory-search-meta { flex-wrap: wrap; }
.memory-search-meta > span { margin-right: auto; }
.memory-trail .memory-moment.search-located { opacity: 1; filter: none; }
.memory-trail .search-located .moment-body { transform: translateY(-6px); transition: transform var(--ds-duration-reveal) var(--ds-ease-soft); }
.memory-trail .search-located .timeline-dot { box-shadow: var(--ds-glow-core); }
.memory-trail .search-located h3 { color: var(--ds-accent-memory-soft); text-shadow: var(--ds-glow-important); }
@media (prefers-reduced-motion: reduce) { .memory-trail .search-located .moment-body { transform: none; transition: none; } }
.memory-search-toolbar .search-status { margin: 4px 14px; font-size: 12px; color: var(--ds-text-secondary); }
.memory-world .memory-results { min-height: 0; max-height: none; overflow: visible; margin: 0 0 24px; padding: 0; }
.memory-world .memory-results .assistant-bubble { width: 100%; max-width: none; margin: 0 0 12px; border-left: 2px solid var(--ds-accent-ai); }
.memory-world .memory-results .assistant-bubble::before { content: '✦ 检索说明'; display: block; margin-bottom: 8px; color: var(--ds-accent-ai); font-size: 11px; }
/* The surrounding memory space stays still; only the connected trail scrolls. */
body.memory-timeline-active { height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.memory-timeline-active .app-header { flex-shrink: 0; width: 100%; }
.memory-timeline-active .app-shell { flex: 1; min-height: 0; padding-top: 10px; padding-bottom: 100px; overflow: hidden; }
.memory-timeline-active #product { height: 100%; }
.memory-timeline-active .memory-world.active { display: flex; flex-direction: column; height: 100%; }
.memory-timeline-active .memory-search-toolbar { position: relative; top: auto !important; flex-shrink: 0; margin-bottom: 10px; background: none; }
.memory-timeline-active #memories-section { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.memory-timeline-active .timeline-header { position: relative; top: auto; flex-shrink: 0; min-height: 76px; margin: 0 0 8px; padding: 0 34px 0 0; }
.memory-timeline-active .timeline-date { flex-direction: row; flex-wrap: wrap; align-content: start; align-items: baseline; gap: 4px 8px; }
.memory-timeline-active .timeline-date small { width: 100%; margin: 0; }
.memory-timeline-active .timeline-header #refresh { top: 4px; bottom: auto; }
.memory-timeline-active .timeline-filter-sheet { flex-shrink: 0; margin-bottom: 8px; }
.memory-timeline-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--ds-border-strong) transparent; mask-image: linear-gradient(to bottom, transparent, black 18px, black calc(100% - 20px), transparent); }
.memory-timeline-scroll.is-dragging { cursor: grabbing; user-select: none; }
.memory-timeline-scroll .load-more { display: block; margin: 0 auto 40px; }
.memory-timeline-scroll .load-more.hidden { display: none; }
@media (min-width: 960px) {
  .memory-timeline-active .app-shell { padding-bottom: 20px; }
  .memory-timeline-active .timeline-header { grid-template-columns: 190px 1fr; }
  .memory-timeline-active .timeline-date #timeline-day { font-size: 38px; }
  .memory-timeline-active .timeline-recall p { margin-top: 8px; font-size: 16px; }
  .memory-search-toolbar { top: calc(var(--desktop-header-height) + 8px); }
  body:has(.local-preview-note) .memory-search-toolbar { top: calc(var(--desktop-header-height) + 50px); }
}
@media (max-height: 650px) { .memory-timeline-active .timeline-header { display: none; } }
@media (max-width: 480px) {
  .memory-world .search-orbit { gap: 6px; padding-inline: 12px; }
  .memory-world .search-orbit .search-spark { display: none; }
}
