/* The roadmap: the graph page, and the badges and ids on the generated pillar and feature pages.
   Status colors are custom properties for both of Material's schemes, and the graph SVG uses them. */

:root, [data-md-color-scheme="slate"] {
  --rm-shipped: #78c98a;
  --rm-built: #e3a93f;
  --rm-planned: #6ea8e6;
  --rm-idea: #a39c8d;
  --rm-decision: #c995e8;
  --rm-missing: var(--rm-decision);
  --rm-text: #e8e0d0;
  --rm-text-dim: #c1baaa;
  --rm-faint: #a39c8d;
  --rm-accent: var(--sb-accent, #b38b59);
  --rm-accent-hover: var(--sb-accent-hover, #c49b68);
  --rm-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  --rm-edge: #8f8a80;
  --rm-ref: #b5ad9c;
  --rm-stage: #181715;
  --rm-plate: #201f1c;
  --rm-plate-rule: #4b4945;
}

/* Light scheme: only the roadmap variables change. */
[data-md-color-scheme="default"] {
  --rm-shipped: #1b7a3d;
  --rm-built: #9a5f06;
  --rm-planned: #1d5aa6;
  --rm-idea: #655f52;
  --rm-decision: #7a37a8;
  --rm-missing: var(--rm-decision);
  --rm-text: #25231f;
  --rm-text-dim: #46423a;
  --rm-faint: #6b665a;
  --rm-accent: #85602f;
  --rm-accent-hover: #6d4d22;
  --rm-edge: #736c5f;
  --rm-ref: #5d574c;
  --rm-stage: #faf6ee;
  --rm-plate: #f1ece0;
  --rm-plate-rule: #b9b09d;
  --rm-shadow: 0 12px 40px rgba(60, 50, 30, .25);
}

/* Badges and ids (pillar and feature pages). */
.roadmap-badge {
  display: inline-block; font-family: var(--text, "Plex Condensed"); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase;
  line-height: 1; padding: .32em .7em .3em; border: 1px solid currentColor; border-radius: 3px; vertical-align: middle;
}
.roadmap-badge--shipped { color: var(--rm-shipped); background: color-mix(in srgb, var(--rm-shipped) 30%, transparent); }
.roadmap-badge--built { color: var(--rm-built); background: color-mix(in srgb, var(--rm-built) 30%, transparent); }
.roadmap-badge--progress { color: var(--rm-built); border-style: dashed; background: color-mix(in srgb, var(--rm-built) 12%, transparent); }
.roadmap-badge--planned { color: var(--rm-planned); background: color-mix(in srgb, var(--rm-planned) 30%, transparent); }
.roadmap-badge--idea { color: var(--rm-idea); border-style: dashed; background: none; }
.roadmap-badge--decision { color: var(--rm-decision); background: none; }
.roadmap-id { font-family: var(--md-code-font, "Source Code Pro"); font-size: .85em; letter-spacing: .02em; color: var(--rm-accent); white-space: nowrap; }

/* The graph page: full width, a narrow rail beside the canvas. */
.md-main:has(.roadmap-window) .md-grid { max-width: none; }
.md-main:has(.roadmap-window) .md-content__inner { margin-left: 1rem; margin-right: 1rem; }

.roadmap-window {
  display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 70vh; margin: 1rem 0 2rem;
  font-family: var(--text, "Plex Condensed"); color: var(--rm-text);
  border: 1px solid var(--rm-plate-rule); border-radius: 6px; overflow: hidden; background: var(--rm-stage);
}
.roadmap-rail {
  display: flex; flex-direction: column; gap: 1rem; padding: .8rem .8rem 1rem; background: var(--rm-plate);
  border-right: 1px solid var(--rm-plate-rule); min-width: 0; min-height: 0; overflow-y: auto;
}
.roadmap-legend { display: grid; grid-template-columns: 1fr; gap: .32rem; font-size: .68rem; color: var(--rm-text-dim); }
.roadmap-legend span { display: flex; align-items: center; gap: .5rem; }
.roadmap-sw { flex: none; display: inline-block; width: 1.5rem; height: .8rem; border: 2px solid; border-radius: 3px; box-sizing: border-box; }
.roadmap-sw--shipped { border-color: var(--rm-shipped); background: color-mix(in srgb, var(--rm-shipped) 26%, var(--rm-stage)); }
.roadmap-sw--built { border-color: var(--rm-built); background: color-mix(in srgb, var(--rm-built) 26%, var(--rm-stage)); }
.roadmap-sw--progress {
  border-color: var(--rm-built); border-style: dashed;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rm-built) 30%, var(--rm-stage)) 0 3px, var(--rm-stage) 3px 7px);
}
.roadmap-sw--planned { border-color: var(--rm-planned); background: color-mix(in srgb, var(--rm-planned) 26%, var(--rm-stage)); }
.roadmap-sw--idea { border-color: var(--rm-idea); border-style: dashed; border-width: 1.5px; }
.roadmap-sw--decision { border-color: var(--rm-decision); border-width: 2px; background: var(--rm-stage); }
.roadmap-sw--ref { border-color: var(--rm-ref); border-width: 1px; }
.roadmap-ln { flex: none; display: inline-block; width: 1.5rem; height: 0; border-top: 1.5px solid var(--rm-edge); }
.roadmap-ln--draft { border-top-style: dotted; border-top-width: 2px; }

.roadmap-search input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: .72rem; color: var(--rm-text); background: var(--rm-stage);
  border: 1px solid var(--rm-plate-rule); border-radius: 4px; padding: .38rem .55rem;
}
.roadmap-search input::placeholder { color: var(--rm-faint); }
.roadmap-search input.is-missing { border-color: var(--rm-missing); }
.roadmap-search input:focus-visible, .roadmap-pillars a:focus-visible, .roadmap-core-toggle:focus-visible, .roadmap-rail-link:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 1px; }
.roadmap-pillars { display: flex; flex-direction: column; gap: .15rem; }
.roadmap-pillars a {
  display: block; width: 100%; box-sizing: border-box; text-align: left; font: inherit; color: var(--rm-text); background: none; cursor: pointer;
  border: 0; border-radius: 4px; padding: .38rem .45rem; text-decoration: none;
}
.roadmap-pillars a:hover { background: color-mix(in srgb, var(--rm-accent) 14%, transparent); color: var(--rm-text); }
.roadmap-group {
  margin-top: .5rem; padding: .6rem .45rem 0; border-top: 1px solid color-mix(in srgb, var(--rm-text-dim) 35%, transparent);
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rm-faint);
}
.roadmap-search-status { margin-top: -.6rem; min-height: .9rem; font-size: .62rem; color: var(--rm-text-dim); }
.roadmap-search-status:empty { display: none; }
.roadmap-rail-link {
  display: block; margin-top: .6rem; padding: .5rem .45rem .38rem; border-top: 1px solid color-mix(in srgb, var(--rm-text-dim) 35%, transparent);
  border-radius: 0 0 4px 4px; color: var(--rm-text); text-decoration: none;
}
.roadmap-rail-link:hover { background: color-mix(in srgb, var(--rm-accent) 14%, transparent); color: var(--rm-text); }
.roadmap-pillar-name { display: block; font-size: .74rem; letter-spacing: .02em; }
.roadmap-pillar-counts { display: block; font-size: .62rem; line-height: 1.35; color: var(--rm-text-dim); margin-top: .1rem; }

.roadmap-canvas { position: relative; min-height: 0; overflow: hidden; background: var(--rm-stage); cursor: grab; touch-action: none; }
.roadmap-canvas.is-dragging { cursor: grabbing; }
/* Material sizes .md-typeset svg itself, so this needs higher specificity. */
.md-typeset .roadmap-canvas > svg.roadmap-svg { display: block; width: 100%; height: 100%; max-width: none; user-select: none; }

/* The graph SVG. */
.rm-heading { font-family: var(--text, "Plex Condensed"); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; fill: var(--rm-text); }
.rm-edge { fill: none; stroke: var(--rm-edge); stroke-width: 1.25; }
.rm-edge.is-draft { stroke-dasharray: 1.5 3; stroke-linecap: round; }
.rm-edge.is-hot { stroke: var(--rm-text); stroke-width: 2.5; }
.rm-arrowhead { fill: var(--rm-edge); }
.rm-stripe-base { fill: var(--rm-stage); }
.rm-stripe { fill: color-mix(in srgb, var(--rm-built) 20%, var(--rm-stage)); }
.rm-shape { stroke-width: 1.6; }
.rm-node.s-shipped .rm-shape { fill: color-mix(in srgb, var(--rm-shipped) 22%, var(--rm-stage)); stroke: var(--rm-shipped); }
.rm-node.s-built .rm-shape { fill: color-mix(in srgb, var(--rm-built) 22%, var(--rm-stage)); stroke: var(--rm-built); }
.rm-node.s-progress .rm-shape { fill: url(#rm-stripes); stroke: var(--rm-built); stroke-dasharray: 5 3; }
.rm-node.s-planned .rm-shape { fill: color-mix(in srgb, var(--rm-planned) 22%, var(--rm-stage)); stroke: var(--rm-planned); }
.rm-node.s-idea .rm-shape { fill: var(--rm-stage); stroke: var(--rm-idea); stroke-dasharray: 4 3; stroke-width: 1.3; }
.rm-node.s-decision .rm-shape { fill: var(--rm-stage); stroke: var(--rm-decision); stroke-width: 2; }
.rm-ref .rm-shape { fill: var(--rm-stage); stroke: var(--rm-ref); stroke-width: 1; }
.rm-id { font-family: var(--md-code-font, "Source Code Pro"); font-size: 10px; fill: var(--rm-text-dim); }
.rm-title { font-family: var(--text, "Plex Condensed"); font-size: 12px; fill: var(--rm-text); }
.rm-ref .rm-id, .rm-ref .rm-title { fill: var(--rm-text-dim); }
.rm-node:hover .rm-shape, .rm-ref:hover .rm-shape { stroke-width: 2.6; }
.rm-node:focus-visible .rm-shape, .rm-ref:focus-visible .rm-shape { stroke: var(--rm-accent); stroke-width: 3; }
.rm-node.is-found .rm-shape, .rm-ref.is-found .rm-shape { stroke: var(--rm-text); stroke-width: 3.2; stroke-dasharray: none; }

.roadmap-zoom { position: absolute; top: 8px; right: 8px; z-index: 4; display: flex; gap: 4px; }
.roadmap-zoom__btn {
  min-width: 2rem; height: 2rem; padding: 0 .55rem; font: inherit; font-size: .78rem; line-height: 1; cursor: pointer;
  color: var(--rm-text); background: var(--rm-stage); border: 1px solid color-mix(in srgb, var(--rm-text-dim) 45%, transparent); border-radius: 4px;
}
.roadmap-zoom__btn:hover { background: color-mix(in srgb, var(--rm-accent) 18%, var(--rm-stage)); }
.roadmap-zoom__btn:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 1px; }
.roadmap-tooltip {
  position: absolute; z-index: 3; width: 21rem; max-width: calc(100% - 16px); box-sizing: border-box; padding: .7rem .8rem .75rem;
  background: var(--rm-plate); border: 1px solid var(--rm-plate-rule); border-radius: 6px; box-shadow: var(--rm-shadow);
  font-size: .76rem; line-height: 1.45; color: var(--rm-text-dim); display: none; pointer-events: none;
}
.roadmap-tooltip.is-open { display: block; }
.roadmap-tip-head { display: flex; align-items: baseline; gap: .6rem; color: var(--rm-text); font-size: .86rem; margin-bottom: .35rem; }
.roadmap-tooltip .roadmap-id { font-size: .76rem; }
.roadmap-tip-meta { font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rm-faint); margin-bottom: .4rem; }
.roadmap-tip-branches, .roadmap-tip-note { margin-top: .45rem; font-size: .7rem; color: var(--rm-faint); }
.roadmap-error { margin: 0; padding: 1rem; grid-column: 1 / -1; }

/* Narrow screens: the rail pillar links take the canvas's place, and the page flows normally. */
@media (max-width: 44.9375em) {
  .roadmap-window { display: block; height: auto !important; border: 0; background: none; overflow: visible; }
  .roadmap-rail { background: none; border: 0; padding: 0; overflow: visible; }
  .roadmap-legend, .roadmap-core-toggle, .roadmap-search, .roadmap-search-status, .roadmap-canvas { display: none; }
  .roadmap-pillar-name { color: var(--rm-accent); }
}

/* The two buttons at the foot of a feature page: Roadmap Graph and Feature in Graph. */
.md-typeset a.md-button {
  color: var(--parchment, var(--rm-text)); background: var(--plate, transparent);
  border: 1px solid var(--rule, var(--rm-faint)); border-radius: 4px; padding: .45em 1.2em; margin: .2rem .4rem .2rem 0;
}
.md-typeset a.md-button:hover, .md-typeset a.md-button:focus-visible {
  color: var(--parchment, var(--rm-text)); background: var(--plate-hover, transparent); border-color: var(--sb-accent, var(--rm-accent));
}

/* Scope: the Core Path toggle in the rail fades what lies outside the core scope. */
.roadmap-core-toggle {
  display: block; width: 100%; margin: .2rem 0 .6rem; padding: .45rem .6rem; font: inherit; font-size: .74rem; text-align: left;
  color: var(--rm-text); background: none; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--rm-text-dim) 45%, transparent); border-radius: 4px;
}
.roadmap-core-toggle:hover { background: color-mix(in srgb, var(--rm-accent) 14%, transparent); }
.roadmap-core-toggle[aria-pressed="true"] { border-color: var(--rm-accent); background: color-mix(in srgb, var(--rm-accent) 20%, transparent); }
.is-core-only .rm-node:not(.sc-core), .is-core-only .rm-ref:not(.sc-core) { opacity: .16; }
.is-core-only .rm-edge:not(.is-core) { opacity: .07; }
.md-typeset .roadmap-scope { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.md-typeset .roadmap-scope--core { color: var(--rm-accent); }
