:root {
  --sw-card-bg: var(--surface-1);
  --sw-card-border: var(--border-default);
  --sw-card-soft: rgba(255, 255, 255, 0.05);
  --sw-text-dim: #8B8B8B;
  --sw-text-soft: #8B8B8B;
  --sw-highlight: #ffd76b;
  --sw-danger: var(--warning);
  --sw-good: var(--success);
  --sw-bad: #c86aa0;
  --sw-muted: var(--foreground-disabled);
  --sw-stitch-0: #7b57bf;
  --sw-stitch-1: #4d79d4;
  --sw-stitch-2: #4da56d;
  --sw-stitch-3: #d98f55;
  --sw-stitch-4: #45b5c4;
  --sw-lane-label-width: 250px;
}

html,
body.swimlane-page {
  overflow: hidden;
  background: var(--background);
}

.sw-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sw-search-group,
.sw-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sw-action-group {
  flex-wrap: nowrap;
}

.sw-search-group {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px;
}

.sw-search-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--foreground-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.sw-search-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.sw-search-input {
  width: 0;
  max-width: 0;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 12px;
  outline: none;
  opacity: 0;
  padding: 0;
  transition: max-width 180ms ease, opacity 120ms ease, padding 180ms ease;
}

.sw-search-group.is-open .sw-search-input {
  width: 220px;
  max-width: 220px;
  opacity: 1;
  padding: 0 4px;
}

.sw-search-nav {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
}

.sw-search-count {
  font-size: 10px;
  color: var(--foreground-secondary);
  min-width: 54px;
  text-align: right;
  padding-right: 6px;
}

.sw-resource-panel {
  position: fixed;
  top: 56px;
  right: 12px;
  width: min(420px, calc(100vw - 24px));
  z-index: 160;
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sw-resource-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sw-resource-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.sw-resource-panel-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--sw-text-dim);
}

.sw-resource-close {
  flex-shrink: 0;
}

.sw-resource-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px 16px;
}

.sw-resource-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-resource-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sw-resource-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.54);
}

.sw-resource-section-note {
  font-size: 11px;
  color: var(--sw-text-dim);
}

.sw-resource-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-resource-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.sw-resource-status-row.is-bound {
  border-color: rgba(91, 115, 255, 0.3);
  background: rgba(91, 115, 255, 0.12);
}

.sw-resource-status-row.is-compare {
  border-color: rgba(255, 214, 107, 0.26);
  background: rgba(255, 214, 107, 0.1);
}

.sw-resource-status-row.is-program {
  border-color: rgba(77, 165, 109, 0.28);
  background: rgba(77, 165, 109, 0.12);
}

.sw-resource-status-row.is-source {
  border-color: rgba(69, 181, 196, 0.28);
  background: rgba(69, 181, 196, 0.12);
}

.sw-resource-status-row.is-muted {
  color: var(--sw-text-dim);
}

.sw-resource-status-label {
  font-size: 11px;
  color: var(--sw-text-dim);
}

.sw-resource-status-value {
  font-size: 12px;
  color: var(--foreground);
  text-align: right;
  word-break: break-word;
}

.sw-resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sw-toggle-group {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-default);
}

.sw-toggle-btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground-secondary);
}

.sw-toggle-btn:last-child {
  border-right: none;
}

.sw-toggle-btn.sw-toggle-active {
  background: rgba(91, 115, 255, 0.16);
  color: #ffffff;
}

.sw-resource-cta {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(91, 115, 255, 0.22);
  border: 1px solid rgba(91, 115, 255, 0.48);
  color: #ffffff;
}

.sw-resource-cta:hover {
  background: rgba(91, 115, 255, 0.28);
  border-color: rgba(91, 115, 255, 0.56);
}

.sw-viewer {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sw-shell {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sw-analysis-row,
.sw-insight-grid {
  display: none;
}

.sw-card {
  background: var(--sw-card-bg);
  border: 1px solid var(--sw-card-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  min-width: 0;
}

.sw-card--filters,
.sw-card--diff {
  min-height: 132px;
}

.sw-card--insight {
  border-color: rgba(123, 87, 191, 0.28);
}

.sw-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sw-card-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground);
}

.sw-card-meta {
  font-size: 11px;
  color: var(--sw-text-dim);
  text-align: right;
}

.sw-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.sw-filter-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.sw-filter-block--controls {
  align-items: flex-end;
  flex-wrap: wrap;
}

.sw-filter-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-text-soft);
  min-width: 48px;
  padding-top: 7px;
}

.sw-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.sw-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--foreground-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.sw-chip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.sw-chip-btn.is-active {
  background: rgba(91, 115, 255, 0.18);
  border-color: rgba(91, 115, 255, 0.42);
  color: #ffffff;
}

.sw-chip-btn.is-muted {
  opacity: 0.45;
}

.sw-chip-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sw-select-label {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
}

.sw-select {
  height: 32px;
  min-width: 140px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
  font-size: 12px;
  padding: 0 10px;
  outline: none;
}

.sw-select:focus {
  border-color: rgba(91, 115, 255, 0.45);
}

.sw-inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sw-chart-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sw-chart-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sw-chart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px 4px;
  flex-shrink: 0;
}

.sw-chart-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.sw-chart-panel-meta {
  font-size: 11px;
  color: var(--sw-text-dim);
}

.sw-data-mode-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 4px 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.sw-data-mode-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.sw-data-mode-label,
.sw-controls-section-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-text-soft);
}

.sw-view-mode-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.sw-view-mode-btn {
  min-width: 58px;
}

.sw-status-pill-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.sw-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.sw-status-pill.is-bound {
  border-color: rgba(91, 115, 255, 0.32);
  background: rgba(91, 115, 255, 0.12);
}

.sw-status-pill.is-compare {
  border-color: rgba(255, 214, 107, 0.28);
  background: rgba(255, 214, 107, 0.11);
}

.sw-status-pill.is-program {
  border-color: rgba(77, 165, 109, 0.3);
  background: rgba(77, 165, 109, 0.12);
}

.sw-status-pill.is-source {
  border-color: rgba(69, 181, 196, 0.28);
  background: rgba(69, 181, 196, 0.12);
}

.sw-status-pill.is-muted {
  opacity: 0.7;
}

.sw-status-pill-label {
  font-size: 10px;
  color: var(--sw-text-dim);
}

.sw-status-pill-value {
  font-size: 11px;
  color: var(--foreground);
}

.sw-grid {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: var(--sw-lane-label-width) minmax(0, 1fr);
  grid-template-rows: 46px 1fr;
  border: 1px solid var(--sw-card-border);
  overflow: hidden;
  background: rgba(20, 20, 20, 0.94);
}

.sw-lane-header {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-timeline-viewport {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-timeline-track {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  will-change: transform;
}

.sw-tick-major,
.sw-tick-minor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
}

.sw-tick-major {
  background: rgba(255, 255, 255, 0.16);
}

.sw-tick-minor {
  top: 18px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sw-tick-label,
.sw-tick-sub {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--foreground-muted);
}

.sw-tick-label {
  top: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.sw-tick-sub {
  top: 26px;
  font-size: 10px;
  color: var(--foreground-secondary);
}

.sw-lane-label-viewport {
  position: relative;
  overflow: hidden;
  background: rgba(14, 14, 18, 0.80);
}

.sw-lane-label-track {
  position: absolute;
  inset: 0 0 auto 0;
  will-change: transform;
}

.sw-lane-label-row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 12px;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: transparent;
  overflow: hidden;
  transition: background 120ms ease;
  text-align: left;
}

.sw-lane-label-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sw-lane-label-row.is-selected {
  background: rgba(91, 115, 255, 0.14);
}

.sw-lane-label-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 120ms ease;
}

.sw-lane-label-row:hover::before,
.sw-lane-label-row.is-selected::before {
  background: rgba(91, 115, 255, 0.7);
}

.sw-lane-label-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sw-lane-label-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.sw-lane-label-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

.sw-lane-label-row:hover .sw-lane-label-meta {
  display: block;
}

.sw-lane-label-count {
  flex-shrink: 0;
  text-align: right;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.32);
  font-family: var(--foreground-muted);
  padding-left: 6px;
}

.sw-lane-main-viewport {
  position: relative;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015)),
    radial-gradient(circle at top, rgba(255,255,255,0.04), transparent 36%);
}

.sw-lane-main-track {
  position: relative;
}

.sw-lane-row {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sw-gap {
  position: absolute;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(201, 16, 125, 0.08), rgba(201, 16, 125, 0.03));
  border: 1px dashed rgba(201, 16, 125, 0.24);
  pointer-events: none;
}

.sw-gap.is-strong {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.10), rgba(249, 115, 22, 0.03));
  border-color: rgba(249, 115, 22, 0.28);
}

.sw-bar {
  position: absolute;
  display: flex;
  align-items: stretch;
  padding: 0;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  opacity: 0.98;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease, filter 120ms ease;
  overflow: hidden;
}

.sw-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.sw-bar.is-dimmed {
  opacity: 0.22;
  filter: saturate(0.75);
}

.sw-bar.is-match {
  box-shadow: 0 0 0 2px var(--sw-highlight);
}

.sw-bar.is-active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px rgba(255, 255, 255, 0.08);
  z-index: 4;
}

.sw-bar.is-compare-hit {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.sw-bar-segments {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  pointer-events: none;
}

.sw-bar-segment {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
  text-transform: uppercase;
}

.sw-bar-segment + .sw-bar-segment {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.14);
}

.sw-bar-segment-in,
.sw-bar-segment-out {
  flex: 0 0 22%;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.4);
}

.sw-bar-segment-compute {
  flex: 1 1 auto;
  justify-content: flex-start;
  padding: 0 5px;
  text-transform: none;
  background: rgba(0, 0, 0, 0.16);
}

.sw-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.sw-ruler-line,
.sw-marker-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
}

.sw-ruler-line {
  background: rgba(255, 255, 255, 0.24);
}

.sw-marker-line {
  background: rgba(121, 192, 255, 0.30);
}

.sw-ruler-tag,
.sw-marker-flag {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--foreground-muted);
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.sw-ruler-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.sw-marker-flag {
  background: rgba(121, 192, 255, 0.16);
  color: #cce4ff;
  pointer-events: auto;
  cursor: pointer;
}

.sw-range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(121, 192, 255, 0.12);
  border-left: 1px solid rgba(121, 192, 255, 0.40);
  border-right: 1px solid rgba(121, 192, 255, 0.40);
}

.sw-range-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(121, 192, 255, 0.12);
  border: 1px solid rgba(121, 192, 255, 0.22);
  color: #cce4ff;
  font-size: 10px;
  font-family: var(--foreground-muted);
}

.sw-metric-list,
.sw-ranked-list,
.sw-diff-list,
.sw-explanation {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-metric-list--spacious {
  gap: 10px;
}

.sw-metric-row,
.sw-ranked-item,
.sw-diff-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sw-ranked-item-main,
.sw-diff-item-main {
  min-width: 0;
}

.sw-ranked-item-title,
.sw-diff-item-title,
.sw-explanation-title {
  font-size: 12px;
  color: var(--foreground);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-ranked-item-sub,
.sw-diff-item-sub,
.sw-metric-row-sub,
.sw-explanation-body {
  font-size: 11px;
  color: var(--sw-text-dim);
  line-height: 1.45;
}

.sw-ranked-item-value,
.sw-diff-item-value,
.sw-metric-row-value {
  font-size: 11px;
  font-family: var(--foreground-muted);
  color: var(--foreground);
  white-space: nowrap;
  flex-shrink: 0;
}

.sw-diff-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.sw-diff-metric {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sw-diff-metric-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-text-soft);
  margin-bottom: 4px;
}

.sw-diff-metric-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}

.sw-diff-metric-value.is-good {
  color: #8fe2a8;
}

.sw-diff-metric-value.is-bad {
  color: #ffb689;
}

.sw-explanation-empty,
.sw-list-empty {
  color: var(--sw-text-dim);
  font-size: 11px;
  line-height: 1.5;
}

.sw-explanation-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(123, 87, 191, 0.08);
  border: 1px solid rgba(123, 87, 191, 0.16);
}

.sw-explanation-body code {
  color: #d6c7ff;
}

.sw-detail-panel {
  width: 320px;
}

.sw-detail-subhead {
  padding: 0 12px 10px;
  font-size: 11px;
  color: var(--sw-text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sw-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sw-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
}

.sw-detail-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.sw-detail-note {
  font-size: 11px;
  color: var(--sw-text-dim);
  line-height: 1.5;
}

.sw-detail-anchor {
  color: #cce4ff;
}

.sw-empty-state,
.sw-empty-card {
  display: contents;
}

@media (max-width: 1024px) {
  :root {
    --sw-lane-label-width: 210px;
  }

  .sw-search-group.is-open .sw-search-input {
    width: 160px;
    max-width: 160px;
  }

  .sw-resource-panel {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .sw-data-mode-bar,
  .sw-chart-controls {
    align-items: flex-start;
  }
}

/* ─── Chart Controls Strip ───────────────────────────────────────────────── */

.sw-chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.sw-chart-controls-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 0 0 auto;
}

.sw-chart-controls-section--mode {
  flex: 0 0 auto;
}

.sw-chart-controls-section--quick {
  flex: 0 0 auto;
}

.sw-chart-controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.sw-chart-controls .sw-select {
  height: 24px;
  font-size: 11px;
  min-width: 96px;
  padding: 0 7px;
}

.sw-chart-controls .btn {
  height: 24px;
  padding: 0 8px;
  font-size: 10px;
  border-radius: 7px;
}

.sw-chart-controls .sw-filter-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-text-soft);
  padding-top: 0;
  min-width: auto;
}

.sw-chart-controls .sw-chip-btn {
  padding: 2px 7px;
  font-size: 10px;
  min-height: 22px;
}

.sw-chart-controls .sw-toggle-group,
.sw-chart-controls .sw-view-mode-group,
.sw-chart-controls .sw-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.sw-more-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.sw-more-menu-btn {
  min-width: 0;
}

.sw-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  min-width: 280px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(24, 24, 28, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sw-more-menu-section + .sw-more-menu-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sw-more-menu-title {
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-text-soft);
}

.sw-more-menu .sw-chart-controls-row + .sw-chart-controls-row {
  margin-top: 6px;
}

.sw-more-menu .sw-chart-controls-row {
  justify-content: space-between;
}

.sw-more-menu .sw-select {
  min-width: 156px;
}

.sw-chart-controls .sw-toggle-group {
  border: none;
  overflow: visible;
  border-radius: 0;
}

.sw-chart-controls .sw-toggle-btn,
.sw-chart-controls .sw-view-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground-secondary);
  min-width: 0;
}

.sw-chart-controls .sw-toggle-btn:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sw-chart-controls .sw-toggle-btn.sw-toggle-active,
.sw-chart-controls .sw-view-mode-btn.is-active,
.sw-chart-controls .btn.btn-primary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

.sw-controls-section-label {
  display: none;
}

.sw-status-pill-row {
  margin-left: auto;
  gap: 6px;
}

.sw-status-pill {
  padding: 3px 8px;
}

.sw-status-pill-label {
  font-size: 9px;
}

.sw-status-pill-value {
  font-size: 10px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Diff Inline Strip ──────────────────────────────────────────────────── */

.sw-diff-inline {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

/* ─── Journey Guidance Panel ─────────────────────────────────────────────── */

.sw-journey-panel {
  position: fixed;
  right: 16px;
  top: 166px;
  bottom: 16px;
  width: 280px;
  z-index: 200;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #292929;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.sw-journey-panel--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
}

.sw-journey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sw-journey-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.54);
}

.sw-journey-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.46);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.sw-journey-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
}

.sw-journey-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 12px 16px;
  flex: 1;
  min-height: 0;
}

.sw-journey-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-journey-card-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}

.sw-journey-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}

.sw-journey-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sw-journey-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 2px 0;
}

.sw-journey-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sw-journey-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.02em;
}

.sw-journey-stat-value {
  font-size: 12px;
  font-family: var(--foreground-muted);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}

.sw-journey-stat-value.is-warn {
  color: #f97316;
}

.sw-journey-stat-value.is-good {
  color: #4da56d;
}

.sw-journey-diagnosis {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.sw-journey-empty-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.32);
  line-height: 1.5;
  font-style: italic;
}

.sw-journey-card-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sw-journey-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  text-align: center;
  justify-content: center;
  width: 100%;
}

.sw-journey-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sw-journey-btn.is-stub {
  opacity: 0.52;
  cursor: default;
}

.sw-journey-btn.is-stub:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.72);
}

.sw-journey-program-bound {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(77, 165, 109, 0.1);
  border: 1px solid rgba(77, 165, 109, 0.22);
  color: #8fe2a8;
  word-break: break-all;
}

.sw-journey-program-bound .sw-journey-bound-check {
  color: #4da56d;
  font-size: 13px;
  flex-shrink: 0;
}

.sw-journey-program-bound.is-folder {
  background: rgba(77, 121, 212, 0.1);
  border-color: rgba(77, 121, 212, 0.22);
  color: #aecdff;
}

.sw-journey-program-bound.is-folder .sw-journey-bound-check {
  color: #7fa9ff;
}

.sw-journey-program-bound.is-empty {
  width: 100%;
  justify-content: center;
  border-style: dashed;
  color: var(--sw-text-dim);
  background: rgba(255, 255, 255, 0.03);
}

/* Journey toggle button — always visible at top-right, hidden when panel is open */
.sw-journey-toggle {
  position: fixed;
  right: 16px;
  top: 166px;
  z-index: 201;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(18, 19, 24, 0.94);
  color: rgba(255, 255, 255, 0.60);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, opacity 160ms ease;
}

.sw-journey-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sw-journey-toggle--hidden {
  opacity: 0;
  pointer-events: none;
}

/* === Task Popup === */
.sw-task-popup {
  position: fixed;
  z-index: 300;
  background: rgba(26,29,38,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  width: 320px;
  max-height: 480px;
  overflow-y: auto;
  backdrop-filter: blur(8px);
}
.sw-task-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sw-task-popup-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(123,87,191,0.25);
  color: #cdb8ff;
}
.sw-task-popup-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #e8eaf0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-task-popup-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.sw-task-popup-close:hover { color: rgba(255,255,255,0.8); }
.sw-task-popup-body {
  padding: 12px 14px;
}
.sw-popup-section { margin-bottom: 14px; }
.sw-popup-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
}
.sw-popup-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
}
.sw-popup-row-key { color: rgba(255,255,255,0.4); }
.sw-popup-row-val { color: rgba(255,255,255,0.85); font-family: monospace; }
.sw-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.sw-popup-action-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
  transition: background 0.15s;
}
.sw-popup-action-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sw-popup-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Split View === */
.sw-split-container {
  position: fixed;
  inset: 0;
  top: 48px; /* below toolbar */
  display: flex;
  flex-direction: column;
  z-index: 150;
  background: var(--background, #12131a);
}
.sw-split-top {
  display: flex;
  flex-direction: column;
  min-height: 80px;
  height: var(--split-top-h, 45%);
  overflow: hidden;
}
.sw-split-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sw-split-top-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.6); }
.sw-split-close-btn { margin-left: auto; }
.sw-split-iframe {
  flex: 1;
  border: none;
  width: 100%;
}
.sw-split-divider {
  height: 5px;
  background: rgba(255,255,255,0.06);
  cursor: row-resize;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s;
}
.sw-split-divider:hover, .sw-split-divider.is-dragging {
  background: rgba(91,115,255,0.4);
}
.sw-split-bottom {
  flex: 1;
  overflow: hidden;
  min-height: 80px;
}

/* === Dependency Lines === */
.sw-dep-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 10;
}
.sw-dep-overlay .dep-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.7;
}
.sw-dep-line-in { stroke: rgba(77,121,212,0.85); }
.sw-dep-line-out { stroke: rgba(217,143,85,0.85); }
.sw-dep-dot {
  cursor: pointer;
  pointer-events: all;
  transition: r 0.15s;
}
.sw-dep-dot:hover { opacity: 1; }
.sw-dep-dot-in { fill: rgba(77,121,212,0.9); }
.sw-dep-dot-out { fill: rgba(217,143,85,0.9); }
