/* ==========================================================================
   Networks — one global navigation and the content (NETWORK-LEVELS; reference images
   docs/architecture/modular-ux/current/10-network/Home_Sublevel_Cards.png, Home_Sublevel_Listview.png, Network_Level.png). No second, permanent
   tree: a breadcrumb tells the place. Home and every organisation node share one level view: the breadcrumb on one row with
   the "Show as" switch, Add and the menu (no summary line), a row of search, Filter and Sort only when the objects do not fit (wwwroot/js/nms-fit.js),
   then framed cards or a framed list. A network shows its name only in the breadcrumb, one compact status line with Add
   device and a menu, the tab row (.nms-module-nav__tabs) and a framed device table.
   Tokens only (the emitted --air-* tokens and the palette), each with a fallback; no hard-coded colour.
   ========================================================================== */

.net-module {
    position: relative;
    min-width: 0;
    container-type: inline-size;
    container-name: net-module;

    /* Two kinds, told apart by sign, word AND colour: an organisation is blue (the accent), a network violet (the
       fourth series colour). Neither is green, red or amber: those say only how devices actually are. */
    --net-kind-org: var(--air-accent, var(--mud-palette-primary));
    --net-kind-network: var(--air-chart-4, var(--mud-palette-secondary));
    /* A surface that stands clearly off the page: the panel colour lifted a step towards the text colour. */
    --net-card-bg: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 5%, var(--air-surface, var(--mud-palette-surface)));
    --net-card-border: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 16%, transparent);
    --net-control-border: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 28%, transparent);
    /* One framed surface for cards, the level list and the device table (Home_Sublevel_Cards.png): a restrained blue
       edge, a little brighter on top, on a panel a step off the page. */
    --net-frame: color-mix(in srgb, var(--air-accent, var(--mud-palette-primary)) 34%, transparent);
    --net-frame-top: color-mix(in srgb, var(--air-accent, var(--mud-palette-primary)) 62%, transparent);
    --net-frame-line: color-mix(in srgb, var(--air-accent, var(--mud-palette-primary)) 18%, var(--net-card-border));
    --net-surface: color-mix(in srgb, var(--air-accent, var(--mud-palette-primary)) 6%, var(--air-surface, var(--mud-palette-surface)));
    /* The page gutter: the same distance from the sidebar on the left as from the window edge on the right. */
    --net-gutter: clamp(1rem, 2.2vw, 2.25rem);
}

.net-work { min-width: 0; display: flex; flex-direction: column; }
.net-page { display: flex; flex-direction: column; padding: 1.75rem var(--net-gutter) 2rem; }

/* ── The breadcrumb: Home (the house), the organisation nodes, the place as text ── */

.net-crumbs { margin: 0 0 1.25rem; font-size: 0.9375rem; }
.net-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0; margin: 0; padding: 0; list-style: none; }
.net-crumbs__item { display: inline-flex; align-items: center; min-width: 0; }
.net-crumbs__sep { margin: 0 0.75rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-crumbs__home { display: inline-flex; align-items: center; gap: 0.625rem; }
.net-crumbs__icon { color: var(--air-text, var(--mud-palette-text-primary)); }
.net-crumbs__link {
    color: var(--air-accent, var(--mud-palette-primary));
    text-decoration: underline;
    text-underline-offset: 0.2em;
    border-radius: 2px;
    overflow-wrap: anywhere;
}
.net-crumbs__link:hover { text-decoration-thickness: 2px; }
.net-crumbs__link:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 2px; }
.net-crumbs__text { color: var(--air-text-muted, var(--mud-palette-text-secondary)); overflow-wrap: anywhere; }
.net-crumbs__current { color: var(--air-text, var(--mud-palette-text-primary)); font-weight: var(--air-font-weight-semibold, 600); overflow-wrap: anywhere; }
.net-crumbs__home[aria-current="page"] { color: var(--air-text, var(--mud-palette-text-primary)); font-weight: var(--air-font-weight-semibold, 600); }

.net-search { position: relative; display: flex; align-items: center; min-width: 0; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-search__icon { position: absolute; left: 0.625rem; pointer-events: none; }
.net-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.375rem;
    padding: 0.375rem 0.625rem;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--air-text, var(--mud-palette-text-primary));
    background: var(--air-surface, var(--mud-palette-surface));
    border: 1px solid var(--air-border, var(--mud-palette-lines-inputs));
    border-radius: 6px;
}
.net-input--search { padding-left: 2.125rem; }
.net-input:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 1px; }

.net-tree { display: flex; flex-direction: column; gap: 0.125rem; margin: 0; padding: 0; list-style: none; }
.net-tree .net-tree { margin: 0.125rem 0 0; }
.net-tree--picker { max-height: 22rem; overflow: auto; border: 1px solid var(--air-border, var(--mud-palette-lines-default)); border-radius: 6px; }
.net-tree__row { display: block; }
.net-tree__item {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    min-height: 2.25rem;
    padding: 0.375rem 0.5rem;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 0.9375rem;
    text-align: left;
    color: var(--air-text, var(--mud-palette-text-primary));
    background: none;
    cursor: pointer;
}
.net-tree__item:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: -2px; }
.net-tree__icon { flex: 0 0 auto; opacity: 0.9; }
.net-tree__label { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.net-tree__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-tree__path { font-size: 0.75rem; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.net-empty, .net-muted { margin: 0.25rem 0; font-size: 0.875rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }

.net-notice { padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.875rem; }
.net-notice--error { color: var(--mud-palette-error); border: 1px solid var(--mud-palette-error); }

/* ── The header: name, summary, one primary action, a menu icon ───────── */

.net-head { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1.25rem; }
.net-head__row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1.5rem; min-height: 3rem; }
.net-head__main { display: flex; align-items: center; gap: 1.25rem; min-width: 0; flex: 1 1 20rem; }
.net-head__titles { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.net-head__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 2rem; min-width: 0; }
.net-head__title {
    margin: 0;
    min-width: 0;
    font-size: 2.125rem;
    line-height: 1.15;
    font-weight: var(--air-font-weight-bold, 700);
    color: var(--air-text, var(--mud-palette-text-primary));
    overflow-wrap: anywhere;
}
.net-head__subtitle { margin: 0; font-size: 1rem; overflow-wrap: anywhere; color: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 82%, transparent); }
/* Home and an organisation level: no visible title and no summary line — the breadcrumb (its last step names the
   place) and the actions share one row, the actions aligned to its foot. */
.net-head--level { padding-bottom: 1.5rem; }
.net-head--level .net-head__row { align-items: flex-end; min-height: 0; }
.net-head--level .net-head__main { flex-basis: 12rem; align-self: center; padding-top: 1rem; }
.net-head--level .net-head__titles { gap: 0; }
.net-head--level .net-crumbs { margin: 0; }
/* A network (Network_level.png): no title block — one compact, unframed line under the breadcrumb: the network sign,
   "Network · N/M reachable · K not measured", then Add device and the menu on the same line. */
.net-head--network { padding-bottom: 0.75rem; }
.net-head--network .net-head__row { align-items: center; min-height: 0; }
.net-head--network .net-head__main { gap: 0.75rem; flex-basis: 14rem; }
.net-head--network .net-head__titles { gap: 0; }
.net-head__kind { flex: 0 0 auto; display: inline-flex; color: var(--air-text, var(--mud-palette-text-primary)); }
.net-head__kind .mud-icon-root { font-size: 1.5rem; }
.net-head__facts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; font-size: 1rem; color: var(--air-text, var(--mud-palette-text-primary)); }
.net-head__kind-text { font-weight: var(--air-font-weight-medium, 500); }
.net-head__sep { color: var(--air-text-muted, var(--mud-palette-text-secondary)); }

/* Cards | List (Home_Sublevel_Cards.png): a small icon switch under the caption "Show as"; the chosen half filled. */
.net-views-field { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.net-views__caption { font-size: 0.75rem; line-height: 1; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-views {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--net-frame);
    border-radius: 6px;
    background: var(--net-surface);
}
.net-views__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: var(--air-text, var(--mud-palette-text-primary));
    background: none;
    cursor: pointer;
}
.net-views__option:hover:not(.is-active) { background: var(--air-hover, var(--mud-palette-action-default-hover)); }
.net-views__option.is-active { color: var(--air-accent-text, var(--mud-palette-primary-text)); background: var(--air-accent, var(--mud-palette-primary)); }
.net-views__option:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 2px; position: relative; z-index: 1; }
.net-head__divider { align-self: flex-end; width: 1px; height: 2.375rem; margin: 0 0.5rem; background: var(--net-frame-line); }
.net-head__summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    white-space: nowrap;
    color: var(--air-text, var(--mud-palette-text-primary));
}
.net-head__actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.net-head__actions > .mud-menu { align-self: flex-end; }
/* Add and the menu (Home_Sublevel_Cards.png): quiet outlined buttons at one compact height, the same on every level and
   on a network; the focus ring stays clear. */
.net-head__more .mud-icon-button { width: 2.5rem; height: 2.375rem; border-radius: 6px; border: 1px solid var(--net-control-border); }
.net-head__actions .mud-button-outlined, .net-head__more .mud-icon-button { color: var(--air-text, var(--mud-palette-text-primary)); border-color: var(--net-control-border); background: transparent; }
.net-head__actions .mud-button-outlined:hover, .net-head__more .mud-icon-button:hover { background: var(--air-hover, var(--mud-palette-action-default-hover)); border-color: var(--net-frame-top); }
.net-head__actions .mud-button-root:focus-visible, .net-head__more .mud-icon-button:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 2px; }
.net-menu-caption { padding: 0.25rem 1rem; font-size: 0.75rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); text-transform: uppercase; letter-spacing: 0.04em; }

/* Buttons in sentence case at the established height and radius (as RADIUS and DHCP's list actions). */
.net-head__actions .mud-button-root:not(.mud-icon-button),
.net-toolbar .mud-button-root:not(.mud-icon-button),
.net-active-filters .mud-button-root,
.net-notice .mud-button-root,
.net-label-filter__add.mud-button-root,
.net-module .net-empty-state .mud-button-root,
.net-settings__head .mud-button-root {
    min-height: 2.5rem;
    padding: 0 1rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: var(--air-font-weight-semibold, 600);
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
}

.net-head__actions .mud-button-root:not(.mud-icon-button) { min-height: 2.375rem; padding: 0 1rem; font-size: 0.9375rem; }

.net-tabs { margin-bottom: 1.25rem; }

/* ── A level (Home or an organisation node): one row, then the children ── */

.net-level { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.net-level__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.net-level__search { flex: 0 1 26rem; min-width: 12rem; }
.net-level__search.mud-input-control { margin-top: 0; }
.net-level__spacer { flex: 1 1 auto; }
.net-level__bar .mud-button-root:not(.mud-icon-button) {
    min-height: 2.375rem;
    padding: 0 1rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: var(--air-font-weight-semibold, 600);
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}
.net-level__sort .mud-button-root { font-weight: var(--air-font-weight-medium, 500); min-width: 14rem; justify-content: space-between; }
.net-level__filter.is-active .mud-button-root { border-color: var(--air-accent, var(--mud-palette-primary)); color: var(--air-accent, var(--mud-palette-primary)); }

.net-level__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.net-level__empty { border: 1px dashed var(--net-control-border); border-radius: 10px; }
.net-level__empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

/* The kind's sign: a tile in the kind's colour (an organisation's building, a network's hub). */
.net-kind--organization { --net-kind: var(--net-kind-org); }
.net-kind--network { --net-kind: var(--net-kind-network); }
.net-kind-tile {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 6px;
    color: var(--air-text, var(--mud-palette-text-primary));
    background: color-mix(in srgb, var(--net-kind) 30%, transparent);
    border: 1px solid color-mix(in srgb, var(--net-kind) 50%, transparent);
}
.net-kind-tile .mud-icon-root { font-size: 1.625rem; }
.net-kind-tile--small { width: 2.25rem; height: 2.25rem; border-radius: 6px; }
.net-kind-tile--small .mud-icon-root { font-size: 1.25rem; }

/* The cards (Home_Sublevel_Cards.png): a responsive grid; each card a filled, framed surface with the kind's stripe on
   the left. The whole card is the link; its ⋯ menu sits above the link, apart from it. */
.net-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.net-cards__item { display: flex; min-width: 0; }
.net-card {
    position: relative;
    background: var(--net-surface);
    border: 1px solid var(--net-frame);
    border-top-color: var(--net-frame-top);
    border-radius: 8px;
    transition: border-color 120ms ease, background-color 120ms ease;
}
.net-card:hover {
    background: color-mix(in srgb, var(--air-accent, var(--mud-palette-primary)) 10%, var(--air-surface, var(--mud-palette-surface)));
    border-color: var(--net-frame-top);
}
.net-card:has(.net-card__link:focus-visible) { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 3px; }
.net-card__link {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.125rem 1.25rem 0.75rem;
    color: var(--air-text, var(--mud-palette-text-primary));
    text-decoration: none;
    border-radius: 8px;
}
.net-card__link:focus-visible { outline: none; }
.net-card__top { display: flex; align-items: flex-start; gap: 1rem; min-width: 0; padding-bottom: 1rem; border-bottom: 1px solid var(--net-frame-line); }
.net-card--menu .net-card__titles { padding-right: 2.75rem; }
.net-card__menu { position: absolute; top: 1.25rem; right: 0.875rem; }
.net-card__titles { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; justify-content: center; min-height: 3rem; }
.net-card__name { min-width: 0; font-size: 1.125rem; font-weight: var(--air-font-weight-bold, 700); overflow-wrap: anywhere; }
.net-card__desc { font-size: 0.9375rem; color: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 82%, transparent); overflow-wrap: anywhere; }
.net-card__foot { display: flex; align-items: center; min-height: 2.25rem; padding-top: 0.625rem; font-size: 0.9375rem; }
.net-item-menu .mud-icon-button { color: var(--air-text, var(--mud-palette-text-primary)); border-radius: 6px; }
.net-item-menu .mud-icon-button:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 1px; }

/* The type in words, in the kind's colour. */
.net-type {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: var(--air-font-weight-semibold, 600);
    line-height: 1.375rem;
    white-space: nowrap;
    color: var(--air-text, var(--mud-palette-text-primary));
}
.net-type--organization { background: color-mix(in srgb, var(--net-kind-org) 40%, transparent); border: 1px solid color-mix(in srgb, var(--net-kind-org) 70%, transparent); }
.net-type--network { background: color-mix(in srgb, var(--net-kind-network) 40%, transparent); border: 1px solid color-mix(in srgb, var(--net-kind-network) 70%, transparent); }

/* The list (Home_Sublevel_Listview.png): one framed table, a distinct head, a line between rows, the kind's stripe on
   the left of each row. A row opens its object; the name is its link (keyboard); ⋯ stays apart. */
.net-level__table-wrap {
    overflow-x: auto;
    background: var(--net-surface);
    border: 1px solid var(--net-frame);
    border-top-color: var(--net-frame-top);
    border-radius: 8px;
}
.net-level__table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.net-level__table th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    white-space: nowrap;
    font-weight: var(--air-font-weight-semibold, 600);
    border-bottom: 1px solid var(--net-frame);
}
.net-level__table td { height: 3rem; padding: 0.375rem 1.25rem; vertical-align: middle; border-bottom: 1px solid var(--net-frame-line); }
.net-level__table tbody tr:last-child td { border-bottom: 0; }
.net-level__table thead td { height: auto; border-bottom: 1px solid var(--net-frame); }
.net-level__row { cursor: pointer; }
.net-level__row:hover { background: var(--air-hover, var(--mud-palette-action-default-hover)); }
.net-level__row-link { display: inline-flex; align-items: center; gap: 0.875rem; min-width: 0; color: inherit; text-decoration: none; border-radius: 4px; }
.net-level__row-link:hover .net-level__row-name { text-decoration: underline; }
.net-level__row-link:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 2px; }
/* No arrow says "this opens": the row shows it — the pointer, the hover, and the keyboard's focus on its name lights the whole row. */
.net-level__row:has(.net-level__row-link:focus-visible) { background: var(--air-hover, var(--mud-palette-action-default-hover)); }
.net-level__row-name { font-weight: var(--air-font-weight-semibold, 600); overflow-wrap: anywhere; }
.net-level__info { color: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 85%, transparent); overflow-wrap: anywhere; }
.net-level__table .net-level__col-actions { width: 3rem; padding-right: 0; text-align: right; }

/* The counts in a row, "·" between them. Each "·" belongs to the count after it (.net-fact-next, never broken apart);
   the row is shifted left by one separator's width and clipped, so a count that wraps to a new line starts that line
   without a dangling "·" at either end — whatever the width, the numbers or the language. */
.net-facts-row { --net-sep: 1.75rem; display: block; min-width: 0; overflow: hidden; }
.net-level__table .net-facts-row { --net-sep: 1.25rem; }
.net-facts-line { display: flex; flex-wrap: wrap; align-items: center; row-gap: 0.375rem; margin-left: calc(-1 * var(--net-sep)); }
.net-facts-line > .net-fact:first-child { margin-left: var(--net-sep); }
.net-fact-next { display: inline-flex; align-items: center; white-space: nowrap; }
.net-fact-next > .net-fact__sep { flex: 0 0 var(--net-sep); text-align: center; }
.net-fact { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.net-fact__icon { color: var(--air-text, var(--mud-palette-text-primary)); }
.net-fact__sep { color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-fact .ar-status-dot { width: 14px; height: 14px; border-radius: 50%; }

/* Home's note when devices or connections have no home network: a quiet link, not a tree entry. */
.net-unplaced-link {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    align-self: flex-start;
    margin: -0.25rem 0 1rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--air-text, var(--mud-palette-text-primary));
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 55%, transparent);
    border-radius: 8px;
}
.net-unplaced-link__go { color: var(--air-accent, var(--mud-palette-primary)); text-decoration: underline; }
.net-unplaced-link:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 2px; }

/* ── The compact row: search, Filter, Columns ─────────────────────────── */

.net-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0 0 0.75rem; }
.net-toolbar__search { flex: 0 1 18.5rem; min-width: 12rem; }
.net-toolbar__search.mud-input-control { margin-top: 0; }
.net-toolbar__columns .mud-button-root { min-height: 2.5rem; border-radius: 6px; text-transform: none; font-weight: var(--air-font-weight-semibold, 600); }
.net-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.375rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: var(--air-font-weight-semibold, 600);
    color: var(--air-accent-text, var(--mud-palette-primary-text));
    background: var(--air-accent, var(--mud-palette-primary));
}

.net-filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--air-border, var(--mud-palette-lines-default));
    border-radius: 8px;
}
.net-filter-panel__labels { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.25rem; }
.net-filter-panel__role { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.net-filter-panel__role > .mud-input-control { flex: 1 1 auto; }
.net-module .mud-button-root { text-transform: none; white-space: nowrap; }
.net-filter-panel__caption { font-size: 0.8125rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-mobile-sort { display: none; }

.net-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding-bottom: 0.75rem; }

.net-label-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.net-label-filter__field { flex: 0 1 14rem; max-width: 14rem; }

/* ── The device table ─────────────────────────────────────────────────── */

.net-devices { min-width: 0; }

.nd-row-cols {
    grid-template-columns: minmax(10rem, 2fr) minmax(7rem, 1fr) minmax(7rem, 1fr) minmax(8rem, 1.1fr) minmax(8rem, 1.3fr) 2.75rem;
    height: 60px;
    padding: 0 0.5rem 0 1rem;
    column-gap: 0.75rem;
}
/* Each optional column the reader chose adds one track before the actions (cols-N: N chosen). */
.nd-row-cols.cols-1 { grid-template-columns: minmax(10rem, 2fr) minmax(7rem, 1fr) minmax(7rem, 1fr) minmax(8rem, 1.1fr) minmax(8rem, 1.3fr) minmax(7rem, 1.2fr) 2.75rem; }
.nd-row-cols.cols-2 { grid-template-columns: minmax(9rem, 1.8fr) minmax(7rem, 1fr) minmax(6.5rem, 0.9fr) minmax(7.5rem, 1fr) minmax(7rem, 1.1fr) repeat(2, minmax(6.5rem, 1.1fr)) 2.75rem; }
.nd-row-cols.cols-3 { grid-template-columns: minmax(9rem, 1.6fr) minmax(7rem, 1fr) minmax(6.5rem, 0.9fr) minmax(7.5rem, 1fr) minmax(7rem, 1fr) repeat(3, minmax(6rem, 1fr)) 2.75rem; }
.nd-row-cols.cols-4 { grid-template-columns: minmax(9rem, 1.6fr) minmax(7rem, 1fr) minmax(6.5rem, 0.9fr) minmax(7.5rem, 1fr) minmax(7rem, 1fr) repeat(4, minmax(5.5rem, 1fr)) 2.75rem; }
.air-list-row.nd-row-cols.nms-head-row { height: 48px; font-weight: var(--air-font-weight-medium, 500); background: var(--air-surface, var(--mud-palette-surface)); border-radius: 6px 6px 0 0; }
.air-list-row.nd-row-cols:not(.nms-head-row) { cursor: pointer; }

.net-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0;
    border: 0;
    font: inherit;
    color: inherit;
    background: none;
    cursor: pointer;
}
.net-sort:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: 2px; border-radius: 2px; }

.nd-name { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.nd-name__icon { flex: 0 0 auto; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.nd-name__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.air-list-row > .nd-status { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.air-list-row > .nd-type, .air-list-row > .nd-address, .air-list-row > .nd-role, .air-list-row > .nd-network,
.air-list-row > .nd-rtt, .air-list-row > .nd-observed { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.air-list-row > .nd-address { font-variant-numeric: tabular-nums; }
.air-list-row > .nd-labels { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.nd-labels > .net-label-chip { flex: 0 1 auto; min-width: 0; }
.nd-labels > .net-label-chip--more { flex: 0 0 auto; min-width: 0; }
.air-list-row > .nd-actions { display: flex; justify-content: flex-end; overflow: visible; }

.ar-status-dot { flex: 0 0 auto; width: 10px; height: 10px; vertical-align: middle; }
.ar-status-dot.st-unreachable { box-shadow: 0 0 0 2px var(--mud-palette-surface), 0 0 0 4px var(--mud-palette-warning); }

.net-label-chip {
    display: inline-block;
    max-width: 10rem;
    padding: 0.125rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: var(--air-text, var(--mud-palette-text-primary));
    background: var(--air-accent-soft, var(--mud-palette-action-default-hover));
    border: 1px solid color-mix(in srgb, var(--air-accent, var(--mud-palette-primary)) 45%, transparent);
    border-radius: 6px;
}
.net-label-chip--more { background: none; border-style: dashed; }

.net-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--air-text-muted, var(--mud-palette-text-secondary));
}
.net-empty-state--inline { flex-direction: row; justify-content: flex-start; padding: 1rem 0; }

/* ── Tables in tabs (connections, networks, alarms, settings) ─────────── */

.net-table-wrap { overflow-x: auto; }
.net-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.net-table th, .net-table td { padding: 0.625rem; text-align: left; border-bottom: 1px solid var(--air-border, var(--mud-palette-lines-default)); vertical-align: middle; }
.net-table th { font-weight: var(--air-font-weight-semibold, 600); white-space: nowrap; }
.net-table--rows tbody tr { cursor: pointer; }
.net-table--rows tbody tr:hover { background: var(--air-hover, var(--mud-palette-action-default-hover)); }
.net-table--rows tbody tr:focus-visible { outline: 2px solid var(--air-accent, var(--mud-palette-primary)); outline-offset: -2px; }
.net-table tr.is-cleared td { color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-table tr.is-action td:first-child { box-shadow: inset 3px 0 0 var(--mud-palette-warning); }
.net-nowrap { white-space: nowrap; }

.net-severity { font-weight: var(--air-font-weight-semibold, 600); white-space: nowrap; }
.net-severity--critical { color: var(--mud-palette-error); }
.net-severity--major { color: var(--mud-palette-warning); }
.net-severity--warning { color: var(--mud-palette-warning); }

.net-alarms, .net-connections, .net-networks, .net-migration { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.net-alarms__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }

/* ── Overview and settings ────────────────────────────────────────────── */

.net-overview, .net-settings { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.net-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem; }
.net-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--air-border, var(--mud-palette-lines-default));
    border-radius: 8px;
    background: var(--air-surface, var(--mud-palette-surface));
}
.net-stat__label { font-size: 0.8125rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-stat__value { font-size: 1.5rem; font-weight: var(--air-font-weight-semibold, 600); font-variant-numeric: tabular-nums; color: var(--air-text, var(--mud-palette-text-primary)); }
.net-stat__value--small { font-size: 1.125rem; }
.net-stat__note { font-size: 0.8125rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-section-title { margin: 0.25rem 0 0; font-size: 1rem; font-weight: var(--air-font-weight-semibold, 600); color: var(--air-text, var(--mud-palette-text-primary)); }
.net-settings__section { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--air-border, var(--mud-palette-lines-default)); }
.net-settings__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }

.net-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1.25rem; margin: 0; font-size: 0.9375rem; }
.net-facts dt { color: var(--air-text-muted, var(--mud-palette-text-secondary)); }
.net-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.net-plain-list { margin: 0; padding-left: 1.25rem; font-size: 0.9375rem; display: flex; flex-direction: column; gap: 0.25rem; }
.net-dep-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.net-dep-add > .mud-input-control { flex: 1 1 12rem; min-width: 10rem; }
.net-member-row { display: grid; grid-template-columns: minmax(8rem, 1.2fr) minmax(7rem, 1fr) minmax(8rem, 1fr) 2.5rem; align-items: center; gap: 0.5rem; }
.net-member-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--air-font-weight-medium, 500); }
.net-type-choice { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

/* ── Details ──────────────────────────────────────────────────────────── */

.net-dialog-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; min-width: 0; }
.net-detail { display: flex; flex-direction: column; gap: 1rem; padding: 0.5rem; }
.net-detail__section { display: flex; flex-direction: column; gap: 0.375rem; }
.net-detail__title { margin: 0; font-size: 1rem; font-weight: var(--air-font-weight-semibold, 600); color: var(--air-text, var(--mud-palette-text-primary)); }
.net-detail__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.net-detail__row--end { justify-content: flex-end; }
.net-detail__text { margin: 0; font-size: 0.9375rem; }
.net-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.net-label-add { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; }
.net-label-add > * { flex: 1 1 10rem; }
.net-label-add > button { flex: 0 0 auto; margin-top: 0.25rem; }
.net-help { margin: 0; font-size: 0.8125rem; color: var(--air-text-muted, var(--mud-palette-text-secondary)); }

/* ── State pills: words first, colour second ──────────────────────────── */

.net-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: var(--air-font-weight-semibold, 600);
    border: 1px solid currentColor;
    white-space: nowrap;
}
.net-pill--up { color: var(--mud-palette-success); }
.net-pill--degraded { color: var(--mud-palette-warning); }
.net-pill--down { color: var(--mud-palette-error); }
.net-pill--unreachable { color: var(--mud-palette-warning); border-style: dashed; }
.net-pill--unknown { color: var(--air-text-muted, var(--mud-palette-text-secondary)); }

/* ── A laptop-wide module: optional columns give way first ── */

@container net-module (max-width: 1150px) {
    .nd-row-cols, .nd-row-cols[class*="cols-"] { grid-template-columns: minmax(9rem, 1.8fr) minmax(7rem, 1fr) minmax(6.5rem, 0.9fr) minmax(7.5rem, 1fr) minmax(7rem, 1fr) 2.75rem; }
    .nd-row-cols > .nd-network, .nd-row-cols > .nd-labels, .nd-row-cols > .nd-rtt, .nd-row-cols > .nd-observed { display: none; }
}

/* ── A narrow work area: columns thin out, the level row wraps ── */

@container net-module (max-width: 900px) {
    .net-level__spacer { display: none; }
    .net-head__main { gap: 0.5rem 1rem; }
    .nd-row-cols, .nd-row-cols[class*="cols-"] { grid-template-columns: minmax(8rem, 1.6fr) minmax(6.5rem, 1fr) minmax(7rem, 1fr) 2.75rem; }
    .nd-row-cols > .nd-type, .nd-row-cols > .nd-role { display: none; }
    .net-col-optional { display: none; }
    .net-mobile-sort { display: flex; }
}

@container net-module (max-width: 600px) {
    .net-head__title { font-size: 1.5rem; }
    .net-head__main { gap: 0.875rem; }
    .net-level__search { flex: 1 1 100%; }
    .net-level__sort .mud-button-root { min-width: 0; }
    .net-card__link { padding: 1rem; }
    .net-card__menu { top: 1rem; right: 0.625rem; }
    .net-kind-tile:not(.net-kind-tile--small) { width: 2.75rem; height: 2.75rem; }
    .net-head--level .net-head__actions, .net-head--network .net-head__actions { flex: 1 1 100%; }
    .net-head--level .net-head__main { padding-top: 0; }
    /* The list: each row two lines — sign and name with ⋯, then what it holds; the column heads stay for assistive technology. */
    .net-level__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .net-level__table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--net-frame-line); }
    .net-level__table tbody tr:last-child { border-bottom: 0; }
    .net-level__table tbody td { height: auto; border-bottom: 0; }
    .net-level__table td.net-level__cell-name { grid-column: 1; grid-row: 1; padding-top: 0.625rem; }
    .net-level__table td.net-level__col-actions { grid-column: 2; grid-row: 1; }
    .net-level__table td.net-level__cell-facts { grid-column: 1 / -1; padding-top: 0; padding-bottom: 0.625rem; padding-left: 3.875rem; }
    .net-head__divider { display: none; }
    .net-level__col-type { display: none; }
    .net-level__table td, .net-level__table th { padding-left: 0.75rem; padding-right: 0.5rem; }
    .net-page { padding-top: 1rem; }
    .net-crumbs__sep { margin: 0 0.5rem; }
    .net-toolbar__search { flex: 1 1 100%; }
    .nd-row-cols, .nd-row-cols[class*="cols-"] { grid-template-columns: minmax(7rem, 1fr) minmax(6rem, auto) 2.75rem; padding-left: 0.5rem; }
    .nd-row-cols > .nd-address { display: none; }
    .net-member-row { grid-template-columns: minmax(0, 1fr) 2.5rem; }
}

/* Visible to assistive technology only. */
.net-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ── One scale on every level (Home_Level.png is the common ground) ──────── */

.net-level__bar .net-level__sort .mud-button-root { font-weight: var(--air-font-weight-medium, 500); }
.net-page .net-tabs .nms-module-nav__tab { font-size: 1.0625rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.net-page .net-toolbar .mud-button-root:not(.mud-icon-button) { min-height: 2.375rem; font-size: 0.9375rem; }
.net-page .air-list-row.nd-row-cols { font-size: 1rem; }
.net-page .air-list-row.nd-row-cols.nms-head-row { font-size: 1rem; }

/* A network's device table (Network_level.png): the level list's framed surface, head and row lines. The frame is drawn
   by the head and the rows themselves, so it ends under the last device instead of filling the list's scroll area (whose
   height the fit measurement reads and stays as it is). */
.net-page .net-devices .air-list-scroll { background: transparent; }
.net-page .net-devices .air-list-header {
    background: var(--net-surface);
    border: 1px solid var(--net-frame);
    border-top-color: var(--net-frame-top);
    border-radius: 8px 8px 0 0;
}
.net-page .net-devices .air-list-row.nd-row-cols.nms-head-row { background: transparent; border-bottom: 0; font-weight: var(--air-font-weight-semibold, 600); }
.net-page .net-devices .air-list-row:not(.nms-head-row) {
    background: var(--net-surface);
    border: 1px solid var(--net-frame);
    border-top: 0;
    border-bottom-color: var(--net-frame-line);
}
.net-page .net-devices .air-list-row:not(.nms-head-row):hover { background: color-mix(in srgb, var(--air-text, var(--mud-palette-text-primary)) 6%, var(--net-surface)); }
.net-page .net-devices .air-list-row:not(.nms-head-row):not(:has(~ .air-list-row)) { border-bottom-color: var(--net-frame); border-radius: 0 0 8px 8px; }
.net-page .net-devices .air-list-statusbar { border-top: 0; }
