/* Executive Product & R&D Roadmap — compact meeting view */

:root {
  --font-stack: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --color-navy: #1e3a5f;
  --color-project: #c2410c;
  --color-project-soft: #fff7ed;
  --color-project-text: #7c2d12;
  --color-rd: #0f766e;
  --color-rd-text: #115e59;
  --color-rd-muted: #3f6f6a;
  --color-rd-soft: #f0fdfa;
  --color-rd-border: #5eead4;
  --color-rd-accent: #0d9488;
  --color-bg: #f6f8fb;
  --color-surface: #ffffff;
  --color-lane-alt: #f2f5f9;
  --color-text: #16324f;
  --color-muted: #6b7280;
  --color-border: #e5eaf1;
  --color-month-divider: #cbd5e1;
  --color-week-divider: #e5eaf1;
  --color-today: #d94f3d;

  --project-col-width: 140px;
  --timeline-edge-pad: 80px;
  --month-count: 9;
  --month-min-width: 112px;
  --month-header-height: 78px;
  --year-band-height: 26px;
  --month-row-height: 48px;
  --line-thickness: 4px;
  --pin-size: 9px;
  --card-width: 118px;
  --rd-label-width: 128px;
  --level-step: 42px;
  --connector-base: 4px;

  --shadow-sm: 0 1px 3px rgba(23, 54, 93, 0.07);
  --shadow-card: 0 1px 4px rgba(23, 54, 93, 0.09);
  --shadow-header: 0 2px 6px rgba(23, 54, 93, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-stack);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

.dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1920px;
  margin: 0 auto;
  padding: 14px 20px 12px;
  gap: 10px;
}

/* ── Header ── */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.header-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.header-logo {
  display: block;
  height: 52px;
  width: auto;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.subtitle {
  margin: 3px 0 0;
  font-size: 0.86rem;
  color: var(--color-muted);
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.view-toggle-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.view-mode-hint {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: #eef2f7;
  border: 1px solid #d8e0ea;
  gap: 2px;
}

.view-toggle__btn {
  border: none;
  background: transparent;
  color: #4b5d73;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.view-toggle__btn:hover:not(.view-toggle__btn--active-projects):not(.view-toggle__btn--active-teams) {
  color: var(--color-navy);
  background: rgba(255, 255, 255, 0.55);
}

.view-toggle__btn.view-toggle__btn--active-projects {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.view-toggle__btn.view-toggle__btn--active-teams {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.22);
}

.view-toggle__btn.view-toggle__btn--active-projects:hover,
.view-toggle__btn.view-toggle__btn--active-teams:hover {
  color: #ffffff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1.2;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.legend-swatch--project {
  background: var(--color-project);
}

.legend-swatch--rd {
  background: var(--color-rd);
  border-radius: 50%;
}

.legend-swatch--delayed {
  background: #fff;
  border: 1.5px solid #e67e22;
}

.timeline-guide {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-top: 2px;
  line-height: 1.25;
  user-select: none;
}

.timeline-guide__row {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.timeline-guide__row--project {
  color: #2f6bdb;
}

.timeline-guide__row--line {
  color: #64748b;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.timeline-guide__row--rd {
  color: #c2410c;
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--color-muted);
}

.toolbar-field--search {
  min-width: 160px;
}

.toolbar-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toolbar select,
.toolbar input[type="search"] {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--color-text);
  background: var(--color-surface);
  min-width: 120px;
}

.toolbar-field--checkbox {
  min-width: auto;
}

.toolbar-checkboxes {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 30px;
}

.toolbar-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--color-text);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.toolbar-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--color-navy);
  cursor: pointer;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-navy);
  color: #fff;
}

.btn--primary:hover {
  background: #1e4a7a;
}

.btn--secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-navy);
}

.btn--secondary:hover {
  background: var(--color-bg);
}

.btn--contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  height: 34px;
  padding: 0 14px;
  background: #0e7490;
  border-color: #0a5c72;
  color: #fff;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
}

.btn--contact:hover {
  background: #0c667f;
  color: #fff;
}

#btn-exec-summary {
  background: #0e7490;
  border-color: #0a5c72;
  color: #fff;
  font-weight: 700;
}

#btn-exec-summary:hover {
  background: #0c667f;
  border-color: #0a5c72;
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-muted);
}

.btn--ghost:hover {
  color: var(--color-navy);
  background: var(--color-bg);
}

/* ── Scroll shell ── */
.roadmap-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.roadmap-frozen-header {
  display: block;
  flex-shrink: 0;
  z-index: 30;
  box-sizing: border-box;
  background: var(--color-bg);
  border-bottom: none;
}

.roadmap-frozen-header[hidden] {
  display: none;
}

/* Month bar only over the timeline — not over the project/team label column */
.roadmap-frozen-header__months {
  box-sizing: border-box;
  margin-left: var(--project-col-width);
  width: calc(100% - var(--project-col-width));
  height: var(--month-header-height);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  background: #eaf3fb;
  border-bottom: 1px solid #bfd1e3;
}

.timeline-inner--months {
  min-height: var(--month-header-height);
}

.month-header-block {
  position: relative;
  width: 100%;
}

.year-header-track {
  position: relative;
  width: 100%;
  height: var(--year-band-height);
  background: #e3eef8;
  border-bottom: 1px solid #c9d9ea;
}

.year-header-track--single {
  background: #eaf3fb;
}

.year-header-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1f4e79;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 6px;
}

.year-header-track--single .year-header-cell {
  justify-content: flex-start;
  padding-left: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  opacity: 0.9;
}

.year-header-sep {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #bfd1e3;
  pointer-events: none;
  z-index: 1;
}

.dashboard-teams-view .roadmap-frozen-header {
  background: #f5f9fa;
}

.dashboard-teams-view .roadmap-shell {
  background: #f5f9fa;
}

.dashboard-teams-view .roadmap-labels-col {
  background: #f5f9fa;
}

.dashboard-teams-view .month-label-spacer {
  background: #eaf3fb;
  border-bottom: 1px solid #bfd1e3;
}

.dashboard-teams-view .lane-label-cell {
  border-bottom-color: #d8e4e6;
}

.dashboard-teams-view .lane-track {
  background: #f8fbfb;
}

.dashboard-teams-view .lane-track--alt {
  background: #f1f7f7;
}

.dashboard-teams-view .month-header-track {
  background: #eaf3fb;
}

.dashboard-teams-view .month-header-cell {
  color: #1f4e79;
}

.dashboard-teams-view .month-header-sep {
  background: #c9d9ea;
}

.dashboard-teams-view .timeline-grid__line--month {
  background: #b9cdd1;
}

.dashboard-teams-view .timeline-grid__line--week {
  background: #d8e4e6;
}

.roadmap-scroll {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* ── Two-column layout ── */
.roadmap-layout {
  display: flex;
  align-items: stretch;
  min-height: 100%;
}

.roadmap-labels-col {
  width: var(--project-col-width);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 25;
  background: var(--color-bg);
}

.month-label-spacer {
  height: var(--month-header-height);
  background: #eaf3fb;
  border-bottom: 1px solid #bfd1e3;
}

.lane-label-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
}

.lane-label-card {
  width: 100%;
  padding: 10px 8px;
  background: #0e7490;
  color: #ffffff;
  border: 1px solid #0a5c72;
  font-weight: 700;
  font-size: 1.0625rem;
  text-align: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  line-height: 1.25;
  word-break: break-word;
  transition: background 0.15s ease;
}

.lane-label-card--with-features {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px 8px;
}

.lane-label-card--with-features .lane-label-card__name {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.25;
}

.lane-feature-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  margin: 2px 0 0;
  padding: 6px 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #eef8fb 100%);
  color: #0e7490;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(10, 60, 75, 0.22);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.lane-feature-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #0a5c72;
  box-shadow: 0 3px 10px rgba(10, 60, 75, 0.28);
  transform: translateY(-1px);
}

.lane-feature-btn:focus-visible {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
}

.lane-feature-btn__icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.9;
}

.lane-feature-btn__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lane-label-card:hover {
  background: #0c667f;
}

.lane-label-card--team {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 10px 11px;
  box-shadow: var(--shadow-sm);
}

.dashboard-teams-view .lane-label-card--team {
  background: #5f8f7b;
  border-color: #48715f;
}

.dashboard-teams-view .lane-label-card--team:hover {
  background: #4f7c69;
}

.lane-label-card__name {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.lane-label-card__count {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.milestone-project-badge {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge-bg, rgba(30, 58, 95, 0.08));
  color: var(--badge-text, var(--color-project-text));
  border: 1px solid var(--badge-border, rgba(30, 58, 95, 0.14));
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.dashboard--teams .milestone-project-badge {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 10px;
  padding: 1px 6px;
  text-align: center;
  line-height: 1.3;
}

.dashboard--teams .lane-track .lane-line {
  background: #5b7fa6;
}

.dashboard--teams .milestone-card--team {
  background: #fff;
  color: var(--color-navy);
  border-left: 3px solid var(--color-project);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 1px 4px rgba(23, 54, 93, 0.1);
}

.dashboard--teams .milestone-card--team-project .milestone-title {
  color: #16324f;
}

.dashboard--teams .milestone-label--team {
  background: #fff;
  color: #16324f;
  border-top: 2px solid var(--color-rd);
  box-shadow: 0 1px 4px rgba(23, 54, 93, 0.1);
}

.dashboard--teams .milestone--project .milestone-pin {
  color: var(--color-project);
}

.dashboard--teams .milestone--rd .milestone-pin {
  color: var(--color-rd);
}

.dashboard--teams .milestone-card--team .milestone-meta--badge,
.dashboard--teams .milestone-label--team .rd-label-meta--badge {
  margin: 2px 0 1px;
  line-height: 1.2;
}

.dashboard--teams .milestone-card--team .milestone-meta--flow,
.dashboard--teams .milestone-label--team .rd-label-meta--flow {
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-muted);
}

.dashboard--teams .milestone-card--team .milestone-title,
.dashboard--teams .milestone-label--team .rd-label-title {
  color: #16324f;
  font-weight: 600;
}

.dashboard--teams .milestone-card--team .milestone-date,
.dashboard--teams .milestone-label--team .milestone-date {
  color: #334155;
  font-weight: 600;
}

.dashboard--teams .milestone--rd .rd-flow-line {
  color: var(--color-muted);
}

.milestone-card--team .milestone-title {
  -webkit-line-clamp: 2;
}

.milestone-delayed-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.milestone-card--grouped .milestone-delayed-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  margin-top: 0;
}

.milestone-date--change {
  font-weight: 700;
  white-space: nowrap;
}

.tooltip-delayed {
  margin-top: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #b42318;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tooltip .tooltip-row {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

.tooltip.tooltip--teams .tooltip-row {
  color: #475569;
}

.tooltip.tooltip--teams .tooltip-delayed {
  color: #b42318;
}

.tooltip.tooltip--teams {
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  z-index: 1200;
  border-radius: 8px;
  padding: 10px 12px;
}

.tooltip.tooltip--teams strong {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 700;
}

.tooltip.tooltip--teams .tooltip-row {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
}

.tooltip.tooltip--teams .tooltip-scope {
  margin-top: 6px;
  font-size: 0.76rem;
  color: #0f766e;
  line-height: 1.45;
  opacity: 1;
}

.roadmap-timeline-col {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.timeline-inner {
  position: relative;
  box-sizing: border-box;
  min-width: max(100%, calc(var(--month-count) * var(--month-min-width)));
}

.timeline-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.timeline-grid__line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
}

.timeline-grid__line--month {
  width: 2px;
  margin-left: -1px;
  background: var(--color-month-divider);
}

.timeline-grid__line--week {
  background: var(--color-week-divider);
}

/* Month header — same date fractions as timeline grid / milestones */
.month-header-track {
  position: relative;
  display: block;
  width: 100%;
  height: var(--month-row-height);
  background: #eaf3fb;
}

.month-header-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1f4e79;
  text-transform: uppercase;
  overflow: visible;
  white-space: nowrap;
  padding: 0 8px;
  border: none;
  min-width: 48px;
}

.month-header-cell:first-child {
  justify-content: flex-start;
  padding-left: 10px;
}

.month-header-sep {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #c9d9ea;
  pointer-events: none;
  z-index: 1;
}

/* Today line */
.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  background: transparent;
  border-left: 2px dotted var(--color-today);
  z-index: 8;
  pointer-events: none;
  transform: translateX(-50%);
}

.today-line__label {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-today);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: auto;
  cursor: default;
}

.today-line__label[data-date]:hover::after {
  content: attr(data-date);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #172b44;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  z-index: 12;
}

/* Project lane */
.lane-track {
  position: relative;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.lane-track--alt {
  background: var(--color-lane-alt);
}

.lane-track > .timeline-grid {
  z-index: 0;
}

.lane-line {
  position: absolute;
  left: var(--timeline-edge-pad, 80px);
  right: var(--timeline-edge-pad, 80px);
  top: 50%;
  transform: translateY(-50%);
  height: var(--line-thickness);
  background: var(--color-navy);
  border-radius: calc(var(--line-thickness) / 2);
  z-index: 1;
}

/* Milestones — pin on timeline line, short stem to card */
.milestone {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.milestone-pin {
  position: absolute;
  left: 0;
  width: var(--pin-size);
  height: var(--pin-size);
  border-radius: 50%;
  background: currentColor;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 1px currentColor;
  z-index: 4;
  pointer-events: none;
}

.milestone--below .milestone-pin {
  top: 0;
  transform: translate(-50%, -50%);
}

.milestone--above .milestone-pin {
  bottom: 0;
  transform: translate(-50%, 50%);
}

.milestone-lead {
  position: absolute;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--card-width);
  transform: translateX(-50%);
  pointer-events: none;
}

.milestone-hit {
  pointer-events: auto;
  cursor: pointer;
  position: relative;
}

.milestone--below .milestone-lead {
  top: 0;
  margin-top: calc(var(--pin-size) / 2 - 1px);
}

.milestone--above .milestone-lead {
  bottom: 0;
  margin-bottom: calc(var(--pin-size) / 2);
  flex-direction: column-reverse;
}

.milestone:hover,
.milestone:has(.milestone-hit:hover) {
  z-index: 15;
}

.milestone-hit:hover {
  z-index: 1;
}

.dashboard--teams .milestone:has(.milestone-hit:hover) {
  z-index: 40;
}

.milestone-stem {
  width: 1.5px;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
  border-radius: 1px;
  pointer-events: none;
}

.milestone-card {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  border-left: 3px solid currentColor;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-surface);
}

.milestone--project { color: var(--color-project); }
.milestone--project .milestone-card {
  background: var(--color-project-soft);
  border-left: 4px solid var(--color-project);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.14);
}

.milestone--project .milestone-lead:hover .milestone-card,
.milestone--project .milestone-card:focus-within {
  background: #c2410c;
  border-left-color: #9a3412;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.35);
}

.milestone--project .milestone-lead:hover .milestone-title,
.milestone--project .milestone-card:focus-within .milestone-title,
.milestone--project .milestone-lead:hover .milestone-group-summary,
.milestone--project .milestone-card:focus-within .milestone-group-summary,
.milestone--project .milestone-lead:hover .milestone-meta,
.milestone--project .milestone-card:focus-within .milestone-meta,
.milestone--project .milestone-lead:hover .milestone-date,
.milestone--project .milestone-card:focus-within .milestone-date {
  color: #ffffff;
}

.milestone--project .milestone-lead:hover .milestone-count-badge,
.milestone--project .milestone-card:focus-within .milestone-count-badge {
  background: #fff7ed;
  color: #c2410c;
}

.milestone--project .milestone-lead:hover .milestone-card--grouped::before,
.milestone--project .milestone-card--grouped:focus-within::before {
  background: rgba(255, 255, 255, 0.9);
  border-color: #ffffff;
  box-shadow: 2px 2px 0 rgba(154, 52, 18, 0.35);
}

.milestone-card--grouped {
  position: relative;
  padding-right: 26px;
}

.milestone-title--stacked {
  margin-top: 2px;
  font-size: 11.5px;
  -webkit-line-clamp: 1;
}

.milestone-group-summary {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-project-text);
}

.milestone-count-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-project);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(30, 58, 95, 0.2);
}

.milestone-card--grouped::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 28px;
  width: 10px;
  height: 12px;
  border: 1.5px solid var(--color-project);
  border-radius: 2px;
  background: rgba(234, 242, 255, 0.85);
  box-shadow: 2px 2px 0 rgba(59, 130, 246, 0.25);
  opacity: 0.85;
}

.milestone--rd { color: var(--color-rd); }

.milestone-lead--rd {
  width: var(--rd-label-width, 112px);
}

.milestone-label {
  width: 100%;
  padding: 1px 4px;
  background: transparent;
  box-shadow: none;
  border: none;
  text-align: center;
  flex-shrink: 0;
}

.rd-label-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-rd-text);
  word-break: break-word;
}

.milestone-meta,
.milestone-date {
  color: #000000;
  font-size: 13.5px;
  font-weight: 500;
}

.rd-label-title .milestone-date {
  font-size: 13.5px;
  font-weight: 700;
  color: #000000;
}

.rd-label-meta {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-rd-muted);
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.rd-label-meta .milestone-date {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
}

.rd-label-flow {
  display: block;
  margin-bottom: 2px;
}

.rd-flow-line {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-rd-muted);
}

.rd-more-link {
  margin: 3px 0 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-rd);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rd-more-link:hover {
  color: #c45a1a;
}

.milestone-lead:hover .milestone-card {
  box-shadow: 0 3px 10px rgba(23, 54, 93, 0.14);
}

.milestone-lead--rd:hover .rd-label-title {
  color: var(--color-rd);
}

.rd-detail-flows {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 0.86rem;
  color: var(--color-text);
}

.rd-detail-flows li {
  margin: 2px 0;
}

.milestone-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-project-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.milestone-meta {
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.milestone--hidden { display: none; }

/* ── Tooltip ── */
.tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 340px;
  padding: 10px 12px;
  background: var(--color-navy);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.45;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.tooltip strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0;
}

.tooltip .tooltip-scope {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #22d3ee;
  opacity: 1;
}

.tooltip .tooltip-item + .tooltip-item {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.detail-group-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin: 4px 0 8px;
  background: var(--color-border);
}

.tooltip .tooltip-row { opacity: 0.88; }

/* ── Detail dialog ── */
.detail-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 420px;
  width: 90vw;
  box-shadow: 0 12px 40px rgba(23, 54, 93, 0.22);
  font-family: var(--font-stack);
}

.detail-dialog::backdrop {
  background: rgba(23, 54, 93, 0.35);
}

.detail-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.detail-dialog__header h2 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--color-navy);
  line-height: 1.35;
  word-break: break-word;
}

.detail-dialog__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}

.detail-dialog__close:hover {
  color: var(--color-navy);
  background: var(--color-border);
}

.detail-dialog__body {
  margin: 0;
  padding: 14px 18px 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}

.detail-dialog__body dt {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-dialog__body dd {
  margin: 0;
  font-size: 0.86rem;
  color: var(--color-text);
}

.detail-dialog__body dd.detail-scope {
  color: #0f766e;
  font-weight: 600;
}

.feature-list-dialog {
  max-width: 720px;
}

.feature-list-dialog__body {
  position: relative;
  padding: 0 0 10px;
  max-height: min(70vh, 560px);
  overflow: auto;
}

.feature-list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 110px;
  gap: 14px;
  align-items: center;
  padding: 10px 20px;
  background: #eaf3fb;
  border-bottom: 1px solid #bfd1e3;
  box-shadow: 0 1px 0 rgba(23, 54, 93, 0.06);
}

.feature-list-head__col {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f4e79;
}

.feature-list-head__col--teams,
.feature-list-head__col--drop {
  text-align: center;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.feature-list__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 110px;
  gap: 14px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.feature-list__item:last-child {
  border-bottom: none;
}

.feature-list__empty {
  grid-column: 1 / -1;
  padding: 18px 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.feature-list__name {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.35;
}

.feature-list__teams {
  display: flex;
  justify-content: center;
}

.feature-list__drop {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #075985;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.feature-list__drop.is-empty {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
  font-weight: 600;
}

.feature-involvement {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 150px;
}

.feature-involvement__labels,
.feature-involvement__cells {
  display: grid;
  grid-template-columns: repeat(4, 28px);
  gap: 6px;
  justify-content: center;
}

.feature-involvement__label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #1e293b;
  line-height: 1;
}

.feature-involvement__cell {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border: 1.5px solid #1f2937;
  border-radius: 2px;
  background: #fff;
}

.feature-involvement__cell.is-active {
  background: #b8e0c8;
  border-color: #1f2937;
}

.error-message {
  padding: 40px;
  text-align: center;
  color: #c0392b;
}

.dashboard-data-warning {
  margin: 0 20px 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #f0c36d;
  background: #fff8e6;
  color: #7a5b14;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Compact density for many projects */
.dashboard--compact {
  --card-width: 110px;
  --level-step: 38px;
}

.dashboard--dense {
  --card-width: 105px;
  --level-step: 36px;
}

.milestone-label--chip {
  width: 100%;
  padding: 5px 7px 5px 8px;
  border-radius: 10px;
  background: var(--owner-bg, var(--color-rd-soft));
  border: 1px solid var(--owner-border, var(--color-rd-border));
  border-left: 3px solid var(--owner-accent, var(--color-rd-accent));
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.1);
  text-align: left;
  box-sizing: border-box;
}

.rd-chip-name {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--owner-text, var(--color-rd-text));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.rd-chip-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 3px;
}

.rd-chip-date {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.rd-chip-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--owner-text, var(--color-rd-text));
  background: color-mix(in srgb, var(--owner-accent, var(--color-rd-accent)) 12%, #fff);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.4;
}

.rd-chip-owner {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--owner-text, var(--color-rd-text));
  background: color-mix(in srgb, var(--owner-accent, var(--color-rd-accent)) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--owner-accent, var(--color-rd-accent)) 35%, #fff);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.milestone-label--multi-owner {
  --owner-accent: #0d9488;
  --owner-bg: #f0fdfa;
  --owner-border: #99f6e4;
  --owner-text: #115e59;
}

.milestone-delayed-badge--compact {
  margin-top: 3px;
  padding: 0;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.milestone-lead--rd {
  width: 118px;
}

@media print {
  body { overflow: visible; }
  .toolbar { display: none; }
  .dashboard { max-width: none; height: auto; padding: 0; }
  .roadmap-shell { box-shadow: none; }
  .roadmap-scroll { overflow: visible; height: auto; }
  .roadmap-timeline-col { overflow: visible; }
}

@media (max-height: 900px) {
  .dashboard { padding: 10px 16px 8px; }
  .dashboard-header h1 { font-size: 1.28rem; }
}
