:root { 
  --bg: #101010; 
  --card-bg: #1a1a1a; 
  --text-main: #eeeeee; 
  --text-muted: #888888; 
  --accent: #00e5ff; 
  --line: #333333; 
  --sadko: #00E676; 
  --novi: #FF9100; 
}

body { 
  background: var(--bg); 
  color: var(--text-main); 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
  margin: 0; 
  height: 100vh; 
  overflow: hidden; 
}

/* --- Layout --- */
.container { 
  display: flex; 
  flex-direction: column; 
  height: 100%; 
  width: 100%; 
  max-width: 2000px; 
  margin: 0 auto; 
}

.header { 
  flex: 0 0 65px; 
  display: flex; 
  background: #000; 
  border-bottom: 2px solid var(--line); 
  align-items: center; 
  font-size: 1.3rem; 
  font-weight: 900; 
  letter-spacing: 3px; 
  z-index: 20; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.col-header { flex: 1; text-align: center; text-transform: uppercase; }
.stem-header { flex: 0 0 120px; text-align: center; color: var(--accent); font-size: 0.9rem; }

/* --- Timeline Scroll Area --- */
.timeline-scroll { 
  flex: 1; 
  overflow-y: auto; 
  scroll-behavior: auto; /* JS handles smoothness */
  position: relative; 
  padding-bottom: 100px; /* Space at bottom */
}

.row { 
  display: flex; 
  align-items: stretch; /* CRITICAL: Ensures Stem grows with content */
  min-height: 160px; 
  position: relative; 
}
.row:hover { background: #141414; }
.row.is-today { background: rgba(0, 229, 255, 0.03); }

/* --- Columns --- */
.col { 
  flex: 1 1 50%; 
  min-width: 0; /* CRITICAL: Prevents text overflow breaking layout */
  padding: 25px 40px; 
  display: flex; 
  flex-direction: column; 
  gap: 25px; 
}
.col.sadko { align-items: flex-end; border-right: 1px solid var(--line); text-align: right; }
.col.novi { align-items: flex-start; border-left: 1px solid var(--line); text-align: left; }

/* --- The Stem (Spine) --- */
.stem { 
  flex: 0 0 120px; 
  flex-shrink: 0; /* Do not squash the stem */
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  padding-top: 35px; 
  position: relative; 
}

/* The Continuous Line */
.stem::before { 
  content: ''; 
  position: absolute; 
  top: 0; bottom: 0; left: 50%; 
  width: 2px; 
  background: var(--line); 
  transform: translateX(-50%); 
  z-index: 0; 
}

/* Date Bubble */
.date-node { 
  background: var(--card-bg); 
  border: 2px solid var(--accent); 
  border-radius: 50%; 
  width: 80px; height: 80px; 
  display: flex; flex-direction: column; 
  align-items: center; justify-content: center; 
  z-index: 2; /* Sit above the line */
  box-shadow: 0 0 20px rgba(0,0,0,0.6); 
}
.dow { font-size: 1.1em; color: var(--accent); font-weight: bold; line-height: 1; margin-bottom: 2px; text-transform: uppercase; }
.day-num { font-size: 1.4em; color: #fff; font-weight: bold; line-height: 1; }
.year-tag { font-size: 0.7em; color: var(--text-muted); margin-top: 2px; }

/* --- Cards --- */
.trip-card { 
  background: var(--card-bg); 
  border: 1px solid #333; 
  border-radius: 6px; 
  padding: 18px; 
  width: 100%; 
  max-width: 650px;
  position: relative; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.4); 
  transition: transform 0.1s ease-in-out;
}
.trip-card:hover { transform: scale(1.01); border-color: #555; z-index: 10; }

.sadko .trip-card { border-right: 4px solid var(--sadko); }
.novi .trip-card { border-left: 4px solid var(--novi); }

/* Connectors */
.col.sadko .trip-card::after { content: ''; position: absolute; right: -46px; top: 40px; width: 42px; height: 2px; background: var(--line); }
.col.sadko .trip-card::before { content: ''; position: absolute; right: -50px; top: 37px; width: 8px; height: 8px; background: var(--sadko); border-radius: 50%; box-shadow: 0 0 10px var(--sadko); }

.col.novi .trip-card::after { content: ''; position: absolute; left: -46px; top: 40px; width: 42px; height: 2px; background: var(--line); }
.col.novi .trip-card::before { content: ''; position: absolute; left: -50px; top: 37px; width: 8px; height: 8px; background: var(--novi); border-radius: 50%; box-shadow: 0 0 10px var(--novi); }

/* --- Card Content --- */
.trip-header { display: flex; justify-content: space-between; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 10px; }
.trip-id { font-family: 'Courier New', monospace; font-size: 1.3em; color: #fff; font-weight: bold; }
.trip-driver { color: var(--accent); font-weight: bold; font-size: 1.1em; text-align: right; }

.trip-meta { display: flex; gap: 12px; font-size: 0.85em; color: var(--text-muted); margin-bottom: 12px; }
.sadko .trip-meta { justify-content: flex-end; }
.meta-tag { background: #222; padding: 4px 8px; border-radius: 4px; border: 1px solid #333; }

/* Stops */
.stop-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.stop-item { display: flex; gap: 15px; padding: 8px 0; border-top: 1px solid #252525; font-size: 0.95em; align-items: baseline; }
.sadko .stop-item { flex-direction: row-reverse; text-align: right; }

.stop-time { color: var(--accent); font-family: 'Courier New', monospace; font-weight: bold; background: rgba(0, 229, 255, 0.1); padding: 2px 6px; border-radius: 3px; }
.stop-addr { color: #ddd; line-height: 1.4; }
.stop-items { display: block; font-size: 0.85em; color: #666; margin-top: 4px; font-style: italic; }
