:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --status-neutral: #898781;
  --status-merged: #4a3aa7;

  --lane-velero: #2a78d6;
  --lane-oadp: #eb6834;
  --lane-datamover: #1baf7a;
  --lane-kubernetes: #eda100;
  --lane-cncf: #e87ba4;
  --lane-uncategorized: #898781;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page-plane: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --gridline: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);

    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-serious: #ec835a;
    --status-critical: #e66767;
    --status-neutral: #898781;
    --status-merged: #9085e9;

    --lane-velero: #3987e5;
    --lane-oadp: #d95926;
    --lane-datamover: #199e70;
    --lane-kubernetes: #c98500;
    --lane-cncf: #d55181;
    --lane-uncategorized: #898781;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page-plane: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gridline: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #e66767;
  --status-neutral: #898781;
  --status-merged: #9085e9;

  --lane-velero: #3987e5;
  --lane-oadp: #d95926;
  --lane-datamover: #199e70;
  --lane-kubernetes: #c98500;
  --lane-cncf: #d55181;
  --lane-uncategorized: #898781;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
}

.topbar {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.topbar h1 {
  font-size: 15px;
  margin: 0;
  white-space: nowrap;
}

.freshness {
  font-size: 12px;
  color: var(--text-secondary);
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

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

.server-state {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.server-state[data-online="true"] { color: var(--status-good); border-color: var(--status-good); }
.server-state[data-online="false"] { color: var(--text-muted); }

#publish-btn {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
}
#publish-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#publish-btn[data-pending="true"] { border-color: var(--status-warning); color: var(--status-warning); }

.lanes-header {
  position: sticky;
  top: 0;
  z-index: 19;
  display: grid;
  background: var(--page-plane);
  border-bottom: 1px solid var(--gridline);
}
.lane-title {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-left: 1px solid var(--gridline);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lane-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ruler-title { position: sticky; left: 0; z-index: 6; font-size: 11px; color: var(--text-muted); padding: 8px 10px; background: var(--page-plane); }

.timeline-scroll {
  overflow: auto;
  height: calc(100vh - 46px);
  overscroll-behavior: contain;
}
.timeline {
  position: relative;
  display: grid;
  min-width: 100%;
}

.ruler { position: sticky; left: 0; z-index: 5; border-right: 1px solid var(--gridline); background: var(--page-plane); }
.ruler-tick {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid var(--gridline);
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 6px;
}
.ruler-tick.now { border-top: 2px solid var(--text-primary); font-weight: 600; color: var(--text-primary); }

.lane {
  position: relative;
  border-left: 1px solid var(--gridline);
  min-width: 230px;
}

.connector {
  position: absolute;
  width: 2px;
  top: 0;
  border-radius: 0 0 2px 2px;
}

.card {
  position: absolute;
  left: 8px;
  right: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  transform: translateY(calc(-50% + var(--dock-shift, 0px))) scale(var(--dock-scale, 1));
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card.parked { opacity: 0.55; }
.card[draggable="true"]:active { cursor: grabbing; }
.card.drag-over { outline: 2px dashed var(--text-muted); }

.card-title {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.status-pill, .ci-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  white-space: nowrap;
}

.note-flag { color: var(--status-warning); }

.panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(360px, 92vw);
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  padding: 16px;
  z-index: 30;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.15s ease;
}
.panel.open { transform: translateX(0); }
.panel h2 { font-size: 14px; margin: 0 0 8px; }
.panel label { display: block; font-size: 12px; color: var(--text-secondary); margin: 10px 0 4px; }
.panel select, .panel textarea {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--page-plane);
  color: var(--text-primary);
}
.panel textarea { min-height: 80px; resize: vertical; }
.panel .panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.panel button {
  font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--page-plane); color: var(--text-primary); cursor: pointer;
}
.panel-close {
  position: absolute; top: 12px; right: 12px; border: none; background: none;
  font-size: 16px; cursor: pointer; color: var(--text-secondary);
}
.ci-checks { margin-top: 8px; font-size: 12px; }
.ci-checks li { list-style: none; display: flex; gap: 6px; align-items: center; }

#toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: var(--surface-1);
  padding: 8px 14px; border-radius: 6px; font-size: 12px; z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
#toast.show { opacity: 1; }

#hover-tooltip {
  position: fixed;
  z-index: 100;
  max-width: 360px;
  background: var(--text-primary);
  color: var(--surface-1);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  display: none;
}
#hover-tooltip.show { display: block; }

