/*
 * Network map
 *
 * Layout for the map shell: intro, toolbar, trail, canvas stage, the key
 * folded into the stage's corner, and the drawer. Colours come from
 * css/colors.css.
 *
 * The app below the intro is sized to the window: toolbar and trail take one
 * row each and the stage takes the rest, so scrolling the map to the top of
 * the screen shows all of it. Above 900px the drawer is a column beside the
 * stage; below it, a sheet over the lower half.
 */

.kop-network {
	--kop-net-gap: 0.75rem;
	--kop-net-drawer: 330px;
	--kop-net-control: 2.25rem;
	--kop-net-radius: 8px;
	--kop-net-border: #d8d2bd;
	/* White, as the board's frames are; the renderer's SURFACE matches. */
	--kop-net-surface: #FFFFFF;
	--kop-net-ink: var(--kop-midnight-blue, #000435);

	max-width: 2200px;
	margin: 1rem auto 2rem;
	padding: 1rem 16px 1.5rem;
	color: var(--kop-net-ink);
	/* Text never sits on the site's gradient: the page is one white card. */
	background: var(--kop-white, #fff);
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0, 4, 53, 0.08);
}

@media (max-width: 600px) {
	.kop-network {
		margin: 0 0 1.5rem;
		border-radius: 0;
	}
}

/* ---------------------------------------------------------------- intro -- */

/* The map is the page, so the intro is one band across its top: title, the
 * two sentences that say what a line is and is not, and the count at the far
 * end. It wraps to a stack on a narrow screen. */
.kop-network__intro {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 1.25rem;
	align-items: baseline;
	margin: 0 0 0.6rem;
}

.kop-network__title {
	flex: 0 0 auto;
	margin: 0;
	font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
	line-height: 1.15;
}

.kop-network__standfirst {
	flex: 1 1 32ch;
	min-width: 0;
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.4;
	opacity: 0.85;
}

.kop-network__tally {
	flex: 0 0 auto;
	margin: 0;
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	opacity: 0.7;
}

.kop-network__donate {
	flex: 0 0 auto;
	align-self: center;
	margin-left: auto;
}

.kop-network__editorial {
	flex: 1 0 100%;
	margin-top: 0.5rem;
}

.kop-network__noscript,
.kop-network__unavailable {
	max-width: 60ch;
	margin: 0 auto 2rem;
	padding: 1rem 1.15rem;
	border-left: 4px solid var(--kop-teal, #33A7B5);
	border-radius: 0 var(--kop-net-radius) var(--kop-net-radius) 0;
	background: var(--kop-soft-yellow, #FFF5CB);
	line-height: 1.6;
}

.kop-network__unavailable code {
	display: inline-block;
	padding: 0.1em 0.35em;
	background: rgba(0, 4, 53, 0.08);
	border-radius: 3px;
	font-size: 0.9em;
}

/* ------------------------------------------------------------------ app -- */

/* Toolbar, trail and stage stacked in one window-high column. svh rather
 * than vh so a phone's address bar cannot push the bottom of the stage off
 * the screen; the vh line is for browsers without it. */
.kop-network__app {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	height: calc(100vh - 1rem);
	height: calc(100svh - 1rem);
	min-height: 520px;
	scroll-margin-top: 0.5rem;
}

/* Full screen: the same column over the whole screen, on the page's own
 * ground rather than the black a browser puts behind a full-screen element.
 * --full is the stand-in where the browser has no full screen to give: the
 * app pinned over the window, above the admin bar. */
.kop-network__app:fullscreen,
.kop-network__app--full {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 0.5rem;
	background: #fff;
}

.kop-network__app--full {
	position: fixed;
	z-index: 100000;
	inset: 0;
}

html.kop-network-pinned {
	overflow: hidden;
}

/* Pressed, it reads as the Focus / Expand switch does. */
.kop-network__button--full[aria-pressed="true"] {
	border-color: var(--kop-navy, #000080);
	background: var(--kop-navy, #000080);
	color: #fff;
}

/* -------------------------------------------------------------- toolbar -- */

/* One row on a desktop: search takes the slack, the controls sit right. */
.kop-network__toolbar {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: center;
}

.kop-network__search {
	position: relative;
	flex: 1 1 240px;
	min-width: 0;
	max-width: 520px;
}

.kop-network__search-input {
	width: 100%;
	height: var(--kop-net-control);
	padding: 0 0.75rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: #fff;
	font-size: 0.95rem;
}

.kop-network__search-input:focus-visible {
	outline: 2px solid var(--kop-teal, #33A7B5);
	outline-offset: 1px;
}

.kop-network__search-results {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 320px;
	margin: 0;
	padding: 0.25rem;
	overflow-y: auto;
	list-style: none;
	background: #fff;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	box-shadow: 0 8px 24px rgba(0, 4, 53, 0.14);
}

/* [hidden] has to win over the display the list would otherwise take. */
.kop-network__search-results[hidden] {
	display: none;
}

.kop-network__search-option {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	padding: 0.4rem 0.55rem;
	border-radius: 4px;
	cursor: pointer;
}

.kop-network__search-option:hover,
.kop-network__search-option[aria-selected="true"] {
	background: var(--kop-sand, #F2EEDF);
}

.kop-network__search-option[aria-selected="true"] {
	outline: 2px solid var(--kop-teal, #33A7B5);
	outline-offset: -2px;
}

.kop-network__search-name {
	font-weight: 600;
	color: var(--kop-midnight-blue, #000435);
}

.kop-network__search-meta {
	font-size: 0.8rem;
	color: #4a4f6a;
}

.kop-network__search-none {
	padding: 0.45rem 0.55rem;
	font-style: italic;
	color: #4a4f6a;
}

.kop-network__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-left: auto;
}

.kop-network__colour {
	display: flex;
	gap: 0.35rem;
	align-items: center;
	font-size: 0.8rem;
	white-space: nowrap;
}

/* The label is the quiet half of the pair; the select carries the value. */
.kop-network__colour > span {
	opacity: 0.75;
}

.kop-network__select,
.kop-network__button {
	height: var(--kop-net-control);
	padding: 0 0.7rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	white-space: nowrap;
	cursor: pointer;
}

.kop-network__button:hover {
	border-color: var(--kop-teal, #33A7B5);
}

.kop-network__button--quiet {
	width: 100%;
	margin-top: 0.5rem;
	background: transparent;
}

/* ---------------------------------------------------------------- path -- */

/* The Path form hangs under its button, over the top of the stage, and goes
 * away once it has an answer: the route is read in the drawer, so nothing is
 * left sitting on the map it describes. */
.kop-network__path-wrap {
	position: relative;
}

.kop-network__path-wrap > .kop-network__button[aria-expanded="true"] {
	border-color: var(--kop-teal, #33A7B5);
	background: var(--kop-sand, #F2EEDF);
}

.kop-network__path {
	position: absolute;
	z-index: 25;
	top: calc(100% + 6px);
	right: 0;
	width: min(340px, calc(100vw - 2rem));
	padding: 0.75rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 4, 53, 0.18);
}

.kop-network__path[hidden] {
	display: none;
}

.kop-network__path-form {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin: 0;
}

.kop-network__path-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--kop-midnight-blue, #000435);
}

/* The search box's own layout rules are for the toolbar; in the form a
 * field is a full-width row with its label above it. */
.kop-network__path-field {
	flex: 0 0 auto;
	max-width: none;
}

.kop-network__path-field label {
	display: block;
	margin-bottom: 0.15rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: #4a4f6a;
}

.kop-network__path-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.kop-network__path-find {
	border-color: var(--kop-navy-blue, #000080);
	background: var(--kop-navy-blue, #000080);
	color: #fff;
	font-weight: 600;
}

.kop-network__path-find:hover {
	background: var(--kop-midnight-blue, #000435);
}

.kop-network__path-message {
	margin: 0;
	font-size: 0.82rem;
	color: #4a4f6a;
}

.kop-network__path-message:empty {
	display: none;
}

/* The route, written out in the drawer: each name, and under it what joins
 * it to the next, down a rule that stands for the line on the board. */
.kop-network__route {
	margin: 0.6rem 0 0.9rem;
	padding: 0;
	list-style: none;
	counter-reset: kop-route;
}

.kop-network__route-step {
	position: relative;
	padding: 0 0 0.7rem 1.6rem;
	counter-increment: kop-route;
}

.kop-network__route-step::before {
	content: counter(kop-route);
	position: absolute;
	top: 0.3rem;
	left: 0;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 50%;
	background: var(--kop-navy-blue, #000080);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.2rem;
	text-align: center;
}

.kop-network__route-step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 1.6rem;
	bottom: 0;
	left: calc(0.6rem - 1px);
	border-left: 2px solid var(--kop-teal, #33A7B5);
}

.kop-network__route-join {
	display: block;
	margin: 0.1rem 0 0 0.4rem;
	padding-left: 0.5rem;
	border-left: 2px solid var(--kop-net-border);
	font-size: 0.8rem;
	font-style: italic;
	color: #33384f;
}

.kop-network__drawer-link[aria-current="true"] {
	font-weight: 700;
	background: var(--kop-sand, #F2EEDF);
}

/* Focus / Expand: a two-way switch styled as one control. */
.kop-network__mode {
	display: inline-flex;
	height: var(--kop-net-control);
	margin: 0;
	padding: 0;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: #fff;
	overflow: hidden;
}

.kop-network__mode-option {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 0 0.75rem;
	font-size: 0.85rem;
	cursor: pointer;
}

.kop-network__mode-option + .kop-network__mode-option {
	border-left: 1px solid var(--kop-net-border);
}

/* The radio stays in the tab order and is announced; the label is the
 * thing that looks pressed. */
.kop-network__mode-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.kop-network__mode-option:has(input:checked) {
	background: var(--kop-navy, #000080);
	color: #fff;
}

.kop-network__mode-option:has(input:focus-visible) {
	outline: 2px solid var(--kop-teal, #33A7B5);
	outline-offset: -2px;
}

/* ------------------------------------------------------ chain breadcrumb -- */

/* One row, always. The strip keeps its height with or without a trail so
 * the stage below never changes size on a click, and a long trail scrolls
 * sideways (app.js keeps the newest step in view) instead of wrapping. */
.kop-network__chain {
	display: flex;
	flex: 0 0 auto;
	gap: 0.5rem;
	align-items: center;
	min-width: 0;
	height: var(--kop-net-control);
	padding: 0 0.3rem 0 0.65rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: var(--kop-net-surface);
}

.kop-network__chain-label {
	flex: 0 0 auto;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
}

.kop-network__chain-list {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: nowrap;
	gap: 0.3rem;
	align-items: center;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
}

.kop-network__chain-list[hidden],
.kop-network__chain-empty[hidden],
.kop-network__chain-home[hidden] {
	display: none;
}

.kop-network__chain-list li {
	display: flex;
	flex: 0 0 auto;
	gap: 0.3rem;
	align-items: center;
	margin: 0;
}

/* The separator is decorative; the list order carries the meaning. */
.kop-network__chain-list li + li::before {
	content: "\203A";
	opacity: 0.5;
}

.kop-network__chain-list button,
.kop-network__chain-current {
	display: inline-block;
	max-width: 24ch;
	overflow: hidden;
	padding: 0.15rem 0.55rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.8rem;
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

/* Start over sits at the far end, out of the way of the crumbs. */
.kop-network__chain-home {
	flex: 0 0 auto;
	order: 1;
	margin-left: auto;
	padding: 0.15rem 0.6rem;
	border: 1px solid var(--kop-net-border);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.8rem;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
}

.kop-network__chain-list button:hover,
.kop-network__chain-home:hover {
	border-color: var(--kop-teal, #33A7B5);
}

.kop-network__chain-empty {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	font-size: 0.8rem;
	font-style: italic;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.7;
}

/* The last crumb is where you are, so it is text carrying aria-current
 * rather than a control that would go nowhere. */
.kop-network__chain-current {
	background: var(--kop-navy, #000080);
	color: #fff;
	cursor: default;
}

/* ----------------------------------------------------------------- body -- */

.kop-network__body {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--kop-net-gap);
	min-height: 0;
}

.kop-network__body:has(.kop-network__drawer:not([hidden])) {
	grid-template-columns: minmax(0, 1fr) var(--kop-net-drawer);
}

/* ------------------------------------------------------------------ key -- */

/* Reset view and Full screen: the stage's own controls, in its top-right
 * corner, drawn like the Key's button opposite them, with the zoom in a
 * column beneath and aligned to the same edge. */
.kop-network__view-controls {
	position: absolute;
	z-index: 5;
	top: 0.5rem;
	right: 0.5rem;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.35rem;
}

.kop-network__view-row {
	display: flex;
	gap: 0.35rem;
}

/* A column at every width: on a phone there is no room for a row, and on a
 * desktop the three read as one control stacked under Reset view. */
.kop-network__zoom {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.35rem;
}

/* Said once, under the zoom it is talking about. */
.kop-network__zoom-hint {
	max-width: min(220px, 60vw);
	margin: 0;
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: var(--kop-soft-pastel-yellow, #FFF5CB);
	font-size: 0.78rem;
	line-height: 1.4;
	box-shadow: 0 4px 14px rgba(0, 4, 53, 0.14);
}

.kop-network__zoom-hint[hidden] {
	display: none;
}

.kop-network__stage-button {
	padding: 0.25rem 0.7rem;
	border: 1px solid var(--kop-net-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: inherit;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 4, 53, 0.1);
}

/* Simplify while it is on: pressed, in the navy of the mode toggle. */
.kop-network__stage-button.is-on {
	border-color: var(--kop-navy-blue, #000080);
	background: var(--kop-navy-blue, #000080);
	color: #fff;
}

.kop-network__stage-button[hidden] {
	display: none;
}

.kop-network__stage-button:hover {
	border-color: var(--kop-teal, #33A7B5);
}

.kop-network__stage-button:focus-visible {
	outline: 2px solid var(--kop-teal, #33A7B5);
	outline-offset: 1px;
}

/* Plus and minus are one glyph each, so they are drawn round rather than
 * left to stretch to the width of the button above them. */
.kop-network__stage-button--icon {
	width: 1.9rem;
	padding: 0.25rem 0;
	font-size: 1rem;
	line-height: 1.1;
	text-align: center;
}

/* Copy link says so for a moment once it has. */
.kop-network__button[data-copied="true"] {
	border-color: var(--kop-teal, #33A7B5);
	background: var(--kop-mint-green, #B6E3D4);
}

/* Folded into the stage's top-left corner: a button when closed, a panel
 * under it when open. Over the map rather than beside it, so opening it does
 * not resize the stage and re-lay the map out; capped in size so that even
 * open on a phone it leaves most of the map in view. */
.kop-network__key {
	position: absolute;
	z-index: 5;
	top: 0.5rem;
	left: 0.5rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	max-width: min(260px, calc(100% - 1rem));
	max-height: calc(100% - 1rem);
}

.kop-network__key-toggle {
	flex: 0 0 auto;
	padding: 0.25rem 0.7rem;
	border: 1px solid var(--kop-net-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: inherit;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 4, 53, 0.1);
}

.kop-network__key-toggle::after {
	content: " \25BE";
}

.kop-network__key-toggle[aria-expanded="true"]::after {
	content: " \25B4";
}

.kop-network__key-toggle:hover {
	border-color: var(--kop-teal, #33A7B5);
}

.kop-network__key-toggle:focus-visible {
	outline: 2px solid var(--kop-teal, #33A7B5);
	outline-offset: 1px;
}

.kop-network__rail {
	min-height: 0;
	/* Its padding and border are inside the width, or a full-width panel
	 * overhangs the stage by them - which is what it did at 390 px once the
	 * Key started opening itself. */
	box-sizing: border-box;
	width: 100%;
	overflow-y: auto;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 6px 20px rgba(0, 4, 53, 0.16);
}

.kop-network__rail[hidden] {
	display: none;
}

.kop-network__group {
	margin: 0 0 1.1rem;
	padding: 0;
	border: 0;
}

.kop-network__group:last-child {
	margin-bottom: 0;
}

.kop-network__group legend {
	margin-bottom: 0.4rem;
	padding: 0;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.7;
}

.kop-network__check {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	padding: 0.22rem 0;
	font-size: 0.88rem;
	line-height: 1.3;
	cursor: pointer;
}

.kop-network__check span:first-of-type {
	flex: 1 1 auto;
}

.kop-network__count {
	flex: 0 0 auto;
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.55;
}

.kop-network__range {
	display: block;
	font-size: 0.88rem;
}

.kop-network__range input {
	width: 100%;
	margin-top: 0.35rem;
}

.kop-network__note {
	margin: 0 0 0.5rem;
	font-size: 0.78rem;
	line-height: 1.45;
	opacity: 0.7;
}

.kop-network__legend-toggle {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
}

.kop-network__legend-toggle::after {
	content: " \25BE";
}

.kop-network__legend-toggle[aria-expanded="true"]::after {
	content: " \25B4";
}

/* ---------------------------------------------------------------- stage -- */

.kop-network__stage {
	position: relative;
	min-height: 360px;
	height: 100%;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: var(--kop-net-surface);
	overflow: hidden;
}

.kop-network__canvas {
	display: block;
	width: 100%;
	height: 100%;
	/* The pointer handlers own panning, so the browser must not also scroll. */
	touch-action: none;
}

.kop-network__canvas:focus-visible {
	outline: 2px solid var(--kop-teal, #33A7B5);
	outline-offset: -2px;
}

.kop-network__loading {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0;
	transform: translate(-50%, -50%);
	font-size: 0.95rem;
	opacity: 0.7;
}

.kop-network__legend:empty {
	display: none;
}

.kop-network__legend-heading {
	margin: 0.6rem 0 0.25rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
}

.kop-network__legend-heading:first-child {
	margin-top: 0;
}

.kop-network__legend-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kop-network__legend-row {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	margin: 0;
	padding: 0.05rem 0;
	font-size: 0.8rem;
	line-height: 1.4;
}

/* Painted by the renderer's own node painter, so it matches the map. */
.kop-network__legend-mark {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

.kop-network__legend-label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* A row that explains a mark rather than naming one: it is a sentence, so
 * it wraps instead of being cut off, and its swatch sits with the first
 * line rather than in the middle of the block. */
.kop-network__legend-row--wrap {
	align-items: flex-start;
}

.kop-network__legend-row--wrap .kop-network__legend-mark {
	margin-top: 0.1rem;
}

.kop-network__legend-row--wrap .kop-network__legend-label {
	overflow: visible;
	text-overflow: clip;
	white-space: normal;
}

/* The two lines at the top of the Key, before any swatch. */
.kop-network__legend-intro {
	margin: 0 0 0.7rem;
	font-size: 0.78rem;
	line-height: 1.45;
	opacity: 0.85;
}

/* Announces selection to screen readers without taking up space. */
/* What a line says. Beside the pointer while a line is hovered, and out of
 * the pointer's way: it must not swallow the move that would dismiss it.
 * Pinned by a click, it takes clicks itself, since the people in it become
 * buttons. */
.kop-network__popup {
	position: absolute;
	z-index: 6;
	max-width: min(300px, calc(100% - 8px));
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--kop-net-border);
	border-left: 3px solid var(--kop-teal, #33A7B5);
	border-radius: var(--kop-net-radius);
	background: #fff;
	box-shadow: 0 6px 20px rgba(0, 4, 53, 0.18);
	color: var(--kop-midnight-blue, #000435);
	font-size: 0.8rem;
	line-height: 1.35;
	pointer-events: none;
}

.kop-network__popup[data-pinned="true"] {
	pointer-events: auto;
	border-left-color: var(--kop-orange, #EF9034);
}

.kop-network__popup-title {
	margin: 0 0 0.3rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: #4a4f6a;
}

.kop-network__popup-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kop-network__popup-item + .kop-network__popup-item {
	margin-top: 0.4rem;
	padding-top: 0.4rem;
	border-top: 1px solid var(--kop-net-border);
}

.kop-network__popup-person,
.kop-network__popup-label {
	display: block;
	font-weight: 600;
	font-size: 0.86rem;
}

button.kop-network__popup-person {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	color: var(--kop-navy-blue, #000080);
	text-align: left;
	text-decoration: underline;
	cursor: pointer;
}

.kop-network__popup-text,
.kop-network__popup-source {
	display: block;
}

.kop-network__popup-source,
.kop-network__popup-hint {
	font-size: 0.72rem;
	color: #4a4f6a;
}

.kop-network__popup-hint {
	margin: 0.4rem 0 0;
}

/* What a name is, beside it once the pointer or the keyboard cursor has
 * rested on it (js/network-map/card.js). Never in the pointer's way: it
 * must not swallow the move that takes the pointer to the next name. */
.kop-network__card {
	position: absolute;
	z-index: 6;
	width: max-content;
	max-width: min(260px, calc(100% - 8px));
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--kop-net-border);
	border-left: 3px solid var(--kop-navy-blue, #000080);
	border-radius: var(--kop-net-radius);
	background: #fff;
	box-shadow: 0 6px 20px rgba(0, 4, 53, 0.18);
	color: var(--kop-midnight-blue, #000435);
	font-size: 0.8rem;
	line-height: 1.35;
	pointer-events: none;
}

.kop-network__card p {
	margin: 0;
}

.kop-network__card-name {
	font-weight: 700;
	font-size: 0.9rem;
}

.kop-network__card-facts {
	margin-bottom: 0.25rem !important;
	color: #4a4f6a;
}

.kop-network__card-deaths {
	font-weight: 600;
	color: #6d0014;
}

.kop-network__card-hint {
	margin-top: 0.3rem !important;
	font-size: 0.72rem;
	color: #4a4f6a;
}

@media (hover: none) {
	.kop-network__card {
		display: none;
	}
}

.kop-network__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --------------------------------------------------------------- drawer -- */

/* The same height as the stage beside it, scrolling on its own. */
.kop-network__drawer {
	min-height: 0;
	overflow-y: auto;
	padding: 1rem;
	border: 1px solid var(--kop-net-border);
	border-radius: var(--kop-net-radius);
	background: #fff;
}

.kop-network__drawer-close {
	float: right;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.kop-network__drawer-close:hover {
	background: rgba(0, 4, 53, 0.07);
}

.kop-network__drawer[hidden] {
	display: none;
}

.kop-network__drawer-title {
	margin: 0 2.2rem 0.25rem 0;
	font-size: 1.15rem;
	line-height: 1.3;
	color: var(--kop-midnight-blue, #000435);
}

.kop-network__drawer-meta,
.kop-network__drawer-aliases {
	margin: 0 0 0.4rem;
	font-size: 0.85rem;
	color: #4a4f6a;
}

/* A warning mark, not decoration: a firm red, never the coral accent. */
.kop-network__drawer-deaths {
	margin: 0 0 0.6rem;
	padding: 0.35rem 0.55rem;
	border-left: 3px solid #B00020;
	font-size: 0.85rem;
	font-weight: 600;
	color: #6d0014;
}

.kop-network__drawer-profile {
	display: inline-block;
	margin: 0.2rem 0 0.8rem;
	font-weight: 600;
	color: var(--kop-navy-blue, #000080);
}

/* Opens the Connect two names form with this name as one end. A button, not
 * a link, so it is drawn as one: the reader has to see that it does something. */
.kop-network__drawer-route {
	display: block;
	margin: 0.2rem 0 0.6rem;
	padding: 0.4rem 0.7rem;
	border: 1px solid var(--kop-teal, #33A7B5);
	border-radius: var(--kop-net-radius);
	background: #fff;
	color: var(--kop-navy-blue, #000080);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

.kop-network__drawer-route:hover,
.kop-network__drawer-route:focus-visible {
	background: var(--kop-sand, #F2EEDF);
}

.kop-network__drawer-group {
	margin: 0.9rem 0 0.3rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #4a4f6a;
}

.kop-network__drawer-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kop-network__drawer-link {
	display: block;
	width: 100%;
	padding: 0.3rem 0.4rem;
	border: 0;
	border-radius: 4px;
	background: none;
	text-align: left;
	font: inherit;
	font-size: 0.88rem;
	color: var(--kop-navy-blue, #000080);
	cursor: pointer;
}

.kop-network__drawer-link:hover,
.kop-network__drawer-link:focus-visible {
	background: var(--kop-sand, #F2EEDF);
	text-decoration: underline;
}

.kop-network__drawer-source {
	display: block;
	padding: 0 0.4rem 0.25rem;
	font-size: 0.72rem;
	color: #4a4f6a;
}

/* A name and, when it has one, its facility profile beside it. */
.kop-network__drawer-row {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
}

.kop-network__drawer-row .kop-network__drawer-link {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

.kop-network__drawer-item-profile {
	flex: 0 0 auto;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--kop-navy-blue, #000080);
}

/* The role on a connection, under its name. */
.kop-network__drawer-role {
	display: block;
	padding: 0 0.4rem 0.2rem;
	font-size: 0.78rem;
	color: #2b2f4a;
}

/* Everywhere else a person has been: indented under them, ruled in teal. */
.kop-network__drawer-also {
	margin: 0.1rem 0 0.45rem 0.6rem;
	padding: 0 0 0 0.55rem;
	list-style: none;
	border-left: 2px solid var(--kop-teal, #33A7B5);
}

.kop-network__drawer-also li {
	padding: 0.1rem 0;
}

.kop-network__drawer-also .kop-network__drawer-role {
	display: inline;
	padding: 0 0.35rem 0 0;
}

.kop-network__drawer-also .kop-network__drawer-role::before {
	content: "- ";
}

.kop-network__drawer-also-link {
	padding: 0.1rem 0.25rem;
	border: 0;
	border-radius: 4px;
	background: none;
	text-align: left;
	font: inherit;
	font-size: 0.8rem;
	color: var(--kop-navy-blue, #000080);
	cursor: pointer;
}

.kop-network__drawer-also-link:hover,
.kop-network__drawer-also-link:focus-visible {
	background: var(--kop-sand, #F2EEDF);
	text-decoration: underline;
}

.kop-network__drawer-toggle {
	display: block;
	margin: 0.2rem 0 0.2rem;
	padding: 0.25rem 0.6rem;
	border: 1px solid var(--kop-net-border);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 0.78rem;
	color: var(--kop-midnight-blue, #000435);
	cursor: pointer;
}

.kop-network__drawer-toggle:hover,
.kop-network__drawer-toggle:focus-visible {
	background: var(--kop-sand, #F2EEDF);
}

.kop-network__drawer-empty {
	font-size: 0.85rem;
	font-style: italic;
	color: #4a4f6a;
}

/* ------------------------------------------------------------- narrow -- */

@media (max-width: 900px) {
	.kop-network__app {
		min-height: 480px;
	}

	.kop-network__body,
	.kop-network__body:has(.kop-network__drawer:not([hidden])) {
		grid-template-columns: minmax(0, 1fr);
	}

	.kop-network__search {
		flex-basis: 100%;
		max-width: none;
	}

	.kop-network__actions {
		gap: 0.4rem;
		margin-left: 0;
	}

	/* The selects' captions go quiet on a phone so the controls fit in two
	 * rows. The caption stays in the accessible name. */
	.kop-network__colour:not(.kop-network__colour--key) > span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.kop-network__select,
	.kop-network__button,
	.kop-network__mode-option {
		padding: 0 0.55rem;
		font-size: 0.8rem;
	}

	/* The trail's label is the first thing to go when room is short. */
	.kop-network__chain-label {
		display: none;
	}

	/* A sheet across the stage rather than a column down one side of it.
	 * At 375 px a 220 px panel leaves the stage's own controls showing
	 * half-covered behind its edge, which reads as broken; the full width
	 * reads as what it is, a panel over the map, the way the drawer does
	 * at this width. It matters now the Key opens itself on a first
	 * visit. */
	.kop-network__key {
		width: calc(100% - 1rem);
		max-width: calc(100% - 1rem);
		max-height: 60%;
	}

	/* The toolbar wraps on a phone, so the button can be anywhere along its
	 * row; the form is pinned to the screen's edges instead of the button's. */
	.kop-network__path-wrap {
		position: static;
	}

	.kop-network__toolbar {
		position: relative;
	}

	.kop-network__path {
		top: 100%;
		left: 0;
		right: 0;
		width: auto;
	}

	/* A sheet over the lower half, not the whole screen: the map has to
	 * stay visible behind what it is describing. */
	.kop-network__drawer {
		position: fixed;
		z-index: 40;
		inset: auto 0 0 0;
		max-height: 50vh;
		border-radius: var(--kop-net-radius) var(--kop-net-radius) 0 0;
		box-shadow: 0 -8px 28px rgba(0, 4, 53, 0.22);
	}
}

/* "Connect two names" is "Connect" on a phone, so Copy link stays on the
 * same row; the button's aria-label keeps the whole name. */
@media (max-width: 480px) {
	.kop-network__path-toggle-rest {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kop-network * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* A line swatch needs more room than a node swatch. */
.kop-network__legend-mark--line {
	width: 26px;
}
