.section-5 .timeline-controls:has(.timeline-search) {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-5 .timeline-search {
  position: relative;
  z-index: 3;
  flex: 0 0 230px;
  font: 14px/1.3 Arial, sans-serif;
}
.section-5 .timeline-search-field {
  display: flex;
  align-items: center;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: #112b4de8;
  box-shadow: 0 5px 16px #03071670;
  color: #fff;
}
.section-5 .timeline-search-field:focus-within {
  background: #285277f2;
  box-shadow: 0 7px 18px #0307169c;
}
body .section-5 .timeline-search input:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
}
.section-5 .timeline-search-icon {
  padding: 0 2px 2px 13px;
  font: 26px/1 Arial, sans-serif;
}
.section-5 .timeline-search input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 13px 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 14px/1.3 Arial, sans-serif;
}
.section-5 .timeline-search input::placeholder { color: #d8e7f4; opacity: .9; }
.section-5 .timeline-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.section-5 .timeline-search input::-ms-clear { display: none; }
.section-5 .timeline-search-clear {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: 28px/1 Arial, sans-serif;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.section-5 .timeline-search-clear[hidden] { display: none; }
.section-5 .timeline-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  box-sizing: border-box;
  display: none;
  width: min(420px, calc(100vw - 40px));
  max-height: min(54svh, 430px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border: 0;
  border-radius: 16px;
  background: #10233df7;
  box-shadow: 0 14px 38px #000a;
  color: #fff;
  scrollbar-width: thin;
}
.section-5 .timeline-search.is-open .timeline-search-results { display: block; }
body:has(.section-5 .timeline-search.is-open) .timeline-year-rail { visibility: hidden !important; pointer-events: none; }
.section-5 .timeline-search-count,
.section-5 .timeline-search-more { margin: 0; padding: 10px 14px; color: #d6e9f7; font: 12px/1.3 Arial, sans-serif; }
.section-5 .timeline-search-more { border-top: 1px solid #ffffff24; }
.section-5 .timeline-search-results ul { margin: 0; padding: 0; list-style: none; }
.section-5 .timeline-search-results li:first-child { border-top: 1px solid #ffffff1d; }
.section-5 .timeline-search-results li + li { border-top: 1px solid #ffffff1d; }
.section-5 .timeline-search-results li button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: 9px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.section-5 .timeline-search-results li button:hover,
.section-5 .timeline-search-results li button:focus-visible { background: #36618b; outline: 0; }
.section-5 .timeline-search-result-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: #c6d5e2; font: 11px/1.2 Arial, sans-serif; }
.section-5 .timeline-search-result-category { display: inline-flex; align-items: center; gap: 4px; color: var(--result-accent); font-weight: 700; }
.section-5 .timeline-search-result-icon { display: inline-flex; width: 14px; height: 14px; }
.section-5 .timeline-search-result-icon svg { width: 14px; height: 14px; }
.section-5 .timeline-search-result-date::before { content: '·'; margin-right: 7px; color: #a5b6c7; }
.section-5 .timeline-search-result-live { --result-accent: #f0a9c8; }
.section-5 .timeline-search-result-music { --result-accent: #8bdcf7; }
.section-5 .timeline-search-result-art { --result-accent: #e9cb89; }
.section-5 .timeline-search-result-word { --result-accent: #d0b5f2; }
.section-5 .timeline-search-result-press { --result-accent: #d3d5e2; }
.section-5 .timeline-search-result-title { display: block; font: 14px/1.3 Arial, sans-serif; }
.section-5 .timeline-shell[data-theme="live"] { --timeline-search-hit-color: #ff1744; }
.section-5 .timeline-shell[data-theme="music"] { --timeline-search-hit-color: #00b7ff; }
.section-5 .timeline-shell[data-theme="art"] { --timeline-search-hit-color: #faff00; }
.section-5 .timeline-shell[data-theme="word"] { --timeline-search-hit-color: #b43cff; }
.section-5 .timeline-shell[data-theme="press"] { --timeline-search-hit-color: #000; }
.section-5 .life-event.timeline-search-hit .life-copy { outline: 3px solid var(--timeline-search-hit-color, #ffdb31); outline-offset: 5px; border-radius: 8px; }
.section-5 .timeline-shell[data-theme="press"] .life-event.timeline-search-hit .life-copy { box-shadow: none; }

/* iOS zooms the page when a focused search field uses text below 16px. */
@media (pointer: coarse) {
  .section-5 .timeline-search input { font-size: 16px; }
}

@media (max-width: 760px) {
  .section-5 .timeline-controls:has(.timeline-search) {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    height: calc(44px + 8px + var(--timeline-mobile-height, 38px));
  }
  .section-5 .timeline-search { flex: none; width: 100%; }
  .section-5 .timeline-search-field { min-height: 44px; }
  .section-5 .timeline-search input { min-height: 42px; font-size: 16px; }
  .section-5 .timeline-search-results {
    top: calc(100% + var(--timeline-mobile-height, 38px) + 16px);
    right: 50%;
    width: calc(100vw - 40px);
    transform: translateX(50%);
  }
}
@media (max-width: 760px) and (orientation: portrait) {
  .section-5 .timeline-shell { padding-top: 8px; }
  .section-5 .timeline-search { align-self: flex-end; }
  .section-5 .timeline-search-results {
    top: calc(100% + var(--timeline-mobile-height, 38px) + 18px);
    right: 0;
    transform: none;
  }
}
@media (min-width: 761px) and (max-width: 1100px) and (max-height: 650px) and (orientation: landscape) {
  .section-5 .timeline-controls:has(.timeline-search) {
    top: 14px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 10px;
    padding-left: 136px;
    justify-content: space-between;
    gap: 12px;
  }
  /* Leave room for the logo and for the tabs' scaled visual width. */
  .section-5 .timeline-search { flex: 0 1 auto; width: min(230px, calc(100% - 440px)); min-width: 140px; max-width: 230px; }
  .section-5 .timeline-groups { flex: none; }
  .section-5 .timeline-search-results {
    top: calc(100% + 18px);
    right: auto;
    left: 0;
    width: min(420px, calc(100vw - 160px));
    transform: none;
  }
}
@media (min-width: 801px) and (max-width: 900px) and (max-height: 650px) and (orientation: landscape) {
  .section-5 .timeline-groups { transform: scale(1.1); }
}
@media (min-width: 761px) and (max-width: 800px) and (max-height: 650px) and (orientation: landscape) {
  .section-5 .timeline-groups { transform: scale(1); }
}
@media (max-width: 760px) and (max-height: 650px) and (orientation: landscape) {
  .section-5 .timeline-controls:has(.timeline-search) {
    top: 64px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 10px;
    align-items: center;
  }
  .section-5 .timeline-search { align-self: flex-start; width: calc(100% - 58px); margin-left: 58px; }
  .section-5 .calendar-biography { margin-top: 65px; }
  .section-5 .timeline-search-results {
    right: 50%;
    left: auto;
    width: min(420px, 100%);
    transform: translateX(50%);
  }
}
/* Photo matches show the actual images; descriptions remain alt text only. */
.section-5 .timeline-search-results li button.has-image-match { display:flex;gap:12px;align-items:center; }
.section-5 .timeline-search-result-copy { display:block;flex:1;min-width:0; }
.section-5 .timeline-search-result-photos { display:flex;flex:none;gap:4px; }
.section-5 .timeline-search-result-photos img { display:block;width:52px;height:62px;object-fit:contain;border:0;border-radius:3px;background:transparent; }
@media (max-width:760px) {
  .section-5 .timeline-search-result-photos img { width:42px;height:54px; }
  .section-5 .timeline-search-result-photos img:nth-child(n+3) { display:none; }
}
