/* Waypoint Planner - Gantt Chart / Tracking Gantt views, timescale chart and Timeline strip.
   Owned by the gantt engineer (docs/ARCHITECTURE.md §2). Colors come from the theme tokens of css/app.css;
   the Gantt-only tokens below are read by the canvas painter (js/ui/gantt/painter.js). */

/* ==========================================================================
   View layout (js/ui/views/ganttView.js)
   ========================================================================== */
.wp-gantt {
  --wp-gantt-late: #3b4256;
  --wp-gantt-late-progress: #0f121b;
  --wp-gantt-inactive: #9aa1b2;
  --wp-gantt-project-summary: #8a91a3;
  --wp-gantt-project-line: #9aa1b2;
  --wp-gantt-row-select: rgba(67, 83, 214, 0.09);
  position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--wp-panel);
}
.wp-gantt-printhead { display: none; }
.wp-gantt-timeline { flex: none; }
.wp-gantt-split { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; }
.wp-gantt-left { position: relative; display: flex; flex: none; min-width: 0; min-height: 0; overflow: hidden; }
.wp-gantt-right { position: relative; display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; }
.wp-gantt-splitter {
  position: relative; flex: none; width: 6px; outline: none; cursor: col-resize; touch-action: none;
  background: var(--wp-panel-2); border-left: 1px solid var(--wp-border); border-right: 1px solid var(--wp-border);
}
.wp-gantt-splitter::after {
  content: ''; position: absolute; top: 50%; left: 1px; width: 2px; height: 28px; margin-top: -14px;
  border-left: 1px dotted var(--wp-border-strong); border-right: 1px dotted var(--wp-border-strong);
}
.wp-gantt-splitter:hover, .wp-gantt-splitter:focus-visible, .wp-gantt.is-resizing .wp-gantt-splitter { background: var(--wp-accent-weak); border-color: var(--wp-accent); }
.wp-gantt.is-resizing, .wp-gantt.is-resizing * { cursor: col-resize !important; user-select: none; }

/* ==========================================================================
   Chart pane (js/ui/gantt/chart.js)
   ========================================================================== */
.wp-gantt-chart { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; }
.wp-gantt-head { position: relative; display: flex; flex: none; overflow: hidden; background: var(--wp-panel-2); }
.wp-gantt-headcanvas { display: block; flex: none; }
.wp-gantt-corner { flex: 1 1 auto; background: var(--wp-panel-2); border-bottom: 1px solid var(--wp-border-strong); }
.wp-gantt-body { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; background: var(--wp-panel); }
.wp-gantt-canvas { position: absolute; top: 0; left: 0; display: block; pointer-events: none; }
.wp-gantt-scroll { position: absolute; inset: 0; overflow: scroll; overscroll-behavior: contain; outline: none; }
.wp-gantt-spacer { width: 1px; height: 1px; pointer-events: none; }
.wp-gantt-scroll.is-move { cursor: move; }
.wp-gantt-scroll.is-resize { cursor: ew-resize; }
.wp-gantt-scroll.is-progress {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ctext x='4' y='16' font-family='Arial,sans-serif' font-size='16' font-weight='700' fill='%23111' stroke='%23fff' stroke-width='0.9' paint-order='stroke'%3E%25%3C/text%3E%3Cpath d='M1 19h20' stroke='%23111' stroke-width='1.4'/%3E%3C/svg%3E") 11 11, ew-resize;
}
html.wp-gantt-drag-move, html.wp-gantt-drag-move * { cursor: move !important; user-select: none; }
html.wp-gantt-drag-resize, html.wp-gantt-drag-resize * { cursor: ew-resize !important; user-select: none; }
html.wp-gantt-drag-progress, html.wp-gantt-drag-progress * { cursor: ew-resize !important; user-select: none; }
html.wp-gantt-drag-link, html.wp-gantt-drag-link * { cursor: alias !important; user-select: none; }

.wp-gantt-tip { max-width: 380px; }
.wp-gantt-tip-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 12px; margin-top: 4px; }
.wp-gantt-tip-k { color: #b5bbd2; white-space: nowrap; }
.wp-gantt-tip-v { color: #f2f3f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Timeline strip (js/ui/gantt/timeline.js)
   ========================================================================== */
.wp-tl {
  position: relative; display: flex; height: 62px; overflow: hidden;
  background: var(--wp-panel); border-bottom: 1px solid var(--wp-border-strong);
  font-size: 11px; user-select: none;
}
.wp-tl[hidden] { display: none; }
.wp-tl-side {
  display: flex; flex: none; flex-direction: column; justify-content: center; gap: 2px;
  width: 96px; padding: 0 10px; background: var(--wp-panel-2);
}
.wp-tl-side.is-start { border-right: 1px solid var(--wp-border); }
.wp-tl-side.is-finish { align-items: flex-end; border-left: 1px solid var(--wp-border); }
.wp-tl-side-title { color: var(--wp-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.wp-tl-side-date { overflow: hidden; color: var(--wp-text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wp-tl-main { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; cursor: pointer; }
.wp-tl-band { position: absolute; left: 10px; right: 10px; background: var(--wp-accent-weak); border-radius: 4px; }
.wp-tl-ticks { position: absolute; left: 0; right: 0; z-index: 1; height: 15px; pointer-events: none; }
.wp-tl-tick {
  position: absolute; top: 0; height: 15px; padding-left: 4px; overflow: hidden;
  border-left: 1px solid rgba(67, 83, 214, 0.28); color: var(--wp-accent-strong);
  font-size: 10.5px; line-height: 15px; white-space: nowrap;
}
.wp-tl-window {
  position: absolute; top: 2px; bottom: 2px; z-index: 1;
  background: rgba(67, 83, 214, 0.08); border: 1px solid rgba(67, 83, 214, 0.5); border-radius: 3px; cursor: grab;
}
.wp-tl-window.is-dragging { cursor: grabbing; background: rgba(67, 83, 214, 0.14); }
.wp-tl-items { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.wp-tl-bar {
  position: absolute; display: flex; align-items: center; padding: 0 6px; overflow: hidden;
  background: var(--wp-bar); color: #fff; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.12);
  font-size: 11px; white-space: nowrap; cursor: pointer; pointer-events: auto;
}
.wp-tl-bar:hover { filter: brightness(1.06); }
.wp-tl-bar.is-summary { background: var(--wp-bar-summary); }
.wp-tl-bar.is-inactive { background: var(--wp-panel); color: var(--wp-muted); box-shadow: inset 0 0 0 1px var(--wp-border-strong); }
.wp-tl-bar.is-selected { box-shadow: 0 0 0 2px var(--wp-accent-strong); }
.wp-tl-bar-label { overflow: hidden; text-overflow: ellipsis; }
.wp-tl-callouts { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wp-tl-ms {
  position: absolute; width: 11px; height: 11px; margin: -6px 0 0 -6px;
  background: var(--wp-milestone); transform: rotate(45deg); cursor: pointer; pointer-events: auto;
}
.wp-tl-ms.is-inactive { background: var(--wp-panel); box-shadow: inset 0 0 0 1px var(--wp-gantt-inactive); }
.wp-tl-ms.is-selected { box-shadow: 0 0 0 2px var(--wp-accent); }
.wp-tl-ms-label {
  position: absolute; display: flex; gap: 5px; height: 16px; overflow: hidden;
  line-height: 16px; white-space: nowrap; cursor: pointer; pointer-events: auto;
}
.wp-tl-ms-label.is-selected .wp-tl-ms-name { color: var(--wp-accent-strong); }
.wp-tl-ms-name { overflow: hidden; color: var(--wp-text); font-weight: 600; text-overflow: ellipsis; }
.wp-tl-ms-date { flex: none; color: var(--wp-muted); }
.wp-tl-today { position: absolute; z-index: 2; width: 0; border-left: 2px solid var(--wp-today); pointer-events: none; }
.wp-tl-today-label { position: absolute; bottom: 0; left: 3px; color: #b46d00; font-size: 10px; font-weight: 600; }
.wp-tl-today[hidden] { display: none; }
.wp-tl-empty { position: absolute; left: 0; right: 0; z-index: 1; color: var(--wp-muted); line-height: 19px; text-align: center; pointer-events: none; }
.wp-tl-empty[hidden] { display: none; }

/* ==========================================================================
   Printing: the Gantt prints what is on screen (frozen at its screen size; see ganttView.js)
   ========================================================================== */
@media print {
  .wp-gantt, .wp-gantt * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wp-gantt.is-print-frozen { flex: none; height: auto; }
  .wp-gantt.is-print-frozen .wp-gantt-printhead { display: block; margin: 0 0 3mm; color: #111; font-size: 11pt; font-weight: 600; }
  .wp-gantt.is-print-frozen .wp-gantt-split { flex: none; }
  .wp-gantt-splitter::after, .wp-tl-window { display: none; }
}
