:root {
  --los-navy-950: #04070d;
  --los-navy-900: #060b16;
  --los-navy-800: #0a1428;
  --los-navy-700: #0f1e38;
  --los-line: #1c2c4a;

  --los-gold: #d4af37;
  --los-gold-bright: #f3dc95;
  --los-gold-dim: #8a6526;
  --los-bronze: #7a5a22;

  --los-blue-data: #4f9fdb;
  --los-blue-dim: #2c4d70;

  --los-text: #eef2fa;
  --los-text-dim: #98a7c4;

  --los-live: var(--los-gold);
  --los-developing: #c9a24e;
  --los-planned: #5c6b8a;
  --los-attention: #ff7a5c;
  --los-new: var(--los-gold-bright);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--los-navy-900);
  color: var(--los-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.los-defs-only { position: absolute; width: 0; height: 0; overflow: hidden; }

.los-header {
  border-bottom: 1px solid var(--los-line);
  background: linear-gradient(180deg, var(--los-navy-800), var(--los-navy-900));
  padding: 28px 20px 22px;
}
.los-header-inner { max-width: 1100px; margin: 0 auto; }
.los-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--los-gold-bright);
}
.los-back-link { color: inherit; text-decoration: none; }
.los-back-link:hover { text-decoration: underline; }
.los-title { margin: 0 0 6px; font-size: clamp(20px, 3vw, 30px); font-weight: 700; }
.los-subtitle { margin: 0; color: var(--los-text-dim); font-size: 14px; }

.los-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
}

.los-tree-error {
  border: 1px solid var(--los-attention);
  background: rgba(255, 122, 92, 0.08);
  color: var(--los-attention);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* --- Canvas shell (shared desktop/mobile) --------------------------- */
.los-canvas-wrap {
  border: 1px solid var(--los-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 15%, rgba(212, 175, 55, 0.05), transparent 55%),
    radial-gradient(circle at 50% 90%, rgba(79, 159, 219, 0.05), transparent 55%),
    var(--los-navy-800);
  padding: 8px;
}
.los-tree-svg { width: 100%; height: auto; display: block; max-height: 680px; }
.los-canvas-wrap--mobile .los-tree-svg { max-height: 560px; }

/* --- Desktop / mobile switch ---------------------------------------- */
.los-desktop-view { display: none; }
.los-mobile-view { display: block; }
.los-mobile-hint {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--los-text-dim);
  text-align: center;
}

@media (min-width: 768px) {
  .los-desktop-view { display: block; }
  .los-mobile-view { display: none; }
}

/* --- Roots ------------------------------------------------------------ */
.los-root-strand {
  fill: none;
  stroke: var(--los-blue-dim);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.75;
}
.los-root-node {
  fill: var(--los-blue-data);
  opacity: 0.85;
}
.los-root-label {
  fill: var(--los-text-dim);
  font-size: 9px;
  letter-spacing: 0.03em;
  pointer-events: none;
}

/* --- Trunk -------------------------------------------------------- */
.los-trunk-group { cursor: pointer; }
.los-trunk-group:focus { outline: none; }
.los-trunk-group:focus .los-trunk { stroke: var(--los-gold-bright); stroke-width: 2; }
.los-trunk {
  fill: url(#los-trunk-gradient);
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1;
}

/* --- Branches ------------------------------------------------------- */
.los-branch-group { cursor: pointer; }
.los-branch-group:focus { outline: none; }
.los-branch-group:focus .los-branch-limb { stroke: var(--los-gold-bright); stroke-width: 1.6; }
.los-branch-limb {
  fill: url(#los-branch-gradient);
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 0.6;
}
.los-branch-group.los-node--planned .los-branch-limb { fill: var(--los-planned); opacity: 0.55; }
.los-branch-group.los-node--attention .los-branch-limb { filter: saturate(1.15); }

/* --- Leaves / buds -------------------------------------------------- */
.los-leaf-group { cursor: pointer; }
.los-leaf-group:focus { outline: none; }
.los-leaf-group:focus .los-glyph-shape { stroke: var(--los-gold-bright); stroke-width: 1.6; }
.los-leaf-stem {
  fill: url(#los-branch-gradient);
  opacity: 0.9;
}

.los-glyph-shape { stroke: rgba(0, 0, 0, 0.25); stroke-width: 0.5; }
.los-glyph--live,
.los-glyph--new-activity { fill: url(#los-leaf-gradient); }
.los-glyph--developing { fill: var(--los-developing); opacity: 0.65; stroke: var(--los-gold-dim); }
.los-glyph--planned { fill: var(--los-navy-800); stroke: var(--los-planned); stroke-width: 1; stroke-dasharray: 1.6 1.6; }
.los-glyph--attention { fill: var(--los-attention); }
.los-glyph-spark { fill: var(--los-blue-data); opacity: 0.9; }

/* --- Hit targets / labels -------------------------------------------- */
.los-hit { fill: transparent; pointer-events: all; }
.los-label {
  fill: var(--los-text);
  font-size: 10px;
  pointer-events: none;
}
.los-label--trunk { font-size: 13px; font-weight: 700; fill: var(--los-gold-bright); }
.los-label--branch { font-size: 11px; font-weight: 600; }
.los-label--leaf { font-size: 9.5px; fill: var(--los-text-dim); }

/* --- Selection focus/recede ------------------------------------------ */
.los-branch-group,
.los-leaf-group {
  transition: opacity 220ms ease;
}
.is-focused { opacity: 1; }
.is-receded { opacity: 0.35; }
.is-selected .los-branch-limb,
.is-selected .los-trunk { filter: brightness(1.25); }
.is-selected .los-glyph-shape { filter: brightness(1.3); }

/* --- Legend -------------------------------------------------------- */
.los-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--los-text-dim);
}
.los-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.los-glyph {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
}
.los-glyph--live { color: var(--los-live); background: var(--los-live); }
.los-glyph--developing { color: var(--los-developing); background: transparent; }
.los-glyph--planned { color: var(--los-planned); background: transparent; border-style: dashed; }
.los-glyph--attention { color: var(--los-attention); background: var(--los-attention); border-radius: 2px; }
.los-glyph--new-activity { color: var(--los-gold-bright); background: var(--los-gold-bright); }

/* --- Info panel -------------------------------------------------------- */
.los-info-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  max-width: 380px;
  margin-left: auto;
  background: var(--los-navy-700);
  border: 1px solid var(--los-gold);
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 20;
}
.los-info-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--los-text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.los-info-state {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--los-gold-bright);
}
.los-info-label { margin: 0 0 8px; font-size: 18px; }
.los-info-description { margin: 0 0 14px; color: var(--los-text-dim); font-size: 14px; line-height: 1.5; }
.los-info-open {
  display: inline-block;
  color: var(--los-navy-900);
  background: var(--los-gold);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.los-info-open[hidden] { display: none; }
.los-info-unavailable { margin: 0; color: var(--los-text-dim); font-size: 13px; }

@media (min-width: 768px) {
  .los-info-panel { left: auto; }
}

/* --- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .los-branch-group,
  .los-leaf-group { transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
