.password-wrap { position: relative; }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 14px; padding: 0;
}
.password-toggle:hover { color: var(--text2); }

/* ─── MODAL OFFSET (below topbar) ───────────────────────────────────────────── */
.modal-overlay {
  top: 52px;
  inset: 52px 0 0 0;
}

/* ─── ADD / EDIT EVENT MODAL ────────────────────────────────────────────────── */
/* Square corners, on desktop and on the mobile bottom sheet. The id raises the
   specificity above the .modal rules in main.css and mobile.css. */
#eventModal .modal {
  border-radius: 0;
}

/* ─── EDITOR LAYOUT ─────────────────────────────────────────────────────────── */
.editor-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ─── TOP BAR ────────────────────────────────────────────────────────────────── */
.editor-topbar {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 9px;
  flex-shrink: 0;
  z-index: 10;
}
.topbar-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-right: 2px;
}
.topbar-logo-icon {
  width: 26px; height: 26px;
  object-fit: cover;
}
.topbar-divider { width: 1px; height: 22px; background: var(--border); }
.topbar-left   { display: flex; align-items: center; gap: 9px; flex: 1 1 auto; min-width: 0; }
.topbar-center { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar-right  { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; justify-content: flex-end; }
/* Single row, ever: buttons never wrap their label and the bar never wraps. */
.editor-topbar { flex-wrap: nowrap; }
.topbar-left, .topbar-center, .topbar-right { flex-wrap: nowrap; }
/* Every topbar button: one line, contents centered. */
.topbar-center button, .topbar-right button {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
/* Flat, square buttons across the editor chrome (no borders, no rounded corners). */
.editor-topbar button { border: 0 !important; border-radius: 0 !important; }
/* All center-topbar action buttons (incl. the viewer's Share / Suggest changes)
   share one box so the row reads as symmetric. Fixed height + line-height:1
   neutralizes the taller line-box of the fullwidth ＋ / ▶ / 🔗 glyphs. */
#publishBtn, #addEventBtn, #presentBtn, #shareBtn, #viewerSaveBtn,
#viewMenuBtn, #rangeFilterBtn {
  min-width: 124px;
  height: 34px;
  box-sizing: border-box;
  padding: 0 16px;
  line-height: 1;
  font-size: 13px;
}
/* View / Range read as the same family as Add Event / Present. */
#viewMenuBtn, #rangeFilterBtn { font-weight: 600; color: var(--text); gap: 6px; }
#viewMenuBtn.active, #rangeFilterBtn.active { box-shadow: inset 0 0 0 1px var(--text3); }
.topbar-menu { border-radius: 0; }
.topbar-menu-item { border-radius: 0; }
/* The title is the only element allowed to shrink when space is tight. */
.topbar-title-wrap { min-width: 0; flex: 1 1 auto; }
.topbar-title { max-width: 100%; }

/* Overflow "More" menu (Export / Clean / Delete live here to declutter the bar) */
.topbar-more { position: relative; display: inline-flex; }
.topbar-more-btn {
  width: 34px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border); color: var(--text2);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.topbar-more-btn:hover { color: var(--text); border-color: var(--text3); }
.topbar-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 200px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 50;
  flex-direction: column; gap: 2px;
}
.topbar-menu-item {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: transparent; border: none;
  color: var(--text2); font-size: 13px; padding: 9px 10px; border-radius: 7px; cursor: pointer;
}
.topbar-menu-item:hover { background: var(--surface2); color: var(--text); }
.topbar-menu-item.danger { color: #fda4af; }
.topbar-menu-item.danger:hover { background: rgba(239,68,68,.14); color: #fff; }
.topbar-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.topbar-title-wrap { }
.topbar-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  background: transparent; border: 1px solid transparent;
  border-radius: 5px; padding: 4px 10px;
  /* Fallback width only: fitTitleWidth() in timeline.js sizes the field to the
     name, and mobile.css takes it to the full width of its row. A name longer
     than the space left in the bar ends in an ellipsis instead of a hard cut. */
  width: 200px;
  text-overflow: ellipsis;
  /* Not `all`: animating the width would make the field wobble while typing. */
  transition: background-color .2s, border-color .2s;
}
.topbar-title:hover { border-color: var(--border); background: var(--surface); }
.topbar-title:focus { border-color: var(--accent); background: var(--surface); outline: none; }

.zoom-controls {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px;
}
.zoom-display {
  font-size: 12px; font-weight: 600; color: var(--text2);
  min-width: 38px; text-align: center;
}
.tool-btn {
  width: 26px; height: 26px; border-radius: 4px;
  background: transparent; color: var(--text2);
  border: 1px solid transparent; display: flex;
  align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; transition: all .15s;
}
.tool-btn:hover { background: var(--surface2); color: var(--text); }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: 2px; }
.topbar-user {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; cursor: pointer;
  text-decoration: none;
}
.topbar-user--anon {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
}

.topbar-user-wrap {
  position: relative;
}
.topbar-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
  overflow: hidden;
}
.topbar-user-dropdown.open { display: block; }
.topbar-dropdown-item {
  display: block; width: 100%;
  padding: 9px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--text2); text-decoration: none;
  background: transparent; border: none;
  text-align: left; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background .15s;
}
.topbar-dropdown-item:hover { background: var(--surface); color: var(--text); }
.topbar-dropdown-item--danger:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.topbar-dropdown-divider { height: 1px; background: var(--border); margin: 2px 0; }

/* ─── CANVAS AREA ────────────────────────────────────────────────────────────── */
.editor-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  background: var(--bg);
  /* dot grid */
  background-image: radial-gradient(circle, var(--border) 1px, transparent 0);
  background-size: 28px 28px;
}
.editor-canvas-wrap.panning { cursor: grabbing; }

/* ─── THE RAIL — lives inside .scene, moves with events (Excalidraw style) ───── */
.rail {
  position: absolute;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
  pointer-events: none;
  z-index: 1;
}

/* ─── SCENE — the infinite canvas transformed by JS (pan + zoom) ─────────────── */
.scene {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  pointer-events: none;
}

/* ─── EVENT CARDS ────────────────────────────────────────────────────────────── */
/* Each event is absolutely positioned by JS: left = screenX, top = 50%          */
.tl-event {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: all;
  cursor: pointer;
}

/* above: card grows upward from the line
   translateY(-100%) → bottom of element = 50% (the line)
   +6px   → dot center (6px from bottom) sits exactly ON the line               */
.tl-event.above {
  transform: translateX(-50%) translateY(calc(-100% + 6px));
}

/* below: card grows downward from the line
   -6px   → dot center (6px from top) sits exactly ON the line                  */
.tl-event.below {
  transform: translateX(-50%) translateY(-6px);
}

/* Connector: a vertical line from dot to card */
.tl-connector {
  width: 2px;
  flex-shrink: 0;
}
.tl-event.above .tl-connector {
  background: linear-gradient(to top, var(--accent2), transparent);
}
.tl-event.below .tl-connector {
  background: linear-gradient(to bottom, var(--accent2), transparent);
}

/* Dot on the line */
.tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  flex-shrink: 0;
  z-index: 3;
  transition: transform .2s;
}
.tl-event:hover .tl-dot { transform: scale(1.4); }

/* Event card */
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  width: 160px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.tl-card:hover {
  border-color: var(--border2);
  box-shadow: 0 6px 28px rgba(0,0,0,0.45);
  transform: translateY(-1px);
}
.tl-card.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.2);
}

.tl-date {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.tl-title {
  font-size: 12px; font-weight: 700;
  color: var(--text); line-height: 1.3; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-desc {
  font-size: 11px; color: var(--text3); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Card actions (view / edit / delete) */
.tl-actions {
  display: flex; justify-content: center; gap: 4px;
  margin-bottom: 8px;
  opacity: 0; transition: opacity .15s;
  height: 0; overflow: hidden;
  transition: opacity .15s, height .15s, margin-bottom .15s;
}
.tl-card:hover .tl-actions {
  opacity: 1; height: 24px; margin-bottom: 8px;
}
.tl-action-btn {
  width: 20px; height: 20px; border-radius: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text3); display: flex; align-items: center;
  justify-content: center; font-size: 10px; cursor: pointer;
  transition: all .15s;
}
.tl-action-btn:hover { color: var(--text); }
.tl-action-btn.del:hover { color: var(--red); }

/* color top borders */
.tl-card[data-color="purple"] { border-top: 2px solid var(--accent); }
.tl-card[data-color="cyan"]   { border-top: 2px solid var(--cyan);   }
.tl-card[data-color="blue"]   { border-top: 2px solid var(--blue);   }
.tl-card[data-color="green"]  { border-top: 2px solid var(--green);  }
.tl-card[data-color="red"]    { border-top: 2px solid var(--red);    }

/* ─── YEAR MARKERS ───────────────────────────────────────────────────────────── */
/* Positioned by JS at the same screenX as their date, always below the line     */
.tl-marker {
  position: absolute;
  top: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.tl-marker-tick {
  width: 1px; height: 8px;
  background: rgba(255,255,255,0.15);
  margin-top: 0;
}
.tl-marker-label {
  font-size: 10px; color: var(--text3);
  font-weight: 500; margin-top: 3px; white-space: nowrap;
}

/* ─── GAP LABELS ─────────────────────────────────────────────────────────────── */
.tl-gap-label {
  position: absolute;
  top: 50%;
  /* Floats a little above the rail instead of sitting on it. */
  transform: translateX(-50%) translateY(-34px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
  pointer-events: none;
  font-style: italic;
  letter-spacing: 0.03em;
}

/* ─── ORIGIN MARKER ─────────────────────────────────────────────────────────── */
.origin-marker {
  position: absolute;
  top: 50%;
  /* -8px = half of the 16px dot, so the dot CENTER sits exactly on the line */
  transform: translateX(-50%) translateY(-8px);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; z-index: 200;
}
.origin-dot-wrap {
  position: relative;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.origin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #ef4444; border: 3px solid #fff;
  box-shadow: 0 0 0 2px #ef4444, 0 0 16px rgba(239,68,68,0.7);
  position: relative; z-index: 2;
}
.origin-pulse {
  position: absolute;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(239,68,68,0.2);
  top: 50%; left: 50%;
  margin-top: -16px; margin-left: -16px;
  animation: oPulse 2.4s ease-out infinite;
}
@keyframes oPulse {
  0%   { transform: scale(.6); opacity: .8; }
  100% { transform: scale(2.2); opacity: 0; }
}
.origin-label {
  margin-top: 6px; font-size: 9px; font-weight: 800;
  letter-spacing: .12em; color: #ef4444; text-transform: uppercase;
  text-shadow: 0 0 8px rgba(239,68,68,.5);
}

/* ─── TOGGLE SWITCH ─────────────────────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 24px; transition: all .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  left: 2px; top: 2px;
  background: var(--text3); transition: all .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ─── PUBLISH BUTTON ─────────────────────────────────────────────────────────── */
.btn-publish {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 12px rgba(16,185,129,0.35);
  transition: all .2s;
  white-space: nowrap;
}
.btn-publish:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(16,185,129,0.5);
}
.publish-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f472b6;
  box-shadow: 0 0 6px #f472b6;
  animation: oPulse 1.1s ease-out infinite;
  flex-shrink: 0;
}

/* ─── PUBLISH MODAL OPTIONS ──────────────────────────────────────────────────── */
.publish-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 10px;
  background: var(--bg3);
}
.publish-option:hover {
  border-color: var(--border2);
  background: var(--surface);
  transform: translateY(-1px);
}
/* Selectable visibility cards (radio-style) */
.vis-option { position: relative; margin-bottom: 0; }
.vis-option.selected {
  border-color: var(--accent);
  background: rgba(124,58,237,0.10);
}
.vis-option.selected::after {
  content: '✓';
  position: absolute; top: 14px; right: 16px;
  color: var(--accent3); font-weight: 700; font-size: 15px;
}
.vis-option.disabled {
  opacity: .45; cursor: not-allowed; pointer-events: none;
}
.publish-option-featured {
  border-color: rgba(124,58,237,0.35);
  background: rgba(124,58,237,0.07);
}
.publish-option-featured:hover {
  border-color: var(--accent);
  background: rgba(124,58,237,0.12);
}
.publish-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.publish-option-body { flex: 1; }
.publish-option-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.publish-option-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}
.publish-option-arrow {
  font-size: 18px;
  color: var(--text3);
  transition: transform .2s;
}
.publish-option:hover .publish-option-arrow { transform: translateX(4px); color: var(--text2); }

/* ─── RESET BUTTON ───────────────────────────────────────────────────────────── */
.btn-reset {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .2s;
  white-space: nowrap;
}
.btn-reset:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.6);
  color: #fff;
}
#cleanEventsBtn:hover {
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.6);
  color: #fff;
}
#exportBtn:hover {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.6);
  color: #fff;
}

/* ─── RECENTER BUTTON (in topbar) ───────────────────────────────────────────── */
.recenter-topbar-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.recenter-topbar-btn:hover {
  background: var(--border2);
  border-color: var(--accent2);
  color: var(--text);
}

/* ─── MINIMAP ────────────────────────────────────────────────────────────────── */
.minimap {
  position: absolute; bottom: 40px; right: 20px;
  width: 180px; height: 48px;
  background: rgba(17,17,24,.9); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; z-index: 20; backdrop-filter: blur(8px);
  cursor: pointer; touch-action: none;
}
.minimap-timeline {
  position: absolute; top: 50%; left: 0; right: 0;
  height: 2px; background: var(--border2); transform: translateY(-50%);
}
.minimap-viewport {
  position: absolute; top: 4px; bottom: 4px;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.4); border-radius: 3px;
  transition: left .1s, width .1s;
  cursor: grab;
}
.minimap.dragging { cursor: grabbing; }
.minimap.dragging .minimap-viewport { transition: none; cursor: grabbing; }
.minimap-dot {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
}

/* ─── HELP PANEL ─────────────────────────────────────────────────────────────── */
.help-panel {
  position: absolute; bottom: 40px; left: 20px;
  background: rgba(17,17,24,.9); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; z-index: 20;
  backdrop-filter: blur(8px); min-width: 180px;
}
.help-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 6px; font-size: 11px; color: var(--text3);
}
.help-row:last-child { margin-bottom: 0; }
.help-key {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
  font-size: 10px; color: var(--text2); font-family: monospace;
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; z-index: 5;
}
.empty-state-icon { font-size: 40px; margin-bottom: 10px; opacity: .3; line-height: 1; }
.empty-state-text { font-size: 14px; color: var(--text3); }
.empty-state-hint { font-size: 12px; color: var(--text3); margin-top: 4px; opacity: .6; }

/* ─── STATUS BAR ─────────────────────────────────────────────────────────────── */
.editor-statusbar {
  height: 26px; background: var(--bg2); border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px;
  gap: 20px; flex-shrink: 0;
}
.statusbar-item {
  font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 5px;
}
.statusbar-item span { color: var(--text2); }

/* ─── SEARCH ─────────────────────────────────────────────────────────────────── */
.tl-card.search-match {
  outline: 1px solid rgba(167,139,250,.5);
}
.tl-card.search-focus {
  outline: 2px solid #a78bfa;
  box-shadow: 0 0 0 3px rgba(167,139,250,.25), var(--shadow);
}
#searchPrev:hover, #searchNext:hover {
  background: var(--bg3) !important;
  color: var(--text) !important;
}

/* ─── COLOR PICKER ───────────────────────────────────────────────────────────── */
.color-picker { display: flex; gap: 8px; }
.color-opt {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
}
.color-opt.selected { border-color: #fff; transform: scale(1.15); }

/* ─── Event card image stack ──────────────────────────────────────────────── */
.tl-stack { position: relative; margin-bottom: 8px; }
/* faux depth behind the photo when there is more than one */
.tl-stack.multi::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: -3px; height: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px 6px 0 0; z-index: 0;
}
.tl-imgbox {
  position: relative; width: 100%; aspect-ratio: 4 / 3; z-index: 1;
  border-radius: 6px; overflow: hidden; background: #0b0c10; cursor: zoom-in;
}
.tl-imgbox img { width: 100%; height: 100%; object-fit: cover; display: block; } /* thumb already 4:3 letterboxed */
.tl-imgcount {
  position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.72);
  color: #fff; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
}

/* ─── Attach photos (event modal) ─────────────────────────────────────────── */
.attach-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; transition: .15s;
}
.attach-btn:hover:not(:disabled) { border-color: var(--border2); }
.attach-btn:disabled { opacity: .5; cursor: not-allowed; }
.attach-hint { font-size: 11px; color: var(--text3); margin-top: 6px; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-item {
  position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: #0b0c10;
}
.attach-item img { width: 100%; height: 100%; object-fit: cover; }
.attach-item.pending::after {
  content: "↻"; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,.45); color: #fff;
}
.attach-item .x {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 5px; background: rgba(0,0,0,.7); color: #fff;
  font-size: 11px; line-height: 18px; cursor: pointer;
}

/* ─── Lightbox ────────────────────────────────────────────────────────────── */
.tl-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: none;
  align-items: center; justify-content: center; z-index: 1000; }
.tl-lightbox.open { display: flex; }
.tl-lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.tl-lightbox button { position: absolute; background: transparent; border: 0; color: #fff; cursor: pointer; }
.tl-lightbox .lb-x { top: 18px; right: 22px; font-size: 24px; }
.tl-lightbox .lb-nav { top: 50%; transform: translateY(-50%); font-size: 34px; width: 56px; }
.tl-lightbox .lb-prev { left: 10px; } .tl-lightbox .lb-next { right: 10px; }
.tl-lightbox .lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 3px 10px; border-radius: 999px; }

/* Color-legend tag on a card (shows the color's meaning) */
.tl-tag {
  display: inline-block; align-self: center; margin-bottom: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── NEUTRAL ACTION BUTTONS (Add Event / Share / Present) ───────────────────── */
/* Quiet, monochrome chrome so the accent stays reserved for Publish and the
   timeline content itself. */
.btn-neutral {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-neutral:hover { background: var(--border2); color: #fff; }
.btn-neutral:active { background: var(--border); }
.btn-neutral:disabled { opacity: .5; cursor: not-allowed; }

/* ─── TIME RANGE FILTER ──────────────────────────────────────────────────────── */
.range-filter-btn.active {
  background: var(--border2);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--text3);
}
.range-filter-panel {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 850;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow, 0 10px 40px rgba(0,0,0,.5));
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
  width: min(92vw, 640px);
}
.range-filter-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.range-filter-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 0; }
.range-filter-field span { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.range-filter-field input {
  width: 100%; box-sizing: border-box;
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text); padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.range-filter-field input:focus { border-color: var(--text3); }
.range-filter-field input.invalid { border-color: var(--red); }
.range-filter-arrow { color: var(--text3); font-size: 14px; padding-bottom: 8px; }
.range-filter-apply { height: 32px; padding: 0 14px; }
.range-filter-clear { height: 32px; padding: 0 10px; font-size: 13px; }
.range-filter-close {
  background: transparent; border: none; color: var(--text3); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 2px 6px; font-family: inherit;
}
.range-filter-close:hover { color: var(--text); }
.range-filter-hint { font-size: 11px; color: var(--text3); }
.range-filter-hint.error { color: #fca5a5; }

/* Translucent band on the rail joining the start and end points of a range. */
.tl-range-band {
  position: absolute;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 4px;
  opacity: .32;
  pointer-events: none;
  z-index: 2;
}

/* "start" / "end" tag on the two cards of a range. */
.tl-role {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 8px;
  letter-spacing: .08em;
  opacity: .85;
  vertical-align: 1px;
}

/* Small helper text under a form field. */
.form-hint { font-size: 11px; color: var(--text3); margin-top: 6px; line-height: 1.5; }
.form-hint strong { color: var(--text2); font-weight: 600; }
.range-role-note { margin-top: -6px; margin-bottom: 14px; }

/* ─── LANES (by color / compare) ─────────────────────────────────────────────── */
/* `#rails` holds one .rail per lane; each is offset vertically by JS. */
.tl-lane-label {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-100% - 10px));
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text3);
  background: rgba(17,17,24,.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.tl-lane-label .lane-swatch {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: 0;
}
/* Events borrowed from the compared timeline: read-only, drawn dashed. */
.tl-card.tl-card--cmp { border-style: dashed; }

/* View menu (lanes / compare / view link) */
.view-menu { min-width: 220px; }
.view-menu .topbar-menu-item { justify-content: flex-start; }
.menu-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--border2); font-size: 10px; color: var(--text);
}
.menu-check.on { background: var(--border2); }
.menu-check.on::after { content: '✓'; }
.view-menu-btn.active { background: var(--border2); color: #fff; box-shadow: inset 0 0 0 1px var(--text3); }

/* Compare modal list */
.compare-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg3);
}
.compare-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; background: transparent; border: none;
  border-bottom: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.compare-item:last-child { border-bottom: none; }
.compare-item:hover { background: var(--surface2); }
.compare-item .compare-meta { font-size: 11px; color: var(--text3); white-space: nowrap; }
.compare-item .compare-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-empty { padding: 14px; font-size: 12px; color: var(--text3); text-align: center; }
#viewMenuLabel { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
