@layer components {
  /* Horizontal Gantt — rows are people (or vehicles), bars are stays/runs. */
  .gantt {
    background: var(--paper);
    border: 1px solid rgba(0,0,0,0.10);
    overflow: hidden;
  }
  .gantt-head {
    display: grid;
    grid-template-columns: 180px 1fr;
    background: rgba(0,0,0,0.04);
    border-bottom: 1px solid rgba(0,0,0,0.10);
  }
  .gantt-head .label-col {
    padding: var(--space-3) var(--space-4);
    font-size: var(--cap-md);
    text-transform: uppercase;
    letter-spacing: var(--tracking-cap-tight);
    color: var(--ink-soft);
    font-weight: var(--weight-bold);
  }
  .gantt-head .timeline { display: grid; grid-template-columns: repeat(6, 1fr); }
  .gantt-head .timeline > div {
    padding: var(--space-3);
    font-family: var(--display);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-soft);
    border-left: 1px solid rgba(0,0,0,0.08);
  }
  .gantt-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .gantt-row:last-child { border-bottom: none; }
  .gantt-label {
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 14px;
  }
  .gantt-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    min-height: 56px;
  }
  .gantt-track > div { border-left: 1px solid rgba(0,0,0,0.06); }
  .gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    border-radius: 2px;
    padding: 0 var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 12px;
    color: #fff;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
    overflow: hidden;
  }
  .gantt-bar.arrive { background: var(--arrive); }
  .gantt-bar.depart { background: var(--depart); }
  .gantt-bar.run    { background: var(--ink); }
  .gantt-bar.dashed {
    background: transparent;
    border: 1.5px dashed rgba(0,0,0,0.25);
    color: var(--ink-faint);
  }
  .gantt-bar.flag { box-shadow: 0 0 0 2px var(--pip-flag-fg); }

  .gantt-banded-row    { background: rgba(74, 124, 78, 0.04); }
  .gantt-lane-self     { background: rgba(74, 124, 78, 0.06); }
  .gantt-lane-unmatched { background: rgba(196, 68, 68, 0.05); }

  /* Legend below a chart. */
  .legend {
    font-size: var(--cap-md);
    color: var(--ink-faint);
    display: flex;
    gap: var(--space-4);
    align-items: center;
    text-transform: uppercase;
    letter-spacing: var(--tracking-cap-tight);
    font-weight: var(--weight-medium);
  }
  .legend .swatch {
    display: inline-block;
    width: 12px; height: 12px;
    margin-right: 6px;
    vertical-align: middle;
  }
}
