/* The Ecosystem map, a Developers page (/developers/ecosystem): a short Developers top, then the map the width of the window
   (map-viewport pans and zooms it) with its toolbar and side panel, then the Developers closing. */
/* The eight line colors and the map's edges, by name; the dark version redefines them at the end. */
body.eco { --eco-primary: #e8613f; --eco-sage: #6f8f78; --eco-clay: #9c5446; --eco-blue: #3c5b9e; --eco-violet: #6c58a6; --eco-gray: #3d3d3e; --eco-amber: #c08227; --eco-teal: #2c776f;
  --eco-edge: rgba(72,68,62,.26); --eco-edge-2: rgba(72,68,62,.34); --eco-stop: #8a8680; --epanel-w: clamp(360px, 27vw, 440px); }
.dv-top-ecosystem h1 em { font-style: normal; color: var(--ink-3); }
/* A short top, so the map is in view on load: no picture, a smaller heading, the lede on one line at desktop widths. */
.dv-top-ecosystem .tx-head { padding-top: 28px; padding-bottom: 24px; }
.dv-top-ecosystem .tx-title { grid-column: 1 / -1; max-width: none; }
.dv-top-ecosystem h1 { margin-top: 12px; font-size: 36px; max-width: none; }
.dv-top-ecosystem .tx-lede { margin-top: 10px; font-size: 16.5px; max-width: none; }
@media (max-width: 760px) {
  .dv-top-ecosystem .tx-head { padding-top: 20px; padding-bottom: 20px; }
  .dv-top-ecosystem h1 { font-size: 30px; }
  .dv-top-ecosystem .tx-lede { font-size: 15.5px; }
}

/* ---------- The map: a toolbar (starting points, finder), the drawing, the key, the zoom controls and the side panel ---------- */
.emap { display: flex; flex-direction: column; height: clamp(640px, 100svh, 1320px); background: var(--well); border-bottom: 1px solid var(--hair); }
.ebar { flex: none; display: flex; align-items: flex-end; gap: 12px 32px; padding: 14px 24px 14px var(--m); background: var(--stone); border-bottom: 1px solid var(--hair); }
.ebar-start { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ebar-k { flex: none; font-size: var(--t-kicker); font-weight: var(--w-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.echips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.echip { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--eco-edge); background: var(--well); font-size: 13px; color: var(--ink); white-space: nowrap; }
.echip:hover { border-color: var(--eco-edge-2); }
.echip i { width: 16px; height: 4px; border-radius: 2px; background: currentColor; flex: none; }
.echip[aria-pressed="true"] { background: var(--ink); color: var(--well); border-color: var(--ink); }
.echip[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--well); }
.efind { flex: none; width: calc(var(--epanel-w) - 48px); }
.efind .search { display: block; position: relative; max-width: none; }
.efind .ds-in { height: 40px; }

.emap-body { position: relative; flex: 1; min-height: 0; }
.eview { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; background: var(--well); }
.eview.is-dragging { cursor: grabbing; }
.eview:focus-visible { outline: 2px solid var(--orange); outline-offset: -3px; }
.eview > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }

/* Zoom in, zoom out and Show all, at the free corner beside the panel */
.ezoom { position: absolute; z-index: 2; right: calc(var(--epanel-w) + 20px); bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ezoom-b, .ezoom-all { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: var(--stone); border: 1px solid var(--eco-edge-2); color: var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.ezoom-b { width: 40px; height: 40px; border-radius: 50%; }
.ezoom-b svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.ezoom-all { height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 520; margin-top: 4px; }
:is(.ezoom-b, .ezoom-all):hover { border-color: var(--ink-2); }

/* Shown for a moment when a plain wheel passes over the map: the page scrolls, and this says how to zoom */
.ewheel { position: absolute; z-index: 2; top: 20px; left: calc((100% - var(--epanel-w)) / 2); transform: translateX(-50%); padding: 10px 18px; border-radius: 999px;
  background: var(--stone); border: 1px solid var(--eco-edge-2); font-size: 13.5px; color: var(--ink); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; }
.ewheel.is-shown { opacity: 1; }

/* The key and the network's numbers, at the bottom left */
.ekey { position: absolute; z-index: 2; left: 20px; bottom: 20px; width: max-content; max-width: calc(100% - var(--epanel-w) - 180px); display: grid; gap: 12px;
  padding: 14px 18px; background: var(--stone); border: 1px solid var(--hair); box-shadow: 0 6px 18px rgba(0,0,0,.22); pointer-events: none; }
.ekey-name .big { font: var(--w-display) 20px/1.1 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.ekey-name .dim { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.ekey-name .mono { margin-top: 6px; font: 400 10.5px/1.4 ui-monospace, Menlo, monospace; letter-spacing: .08em; color: var(--ink-3); }
.ekey-marks { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.ekey-marks li { display: inline-flex; align-items: center; gap: 7px; }
.ekey-marks svg { flex: none; overflow: visible; }
.ekey .k-trmnl, .ekey .k-partner { fill: var(--well); stroke: var(--ink-2); stroke-width: 3.5; stroke-linejoin: round; }
.ekey .k-community { fill: var(--ink-2); }
.ekey .k-int { fill: var(--well); stroke: var(--ink); stroke-width: 4; }

/* The drawing (its states are the ecosystem-map controller's data attributes) */
.eview svg g[data-stop] text { font-size: 19px; }
.eview svg g[data-stop].int text { font-size: 21px; font-weight: 640; }
.eview svg [data-c="primary"] { color: var(--eco-primary); } .eview svg [data-c="sage"] { color: var(--eco-sage); } .eview svg [data-c="clay"] { color: var(--eco-clay); }
.eview svg [data-c="blue"] { color: var(--eco-blue); } .eview svg [data-c="violet"] { color: var(--eco-violet); } .eview svg [data-c="gray"] { color: var(--eco-gray); }
.eview svg [data-c="amber"] { color: var(--eco-amber); } .eview svg [data-c="teal"] { color: var(--eco-teal); }
.eview svg path[data-line] { transition: opacity .2s; }
.eview svg [data-dimmed="true"] { opacity: .14; }
.eview svg g[data-stop] { cursor: pointer; outline: none; }
.eview.is-dragging svg g[data-stop] { cursor: grabbing; }
.eview svg g[data-stop] > circle:first-child { fill: currentColor; opacity: 0; }
.eview svg g[data-stop][data-active="true"] > circle:first-child, .eview svg g[data-stop][data-match="true"] > circle:first-child { opacity: .3; }
.eview svg circle:not([fill]), .eview svg polygon:not([fill]) { fill: var(--well); }
.eview svg circle[fill="currentColor"] { stroke: var(--well); }
.eview svg circle[r="13"]:not([stroke]) { stroke: var(--ink); }
.eview svg text { font-family: var(--sans); fill: var(--ink); stroke: var(--well); stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; font-weight: 480; }
.eview svg g[data-stop]:hover text, .eview svg g[data-stop]:focus-visible text { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .eview svg path[data-line], .ewheel { transition: none; } }

/* The map dims as it passes under the panel, so a label cut by the panel's edge reads as going under it */
.emap-body::after { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; right: var(--epanel-w); width: 32px; pointer-events: none;
  background: linear-gradient(to right, transparent, rgba(15,15,14,.85)); }

/* ---------- The side panel: how to read the map and what is often built twice, or the chosen card ---------- */
.epanel { position: absolute; z-index: 3; top: 0; right: 0; bottom: 0; width: var(--epanel-w); overflow-y: auto; overscroll-behavior: contain; padding: 28px 24px 32px;
  --well: var(--stone); background: var(--stone); border-left: 1px solid var(--hair); box-shadow: -20px 0 40px rgba(0,0,0,.3); }
.epanel .s-k { color: var(--ink-2); }
.epanel h2 { margin-top: 12px; font-size: 26px; line-height: 1.15; letter-spacing: -0.03em; font-weight: var(--w-display); text-wrap: balance; }
.epanel .sub { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.epanel .ds-msg { margin-top: 18px; }
.elegend { margin-top: 20px; border-bottom: 1px solid var(--hair); }
.elegend p { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hair); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.elegend b { color: var(--ink); font-weight: 560; }
.elegend .sw-line { width: 26px; height: 6px; border-radius: 3px; background: var(--eco-primary); }
.elegend .sw-stop { width: 16px; height: 16px; border-radius: 50%; border: 4px solid var(--eco-stop); margin-left: 4px; box-sizing: border-box; }
.elegend .sw-int { width: 24px; height: 24px; border-radius: 50%; border: 4.5px solid var(--ink); box-sizing: border-box; }
.enote { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.elabel { margin-top: 28px; font-size: var(--t-kicker); font-weight: var(--w-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.elist { margin-top: 12px; list-style: none; border-bottom: 1px solid var(--hair); }
.elist button { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 12px 0; border-top: 1px solid var(--hair); font-size: 15px; font-weight: 480; color: var(--ink); }
.elist button span { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.elist .it-ic[hidden] { display: none; }
/* An often-built item with its icon: the icon at 25 px (the site's compact rows) beside the name and its line. */
.elist button:has(> .it-ic:not([hidden])) { display: grid; grid-template-columns: 25px 1fr; column-gap: 12px; align-items: start; }
.elist button > .it-ic:not([hidden]) { grid-row: 1 / span 2; display: flex; margin-top: 1px; color: var(--ink); }
.elist button:has(> .it-ic:not([hidden])) > span:not(.it-ic) { grid-column: 2; }
.elist .it-ic > svg { display: block; width: 25px; height: 25px; }
.elist button:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Today's controller fills search results from a template: the name is a span too, so it keeps the button's type. */
.elist button span[data-name] { display: inline; margin-top: 0; font-size: inherit; font-weight: inherit; color: inherit; }
.elist.stops li { position: relative; padding-left: 26px; }
.elist.stops li::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 4px; background: currentColor; }
.elist.stops li::after { content: ""; position: absolute; left: 1px; top: 16px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid currentColor; background: var(--well); box-sizing: border-box; }
.elist.stops button { color: var(--ink); }
.etags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.etags:first-child { margin-top: 0; }
.etag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--eco-edge); color: var(--ink); }
.etag i { width: 12px; height: 3px; border-radius: 2px; background: currentColor; }
.ecard p.desc { margin-top: 16px; font-size: var(--t-body-s); line-height: 1.6; color: var(--ink); }
.ecard p.skip { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.ecard p.skip b { color: var(--ink); font-weight: 560; }
.elinks { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.elinks .s-arrow { margin-top: 0; }
.elinks .s-arrow::before { content: "\2197"; }
.ealong { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--hair); }
.ealong p { font-size: var(--t-caption); color: var(--ink-3); letter-spacing: .02em; }
.ealong div { margin-top: 8px; display: flex; justify-content: space-between; gap: 12px; }
.ealong button, .eback { all: unset; cursor: pointer; font-size: 14px; font-weight: 520; color: var(--ink); }
.ealong button:hover, .eback:hover { text-decoration: underline; text-underline-offset: 3px; }
.eback { display: inline-block; margin-top: 24px; padding: 8px 16px; border: 1px solid var(--eco-edge-2); border-radius: 999px; }
.ecard[hidden], .epanel section[hidden] { display: none; }
.ecard:focus { outline: none; } /* a card the controller hands the focus to; the reader's next Tab is inside it */

.echip[data-c="primary"] i, .etag[data-c="primary"] i, .elist[data-c="primary"] { color: var(--eco-primary); } .echip[data-c="sage"] i, .etag[data-c="sage"] i, .elist[data-c="sage"] { color: var(--eco-sage); }
.echip[data-c="clay"] i, .etag[data-c="clay"] i, .elist[data-c="clay"] { color: var(--eco-clay); } .echip[data-c="blue"] i, .etag[data-c="blue"] i, .elist[data-c="blue"] { color: var(--eco-blue); }
.echip[data-c="violet"] i, .etag[data-c="violet"] i, .elist[data-c="violet"] { color: var(--eco-violet); } .echip[data-c="gray"] i, .etag[data-c="gray"] i, .elist[data-c="gray"] { color: var(--eco-gray); }
.echip[data-c="amber"] i, .etag[data-c="amber"] i, .elist[data-c="amber"] { color: var(--eco-amber); } .echip[data-c="teal"] i, .etag[data-c="teal"] i, .elist[data-c="teal"] { color: var(--eco-teal); }
.echip[aria-pressed="true"][data-c="gray"] i { color: var(--well); }

/* Focus: the map's controls drop the browser's ring (all: unset); they take the site's orange ring, a stop a ring in ink. */
:is(.echip, .ezoom-b, .ezoom-all, .eback, .elist button, .ealong button):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.eview svg g[data-stop]:focus-visible > circle:first-child { opacity: 1; fill: none; stroke: var(--ink); stroke-width: 4; }

/* ---------- Where the panel does not fit beside the map: the map keeps the window's width, the panel is a section under it ---------- */
@media (max-width: 1199px) {
  .emap { display: block; height: auto; }
  .ebar { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px var(--m); }
  .efind { width: min(100%, 440px); }
  .emap-body { position: static; }
  .emap-body::after { content: none; }
  .eview { position: relative; inset: auto; height: clamp(420px, 66svh, 640px); }
  .ezoom { right: 16px; bottom: 16px; }
  .ewheel { left: 50%; }
  .ekey { position: static; width: auto; max-width: none; box-shadow: none; border: 0; border-top: 1px solid var(--hair); padding: 16px var(--m); }
  .epanel { position: static; width: auto; overflow: visible; box-shadow: none; border-left: 0; border-top: 1px solid var(--hair); --well: var(--band-paper); background: var(--band-paper);
    padding: 48px max(var(--m), (100% - 1440px) / 2 + var(--m)) 72px; }
  .epanel > :not(.eover) { max-width: 640px; }
  .epanel h2 { font-size: 30px; }
}
/* The overview as two columns where the section under the map is wide enough */
@media (min-width: 700px) and (max-width: 1199px) {
  .eover { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); align-items: start; }
  .eover-twice .elabel { margin-top: 6px; }
}
/* On a phone the starting points are one row that scrolls sideways, the finder under them */
@media (max-width: 760px) {
  .echips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--m)); padding: 0 var(--m) 2px; width: calc(100% + 2 * var(--m)); scrollbar-width: none; }
  .echip { flex: none; }
  .efind { width: 100%; }
  .ekey-name .big { font-size: 18px; }
}

/* ---------- The dark map: the Developers ground (the locked dark scale in system.css), line colors as dark-ground variants of
   the same hues, measured: each line at least 3.2:1 on the plate (#282726), the closest two lines 14 apart (CIEDE2000). ---------- */
:root.dark body.eco { --eco-primary: #f26c45; --eco-sage: #8fbf9a; --eco-clay: #b05d4a; --eco-blue: #6489e0; --eco-violet: #c8b6f2;
  --eco-gray: #dedad3; --eco-amber: #efbc5a; --eco-teal: #2b9f91;
  --eco-edge: rgba(239,235,228,.24); --eco-edge-2: rgba(239,235,228,.34); --eco-stop: rgba(239,235,228,.62); }
/* A chosen starting point turns cream: its swatch takes the hue's light-ground value, the three lightest a step darker (3:1 on cream). */
:root.dark body.eco .echip[aria-pressed="true"] { background: var(--ink); color: var(--dark-band-a); border-color: var(--ink); }
:root.dark body.eco .echip[aria-pressed="true"] i { box-shadow: none; }
:root.dark body.eco .echip[aria-pressed="true"][data-c="primary"] i { color: #cf5232; } :root.dark body.eco .echip[aria-pressed="true"][data-c="sage"] i { color: #638470; }
:root.dark body.eco .echip[aria-pressed="true"][data-c="clay"] i { color: #9c5446; } :root.dark body.eco .echip[aria-pressed="true"][data-c="blue"] i { color: #3c5b9e; }
:root.dark body.eco .echip[aria-pressed="true"][data-c="violet"] i { color: #6c58a6; } :root.dark body.eco .echip[aria-pressed="true"][data-c="gray"] i { color: #3d3d3e; }
:root.dark body.eco .echip[aria-pressed="true"][data-c="amber"] i { color: #a06a1c; } :root.dark body.eco .echip[aria-pressed="true"][data-c="teal"] i { color: #2c776f; }

