:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: rgba(19, 19, 19, 0.94);
  --surface-hover: #242424;
  --ink: #dedede;
  --muted: #858585;
  --status-accent: #78abc8;
  --faint: #2b2b2b;
  --line: #555;
  --strong: #f0f0f0;
  --shadow: rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f1ef;
  --surface: rgba(255, 255, 253, 0.94);
  --surface-hover: #ededeb;
  --ink: #262626;
  --muted: #747474;
  --status-accent: #376f90;
  --faint: #d5d5d1;
  --line: #999;
  --strong: #111;
  --shadow: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

html, body, .timeline-app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background: var(--bg);
  transition: color 180ms ease, background 180ms ease;
}

button, input, select {
  font: inherit;
}

button, select {
  cursor: pointer;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 18px;
  display: flex;
  width: calc(100% - 36px);
  gap: 8px;
  align-items: center;
}

.topbar-button,
.topbar-link,
.search-form,
.floating-panel,
.zoom-controls {
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 30px var(--shadow);
  backdrop-filter: blur(18px);
}

.history-controls {
  position: absolute;
  z-index: 10;
  left: 18px;
  bottom: 18px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 30px var(--shadow);
  backdrop-filter: blur(18px);
}

.history-controls button {
  width: 42px;
  height: 38px;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.history-controls button + button {
  border-left: 1px solid var(--faint);
}

.history-controls button:disabled {
  cursor: default;
  opacity: 0.3;
}

.timeline-status {
  position: absolute;
  z-index: 5;
  top: 78px;
  left: 18px;
  display: flex;
  gap: 10px;
  pointer-events: none;
  color: var(--status-accent);
  font-size: 0.68rem;
}

.timeline-status span + span::before {
  content: "·";
  margin-right: 10px;
}

.return-now {
  position: absolute;
  z-index: 10;
  right: 18px;
  top: 108px;
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow);
}

.return-now[hidden],
.hover-time[hidden],
.event-preview[hidden],
.app-notice[hidden] {
  display: none;
}

.app-notice {
  position: fixed;
  z-index: 14;
  right: 18px;
  bottom: 108px;
  width: min(340px, calc(100% - 36px));
  border: 1px solid color-mix(in srgb, var(--faint), transparent 45%);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), transparent 58%);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--shadow), transparent 55%);
  backdrop-filter: blur(8px);
  pointer-events: none;
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: left;
}

.app-notice[data-kind="error"] {
  border-color: color-mix(in srgb, #d86a6a, transparent 40%);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface), transparent 28%);
}

.hover-time {
  position: absolute;
  z-index: 15;
  transform: translate(-50%, -145%);
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 6px 9px;
  pointer-events: none;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 22px var(--shadow);
  font-size: 0.7rem;
  white-space: nowrap;
}

@media (hover: none) {
  .hover-time { display: none !important; }
}

.event-preview {
  position: absolute;
  z-index: 16;
  width: min(340px, calc(100% - 24px));
  border: 1px solid var(--faint);
  border-radius: 16px;
  padding: 28px 15px 15px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 60px var(--shadow);
  backdrop-filter: blur(20px);
  pointer-events: auto;
  cursor: pointer;
  transition: width 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.event-preview-drag {
  position: absolute;
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

.event-preview-drag-top {
  top: 0;
  right: 36px;
  left: 0;
  height: 22px;
  border-radius: 16px 0 0 0;
}

.event-preview-drag-top::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 9px auto 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--muted), transparent 35%);
}

.event-preview-drag-left,
.event-preview-drag-right {
  top: 22px;
  bottom: 0;
  width: 14px;
}

.event-preview-drag-left { left: 0; }
.event-preview-drag-right { right: 0; }

.event-preview.is-dragging,
.event-preview.is-dragging .event-preview-drag {
  cursor: grabbing;
  user-select: none;
}

.event-preview.is-dragging {
  transition: none;
}
.event-preview[data-expanded="true"] {
  width: min(420px, calc(100% - 24px));
  max-height: calc(100% - 142px);
  overflow: auto;
}
.event-preview:focus-visible { outline: 2px solid #55c47e; outline-offset: 3px; }

.event-preview-expand-hint {
  margin: 10px 0 0;
  color: #55c47e;
  font-size: 0.7rem;
  font-weight: 750;
}

.event-preview[data-expanded="true"] .event-preview-expand-hint { display: none; }
.event-preview[data-expanded="false"] .event-preview-links,
.event-preview[data-expanded="false"] .event-preview-actions,
.event-preview[data-expanded="false"] .event-preview-media,
.event-preview[data-expanded="false"] .event-preview-tags { display: none; }

.event-preview[data-expanded="false"] {
  padding-bottom: 52px;
}

.event-preview[data-expanded="false"] .event-preview-votes {
  position: absolute;
  right: 12px;
  bottom: 10px;
  margin: 0;
}

.event-preview button,
.event-preview a,
.event-preview summary { cursor: pointer; }

.event-preview.is-featured {
  border-color: color-mix(in srgb, var(--featured-accent, #ffb84d), transparent 25%);
  background:
    var(--featured-bg, linear-gradient(135deg, rgba(255, 184, 77, 0.22), rgba(20, 20, 20, 0.95))),
    var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 28px color-mix(in srgb, var(--featured-accent, #ffb84d), transparent 72%);
}

.event-preview-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--featured-accent, #ffb84d), transparent 30%);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--featured-accent, #ffb84d), transparent 78%);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-preview-badge[hidden] { display: none; }

.event-preview-pinned,
.detail-pinned {
  border-left: 3px solid var(--featured-accent, #ffb84d);
  padding-left: 10px;
  color: var(--ink);
  font-weight: 700;
}

.featured-play-button,
.detail-actions button,
.duplicate-actions button,
.duplicate-actions a,
.duplicate-review > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--featured-accent, var(--strong)), transparent 35%);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--ink);
  background: color-mix(in srgb, var(--featured-accent, var(--strong)), transparent 82%);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.featured-detail,
.duplicate-review {
  border: 1px solid var(--faint);
  border-radius: 14px;
  margin: 12px 0;
  padding: 12px;
  background: color-mix(in srgb, var(--surface), transparent 8%);
}

.featured-detail blockquote {
  margin: 12px 0;
  color: var(--ink);
}

.detail-actions,
.duplicate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.duplicate-match-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.duplicate-match {
  border: 1px solid var(--faint);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg);
}

.duplicate-match strong,
.duplicate-match span,
.duplicate-match small {
  display: block;
}

.event-preview-close {
  position: absolute;
  top: 8px;
  right: 9px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 1.1rem;
  pointer-events: auto;
}

.event-preview-type {
  margin: 0 0 5px;
  color: #ef6767;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-preview-date {
  position: relative;
  z-index: 3;
  margin: 0 30px 8px 0;
  color: var(--strong);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

.event-preview h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.event-preview-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.event-preview-tags {
  border-top: 1px solid var(--faint);
  margin-top: 14px;
  padding-top: 12px;
}

.event-preview-tags[hidden] { display: none; }

.event-preview-tags h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-preview-tags ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-preview-tags li {
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), transparent 35%);
  font-size: 0.67rem;
  line-height: 1.25;
}

.event-preview-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.event-preview-links[hidden] {
  display: none;
}

.event-preview-votes {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.event-preview-votes button {
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
}

.event-preview[data-expanded="false"] .event-preview-votes button {
  padding: 4px 8px;
  font-size: 0.68rem;
}

.event-preview-votes button:hover,
.event-preview-votes button.is-selected {
  border-color: #55c47e;
  color: var(--ink);
  background: color-mix(in srgb, #55c47e 12%, transparent);
}

.event-preview-votes button:disabled {
  opacity: 0.55;
}

.reference-trigger {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  font-size: 0.7rem;
  pointer-events: auto;
}

.reference-trigger:hover,
.reference-trigger:focus-visible,
.reference-menu[open] > .reference-trigger {
  border-color: #55c47e;
  background: color-mix(in srgb, #55c47e 9%, transparent);
}

.reference-menu {
  position: relative;
}

.reference-menu summary {
  cursor: pointer;
  list-style: none;
}

.reference-menu summary::-webkit-details-marker {
  display: none;
}

.reference-menu summary::after {
  content: "▾";
  margin-left: 6px;
  color: var(--muted);
}

.reference-popover {
  position: absolute;
  z-index: 4;
  top: calc(100% + 7px);
  left: 0;
  display: none;
  width: min(310px, calc(100vw - 54px));
  border: 1px solid var(--faint);
  border-radius: 10px;
  padding: 9px;
  color: var(--ink);
  background: #111;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.52);
  text-align: left;
}

.reference-trigger-single:hover .reference-popover,
.reference-trigger-single:focus-visible .reference-popover,
.reference-menu:hover > .reference-popover,
.reference-menu:focus-within > .reference-popover,
.reference-menu[open] > .reference-popover {
  display: block;
}

.reference-popover-heading,
.reference-item,
.reference-url {
  display: block;
}

.reference-popover-heading {
  margin: 0 2px 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reference-list {
  display: grid;
  gap: 5px;
}

.reference-item {
  min-width: 0;
  border-radius: 7px;
  padding: 7px;
  color: var(--ink);
  text-decoration: none;
}

a.reference-item:hover,
a.reference-item:focus-visible {
  background: #242424;
  outline: none;
}

.reference-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.72rem;
  line-height: 1.25;
}

.reference-url {
  overflow: hidden;
  color: #a4b8d0;
  font-size: 0.65rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.event-preview-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.event-preview-actions button {
  border: 1px solid var(--faint); border-radius: 999px; padding: 6px 9px;
  color: var(--muted); background: transparent; cursor: pointer; font-size: .7rem;
}
.event-preview-actions button.is-merge-source {
  color: #ffd6d6;
  border-color: #e04848;
  background: #7a1a1a;
}
.event-preview-actions button.is-merge-target {
  color: #d6ffe4;
  border-color: #3dba6a;
  background: #165c32;
}

.event-action-dialog {
  width: min(420px, calc(100% - 28px));
}
.event-action-copy {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}
.event-action-events {
  display: grid;
  gap: 8px;
}
.event-action-event {
  border: 1px solid var(--faint);
  border-radius: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--surface) 88%, black);
}
.event-action-event strong {
  display: block;
  font-size: 0.92rem;
}
.event-action-event span {
  color: var(--muted);
  font-size: 0.75rem;
}
.event-action-and {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.event-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.event-action-buttons [data-action="close-event-action"] {
  border: 1px solid var(--faint);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.topbar-button {
  flex: 0 0 auto;
  border-color: var(--faint);
  padding: 0 15px;
  color: var(--ink);
}

.topbar-link {
  flex: 0 0 auto;
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 20px;
}

.topbar-link-projects {
  margin-left: auto;
}

.topbar-button:hover,
.topbar-button[aria-expanded="true"],
.topbar-link:hover {
  background: var(--surface-hover);
}

.topbar-button-accent {
  border-color: #3fa568;
  color: #07170d;
  background: #55c47e;
  font-weight: 700;
}

.topbar-button-accent:hover,
.topbar-button-accent[aria-expanded="true"] {
  background: #6ed594;
}

.search-form {
  width: 100%;
  min-width: 100px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  border-color: color-mix(in srgb, #79b6ff, var(--faint) 74%);
  box-shadow: 0 8px 30px var(--shadow), inset 0 1px 0 rgba(255,255,255,.07);
}

.search-shell {
  position: relative;
  flex: 1;
  min-width: 100px;
}

.search-suggestions {
  position: absolute;
  z-index: 34;
  top: 52px;
  left: 0;
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(121, 182, 255, .34);
  border-radius: 20px;
  padding: 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface), #071427 14%);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255,255,255,.09);
  backdrop-filter: blur(25px) saturate(145%);
}
.search-suggestions[hidden],
.search-suggestion-dates[hidden],
.search-suggestion-tags[hidden],
.search-suggestion-events[hidden] { display: none; }
.search-suggestions p {
  margin: 5px 8px 7px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.search-suggestion-date-list { display: grid; gap: 2px; }
.search-suggestion-date {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.search-suggestion-date:hover,
.search-suggestion-date:focus-visible {
  border-color: rgba(121, 182, 255, .28);
  background: rgba(121, 182, 255, .09);
  outline: none;
}
.search-suggestion-date-title {
  overflow: hidden;
  font-size: .74rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-suggestion-date-meta { color: #93c7fa; font-size: .64rem; white-space: nowrap; }
.search-suggestion-dates { padding-bottom: 6px; }
.search-suggestion-tags {
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--faint), transparent 30%);
}
.search-suggestion-dates[hidden] + .search-suggestion-tags {
  padding-top: 0;
  border-top: 0;
}

.search-suggestion-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 5px 8px;
}
.search-suggestion-tag {
  border: 1px solid rgba(121, 182, 255, .3);
  border-radius: 999px;
  padding: 6px 10px;
  color: #beddff;
  background: rgba(55, 113, 185, .13);
  font-size: .69rem;
}
.search-suggestion-tag:hover,
.search-suggestion-tag:focus-visible {
  border-color: #8ac7ff;
  background: rgba(55, 133, 225, .25);
  outline: none;
}
.search-suggestion-event-list { display: grid; gap: 2px; }
.search-suggestion-event {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.search-suggestion-event:hover,
.search-suggestion-event:focus-visible {
  border-color: rgba(121, 182, 255, .28);
  background: rgba(121, 182, 255, .09);
  outline: none;
}
.search-suggestion-event-title {
  overflow: hidden;
  font-size: .74rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-suggestion-event-meta { color: #93c7fa; font-size: .64rem; white-space: nowrap; }
.search-suggestion-events {
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--faint), transparent 30%);
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
}

.search-form input::placeholder {
  color: var(--muted);
}

.search-form button {
  flex: 0 0 auto;
  height: 36px;
  align-self: center;
  margin-right: 4px;
  border: 1px solid rgba(133, 193, 255, .42);
  border-radius: 999px;
  padding: 0 17px;
  color: #fff;
  background: linear-gradient(135deg, #2d7be1, #5c4bc5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 14px rgba(35, 105, 202, .3);
  font-weight: 700;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.search-form button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 6px 18px rgba(35, 105, 202, .42);
}

.search-form button:focus-visible {
  outline: 2px solid #77aeff;
  outline-offset: -3px;
}

.search-navigator {
  position: fixed;
  z-index: 28;
  top: 76px;
  left: 50%;
  display: grid;
  grid-template-columns: 42px minmax(180px, 310px) 42px;
  gap: 7px;
  align-items: center;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.42));
}

.search-navigator[hidden],
.search-result-panel[hidden] { display: none; }

.search-nav-arrow,
.search-result-toggle {
  min-height: 42px;
  border: 1px solid color-mix(in srgb, #79b6ff, var(--faint) 58%);
  color: #e8f4ff;
  background: linear-gradient(145deg, rgba(38, 75, 123, 0.88), rgba(13, 21, 38, 0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 22px rgba(17, 73, 143, .25);
  backdrop-filter: blur(20px) saturate(140%);
}

.search-nav-arrow {
  width: 42px;
  border-radius: 50% 46% 50% 46%;
  padding: 0;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-nav-arrow:first-child { border-radius: 56% 44% 44% 56%; }
.search-nav-arrow:last-child { border-radius: 44% 56% 56% 44%; }
.search-nav-arrow:hover:not(:disabled) {
  transform: scale(1.08);
  border-color: #8ac7ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 24px rgba(77, 157, 255, .42);
}
.search-nav-arrow:active:not(:disabled) { transform: scale(.95); }
.search-nav-arrow:disabled { cursor: default; opacity: .36; }

.search-result-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px 8px 17px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.search-result-toggle:hover,
.search-result-toggle[aria-expanded="true"] {
  border-color: #8ac7ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 26px rgba(77, 157, 255, .34);
}
.search-result-query {
  overflow: hidden;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-position {
  color: #a9d3ff;
  font-size: .72rem;
  white-space: nowrap;
}
.search-result-caret { color: #8ac7ff; transition: transform 160ms ease; }
.search-result-toggle[aria-expanded="true"] .search-result-caret { transform: rotate(180deg); }

.search-result-panel {
  position: absolute;
  top: 51px;
  left: 49px;
  width: min(430px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid rgba(121, 182, 255, .36);
  border-radius: 22px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface), #071427 18%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .54), inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(26px) saturate(145%);
}
.search-result-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--faint), transparent 25%);
  font-size: .74rem;
}
.search-result-summary { color: var(--muted); font-size: .65rem; text-align: right; }
.search-result-list {
  max-height: min(54vh, 510px);
  overflow: auto;
  padding: 7px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(121, 182, 255, .45) transparent;
}
.search-result-item {
  display: grid;
  width: 100%;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 11px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.search-result-item:hover { background: rgba(121, 182, 255, .09); }
.search-result-item.is-active {
  border-color: rgba(121, 182, 255, .42);
  background: linear-gradient(90deg, rgba(42, 116, 202, .24), rgba(95, 67, 171, .11));
}
.search-result-date { color: #93c7fa; font-size: .67rem; font-variant-numeric: tabular-nums; }
.search-result-title { overflow: hidden; font-size: .76rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.search-result-best {
  display: inline-block;
  margin-left: 7px;
  border: 1px solid rgba(111, 205, 155, .4);
  border-radius: 999px;
  padding: 2px 6px;
  color: #79dda5;
  background: rgba(64, 170, 111, .12);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.search-result-type {
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255,255,255,.055);
  font-size: .58rem;
  text-transform: uppercase;
}
.search-result-empty { margin: 0; padding: 24px 18px; color: var(--muted); font-size: .76rem; text-align: center; }

.timeline-viewport.is-search-flying .starfield-far { animation: search-flight-far 900ms cubic-bezier(.2,.7,.2,1) both; }
.timeline-viewport.is-search-flying .starfield-near { animation: search-flight-near 900ms cubic-bezier(.16,.76,.25,1) both; }
.timeline-viewport.is-search-flying .space-nebula { animation: search-flight-nebula 900ms ease-in-out both; }

.search-warp {
  --warp-axis: 50%;
  --warp-color: 126, 203, 255;
  --warp-color-alt: 170, 112, 255;
  --warp-tilt: 0deg;
  position: absolute;
  inset: -8%;
  z-index: 6;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scaleX(1) rotate(var(--warp-tilt));
  transform-origin: center;
  will-change: opacity, transform, filter;
}

.timeline-viewport[data-warp-direction="right"] .search-warp { transform: scaleX(-1) rotate(var(--warp-tilt)); }
.timeline-viewport[data-warp-variation="1"] .search-warp {
  --warp-axis: 43%;
  --warp-color: 105, 183, 255;
  --warp-color-alt: 255, 187, 102;
  --warp-tilt: -2.5deg;
}
.timeline-viewport[data-warp-variation="2"] .search-warp {
  --warp-axis: 57%;
  --warp-color: 181, 127, 255;
  --warp-color-alt: 75, 231, 211;
  --warp-tilt: 2deg;
}
.timeline-viewport[data-warp-variation="3"] .search-warp {
  --warp-axis: 34%;
  --warp-color: 255, 112, 198;
  --warp-color-alt: 86, 218, 255;
  --warp-tilt: -5.5deg;
}
.timeline-viewport[data-warp-variation="4"] .search-warp {
  --warp-axis: 68%;
  --warp-color: 91, 235, 166;
  --warp-color-alt: 190, 116, 255;
  --warp-tilt: 5deg;
}
.timeline-viewport[data-warp-variation="5"] .search-warp {
  --warp-axis: 46%;
  --warp-color: 255, 197, 104;
  --warp-color-alt: 91, 155, 255;
  --warp-tilt: -1.2deg;
}
.timeline-viewport[data-warp-variation="6"] .search-warp {
  --warp-axis: 55%;
  --warp-color: 255, 123, 112;
  --warp-color-alt: 140, 230, 255;
  --warp-tilt: 1.3deg;
}

.timeline-viewport.is-search-warping .search-warp {
  animation: warp-shell 940ms cubic-bezier(.16,.74,.24,1) both;
}

.warp-tunnel,
.warp-flash,
.warp-streaks,
.warp-auras { position: absolute; inset: 0; }

.warp-tunnel {
  background:
    radial-gradient(ellipse at 50% var(--warp-axis), transparent 0 7%, rgba(var(--warp-color), .15) 15%, transparent 37%),
    radial-gradient(ellipse at 50% var(--warp-axis), transparent 0 16%, rgba(var(--warp-color-alt), .12) 28%, transparent 59%),
    linear-gradient(90deg, rgba(2, 4, 14, .84), transparent 28% 72%, rgba(2, 4, 14, .84));
  filter: blur(5px) saturate(145%);
}

.timeline-viewport.is-search-warping .warp-tunnel { animation: warp-tunnel-pulse 940ms ease-in-out both; }

.warp-streaks i {
  --streak-y: 10%;
  --streak-delay: 0ms;
  --streak-width: 34vw;
  position: absolute;
  top: var(--streak-y);
  left: -38vw;
  width: var(--streak-width);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(var(--warp-color), .34) 28%, rgba(239, 249, 255, .96));
  box-shadow: 0 0 7px rgba(var(--warp-color), .7);
  opacity: 0;
  transform: skewX(-18deg) scaleX(.15);
  will-change: left, opacity, transform;
}
.warp-streaks i:nth-child(2n) { height: 1px; --streak-width: 24vw; }
.warp-streaks i:nth-child(3n) { background: linear-gradient(90deg, transparent, rgba(var(--warp-color-alt), .42), white); }
.warp-streaks i:nth-child(1) { --streak-y: 8%; --streak-delay: 10ms; }
.warp-streaks i:nth-child(2) { --streak-y: 17%; --streak-delay: 150ms; }
.warp-streaks i:nth-child(3) { --streak-y: 25%; --streak-delay: 70ms; }
.warp-streaks i:nth-child(4) { --streak-y: 34%; --streak-delay: 230ms; }
.warp-streaks i:nth-child(5) { --streak-y: 42%; --streak-delay: 25ms; }
.warp-streaks i:nth-child(6) { --streak-y: 49%; --streak-delay: 180ms; }
.warp-streaks i:nth-child(7) { --streak-y: 57%; --streak-delay: 95ms; }
.warp-streaks i:nth-child(8) { --streak-y: 66%; --streak-delay: 270ms; }
.warp-streaks i:nth-child(9) { --streak-y: 74%; --streak-delay: 35ms; }
.warp-streaks i:nth-child(10) { --streak-y: 83%; --streak-delay: 205ms; }
.warp-streaks i:nth-child(11) { --streak-y: 91%; --streak-delay: 120ms; }
.warp-streaks i:nth-child(12) { --streak-y: 13%; --streak-delay: 310ms; }
.warp-streaks i:nth-child(13) { --streak-y: 30%; --streak-delay: 350ms; }
.warp-streaks i:nth-child(14) { --streak-y: 53%; --streak-delay: 330ms; }
.warp-streaks i:nth-child(15) { --streak-y: 70%; --streak-delay: 380ms; }
.warp-streaks i:nth-child(16) { --streak-y: 87%; --streak-delay: 300ms; }
.timeline-viewport.is-search-warping .warp-streaks i { animation: warp-streak 610ms cubic-bezier(.12,.66,.2,1) var(--streak-delay) both; }

.warp-auras i {
  --aura-y: 18%;
  --aura-delay: 0ms;
  position: absolute;
  top: var(--aura-y);
  left: -22vmax;
  width: 14vmax;
  aspect-ratio: 1;
  border: clamp(2px, .35vmax, 6px) solid rgba(var(--warp-color), .5);
  border-radius: 50%;
  box-shadow: 0 0 3vmax rgba(var(--warp-color), .25), inset 0 0 2vmax rgba(var(--warp-color-alt), .18);
  filter: blur(1.5px);
  opacity: 0;
}
.warp-auras i:nth-child(2) { --aura-y: 65%; --aura-delay: 130ms; width: 9vmax; }
.warp-auras i:nth-child(3) { --aura-y: 38%; --aura-delay: 270ms; width: 18vmax; border-color: rgba(var(--warp-color-alt), .38); }
.warp-auras i:nth-child(4) { --aura-y: 80%; --aura-delay: 390ms; width: 7vmax; }
.warp-auras i:nth-child(5) { --aura-y: 6%; --aura-delay: 330ms; width: 11vmax; border-color: rgba(var(--warp-color-alt), .42); }
.warp-auras i:nth-child(6) { --aura-y: 52%; --aura-delay: 480ms; width: 5vmax; }
.timeline-viewport.is-search-warping .warp-auras i { animation: warp-aura 520ms cubic-bezier(.1,.7,.15,1) var(--aura-delay) both; }

.warp-flash {
  background: radial-gradient(ellipse at 50% var(--warp-axis), rgba(255,255,255,.5), rgba(var(--warp-color), .13) 7%, transparent 34%);
  opacity: 0;
  mix-blend-mode: screen;
}
.timeline-viewport.is-search-warping .warp-flash { animation: warp-arrival 940ms ease-out both; }

@keyframes warp-shell {
  0% { opacity: 0; filter: brightness(.75); }
  12%, 76% { opacity: 1; }
  100% { opacity: 0; filter: brightness(1.2); }
}
@keyframes warp-tunnel-pulse {
  0% { transform: scale(.86); opacity: 0; }
  38% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1.42); opacity: 0; }
}
@keyframes warp-streak {
  0% { left: -38vw; opacity: 0; transform: skewX(-18deg) scaleX(.12); }
  16% { opacity: .9; }
  68% { opacity: 1; transform: skewX(-18deg) scaleX(1.35); }
  100% { left: 112vw; opacity: 0; transform: skewX(-18deg) scaleX(.65); }
}
@keyframes warp-aura {
  0% { left: -22vmax; opacity: 0; transform: scale(.22); }
  24% { opacity: .62; }
  100% { left: 112vw; opacity: 0; transform: scale(1.7); }
}
@keyframes warp-arrival {
  0%, 68% { opacity: 0; transform: scale(.45); }
  82% { opacity: .7; }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes search-flight-far {
  0%, 100% { transform: scale(1); filter: blur(0); }
  48% { transform: scale(1.28); filter: blur(1px); opacity: .8; }
}
@keyframes search-flight-near {
  0%, 100% { transform: scale(1); filter: blur(0); }
  46% { transform: scale(1.62); filter: blur(2.2px); opacity: 1; }
}
@keyframes search-flight-nebula {
  0%, 100% { transform: scale(1); filter: blur(24px) saturate(118%); }
  50% { transform: scale(1.17); filter: blur(29px) saturate(155%); }
}

.timeline-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.timeline-viewport.is-dragging {
  cursor: grabbing;
}

.timeline-viewport.is-interactive {
  cursor: pointer;
}
.timeline-viewport:focus-visible { outline: 2px solid color-mix(in srgb, var(--strong), transparent 30%); outline-offset: -3px; }

.space-ambience {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.96;
}

.space-nebula,
.starfield {
  position: absolute;
  inset: -12%;
}

.space-nebula {
  background:
    radial-gradient(circle at 18% 22%, rgba(72, 109, 210, 0.28), transparent 28%),
    radial-gradient(circle at 76% 18%, rgba(124, 74, 186, 0.22), transparent 24%),
    radial-gradient(circle at 64% 78%, rgba(40, 133, 117, 0.18), transparent 26%),
    radial-gradient(circle at 30% 70%, rgba(255, 126, 72, 0.14), transparent 20%);
  filter: blur(24px) saturate(118%);
  animation: nebula-drift 40s ease-in-out infinite alternate;
}

.starfield {
  mix-blend-mode: screen;
}

.starfield-far {
  opacity: 0.3;
  animation: star-drift-far 70s linear infinite;
}

.starfield-near {
  opacity: 0.44;
  animation: star-drift-near 45s linear infinite;
}

.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
}

.starfield-far::before {
  width: 1px;
  height: 1px;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    3vw 8vh 0 0 rgba(255,255,255,0.6),
    11vw 18vh 0 0 rgba(180,210,255,0.45),
    19vw 9vh 0 0 rgba(255,255,255,0.55),
    27vw 24vh 0 0 rgba(255,255,255,0.52),
    34vw 14vh 0 0 rgba(180,210,255,0.42),
    42vw 30vh 0 0 rgba(255,255,255,0.5),
    49vw 12vh 0 0 rgba(255,255,255,0.58),
    56vw 22vh 0 0 rgba(180,210,255,0.46),
    63vw 7vh 0 0 rgba(255,255,255,0.54),
    71vw 28vh 0 0 rgba(255,255,255,0.48),
    78vw 16vh 0 0 rgba(180,210,255,0.43),
    86vw 10vh 0 0 rgba(255,255,255,0.56),
    92vw 26vh 0 0 rgba(255,255,255,0.46),
    8vw 40vh 0 0 rgba(255,255,255,0.52),
    16vw 52vh 0 0 rgba(180,210,255,0.45),
    24vw 36vh 0 0 rgba(255,255,255,0.57),
    31vw 48vh 0 0 rgba(255,255,255,0.49),
    39vw 58vh 0 0 rgba(180,210,255,0.44),
    46vw 44vh 0 0 rgba(255,255,255,0.55),
    53vw 54vh 0 0 rgba(255,255,255,0.47),
    61vw 38vh 0 0 rgba(180,210,255,0.43),
    69vw 60vh 0 0 rgba(255,255,255,0.53),
    77vw 42vh 0 0 rgba(255,255,255,0.48),
    84vw 56vh 0 0 rgba(180,210,255,0.45),
    91vw 34vh 0 0 rgba(255,255,255,0.57),
    6vw 72vh 0 0 rgba(255,255,255,0.5),
    14vw 84vh 0 0 rgba(180,210,255,0.42),
    22vw 68vh 0 0 rgba(255,255,255,0.56),
    29vw 80vh 0 0 rgba(255,255,255,0.47),
    37vw 90vh 0 0 rgba(180,210,255,0.44),
    45vw 74vh 0 0 rgba(255,255,255,0.55),
    52vw 86vh 0 0 rgba(255,255,255,0.46),
    60vw 70vh 0 0 rgba(180,210,255,0.42),
    68vw 92vh 0 0 rgba(255,255,255,0.53),
    75vw 76vh 0 0 rgba(255,255,255,0.47),
    83vw 88vh 0 0 rgba(180,210,255,0.43),
    90vw 66vh 0 0 rgba(255,255,255,0.56);
}

.starfield-far::after {
  width: 1px;
  height: 1px;
  top: 6vh;
  left: 4vw;
  border-radius: 50%;
  background: rgba(200, 226, 255, 0.5);
  box-shadow:
    7vw 12vh 0 0 rgba(255,255,255,0.4),
    21vw 20vh 0 0 rgba(200,226,255,0.36),
    33vw 8vh 0 0 rgba(255,255,255,0.38),
    47vw 18vh 0 0 rgba(200,226,255,0.34),
    58vw 6vh 0 0 rgba(255,255,255,0.36),
    73vw 22vh 0 0 rgba(200,226,255,0.35),
    88vw 14vh 0 0 rgba(255,255,255,0.38),
    12vw 46vh 0 0 rgba(200,226,255,0.33),
    28vw 38vh 0 0 rgba(255,255,255,0.37),
    43vw 50vh 0 0 rgba(200,226,255,0.34),
    57vw 40vh 0 0 rgba(255,255,255,0.39),
    74vw 56vh 0 0 rgba(200,226,255,0.33),
    87vw 44vh 0 0 rgba(255,255,255,0.36),
    18vw 78vh 0 0 rgba(200,226,255,0.34),
    32vw 70vh 0 0 rgba(255,255,255,0.39),
    48vw 82vh 0 0 rgba(200,226,255,0.33),
    64vw 72vh 0 0 rgba(255,255,255,0.37),
    79vw 88vh 0 0 rgba(200,226,255,0.35);
}

.starfield-near::before {
  width: 2px;
  height: 2px;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    5vw 10vh 0 0 rgba(255,255,255,0.8),
    15vw 28vh 0 0 rgba(173,220,255,0.64),
    26vw 16vh 0 0 rgba(255,244,220,0.58),
    38vw 32vh 0 0 rgba(255,255,255,0.78),
    50vw 14vh 0 0 rgba(173,220,255,0.6),
    62vw 26vh 0 0 rgba(255,255,255,0.76),
    74vw 12vh 0 0 rgba(255,244,220,0.56),
    85vw 30vh 0 0 rgba(255,255,255,0.78),
    10vw 48vh 0 0 rgba(173,220,255,0.58),
    22vw 60vh 0 0 rgba(255,255,255,0.8),
    35vw 44vh 0 0 rgba(255,244,220,0.56),
    47vw 58vh 0 0 rgba(255,255,255,0.77),
    59vw 42vh 0 0 rgba(173,220,255,0.58),
    71vw 62vh 0 0 rgba(255,255,255,0.8),
    83vw 46vh 0 0 rgba(255,244,220,0.56),
    13vw 82vh 0 0 rgba(255,255,255,0.78),
    28vw 72vh 0 0 rgba(173,220,255,0.6),
    41vw 88vh 0 0 rgba(255,255,255,0.77),
    58vw 76vh 0 0 rgba(255,244,220,0.56),
    73vw 90vh 0 0 rgba(255,255,255,0.8),
    88vw 74vh 0 0 rgba(173,220,255,0.58);
}

.starfield-near::after {
  width: 3px;
  height: 3px;
  top: 4vh;
  left: 8vw;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  animation: star-drift-highlight 32s linear infinite;
  box-shadow:
    18vw 20vh 0 0 rgba(255,255,255,0.42),
    44vw 12vh 0 0 rgba(173,220,255,0.34),
    67vw 24vh 0 0 rgba(255,244,220,0.32),
    82vw 54vh 0 0 rgba(255,255,255,0.38),
    36vw 68vh 0 0 rgba(173,220,255,0.3),
    61vw 82vh 0 0 rgba(255,255,255,0.36);
}

#timeline-canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  transition: opacity 180ms ease, filter 180ms ease;
}

.timeline-viewport.is-search-warping #timeline-canvas {
  opacity: .56;
  filter: blur(.55px) saturate(.9) hue-rotate(var(--timeline-warp-hue, 0deg));
  animation: timeline-warp-past-left 940ms cubic-bezier(.16,.74,.24,1) both;
  transform-origin: center;
}

.timeline-viewport[data-warp-direction="left"].is-search-warping #timeline-canvas {
  animation-name: timeline-warp-past-right;
}

.timeline-viewport[data-warp-variation="1"] { --timeline-warp-hue: 9deg; }
.timeline-viewport[data-warp-variation="2"] { --timeline-warp-hue: -11deg; }
.timeline-viewport[data-warp-variation="3"] { --timeline-warp-hue: 18deg; }
.timeline-viewport[data-warp-variation="4"] { --timeline-warp-hue: -18deg; }
.timeline-viewport[data-warp-variation="5"] { --timeline-warp-hue: 27deg; }
.timeline-viewport[data-warp-variation="6"] { --timeline-warp-hue: -27deg; }

@keyframes timeline-warp-past-left {
  0% { opacity: .9; transform: translateX(0) scale(1); }
  38% { opacity: .48; transform: translateX(-5.5vw) scale(1.035, .97); }
  72% { opacity: .62; transform: translateX(-8vw) scale(1.06, .95); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes timeline-warp-past-right {
  0% { opacity: .9; transform: translateX(0) scale(1); }
  38% { opacity: .48; transform: translateX(5.5vw) scale(1.035, .97); }
  72% { opacity: .62; transform: translateX(8vw) scale(1.06, .95); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

.floating-panel {
  position: fixed;
  z-index: 30;
  top: 70px;
  padding: 8px;
}

.floating-panel[hidden] {
  display: none;
}

.filter-panel {
  left: min(500px, calc(100% - 278px));
  width: 260px;
  max-height: calc(100vh - 90px);
  overflow: auto;
}

.floating-panel button,
.floating-panel a {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: 0.82rem;
}

.floating-panel button:hover,
.floating-panel a:hover {
  background: var(--surface-hover);
}

.panel-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--faint);
}

.filter-group {
  padding: 8px 4px 12px;
  border-bottom: 1px solid var(--faint);
}

.filter-disclosure {
  padding-top: 8px;
}

.filter-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
}

.filter-disclosure summary::-webkit-details-marker {
  display: none;
}

.filter-disclosure summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.8rem;
  transform: rotate(-90deg);
  transition: transform 160ms ease;
}

.filter-disclosure[open] summary::after {
  transform: rotate(0deg);
}

.filter-disclosure summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  color: var(--bg);
  background: var(--strong);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.year-range-filter {
  padding: 8px 4px 12px;
  border-bottom: 1px solid var(--faint);
}

.year-range-filter > label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.year-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.year-range-fields input,
.year-range-filter select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--faint);
  border-radius: 5px;
  padding: 8px;
  color: var(--ink);
  background: var(--bg);
}

.year-range-filter select {
  margin-top: 7px;
}

.filter-group > label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.check-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 6px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 0;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.2;
}

.check-row input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--strong);
}

.check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.filter-group select {
  width: 100%;
  border: 1px solid var(--faint);
  border-radius: 5px;
  padding: 8px;
  color: var(--ink);
  background: var(--bg);
}

.filter-group input,
.filter-group small {
  width: 100%;
}

.filter-group input {
  border: 1px solid var(--faint);
  border-radius: 5px;
  padding: 8px;
  color: var(--ink);
  background: var(--bg);
}

.tag-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-suggestion-list[hidden] {
  display: none;
}

.tag-suggestion {
  border: 1px solid color-mix(in srgb, var(--strong), transparent 45%);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink);
  background: color-mix(in srgb, var(--strong), transparent 84%);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-suggestion:hover,
.tag-suggestion:focus-visible {
  background: color-mix(in srgb, var(--strong), transparent 68%);
}

.tag-suggestion-empty {
  color: var(--muted);
  font-size: 0.7rem;
}

.filter-group small,
.field-hint {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.panel-reset {
  margin-top: 6px;
  color: var(--muted) !important;
}

.zoom-controls {
  position: absolute;
  z-index: 10;
  right: 18px;
  bottom: 18px;
  overflow: hidden;
}

.zoom-controls button {
  display: block;
  width: 42px;
  height: 38px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.2rem;
}

.zoom-controls button + button {
  border-top: 1px solid var(--faint);
}

.zoom-controls button:hover {
  background: var(--surface-hover);
}

.live-clock,
.loading-state {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.live-clock {
  right: 18px;
  top: 78px;
  color: var(--status-accent);
  font-variant-numeric: tabular-nums;
}

.loading-state {
  top: 50%;
  left: 50%;
  width: min(660px, calc(100% - 48px));
  transform: translate(-50%, -50%);
  color: var(--ink);
  text-align: center;
  letter-spacing: normal;
}

.loading-state h1 {
  margin: 0 0 12px;
  color: var(--strong);
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.loading-state p {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  line-height: 1.55;
}

.loading-state .loading-label {
  margin-top: 16px;
  color: var(--status-accent);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.add-event-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid var(--faint);
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 20px 80px var(--shadow);
}

.add-event-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.add-event-dialog form {
  display: grid;
  gap: 16px;
  padding: 20px;
  max-height: min(86vh, 760px);
  overflow: auto;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.dialog-heading button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 1.5rem;
}

.add-event-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.74rem;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.required-marker {
  color: currentColor;
  opacity: 0.72;
  font-weight: 800;
}

.precision-required-marker.is-inactive {
  opacity: 0.2;
}

.date-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--faint);
  border-radius: 8px;
}

.date-range-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 12px;
  border: 1px solid var(--faint);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel), transparent 20%);
  cursor: pointer;
}

.end-date-fieldset[hidden] {
  display: none;
}

.date-range-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.reference-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--faint);
  border-radius: 8px;
}

.submission-limit-status {
  margin: -4px 0 2px;
  padding: 8px 10px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg), transparent 10%);
  font-size: 0.7rem;
}

.submission-limit-status.is-unlimited {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent), transparent 55%);
}

.submission-limit-status a { color: var(--ink); }

.reference-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
}

.reference-fields {
  display: grid;
  gap: 10px;
}

.reference-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg), transparent 12%);
}

.reference-entry:has(.remove-reference-button) {
  padding-right: 38px;
}

.optional-marker {
  color: var(--muted);
  font-size: 0.65rem;
}

.add-reference-button,
.remove-reference-button {
  border: 1px solid var(--faint);
  color: var(--ink);
  background: transparent;
}

.add-reference-button {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.72rem;
}

.remove-reference-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
}

.date-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
}

.date-entry-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px 10px;
}

.add-event-dialog input,
.add-event-dialog select,
.add-event-dialog textarea {
  width: 100%;
  border: 1px solid var(--faint);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  background: var(--bg);
  resize: vertical;
}

.add-event-dialog form.show-validation :is(input, select, textarea):invalid {
  border-color: #ef6767;
  box-shadow: 0 0 0 1px rgba(239, 103, 103, 0.18);
}

.add-event-dialog form.show-validation label:has(:invalid) .required-marker,
.add-event-dialog form.show-validation .date-fieldset:has(:invalid) > legend .required-marker {
  color: #ef6767;
  opacity: 1;
}

.add-event-dialog form.show-validation :is(input, select, textarea):invalid:focus {
  outline: 2px solid rgba(239, 103, 103, 0.45);
  outline-offset: 1px;
}

.submit-event-button {
  border: 1px solid #3fa568;
  border-radius: 6px;
  padding: 11px;
  color: #07170d;
  background: #55c47e;
  font-weight: 700;
}

.submit-event-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

body[data-theme="light"] .space-ambience {
  opacity: 0.18;
}

body[data-theme="light"] .space-nebula {
  filter: blur(24px) saturate(70%);
}

@keyframes star-drift-far {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-120px, 72px, 0) scale(1.05); }
}

@keyframes star-drift-near {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-260px, 170px, 0) scale(1.11); }
}

@keyframes star-drift-highlight {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-340px, 220px, 0) scale(1.14); }
}

@keyframes nebula-drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-3%, 2%, 0); }
}

@media (max-width: 620px) {
  .topbar {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-shell { grid-column: 1 / -1; grid-row: 1; }
  .search-suggestions { width: 100%; max-height: 62vh; overflow: auto; }
  .topbar-button, .topbar-link-projects { min-height: 38px; margin: 0; padding: 8px 7px; text-align: center; }
  .topbar-link-projects { display: grid; place-items: center; }

  .topbar-button {
    padding-inline: 11px;
  }

  .search-form input {
    font-size: 0.82rem;
  }

  .search-navigator {
    top: 105px;
    width: calc(100% - 20px);
    grid-template-columns: 39px minmax(0, 1fr) 39px;
  }
  .search-nav-arrow { width: 39px; min-height: 39px; }
  .search-result-toggle { min-height: 39px; }
  .search-result-panel { left: 0; width: 100%; }
  .search-result-item { grid-template-columns: 96px minmax(0, 1fr); }
  .search-result-type { display: none; }

  .filter-panel {
    top: 108px;
    right: 10px;
    left: auto;
    width: min(280px, calc(100% - 20px));
  }

  .timeline-status {
    top: 106px;
    flex-wrap: wrap;
    row-gap: 4px;
    max-width: calc(100% - 20px);
  }

  .timeline-status span {
    white-space: nowrap;
  }

  .live-clock {
    display: none;
  }

  .app-notice {
    right: 10px;
    bottom: 104px;
    width: min(280px, calc(100% - 20px));
  }

  .event-preview, .event-preview[data-pinned="true"] {
    position: fixed; inset: auto 10px 10px 10px !important; width: auto; max-height: 48vh; overflow: auto;
  }

  .event-preview-drag { display: none; }

  .reference-popover {
    position: static;
    width: 100%;
    margin-top: 7px;
  }

  .date-entry-grid {
    grid-template-columns: 1fr;
  }

  .reference-entry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 340px) {
  .timeline-status {
    top: 128px;
  }

  .filter-panel,
  .return-now {
    top: 134px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .space-ambience {
    opacity: 0.5;
  }
}
