:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --page: #f4f7fb;
  --header: #eef3f8;
  --travel: #4d8fd8;
  --travel-ink: #ffffff;
  --saturday: #dcecff;
  --saturday-ink: #2f66b0;
  --sunday: #ffe3e0;
  --sunday-ink: #c23b32;
  --today: #fff3c4;
  --sticky-shadow: 12px 0 20px rgba(15, 31, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.updated {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

button {
  appearance: none;
  border: 1px solid #b8c7d9;
  background: #fff;
  color: #24364f;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: #f7fafe;
}

.status {
  display: none;
  margin-bottom: 12px;
  border: 1px solid #c7d7ec;
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  color: #244668;
  font-size: 13px;
}

.status.show {
  display: block;
}

.status.error {
  border-color: #f0b4aa;
  background: #fff6f4;
  color: #8f251d;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
  color: #46566c;
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 18px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.swatch.travel { background: var(--travel); }
.swatch.saturday { background: var(--saturday); }
.swatch.sunday { background: var(--sunday); }
.swatch.today { background: var(--today); }

.gantt-wrap {
  overflow: auto;
  max-height: min(78vh, 860px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.gantt-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}

th,
td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  height: 34px;
  padding: 5px 7px;
  vertical-align: middle;
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--header);
  color: #32445d;
  font-weight: 720;
  text-align: center;
}

thead tr:nth-child(2) th {
  top: 34px;
}

.col-traveler {
  width: 260px;
  min-width: 260px;
}

.col-arrival,
.col-departure {
  width: 88px;
  min-width: 88px;
  text-align: center;
}

.col-date {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  text-align: center;
}

.sticky-1,
.sticky-2,
.sticky-3 {
  position: sticky;
  z-index: 8;
}

thead .sticky-1,
thead .sticky-2,
thead .sticky-3 {
  z-index: 18;
}

.sticky-1 { left: 0; }
.sticky-2 {
  left: 260px;
}
.sticky-3 {
  left: 348px;
  box-shadow: var(--sticky-shadow);
}

.traveler-name,
.traveler-affiliation,
.traveler-programs {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.traveler-name {
  font-weight: 650;
}

a.traveler-name {
  color: inherit;
  text-decoration: none;
}

a.traveler-name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.traveler-affiliation {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.traveler-programs {
  margin-top: 1px;
  color: #3f5878;
  font-size: 11px;
}

.weekend-sat {
  background: var(--saturday);
  color: var(--saturday-ink);
}

.weekend-sun {
  background: var(--sunday);
  color: var(--sunday-ink);
}

.today {
  background: #fff9e8;
  box-shadow: inset 1px 0 0 #dca900, inset -1px 0 0 #dca900;
}

td.bar {
  background: var(--travel);
  color: var(--travel-ink);
  border-right-color: rgba(255, 255, 255, 0.42);
}

td.bar.start {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

td.bar.end {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .page {
    padding: 10px;
  }

  .topbar {
    display: block;
  }

  .actions {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .gantt-wrap {
    max-height: 74vh;
  }

  .col-traveler {
    width: 210px;
    min-width: 210px;
  }

  .col-arrival,
  .col-departure {
    width: 74px;
    min-width: 74px;
    font-size: 11px;
  }

  .sticky-1 { left: 0; }
  .sticky-2 { left: 210px; }
  .sticky-3 { left: 284px; }
}
