/* Dimension colour classes; shape carries the same distinction in the SVG itself. */
.netz-dim-0 { --dim: var(--cat-ai-lit); }
.netz-dim-1 { --dim: var(--cat-gen-ki); }
.netz-dim-2 { --dim: var(--cat-prompt); }
.netz-dim-3 { --dim: var(--cat-ki-sonst); }
.netz-dim-4 { --dim: var(--cat-soz-arb); }
.netz-dim-5 { --dim: var(--cat-bias); }
.netz-dim-6 { --dim: var(--cat-gender); }
.netz-dim-7 { --dim: var(--cat-divers); }
.netz-dim-8 { --dim: var(--cat-femin); }
.netz-dim-9 { --dim: var(--cat-fairness); }

.netz-controls { align-items: flex-start; }

.netz-fields {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-md) var(--space-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-lg);
    min-inline-size: 0;
}

.netz-fields legend { padding-inline: var(--space-xs); font-size: var(--text-sm); color: var(--gray-600); }

/* Selectors repeat .netz-controls to outrank the shared .controls label and input rules. */
.netz-controls .netz-check,
.netz-controls .netz-works-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-block-size: 1.75rem;
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--gray-900);
}

.netz-controls input[type="checkbox"] {
    min-block-size: 0;
    inline-size: 1.125rem;
    block-size: 1.125rem;
    padding: 0;
    accent-color: var(--primary-dark);
}

/* The bipartite layout only exists at wide widths; the script uses the same query. */
.netz-controls .netz-works-toggle { display: none; }
@media (min-width: 64rem) { .netz-controls .netz-works-toggle { display: inline-flex; } }

:is(.release-main, .release-view) .netz-heading {
    margin-block: var(--space-lg) var(--space-sm);
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 600;
    line-height: 1.3;
}

:is(.release-main, .release-view) .netz-heading:empty { display: none; }

.netz-heading-dim {
    margin-inline-start: var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--gray-600);
}

.netz-figure { overflow-x: auto; }

/* On narrow screens the figure cannot show its labels at a readable size, so the
   table with the same terms and counts comes first and the figure follows. */
.netz-body { display: flex; flex-direction: column; }
@media (max-width: 40rem) { .netz-list-wrap { order: -1; } }

.netz-graph {
    display: block;
    inline-size: 100%;
    block-size: auto;
    max-block-size: 90vh;
    min-inline-size: 46rem;
}

/* On narrow screens the whole figure scales into the column, so no label is cut off at
   the edge of a scroll region; the table above it carries the readable equivalent. */
@media (max-width: 40rem) { .netz-graph { min-inline-size: 0; } }

.netz-graph text { font-family: var(--font-body); }

.netz-label { font-size: 13px; fill: var(--gray-900); }

.netz-label,
.netz-count-inline {
    paint-order: stroke;
    stroke: Canvas;
    stroke-width: 3px;
    stroke-linejoin: round;
}

.netz-count-inline { font-weight: 600; fill: var(--gray-600); }

.netz-glyph { fill: var(--gray-600); }

.netz-item { cursor: pointer; }
.netz-item:focus { outline: none; }

.netz-line {
    /* Darkened toward the text colour, so even the light category colours keep 3:1 against the page. */
    stroke: color-mix(in oklch, var(--dim) 55%, var(--gray-900));
    stroke-linecap: round;
}

.netz-ring,
.netz-hit { fill: none; stroke: transparent; stroke-linecap: round; pointer-events: stroke; }
.netz-ring { pointer-events: none; }

.netz-edge:hover .netz-ring { stroke: var(--gray-400); }
.netz-edge:focus-visible .netz-ring { stroke: var(--gray-900); }

.netz-count-box { fill: Canvas; stroke: var(--gray-500); stroke-width: 1; }
.netz-count { font-size: 12px; font-weight: 600; fill: var(--gray-900); }
.netz-edge:hover .netz-count-box { stroke: var(--gray-700); }
.netz-edge:focus-visible .netz-count-box { stroke: var(--gray-900); stroke-width: 2.5; }
.netz-edge.is-selected .netz-count-box { fill: var(--gray-800); stroke: var(--gray-900); }
.netz-edge.is-selected .netz-count { fill: var(--gray-50); }

.netz-marker { fill: var(--dim); stroke: var(--gray-800); stroke-width: 1.5; stroke-linejoin: round; }

/* Filled hit shapes: circles and rects need fill to be hit and stroke to show focus. */
circle.netz-hit,
rect.netz-hit { fill: transparent; stroke: transparent; pointer-events: all; }
.netz-node:hover .netz-hit,
.netz-term:hover .netz-hit,
.netz-work:hover .netz-hit { stroke: var(--gray-400); stroke-width: 1.5; }
.netz-node:focus-visible .netz-hit,
.netz-term:focus-visible .netz-hit,
.netz-work:focus-visible .netz-hit { stroke: var(--gray-900); stroke-width: 2.5; }

.netz-term.is-selected .netz-label { font-weight: 700; }
.netz-term.is-selected .netz-hit { stroke: var(--gray-700); stroke-width: 1.5; }

.netz-ego rect { fill: var(--primary-dark); }
.netz-ego text { font-size: 14px; font-weight: 600; fill: var(--gray-50); }

.netz-dot { fill: var(--gray-600); }

.netz-link { stroke: var(--dim); stroke-opacity: 0.35; stroke-width: 1; }
.netz-link.is-selected { stroke-opacity: 1; stroke-width: 2; }

.netz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-lg);
    margin-block: var(--space-md);
    padding: 0;
    list-style: none;
    font-size: var(--text-sm);
    color: var(--gray-700);
}

.netz-legend li { display: inline-flex; align-items: center; gap: var(--space-xs); }

.netz-legend-marker { fill: var(--dim); stroke: var(--gray-800); stroke-width: 1.5; stroke-linejoin: round; flex: none; }

/* Positioned so the absolutely placed .sr-only spans scroll with the table instead of widening the page. */
.netz-list-wrap { position: relative; overflow-x: auto; container-type: inline-size; margin-block-end: var(--space-xl); }

.netz-list {
    inline-size: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

.netz-list caption {
    padding-block: var(--space-sm);
    text-align: start;
    font-weight: 600;
}

.netz-list th,
.netz-list td {
    padding: var(--space-xs) var(--space-sm);
    border-block-end: 1px solid var(--gray-200);
    text-align: start;
    vertical-align: middle;
}

.netz-list thead th { color: var(--gray-600); font-size: var(--text-sm); font-weight: 600; }
.netz-list tbody th { font-weight: 400; }
.netz-list tr.is-selected { background: var(--gray-100); }

.netz-list button {
    min-block-size: 1.75rem;
    padding: 0 var(--space-sm);
    border: 1px solid var(--gray-500);
    border-radius: var(--radius-sm);
    background: Canvas;
    color: var(--gray-900);
    font: inherit;
    font-size: var(--text-sm);
    white-space: nowrap;
    cursor: pointer;
}

.netz-list button:hover { border-color: var(--gray-600); }
.netz-list button[aria-pressed="true"] { background: var(--gray-800); border-color: var(--gray-800); color: var(--gray-50); }

@container (inline-size < 34rem) {
    .netz-list { font-size: var(--text-sm); hyphens: auto; }
    .netz-list th,
    .netz-list td { padding-inline: var(--space-xs); }
    .netz-list button { padding-inline: var(--space-xs); white-space: normal; }
}

/* Wissensnetz of the working application (wissensnetz.js): the screening categories as
   a network of joint coding. Every rule is scoped to .wn-root, which only index.html has. */
.wn-root .wn-controls { align-items: end; }
.wn-root .wn-bases { margin-bottom: 0; }
.wn-terms-link { font-size: var(--text-sm); margin: 0 0 var(--space-sm); }
.wn-controls .wn-terms-link { margin: 0 0 0 auto; align-self: center; }

.wn-layout { display: flex; flex-direction: column; gap: var(--space-xl); }
.wn-main, .wn-side { min-width: 0; }
/* Below the two-column width the linked table and the selection come before the figure. */
.wn-side { order: -1; display: flex; flex-direction: column; gap: var(--space-lg); }

@media (min-width: 64rem) {
    .wn-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 1fr); align-items: start; }
    .wn-side { order: 0; }
}

.wn-figure { max-inline-size: 46rem; }
.wn-graph { display: block; inline-size: 100%; block-size: auto; font-family: var(--font-body); }
.wn-bg { fill: transparent; }

.wn-line { fill: none; stroke: var(--gray-500); stroke-opacity: var(--o, .5); stroke-linecap: round; transition: stroke-opacity .2s ease, stroke .2s ease; }
.wn-line--union { stroke: var(--gray-300); stroke-opacity: .7; }
.wn-line--both { stroke: var(--gray-700); stroke-opacity: .75; }
.wn-hit { fill: none; stroke: transparent; pointer-events: stroke; }
.wn-node .wn-hit { fill: transparent; pointer-events: all; }
.wn-item { cursor: pointer; outline: none; }

.wn-dot { fill: var(--node); stroke: var(--gray-50); stroke-width: 1.5; }
.wn-dot--union { fill-opacity: .35; stroke: var(--node); }
.wn-dot-both { fill: var(--node); }
/* A residual category (Sonstige) recedes: muted fill and a dashed outline in its colour. */
.wn-node--residual .wn-dot { fill-opacity: .4; stroke: var(--node); stroke-dasharray: 3 2; }
.wn-label { fill: var(--gray-900); font-weight: 500; }
.wn-count { fill: var(--gray-600); font-weight: 400; font-variant-numeric: tabular-nums; }

.wn-edge:hover .wn-line { stroke-opacity: 1; stroke: var(--gray-800); }
.wn-graph.has-selection .wn-edge:not(.is-near) .wn-line,
.wn-graph.is-preview .wn-edge:not(.is-preview-near) .wn-line { stroke-opacity: .08; }
.wn-graph.has-selection .wn-node:not(.is-near) .wn-dot { opacity: .55; }
.wn-edge.is-near .wn-line:not(.wn-line--union),
.wn-edge.is-preview-near .wn-line:not(.wn-line--union) { stroke: var(--primary-dark); stroke-opacity: .85; }
.wn-edge.is-near .wn-line--union { stroke: var(--primary-light); stroke-opacity: .45; }
.wn-edge.is-selected .wn-line:not(.wn-line--union) { stroke: var(--primary-dark); stroke-opacity: 1; }
.wn-node.is-selected .wn-dot { stroke: var(--gray-900); stroke-width: 3; }
.wn-node.is-selected .wn-label { font-weight: 700; }

.wn-item:focus-visible .wn-dot { stroke: var(--primary-dark); stroke-width: 4; }
.wn-item:focus-visible .wn-hit { stroke: var(--primary); stroke-opacity: .35; }
.wn-node:focus-visible .wn-hit { stroke: none; }

.wn-pill { pointer-events: none; }
/* Narrower than the navigation tooltip, so one fits between nodes, labels and the work list. */
.wn-tip { min-width: 0; max-width: 15rem; }
.wn-pill rect { fill: var(--gray-50); stroke: var(--primary-dark); stroke-width: 1.2; }
.wn-pill text { fill: var(--gray-900); font-weight: 600; font-variant-numeric: tabular-nums; }

.wn-legend { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); margin: var(--space-sm) 0 0; padding: 0; list-style: none; font-size: var(--text-xs); color: var(--gray-700); }
.wn-legend li { display: inline-flex; align-items: center; gap: var(--space-xs); }
.wn-legend-dot { fill: var(--gray-400); }
.wn-legend .wn-line { stroke-opacity: .8; }
.wn-legend-dot--residual { fill: var(--gray-400); fill-opacity: .4; stroke: var(--gray-600); stroke-width: 1.5; stroke-dasharray: 3 2; }

.wn-detail { border-bottom: 1px solid var(--gray-200); padding-bottom: var(--space-md); }
.wn-detail[hidden] { display: none; }
.wn-detail-head { display: flex; align-items: start; justify-content: space-between; gap: var(--space-sm); }
.wn-clear { flex: none; inline-size: 1.75rem; block-size: 1.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius-md); background: var(--gray-50); color: var(--gray-700); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.wn-clear:hover { background: var(--gray-100); }
.wn-list { max-height: 24rem; }
.wn-root .lk-mark--none { border: 1px dashed var(--gray-400); }

.wn-table-wrap { max-height: 26rem; overflow: auto; }
.wn-table { inline-size: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.wn-table caption { text-align: start; font-weight: 600; color: var(--gray-800); padding-block-end: var(--space-xs); }
.wn-table th, .wn-table td { padding: .3rem var(--space-xs); border-bottom: 1px solid var(--gray-100); text-align: start; vertical-align: middle; }
.wn-table thead th { position: sticky; top: 0; background: var(--gray-50); font-weight: 500; color: var(--gray-600); font-size: var(--text-xs); }
.wn-pair { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-weight: 400; }
.wn-table tr.is-selected { background: var(--gray-100); }
.wn-table .wn-num { text-align: end; font-variant-numeric: tabular-nums; color: var(--gray-700); white-space: nowrap; }
/* The count is a plain number with a slim bar; it stays a button because it selects the connection. */
.wn-count-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); }
.wn-bar { inline-size: 3rem; block-size: 4px; border-radius: 2px; background: var(--gray-100); overflow: hidden; }
.wn-bar span { display: block; block-size: 100%; background: var(--primary-dark); }
.wn-pick { min-inline-size: 2.25rem; padding: .1rem .15rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--gray-900); font: inherit; font-variant-numeric: tabular-nums; text-align: end; cursor: pointer; }
.wn-pick:hover { color: var(--primary-dark); text-decoration: underline; }
.wn-pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wn-pick[aria-pressed="true"] { color: var(--primary-dark); font-weight: 700; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .wn-line { transition: none; } }
