:root {
    color-scheme: dark;
    --bg: #111315;
    --panel: #191c1f;
    --panel2: #202428;
    --border: #2b3034;
    --text: #edf0f2;
    --muted: #929ca5;
    --accent: #8be3b3;
    --accent-bg: #1b372b;
    --amber: #e8bf7a;
    --red: #ef9191;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font:
        14px/1.55 Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}
button,
a {
    touch-action: manipulation;
}
button {
    cursor: pointer;
}
button:disabled {
    opacity: 0.45;
    cursor: wait;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    background: var(--panel2);
    padding: 10px 16px;
    font-weight: 550;
    transition:
        background 0.15s,
        border-color 0.15s;
}
button:hover {
    background: #2b3236;
    border-color: #485159;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #10271b;
}
.primary:hover {
    background: #a1efc4;
    border-color: #a1efc4;
}
.ghost {
    background: transparent;
}
.danger {
    color: var(--red);
}
.compact {
    font-size: 12px;
    padding: 7px 10px;
}
.icon-button {
    padding: 7px 10px;
    background: transparent;
}
.full {
    width: 100%;
    display: flex;
    justify-content: space-between;
}
.hidden {
    display: none !important;
}
.muted {
    color: var(--muted);
}
.eyebrow {
    font-size: 10px;
    letter-spacing: 1.6px;
    font-weight: 650;
    color: var(--muted);
}
h1 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.2;
    margin: 10px 0 8px;
}
h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
}
h3 {
    font-size: 14px;
    margin: 0;
}
.dot {
    display: inline-block;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    background: var(--muted);
    border-radius: 100%;
    margin-right: 6px;
}
.dot.green {
    background: var(--accent);
}
.dot.amber {
    background: var(--amber);
}
.dot.red {
    background: var(--red);
}
.badge {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 550;
    background: var(--panel2);
    color: var(--muted);
    white-space: nowrap;
}
.badge.green {
    color: var(--accent);
    background: var(--accent-bg);
}
.badge.amber {
    color: var(--amber);
    background: #382f21;
}
.badge.red {
    color: var(--red);
    background: #3a2729;
}
.mono {
    font:
        12px ui-monospace,
        SFMono-Regular,
        Consolas,
        monospace;
}
.app {
    min-height: 100vh;
}
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 234px;
    padding: 30px 18px 18px;
    background: #15181a;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -0.5px;
}
.small-mark {
    background: var(--accent);
    color: #10271b;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -2px;
    border-radius: 11px;
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
}
.logo small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0;
}
.sidebar-label {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #6f7981;
    padding: 40px 13px 13px;
}
nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #9ca6ad;
    font-size: 13px;
    padding: 11px 13px;
    margin: 4px 0;
    border-radius: 8px;
}
nav a:hover {
    background: var(--panel2);
    color: var(--text);
}
nav a.active {
    background: #25342c;
    color: #a3e8be;
}
nav svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
}
.sidebar-bottom {
    margin-top: auto;
    padding-top: 20px;
}
.sidebar-bottom > a {
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    padding: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.local-status {
    padding: 16px 12px;
    display: flex;
    align-items: center;
    font-size: 11px;
}
.local-status small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}
.sidebar-bottom > button {
    margin-left: 12px;
}
.main {
    margin-left: 234px;
    padding: 0 36px 24px;
    max-width: 1700px;
}
.topbar {
    height: 76px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}
.breadcrumb {
    display: flex;
    gap: 12px;
    align-items: center;
}
.breadcrumb b {
    color: #c6cdd2;
    font-weight: 450;
}
.breadcrumb span {
    color: #50585f;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.page-head {
    padding: 34px 0 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.page-head p {
    font-size: 13px;
    margin: 8px 0 0;
}
#page-actions {
    display: flex;
    gap: 8px;
}
.grid {
    display: grid;
    gap: 18px;
}
.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}
.stat {
    padding: 18px 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.stat-label {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.stat-value {
    font-size: 23px;
    margin: 10px 0 3px;
    font-weight: 550;
    letter-spacing: -0.6px;
}
.stat-foot {
    font-size: 11px;
    color: var(--muted);
}
.overview-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    align-items: start;
}
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 19px 21px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.card-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
}
.card-body {
    padding: 21px;
}
.current-node {
    padding: 24px;
    background: #1c2821;
    border: 1px solid #344b3d;
    border-radius: 12px;
    margin-bottom: 18px;
}
.node-hero-top {
    display: flex;
    justify-content: space-between;
}
.node-hero-name {
    font-size: 25px;
    font-weight: 550;
    margin: 19px 0 0;
    letter-spacing: -0.7px;
}
.node-hero-address {
    font-size: 12px;
    color: #a4b8ac;
    margin: 2px 0 22px;
}
.node-hero-bottom {
    border-top: 1px solid #35483d;
    padding-top: 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.node-hero-bottom > div {
    font-size: 11px;
    color: #9caf9f;
}
.node-hero-bottom strong {
    color: var(--text);
    font-size: 18px;
    display: block;
    font-weight: 500;
}
.resource-row {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    gap: 12px;
}
.resource-row + .resource-row {
    border-top: 1px solid var(--border);
}
.resource-icon {
    height: 34px;
    width: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--panel2);
    border-radius: 9px;
    color: #c9d2d8;
    font-size: 18px;
    font-weight: 650;
}
.resource-info {
    flex: 1;
    min-width: 0;
}
.resource-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
}
.resource-sub {
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
}
.resource-ms {
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
}
.resource-ms small {
    display: block;
    font-size: 10px;
    color: var(--muted);
}
.resource-refresh {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    padding: 3px 5px;
}
.resource-caption {
    font-size: 11px;
    color: var(--muted);
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}
.service-row {
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.service-row:last-child {
    border: 0;
}
.service-row small {
    color: var(--muted);
}
.kv {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px 20px;
    font-size: 12px;
}
.kv dt {
    color: var(--muted);
}
.kv dd {
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}
.info-line {
    padding: 14px 17px;
    background: #1c2329;
    color: #a9bac6;
    font-size: 12px;
    border: 1px solid #2b3943;
    border-radius: 9px;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.info-line.amber {
    background: #29251e;
    border-color: #453d2c;
    color: #d5bf99;
}
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.table-toolbar input {
    max-width: 280px;
}
.table-toolbar span {
    color: var(--muted);
    font-size: 12px;
}
.table-scroll {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}
th {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--muted);
    font-weight: 500;
    background: #1b1f22;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
tr:last-child td {
    border-bottom: 0;
}
tr.selected {
    background: #1b2822;
}
td small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}
.node-label {
    display: flex;
    align-items: center;
    gap: 9px;
}
.node-mark {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    color: #9bada1;
    background: #29372f;
    border-radius: 8px;
    font-size: 13px;
}
.cell-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}
.cell-actions button {
    font-size: 11px;
    padding: 6px 9px;
}
.latency {
    font-weight: 550;
    color: var(--accent);
}
.spark {
    display: inline-flex;
    align-items: end;
    height: 15px;
    gap: 2px;
    margin-left: 7px;
    vertical-align: middle;
}
.spark i {
    width: 3px;
    background: #5c9472;
    border-radius: 1px;
    min-height: 2px;
}
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 22px;
    align-items: start;
}
.form-section {
    padding: 22px;
    border-bottom: 1px solid var(--border);
}
.form-section:last-child {
    border: 0;
}
.form-section > p {
    color: var(--muted);
    font-size: 12px;
    margin: 5px 0 22px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.span2 {
    grid-column: 1/-1;
}
label {
    display: block;
    font-size: 12px;
    color: #c4cbd0;
}
input,
select,
textarea {
    display: block;
    width: 100%;
    border: 1px solid #353c41;
    background: #121618;
    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;
    outline: none;
    margin-top: 6px;
    font-size: 13px;
}
input:focus,
select:focus,
textarea:focus {
    border-color: #82b799;
    box-shadow: 0 0 0 2px #8be3b312;
}
input[type='checkbox'] {
    display: inline-block;
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    margin: 0;
    flex-shrink: 0;
}
textarea {
    min-height: 160px;
    resize: vertical;
    font:
        12px/1.8 ui-monospace,
        Consolas,
        monospace;
}
.field-help {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.6;
}
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    padding: 12px 0;
}
.toggle-row small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}
.note-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-size: 12px;
}
.note-card h3 {
    color: var(--text);
    margin-bottom: 12px;
}
.note-card ul {
    padding-left: 17px;
    margin: 0;
}
.note-card li + li {
    margin-top: 11px;
}
.field-with-button {
    display: flex;
    gap: 7px;
    align-items: end;
}
.field-with-button input {
    flex: 1;
    min-width: 0;
}
.field-with-button button {
    padding: 10px;
}
.routing-grid {
    grid-template-columns: 1fr 1fr;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px;
}
.inline-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}
.save-bar {
    position: fixed;
    bottom: 22px;
    left: 270px;
    right: 36px;
    background: #263b2e;
    border: 1px solid #466b52;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 25;
    gap: 14px;
}
.save-bar strong {
    font-size: 13px;
}
.save-bar small {
    display: block;
    color: #b1c3b5;
    font-size: 11px;
}
.save-bar > div:last-child {
    display: flex;
    gap: 7px;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: #0009;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal {
    background: #1c2023;
    border: 1px solid #3b444b;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    right: 15px;
    top: 14px;
    font-size: 20px;
}
.modal h2 {
    font-size: 23px;
    margin: 8px 0 10px;
}
.modal p {
    font-size: 12px;
    color: var(--muted);
}
.modal ul {
    padding-left: 20px;
    font-size: 13px;
}
.modal li {
    margin: 9px 0;
}
.modal .checks {
    padding: 14px 16px;
    background: #172a20;
    border: 1px solid #2e4d39;
    border-radius: 8px;
    font-size: 12px;
    color: #acd5bb;
}
.modal-actions {
    display: flex;
    justify-content: end;
    gap: 8px;
    margin-top: 24px;
}
.toast {
    position: fixed;
    right: 24px;
    bottom: 25px;
    z-index: 80;
    background: #30383d;
    border: 1px solid #536069;
    padding: 13px 19px;
    border-radius: 9px;
    max-width: 420px;
    font-size: 13px;
}
.banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 13px 17px;
    margin-top: 15px;
    background: #262d24;
    border: 1px solid #44563b;
    border-radius: 10px;
    color: #d4e1c7;
    font-size: 12px;
}
.banner.amber {
    background: #30291f;
    border-color: #5c4a2c;
    color: #e6c897;
}
.banner strong {
    display: block;
    font-size: 13px;
}
.banner .inline-actions button {
    font-size: 12px;
    padding: 7px 10px;
}
.spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid #4f6557;
    border-top-color: var(--accent);
    border-radius: 100%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #697780;
    font-size: 10px;
    padding: 25px 0 5px;
}
.footer > span:first-child {
    display: flex;
    align-items: center;
}
.timeline-item {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 15px;
    border-bottom: 1px solid var(--border);
    padding: 16px 21px;
    font-size: 12px;
}
.timeline-item small {
    color: var(--muted);
    font-size: 11px;
}
.empty {
    padding: 35px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}
.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login-wrap {
    max-width: 430px;
    width: 100%;
    margin: auto;
    padding: 50px 30px;
}
.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent);
    color: #173523;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 31px;
    font-weight: 750;
    letter-spacing: -3px;
    margin-bottom: 42px;
}
.brand-mark span {
    font-size: 20px;
    margin-top: -13px;
}
.login-wrap h1 {
    font-size: 42px;
    letter-spacing: -1.7px;
    margin: 17px 0;
}
.login-wrap h1 span {
    color: var(--accent);
}
.login-wrap > .muted {
    font-size: 13px;
    margin-bottom: 30px;
}
.login-wrap label {
    margin-bottom: 17px;
}
.login-wrap input {
    padding: 12px 14px;
}
.login-wrap .primary {
    padding: 13px 15px;
}
.login-note {
    font-size: 10px;
    color: #74818b;
    line-height: 1.8;
    margin-top: 23px;
}
.form-error {
    font-size: 12px;
    color: var(--red);
    margin: 5px 0 15px;
}
.login-aside {
    border-left: 1px solid var(--border);
    background: #171d1a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.network-art {
    width: 400px;
    height: 400px;
    position: relative;
    display: grid;
    place-items: center;
}
.art-ring {
    position: absolute;
    border: 1px solid #34433a;
    border-radius: 50%;
}
.ring1 {
    width: 190px;
    height: 190px;
}
.ring2 {
    width: 290px;
    height: 290px;
}
.ring3 {
    width: 390px;
    height: 390px;
}
.art-core {
    display: grid;
    place-items: center;
    width: 87px;
    height: 87px;
    border-radius: 25px;
    background: #8be3b3;
    color: #173523;
    font-size: 48px;
    font-weight: 650;
    transform: rotate(-8deg);
}
.art-dot {
    width: 11px;
    height: 11px;
    background: #8be3b3;
    border: 3px solid #1c2821;
    border-radius: 100%;
    position: absolute;
    box-sizing: content-box;
}
.dot1 {
    left: 47px;
    top: 87px;
}
.dot2 {
    right: 94px;
    bottom: 78px;
}
.dot3 {
    right: 109px;
    top: 166px;
    width: 7px;
    height: 7px;
}
.aside-caption {
    position: absolute;
    bottom: 55px;
    font-size: 9px;
    letter-spacing: 2px;
    color: #62776a;
}
#mobile-menu {
    display: none;
}
@media (min-width: 1500px) {
    .main {
        padding-left: 48px;
        padding-right: 48px;
    }
}
@media (max-width: 1150px) {
    .sidebar {
        width: 205px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .main {
        margin-left: 205px;
        padding: 0 24px 24px;
    }
    .overview-grid {
        grid-template-columns: 1fr;
    }
    .overview-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .current-node {
        margin: 0;
    }
    .form-layout {
        grid-template-columns: 1fr;
    }
    .note-card {
        display: none;
    }
    .save-bar {
        left: 230px;
        right: 24px;
    }
    .stat {
        padding: 15px;
    }
    .stat-value {
        font-size: 20px;
    }
    .resource-row {
        padding: 12px 18px;
    }
}
@media (max-width: 760px) {
    .sidebar {
        display: none;
        width: 234px;
    }
    .sidebar.open {
        display: flex;
        box-shadow: 0 0 0 100vw #0008;
    }
    .main {
        margin-left: 0;
        padding: 0 17px 20px;
    }
    #mobile-menu {
        display: block;
        margin-right: 10px;
    }
    .topbar {
        height: 65px;
    }
    .topbar-right {
        gap: 8px;
        font-size: 10px;
    }
    .breadcrumb {
        gap: 7px;
        font-size: 10px;
    }
    .page-head {
        padding: 25px 0 20px;
        align-items: start;
    }
    .page-head h1 {
        font-size: 26px;
    }
    .page-head p {
        font-size: 11px;
    }
    .page-head #page-actions button {
        font-size: 11px;
        padding: 8px 10px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .stat {
        padding: 14px;
    }
    .stat-value {
        font-size: 21px;
    }
    .overview-left {
        display: block;
    }
    .current-node {
        margin-bottom: 17px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .span2 {
        grid-column: auto;
    }
    .routing-grid {
        grid-template-columns: 1fr;
    }
    .save-bar {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 12px;
        align-items: stretch;
    }
    .save-bar small {
        display: none;
    }
    .save-bar strong {
        font-size: 10px;
    }
    .save-bar button {
        font-size: 11px;
        padding: 8px;
    }
    .timeline-item {
        grid-template-columns: 90px 1fr;
    }
    .timeline-item > .badge {
        display: none;
    }
    .banner {
        align-items: start;
        flex-direction: column;
        gap: 10px;
    }
    .resource-title {
        font-size: 12px;
        gap: 6px;
    }
    .resource-title .badge {
        font-size: 9px;
    }
    .resource-ms {
        font-size: 11px;
    }
    .resource-row {
        padding: 12px;
    }
    .card-head {
        padding: 16px;
    }
    .login-screen {
        display: block;
    }
    .login-aside {
        display: none;
    }
    .login-wrap {
        padding-top: 70px;
    }
    .login-wrap h1 {
        font-size: 38px;
    }
    .table-toolbar input {
        max-width: 180px;
    }
    .modal {
        padding: 25px 20px;
    }
    .form-section {
        padding: 18px;
    }
    .footer {
        gap: 10px;
        font-size: 9px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

.device-note {
    margin-top: 18px;
}
.device-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 230px;
}
.device-editor-section {
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding-top: 18px;
}
.device-editor-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
}
.device-field {
    margin-top: 14px;
}
.device-table td:first-child {
    white-space: normal;
    min-width: 165px;
    max-width: 230px;
    overflow-wrap: anywhere;
}
input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.device-table th:last-child,
.device-table td:last-child {
    position: sticky;
    right: 0;
    background: var(--panel);
    text-align: right;
    box-shadow: -8px 0 14px #0002;
    z-index: 1;
    min-width: 112px;
}
.device-table th:last-child {
    background: #1b1f22;
}

/* Product guidance remains readable on narrow displays. */
@media (max-width: 1150px) {
    .form-layout > .product-note {
        display: block;
        margin-top: 20px;
    }
}

.profile-rules {
    min-width: 820px;
}
.profile-rules th,
.profile-rules td {
    padding: 10px 12px;
}
.profile-rules .inline-actions {
    flex-wrap: nowrap;
    gap: 4px;
}
.profile-rules button {
    padding: 5px 8px;
    font-size: 11px;
}
.profile-rules td {
    vertical-align: middle;
}

.identity-tools {
    margin: 18px 0;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}
.identity-tools p {
    font-size: 12px;
}
.identity-tools .inline-actions {
    margin: 14px 0;
}
.device-editor-section > button {
    margin-top: 12px;
}
.kv dd {
    max-width: 340px;
    overflow-wrap: anywhere;
}
/* Shared management screens */
.settings-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}
.section-details {
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
}
.section-details summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 550;
}
.section-details p {
    line-height: 1.75;
}
.editable-table {
    min-width: 620px;
    table-layout: fixed;
}
.editable-table th,
.editable-table td {
    padding: 9px 8px;
    white-space: normal;
}
.editable-table th:last-child,
.editable-table td:last-child {
    width: 46px;
}
.editable-table input {
    margin: 0;
    min-width: 0;
}
.editable-table button {
    padding: 6px 9px;
}
.diagnostic-output {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 400px;
    overflow: auto;
    font-size: 12px;
}
.traffic-toolbar {
    margin-bottom: 20px;
    padding: 0;
    border: 0;
    flex-wrap: wrap;
}
.traffic-toolbar label {
    min-width: 210px;
}
.traffic-chart {
    padding: 18px 22px;
}
.traffic-chart svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    overflow: visible;
}
.chart-axis {
    stroke: var(--border);
    fill: none;
}
.chart-download,
.chart-upload {
    fill: none;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.chart-download {
    stroke: var(--accent);
}
.chart-upload {
    stroke: var(--amber);
}
.chart-times,
.chart-legend {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 11px;
}
.chart-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 10px;
}
.download-key {
    color: var(--accent);
}
.upload-key {
    color: var(--amber);
}
.chart-scale {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 7px;
}
input[type='file'] {
    white-space: normal;
    padding: 12px 8px;
    max-width: 100%;
}
input::file-selector-button {
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--text);
    border-radius: 6px;
    padding: 6px 9px;
    margin-right: 10px;
}
.form-section label + label {
    margin-top: 14px;
}
.form-grid label + label {
    margin-top: 0;
}
.form-section > button,
.form-section > .inline-actions {
    margin-top: 18px;
}
.table-scroll {
    max-width: 100%;
    overscroll-behavior-x: contain;
}
.main,
#content,
.card,
.form-layout > *,
.settings-columns > * {
    min-width: 0;
}
.card-head h2,
.page-head h1 {
    overflow-wrap: anywhere;
}
.modal {
    scrollbar-gutter: stable;
}
.modal .form-grid {
    margin: 14px 0;
}
.modal .modal-actions {
    flex-wrap: wrap;
}
.kv dd {
    max-width: none;
    overflow-wrap: anywhere;
}
button:disabled {
    cursor: not-allowed;
}
.profile-rules td {
    white-space: normal;
}
.profile-rules td:last-child {
    white-space: nowrap;
}
.profile-rules th:first-child {
    width: 52px;
}
.profile-rules td:nth-child(3) {
    max-width: 240px;
    word-break: break-word;
}
.device-table td:last-child .cell-actions {
    flex-wrap: wrap;
}
.device-table td:last-child button {
    display: block;
    margin: 4px 0 4px auto;
}
.sidebar {
    overflow-y: auto;
}
.sidebar-label {
    padding-top: 24px;
}
.sidebar-bottom {
    flex-shrink: 0;
}
nav a {
    padding: 9px 13px;
    margin: 2px 0;
}
.stats-grid .stat-value {
    font-size: 22px;
}
.note-card .kv {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}
.note-card p {
    overflow-wrap: anywhere;
}
.form-section > p,
.modal p {
    line-height: 1.7;
}
@media (max-width: 1150px) {
    .settings-columns {
        grid-template-columns: 1fr;
    }
    .form-layout {
        grid-template-columns: 1fr;
    }
    .form-layout > .note-card {
        display: block;
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .overview-grid {
        grid-template-columns: 1fr;
    }
    .page-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    #page-actions {
        flex-wrap: wrap;
    }
}
@media (max-width: 700px) {
    .main {
        padding-left: 18px;
        padding-right: 18px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid .span2 {
        grid-column: auto;
    }
    .card-head,
    .card-body,
    .form-section {
        padding: 18px;
    }
    .topbar {
        gap: 10px;
    }
    .topbar-right {
        gap: 9px;
    }
    .topbar-right #username-display {
        display: none;
    }
    .breadcrumb {
        gap: 7px;
    }
    .modal-backdrop {
        padding: 10px;
    }
    .modal {
        padding: 24px 18px;
        max-height: 94vh;
    }
    .save-bar {
        left: 12px;
        right: 12px;
        bottom: 12px;
        flex-wrap: wrap;
        padding: 14px;
    }
    .save-bar > div:last-child {
        width: 100%;
        justify-content: flex-end;
    }
    .banner {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .banner .inline-actions {
        width: 100%;
    }
    .traffic-toolbar label {
        min-width: 160px;
    }
    .table-toolbar {
        flex-wrap: wrap;
    }
    .table-toolbar input {
        max-width: none;
    }
    .kv {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .page-head {
        padding-top: 24px;
    }
    h1 {
        font-size: 27px;
    }
    .stat {
        padding: 14px;
    }
    .stats-grid .stat-value {
        font-size: 19px;
    }
    .inline-actions button {
        max-width: 100%;
    }
    .node-hero-bottom {
        flex-wrap: wrap;
    }
    .footer {
        gap: 10px;
    }
    .resource-title {
        flex-wrap: wrap;
        gap: 4px;
    }
    .profile-rules {
        min-width: 760px;
    }
    .editable-table {
        min-width: 580px;
    }
}

.sidebar {
    overflow: hidden;
}
.sidebar-label {
    display: none;
}
#navigation {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 16px 0;
    scrollbar-width: thin;
}
.nav-group-label {
    font-size: 9px;
    letter-spacing: 1.1px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 14px 13px 4px;
}
.sidebar-bottom {
    margin-top: 0;
    padding-top: 8px;
}
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 16px;
    background: var(--panel2);
    font-size: 13px;
}
.button-link:hover {
    border-color: var(--muted);
}

.subscription-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.subscription-sources {
    min-width: 0;
}
.subscription-source-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}
.subscription-source {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    gap: 5px;
    width: 100%;
}
.subscription-source.active {
    background: rgba(139, 227, 179, 0.12);
    border-color: #6ab58a;
}
.subscription-source small {
    font-weight: 400;
    color: var(--muted, #9aa4ac);
}
.subscription-editor {
    min-width: 0;
}
.subscription-editor input {
    min-width: 0;
}
.subscription-editor .card-head {
    padding: 0;
    margin-bottom: 20px;
}
.subscription-editor .card-head h2 {
    margin: 0;
}
@media (max-width: 800px) {
    .subscription-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .subscription-source-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

.subscription-editor label:has(input[id$='SUB_HWID']) {
    grid-column: 1/-1;
}

#p-records-table {
    min-width: 480px;
}
#p-records-table:has(tbody:empty) {
    min-width: 0;
}
.modal-unsaved {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--panel);
    border-radius: inherit;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.modal {
    position: relative;
}

.subscription-conflict {
    grid-column: 1/-1;
    margin: 0;
}
.subscription-conflict button {
    margin-left: 10px;
}

/* Diagnostic stages remain readable inside the node table. */
.probe-details {
    white-space: normal;
    min-width: 150px;
    max-width: 280px;
}
.probe-details ul {
    padding-left: 18px;
}
.probe-details li {
    margin-top: 6px;
}
.nodes-table .cell-actions {
    max-width: 240px;
    flex-wrap: wrap;
    margin-left: auto;
}

.nodes-table td:first-child {
    white-space: normal;
    min-width: 240px;
    max-width: 340px;
}

.quality-details {
    max-width: 300px;
    white-space: normal;
}
.quality-details p,
.quality-details small {
    white-space: normal;
    overflow-wrap: anywhere;
}

.mandatory-row {
    border: 1px solid var(--border, #343a3c);
    border-radius: 12px;
    padding: 16px;
    margin: 14px 0;
}
#mandatory-editor[hidden] {
    display: none;
}
#mandatory-editor > label {
    margin-top: 20px;
}

.node-note {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 320px;
}
.preference-archive-row {
    padding: 16px 0;
    border-bottom: 1px solid var(--border, #343a3c);
    overflow-wrap: anywhere;
}
.preference-archive-row > small {
    display: block;
    margin-top: 6px;
}
