/* Sequencing timeline — uses the board's existing light tokens. */

.tl-host {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 4px 28px 40px;
}

.tl-root {
  font-family: var(--font-body, "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif);
  color: var(--text, #0f172a);
}

.tl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tl-toolbar-title h2 {
  font-family: var(--font-display, inherit);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.tl-toolbar-sub {
  color: var(--muted, #475569);
  font-size: 13px;
  margin-top: 4px;
}

.tl-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.tl-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted, #475569);
}

.tl-field input,
.tl-field select {
  font: inherit;
  font-size: 13px;
  color: var(--text, #0f172a);
  background: var(--panel, #fff);
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  padding: 7px 10px;
  min-height: 36px;
}

.tl-zoom {
  display: inline-flex;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
}

.tl-zoom-btn {
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 0;
  background: var(--panel-2, #f8fafc);
  color: var(--muted, #475569);
  cursor: pointer;
  min-height: 36px;
}

.tl-zoom-btn.is-on {
  background: var(--accent, #0f766e);
  color: #fff;
  font-weight: 600;
}

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  list-style: none;
  font-size: 12px;
  color: var(--muted, #475569);
  margin: 0 0 12px;
}

.tl-legend li { display: flex; align-items: center; gap: 6px; }

.tl-swatch {
  width: 18px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.tl-swatch-planned {
  background: transparent;
  border: 2px solid var(--accent, #0f766e);
}

.tl-swatch-actual { background: var(--accent, #0f766e); }

.tl-swatch-mark {
  width: 10px;
  height: 10px;
  background: #0f172a;
  transform: rotate(45deg);
  border-radius: 1px;
}

.tl-swatch-today {
  width: 2px;
  height: 14px;
  background: var(--danger, #dc2626);
  border-radius: 0;
}

.tl-scroll {
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 10px);
  background: var(--bg-2, #fff);
  scrollbar-width: thin;
}

.tl-grid {
  min-width: 920px;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.tl-corner {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  border-right: 1px solid var(--border, #e2e8f0);
}

.tl-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.tl-head-grid {
  position: relative;
  display: flex;
  min-height: 48px;
}

.tl-hcell {
  box-sizing: border-box;
  border-right: 1px solid var(--border, #e2e8f0);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tl-hcell-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.tl-hcell-sub {
  font-size: 10px;
  color: var(--muted-2, #64748b);
}

.tl-phase {
  grid-column: 1 / -1;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2, #64748b);
  background: var(--bg-3, #f1f5f9);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.tl-row {
  display: contents;
}

.tl-label {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  border-right: 1px solid var(--border, #e2e8f0);
  padding: 8px 10px;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tl-label-stage {
  padding-left: 28px;
  background: var(--panel-2, #f8fafc);
  font-size: 12px;
  color: var(--muted, #475569);
}

.tl-expand,
.tl-product,
.tl-mini,
.tl-unscheduled-name,
.tl-btn {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: inherit;
}

.tl-expand {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted, #475569);
}

.tl-expand:hover,
.tl-product:hover,
.tl-unscheduled-name:hover { background: var(--bg-3, #f1f5f9); }

.tl-product,
.tl-unscheduled-name {
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  padding: 4px 6px;
  border-radius: 6px;
}

.tl-label-actions { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }

.tl-mini {
  font-size: 11px;
  color: var(--accent, #0f766e);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 99px;
  padding: 3px 8px;
  min-height: 28px;
}

.tl-mini:hover { border-color: var(--accent, #0f766e); }

.tl-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
}

.tl-warn {
  width: 100%;
  font-size: 11px;
  color: var(--danger, #dc2626);
  line-height: 1.35;
}

.tl-track {
  position: relative;
  border-bottom: 1px solid var(--border, #e2e8f0);
  min-height: 44px;
  background-image: repeating-linear-gradient(
    to right,
    transparent,
    transparent calc(100% / 12 - 1px),
    var(--border, #e2e8f0) calc(100% / 12 - 1px),
    var(--border, #e2e8f0) calc(100% / 12)
  );
}

.tl-bars { position: relative; height: 100%; min-height: 44px; }

.tl-bar {
  position: absolute;
  top: 14px;
  height: 14px;
  border-radius: 4px;
  box-sizing: border-box;
}

.tl-bar-planned {
  border: 2px solid currentColor;
  background: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 3px,
    rgba(15, 23, 42, 0.06) 3px,
    rgba(15, 23, 42, 0.06) 5px
  );
  z-index: 1;
}

.tl-bar-actual {
  top: 16px;
  height: 10px;
  opacity: 0.92;
  z-index: 2;
}

.tl-mark {
  position: absolute;
  top: 14px;
  width: 11px;
  height: 11px;
  margin-left: -5px;
  border: 0;
  padding: 0;
  background: #0f172a;
  transform: rotate(45deg);
  z-index: 4;
  cursor: pointer;
}

.tl-mark-decision { background: var(--accent, #0f766e); }
.tl-mark-release { background: var(--c-live, #059669); }
.tl-mark-target { background: #0f172a; }
.tl-mark.is-done { opacity: 0.4; }

.tl-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--danger, #dc2626);
  z-index: 3;
  pointer-events: none;
}

.tl-unscheduled {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-3, #f1f5f9);
  border: 1px dashed var(--border-strong, #cbd5e1);
  border-radius: var(--radius, 10px);
}

.tl-unscheduled h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tl-unscheduled p {
  font-size: 12px;
  color: var(--muted, #475569);
  margin-bottom: 8px;
}

.tl-unscheduled ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tl-unscheduled li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.tl-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tl-dialog {
  background: var(--panel, #fff);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow, 0 1px 2px rgba(15, 23, 42, 0.05));
  padding: 18px 18px 14px;
  width: min(420px, 100%);
}

.tl-dialog h3 { font-size: 16px; margin-bottom: 10px; }

.tl-dialog-err {
  background: #fef2f2;
  color: #991b1b;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
}

.tl-fieldset {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
  display: grid;
  gap: 8px;
}

.tl-fieldset legend {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2, #64748b);
  padding: 0 4px;
}

.tl-hint { font-size: 12px; color: var(--muted, #475569); margin: 8px 0 0; }

.tl-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tl-btn {
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 36px;
  background: var(--panel-2, #f8fafc);
}

.tl-btn-primary {
  background: var(--accent, #0f766e);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

@media (max-width: 720px) {
  .tl-host { padding: 4px 12px 32px; }
  .tl-grid { grid-template-columns: 160px 1fr; min-width: 720px; }
}

@media print {
  .tl-host { padding: 0; }
  .tl-toolbar-controls,
  .tl-mini,
  .tl-expand,
  .tl-dialog-backdrop { display: none !important; }
  .tl-scroll { overflow: visible; border: 0; }
  .tl-grid { min-width: 0; }
  .tl-label, .tl-corner { position: static; }
  .tl-bar-planned { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tl-bar-actual { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
