/* TALOS interactive architecture --- styles
 *
 * Three-pane layout (sidebar | canvas | detail) with light/dark support.
 * Reuses Material-style indigo accents so it sits next to the rest of the
 * docs without clashing.
 */

:root {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-canvas: #eceff4;
  --bg-canvas-dot: rgba(57, 73, 171, 0.08);
  --fg: #1a1a1a;
  --fg-muted: #596573;
  --border: #d5dbe3;
  --border-strong: #b0b9c5;
  --accent: #3949ab;          /* indigo 600 */
  --accent-soft: #e8eaf6;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.12);

  --status-done: #2e7d32;
  --status-proposed: #ef6c00;
  --status-approved: #1565c0;
  --status-deferred: #6a1b9a;
  --status-dropped: #90a4ae;

  --group-client: #0288d1;
  --group-central: #3949ab;
  --group-edge: #00897b;
  --group-edge-hw: #00695c;
  --group-external: #6d4c41;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-elev: #151e2e;
    --bg-canvas: #0a111c;
    --bg-canvas-dot: rgba(121, 134, 203, 0.14);
    --fg: #e6ebf2;
    --fg-muted: #8a96a6;
    --border: #253047;
    --border-strong: #354460;
    --accent: #7986cb;
    --accent-soft: #1c243a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 22px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 14px 50px rgba(0, 0, 0, 0.7);

    --status-done: #66bb6a;
    --status-proposed: #ffb74d;
    --status-approved: #64b5f6;
    --status-deferred: #ba68c8;
    --status-dropped: #78909c;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 0.12s; }
a:hover { text-decoration: underline; }

.muted { color: var(--fg-muted); font-weight: normal; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 10;
  position: relative;
}

.topbar .title { font-size: 15px; letter-spacing: -0.01em; }
.topbar .title strong {
  color: var(--accent);
  font-size: 17px;
  letter-spacing: -0.02em;
  margin-right: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar button,
.repo-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}

.topbar button:hover,
.repo-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.topbar button:active { transform: translateY(1px); }

/* ------------------------------------------------------------------ layout */

.layout {
  display: flex;
  height: calc(100vh - 57px);
  overflow: hidden;
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 18px 32px;
}

.canvas-wrap {
  flex: 1;
  position: relative;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(circle, var(--bg-canvas-dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: 0 0;
  min-width: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.08);
}

#cy {
  width: 100%;
  height: 100%;
}

.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 16px;
}
.loading.hidden { display: none; }

.detail {
  width: 400px;
  flex: 0 0 400px;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 22px 22px 40px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.18s ease-out;
}
.detail[hidden] { display: none; }

@keyframes slideIn {
  from { transform: translateX(12px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@media (max-width: 1100px) {
  .sidebar { width: 200px; flex-basis: 200px; }
  .detail  { width: 320px; flex-basis: 320px; }
}

@media (max-width: 880px) {
  .layout { flex-direction: column; height: auto; }
  .sidebar, .detail { width: 100%; flex-basis: auto; max-height: 50vh; }
  .canvas-wrap { height: 60vh; }
}

/* ------------------------------------------------------------------ filters */

.filter-block { margin-bottom: 26px; }
.filter-block h3 {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 600;
}
.filter-block .hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.35;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  box-shadow: var(--shadow-sm);
}
.chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(57, 73, 171, 0.35);
}
.chip .count {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-canvas);
  font-size: 10px;
  color: var(--fg-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chip.active .count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Static chip row used inside the detail panel */
.chip-static .chip { cursor: default; }
.chip-static .chip:hover { border-color: var(--border); }

/* ------------------------------------------------------------------ legend */

.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-sm);
}
.status-DONE     { background: var(--status-done); }
.status-APPROVED { background: var(--status-approved); }
.status-PROPOSED { background: var(--status-proposed); }
.status-DEFERRED { background: var(--status-deferred); }
.status-DROPPED  { background: var(--status-dropped); }

/* ------------------------------------------------------------------ detail panel */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.detail-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-weight: 700;
}
.detail-head p {
  margin: 4px 0 0;
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
#detail-close {
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
#detail-close:hover { color: var(--fg); }

#detail-description {
  font-size: 13px;
  color: var(--fg);
  margin: 0 0 16px;
}

.detail section {
  margin-bottom: 18px;
}
.detail section h3 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.link-list li {
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
  word-break: break-all;
}
.link-list li:last-child { border-bottom: 0; }

.roadmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.roadmap-table th,
.roadmap-table td {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.roadmap-table th {
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.roadmap-table td.id   { font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.roadmap-table td.item { font-weight: 500; }
.roadmap-table td.pri  { text-align: center; }
.roadmap-table td.ver  { white-space: nowrap; }

.edge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.edge-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.edge-list li:last-child { border-bottom: 0; }
.edge-list .edge-arrow { color: var(--fg-muted); }
.edge-list .edge-protocol {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
}
.edge-list .edge-desc {
  display: block;
  color: var(--fg-muted);
  font-size: 11px;
  margin-top: 2px;
}
.edge-list .edge-topics {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--fg-muted);
  margin-top: 2px;
  white-space: pre-wrap;
}
