/* Timeline + swimlane + list view styles. Imports after zephyr.css. */

/* ───── TIMELINE ───── */
.zr-tl {
  background: #fff;
  border: 1px solid var(--border-1);
  padding: 0;
  position: relative;
}

.zr-tl-rail {
  position: relative;
  height: 78px;
  border-bottom: 1px solid var(--border-1);
  background: var(--vds-bone);
  padding-left: 200px;
}
.zr-tl-rail-line {
  position: absolute;
  left: 200px; right: 16px; top: 56px;
  height: 1px;
  background: var(--border-1);
}
.zr-tl-pin {
  position: absolute;
  top: 6px;
  width: 0;
  transform: translateX(-50%);
  z-index: 2;
}
.zr-tl-pin .flag-body {
  position: absolute;
  left: 0; top: 0;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--vds-red);
  border-left: 3px solid var(--vds-red);
  padding: 3px 8px 4px;
  white-space: nowrap;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-1);
}
.zr-tl-pin .flag-body .date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--vds-red);
  letter-spacing: 0.08em;
  font-weight: 700;
}
.zr-tl-pin .flag-body .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-1);
  margin-top: 1px;
}
.zr-tl-pin .stem {
  position: absolute;
  left: 0;
  top: 40px;
  width: 1px;
  height: 12px;
  background: var(--vds-red);
}
.zr-tl-pin .dot {
  position: absolute;
  left: -4px;
  top: 50px;
  width: 9px;
  height: 9px;
  background: var(--vds-red);
  transform: rotate(45deg);
}
.zr-tl-pin-compliance .flag-body { border-color: var(--vds-graphite-900); border-left-color: var(--vds-graphite-900); }
.zr-tl-pin-compliance .flag-body .date { color: var(--vds-graphite-900); }
.zr-tl-pin-compliance .stem { background: var(--vds-graphite-900); }
.zr-tl-pin-compliance .dot { background: var(--vds-graphite-900); }

/* Stagger flag vertical positions to reduce overlap */
.zr-tl-pin:nth-child(even) .flag-body { top: 18px; }
.zr-tl-pin:nth-child(even) .stem { top: 58px; height: 0; }

.zr-tl-axis {
  position: relative;
  height: 28px;
  padding-left: 200px;
  border-bottom: 1px solid var(--border-1);
  background: #fff;
}
.zr-tl-tick {
  position: absolute;
  top: 0; bottom: 0;
  width: 0;
  border-left: 1px solid var(--border-2);
}
.zr-tl-tick.month { border-left-color: var(--border-1); }
.zr-tl-tick .lbl {
  position: absolute;
  top: 8px;
  left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
}
.zr-tl-tick.month .lbl {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--vds-red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  top: 6px;
}

.zr-tl-today {
  position: absolute;
  top: 0; bottom: 0;
  width: 0;
  z-index: 3;
}
.zr-tl-today .l {
  position: absolute;
  top: 0; bottom: -2000px;
  left: 0;
  width: 2px;
  background: var(--vds-red);
  opacity: 0.9;
  transform: translateX(-1px);
}
.zr-tl-today .lbl {
  position: absolute;
  top: 4px;
  left: 6px;
  background: var(--vds-red);
  color: #fff;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.zr-tl-body {
  position: relative;
  padding-left: 200px;
}
.zr-tl-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding-left: 200px;
}
.zr-tl-grid .gl {
  position: absolute;
  top: 0; bottom: 0;
  width: 0;
  border-left: 1px dashed var(--border-2);
}
.zr-tl-grid .gl.m { border-left-style: solid; border-left-color: var(--border-1); }
.zr-tl-grid .gl.today { border-left: 2px solid var(--vds-red); opacity: 0.4; }

/* Deps live above grid but under bars */
.zr-tl-deps {
  position: absolute;
  left: 200px; right: 0; top: 0; bottom: 0;
  pointer-events: none;
  z-index: 2;
}
/* Two svgs are rendered due to code path, hide the first placeholder */
.zr-tl-body > svg.zr-tl-deps:first-of-type { display: none; }

.zr-tl-lane {
  position: absolute;
  left: 0; right: 0;
}
.zr-tl-lane-head {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  padding: 8px 16px 0 14px;
  border-left: 3px solid var(--vds-graphite-600);
  border-right: 1px solid var(--border-1);
  height: 100%;
  background: var(--vds-graphite-50);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zr-tl-lane-head .ct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
}

.zr-tl-bar {
  position: absolute;
  height: 34px;
  background: #fff;
  border: 1px solid var(--border-1);
  border-left: 3px solid var(--lane-color, var(--vds-graphite-600));
  cursor: pointer;
  overflow: hidden;
  transition: border-color 120ms var(--ease-standard), box-shadow 120ms var(--ease-standard);
  z-index: 3;
}
.zr-tl-bar:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
}
.zr-tl-bar .bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  height: 100%;
  gap: 8px;
  min-width: 0;
}
.zr-tl-bar .title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

body[data-density="compact"] .zr-tl-bar { height: 26px; }
body[data-density="compact"] .zr-tl-bar .title { font-size: 11px; }

body[data-color="off"] .zr-tl-bar { border-left-color: var(--vds-graphite-600) !important; }
body[data-color="off"] .zr-tl-lane-head { border-left-color: var(--vds-graphite-600) !important; }

/* ───── SWIMLANE ───── */
.zr-sw {
  background: #fff;
  border: 1px solid var(--border-1);
  overflow-x: auto;            /* horizontal scroll on narrow viewports */
  -webkit-overflow-scrolling: touch;
}
.zr-sw-grid {
  display: grid;
  /* Strict fixed widths so the head row and every lane row line up perfectly.
     The whole swimlane scrolls horizontally as one unit. */
  grid-template-columns: 220px repeat(5, 240px);
  gap: 0;
  width: max-content;
  min-width: 100%;
}
.zr-sw-cell { min-width: 0; }
.zr-sw-cell .zr-card { max-width: 100%; }
@media (min-width: 1500px) {
  /* Plenty of room — let columns grow */
  .zr-sw-grid { grid-template-columns: 220px repeat(5, 1fr); width: 100%; }
}
.zr-sw-heads {
  background: var(--vds-graphite-50);
  border-bottom: 1px solid var(--border-1);
  position: sticky;
  top: 0;
  z-index: 4;
}
.zr-sw-col-head {
  padding: 14px 16px 12px;
  border-left: 1px solid var(--border-1);
}
.zr-sw-col-head .ttl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-1);
}
.zr-sw-col-head .sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.zr-sw-lane-head-ph {
  background: var(--vds-graphite-900);
  border-right: 1px solid var(--vds-graphite-700);
}

.zr-sw-lane {
  border-bottom: 1px solid var(--border-1);
}
.zr-sw-lane:last-child { border-bottom: 0; }

.zr-sw-lane-head {
  background: var(--vds-graphite-900);
  color: #fff;
  padding: 16px 14px 16px 18px;
  border-left: 4px solid var(--lane-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zr-sw-lane-head .blurb {
  font-size: 12px;
  color: var(--vds-graphite-300);
  line-height: 1.4;
  margin-top: 2px;
}
.zr-sw-lane-head .ct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--vds-graphite-400);
  letter-spacing: 0.08em;
  margin-top: auto;
}

.zr-sw-cell {
  padding: 10px;
  border-left: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--vds-bone);
}
.zr-sw-cell:nth-child(2) { background: var(--vds-graphite-50); } /* "now" bucket subtle */
.zr-sw-cell .empty {
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
  padding: 14px 0;
  opacity: 0.5;
}

/* ── drag & drop ── */
.zr-sw-drag {
  cursor: grab;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.zr-sw-drag:active { cursor: grabbing; }
.zr-sw-drag.dragging {
  opacity: 0.35;
  transform: scale(0.98);
}
.zr-sw-drag.overridden .zr-card {
  box-shadow: inset 3px 0 0 var(--vds-red);
}
.zr-sw-drag.overridden .zr-card::after {
  content: "moved";
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vds-red-deep);
  background: var(--vds-red-tint, #fdeee5);
  padding: 1px 5px;
  border: 1px solid var(--vds-red);
}
.zr-sw-cell.drop-target {
  background: color-mix(in oklab, var(--lane-color, var(--vds-red)) 8%, var(--vds-bone));
  outline: 2px dashed var(--lane-color, var(--vds-red));
  outline-offset: -4px;
}
.zr-sw-cell.drop-target .empty {
  opacity: 1;
  color: var(--lane-color, var(--vds-red));
  font-weight: 600;
}
.zr-sw-col-head.drop {
  color: var(--vds-red-deep);
}

body[data-color="off"] .zr-sw-lane-head { border-left-color: var(--vds-graphite-600) !important; }

/* ── narrow viewport (phones, narrow desktop) ─────────────────── */
@media (max-width: 900px) {
  .zr-sw {
    /* hint that there's more to scroll */
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to right, rgba(255,255,255,0), #fff 70%) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.12), rgba(0,0,0,0)),
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.12), rgba(0,0,0,0)) 100% 0;
    background-repeat: no-repeat;
    background-color: #fff;
    background-size: 28px 100%, 28px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .zr-sw-grid {
    grid-template-columns: 140px repeat(5, 200px);
    width: max-content;
  }
  .zr-sw-lane-head {
    padding: 10px 12px !important;
    font-size: 11px;
  }
  .zr-sw-lane-head .blurb { display: none; }     /* save space */
  .zr-sw-lane-head .ct { font-size: 9px; }
  .zr-sw-col-head { padding: 10px 12px 8px; }
  .zr-sw-col-head .ttl { font-size: 11px; line-height: 1.2; }
  .zr-sw-col-head .sub { font-size: 9px; }
  .zr-sw-cell { padding: 8px; }
  /* Make the heads non-sticky vertically when scrolling horizontally
     so they don't overlap badly on phones. */
  .zr-sw-heads { position: relative; }
}

/* ───── LIST ───── */
.zr-ls { }
.zr-ls-controls {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border-1);
}
.zr-ls-controls .ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.zr-ls-controls .ctrl-k {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.zr-ls-controls .seg {
  display: inline-flex;
  border: 1px solid var(--border-1);
}
.zr-ls-controls .seg button {
  background: #fff;
  border: 0;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-3);
  cursor: pointer;
  border-right: 1px solid var(--border-1);
  letter-spacing: 0.02em;
}
.zr-ls-controls .seg button:last-child { border-right: 0; }
.zr-ls-controls .seg button.on { background: var(--vds-graphite-900); color: #fff; }
.zr-ls-controls .seg button:hover:not(.on) { background: var(--vds-graphite-50); color: var(--fg-1); }

.zr-ls-group {
  background: #fff;
  border: 1px solid var(--border-1);
  margin-bottom: 14px;
}
.zr-ls-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  background: var(--vds-graphite-900);
  color: #fff;
}
.zr-ls-group-head .ttl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.zr-ls-group-head .ct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--vds-graphite-300);
  letter-spacing: 0.08em;
}
.zr-ls-table {
  width: 100%;
  border-collapse: collapse;
}
.zr-ls-table th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  background: var(--vds-graphite-50);
}
.zr-ls-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: top;
  font-size: 13px;
}
.zr-ls-row {
  cursor: pointer;
  transition: background 120ms var(--ease-standard);
  border-left: 3px solid var(--lane-color);
}
.zr-ls-row:hover { background: var(--vds-graphite-50); }
.zr-ls-row .c-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.zr-ls-row .c-title .ttl {
  font-weight: 700;
  color: var(--fg-1);
  font-size: 13px;
}
.zr-ls-row .c-title .sum {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 2px;
}
.zr-ls-row .c-owner .owner {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--fg-2);
  font-size: 12px;
}
.zr-ls-row .c-dates .dates {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  white-space: nowrap;
}
.zr-ls-row .c-deps {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  text-align: center;
}

body[data-color="off"] .zr-ls-row { border-left-color: var(--vds-graphite-600) !important; }
body[data-show-status="0"] .zr-ls-table .c-status,
body[data-show-status="0"] .zr-ls-table th.c-status { display: none; }
body[data-show-owners="0"] .zr-ls-table .c-owner,
body[data-show-owners="0"] .zr-ls-table th.c-owner { display: none; }
body[data-show-dates="0"] .zr-ls-table .c-dates,
body[data-show-dates="0"] .zr-ls-table th.c-dates { display: none; }
