.timeline-preview {
  position: fixed;
  z-index: 30;
  width: min(312px, calc(100vw - 20px));
  color: #23384c;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 7px 28px #1a324526;
  isolation: isolate;
}
.timeline-preview[hidden] { display: none; }
/* The unpainted bridge keeps the card open as the pointer crosses the 6px gap. */
.timeline-preview::before { content: ''; position: absolute; left: 0; right: 0; height: 6px; }
.timeline-preview[data-side="below"]::before { bottom: 100%; }
.timeline-preview[data-side="above"]::before { top: 100%; }
.timeline-preview-surface {
  max-height: var(--preview-room, calc(100vh - 20px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 1px solid #cad7e1;
  border-radius: inherit;
}
.timeline-preview-image {
  display: block;
  width: 100%;
  height: clamp(76px, 16vh, 126px);
  object-fit: contain;
  background: #edf2f5;
  border-bottom: 1px solid #dde5ec;
}
.timeline-preview:is([data-project-id="shinjuku"], [data-project-id="shimanami"],
                    [data-project-id="vr-fire"], [data-project-id="hinasaki"]) .timeline-preview-image {
  object-fit: cover;
}
.timeline-preview-copy { padding: 12px 16px 15px; }
.timeline-preview-meta { display: block; color: #596f82; font-size: 11px; line-height: 1.5; }
.timeline-preview-copy h3 {
  margin: 4px 0 6px;
  color: #19384f;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.timeline-preview-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #445b6d;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.timeline-preview-copy a[href] {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 5px;
  color: #245e91;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.timeline-preview-close {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #d1dce4;
  border-radius: 50%;
  padding: 0;
  color: #334e63;
  background: #fff;
  font: 22px/1 system-ui, sans-serif;
}
.timeline-preview-close:hover { background: #edf3f7; }
.timeline-preview-copy .timeline-preview-detail {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e0e7ed;
  color: #185da6;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}
.timeline-preview-copy .timeline-preview-detail:hover { text-decoration: underline; text-underline-offset: 3px; }
.timeline-preview:focus-visible, .timeline-preview :focus-visible { outline: 2px solid #397bcc; outline-offset: 2px; }
.timeline-grid button.period { font-family: inherit; font-size: inherit; text-align: inherit; }
.timeline-grid .period[aria-expanded="true"] > span { color: var(--blue, #1769ff); }
@media (max-width: 760px), (pointer: coarse) {
  .timeline-preview-close { width: 40px; height: 40px; }
  .timeline-preview-copy a[href] { min-height: 40px; }
}
@media print { .timeline-preview { display: none !important; } }
