:root {
    color-scheme: light;
    --hubr-bg: #f2f7fb;
    --hubr-panel: #ffffff;
    --hubr-text: #1e2938;
    --hubr-muted: #64758a;
    --hubr-line: #d7e2ec;
    --hubr-accent: #2ea3f2;
    --hubr-accent-dark: #066aab;
    --hubr-accent-soft: #e8f5fd;
    --hubr-danger: #b42318;
}

html {
    scroll-padding-top: 5.5rem;
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #ffffff 0, #f6f9fc 320px, var(--hubr-bg) 100%);
    color: var(--hubr-text);
}

.text-muted,
.form-text,
.card-text,
.small,
small {
    color: var(--hubr-muted) !important;
}

.btn-primary {
    --bs-btn-bg: var(--hubr-accent);
    --bs-btn-border-color: var(--hubr-accent);
    --bs-btn-hover-bg: var(--hubr-accent-dark);
    --bs-btn-hover-border-color: var(--hubr-accent-dark);
    --bs-btn-active-bg: var(--hubr-accent-dark);
    --bs-btn-active-border-color: var(--hubr-accent-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--hubr-accent);
    --bs-btn-border-color: var(--hubr-accent);
    --bs-btn-hover-bg: var(--hubr-accent);
    --bs-btn-hover-border-color: var(--hubr-accent);
    --bs-btn-active-bg: var(--hubr-accent-dark);
    --bs-btn-active-border-color: var(--hubr-accent-dark);
}

.btn-outline-secondary {
    --bs-btn-color: #486277;
    --bs-btn-border-color: #c5d3df;
    --bs-btn-hover-bg: #eef5fa;
    --bs-btn-hover-border-color: #9bb9d0;
    --bs-btn-hover-color: #173a5e;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--hubr-accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app-shell {
    width: min(1240px, 100%);
    max-width: 1240px;
}

.app-shell > .topbar,
.monitor-shell > .topbar {
    margin-bottom: 1.25rem !important;
}

.app-shell > .content-panel,
.app-shell > .editor-pane {
    padding: clamp(1rem, 3vw, 1.5rem) !important;
}

.monitor-shell {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
    padding-bottom: 2rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 4.5rem;
    padding: 0.55rem 0 0.8rem;
    border-bottom: 1px solid var(--hubr-line);
    background: var(--hubr-bg);
    transition: min-height 180ms ease, padding 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.topbar.is-compact {
    min-height: 3.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 8px 22px rgba(26, 35, 52, 0.12);
}

.topbar.is-compact .comba-logo {
    font-size: clamp(1.55rem, 2.4vw, 1.9rem);
}

.topbar.is-compact .project-version {
    font-size: 0.56rem;
}

.topbar.is-compact .top-menu {
    gap: clamp(0.65rem, 1.5vw, 1.25rem);
    font-size: 0.9rem;
}

.app-shell > .topbar.is-compact,
.monitor-shell > .topbar.is-compact {
    margin-bottom: 0.65rem !important;
}

.monitor-topbar {
    min-height: 4.5rem;
}

.comba-logo {
    color: #23aee6;
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.comba-logo:hover {
    color: #1d9fd4;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
}

.project-version {
    margin-left: 0.15rem;
    margin-top: 0.08rem;
    color: var(--hubr-muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    opacity: 0.78;
}

.top-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.85rem, 2vw, 1.8rem);
    color: #18334d;
    font-size: 0.96rem;
    font-weight: 800;
}

.top-menu a,
.top-menu button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: none;
}

.top-menu a:hover,
.top-menu button:hover,
.top-menu .active {
    color: var(--hubr-accent);
}

.top-menu .active {
    position: relative;
}

.top-menu .active::after {
    position: absolute;
    right: 0;
    bottom: -0.95rem;
    left: 0;
    height: 3px;
    border-radius: 99px;
    background: var(--hubr-accent);
    content: "";
}

.top-menu a:focus-visible,
.top-menu button:focus-visible,
.menu-toggle:focus-visible {
    outline: 3px solid rgba(46, 163, 242, 0.32);
    outline-offset: 3px;
}

.menu-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--hubr-line);
    border-radius: 0.55rem;
    background: var(--hubr-panel);
    color: var(--hubr-text);
    cursor: pointer;
    font-size: 1.2rem;
}

.menu-toggle:hover {
    border-color: var(--hubr-accent);
    color: var(--hubr-accent);
}

.top-menu [data-advanced-link] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-menu [data-advanced-link] i {
    font-size: 1.05rem;
}

.system-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.system-submenu-toggle {
    display: inline-flex;
    width: 1.8rem;
    height: 1.8rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem !important;
    color: var(--hubr-muted) !important;
    cursor: pointer;
    font-size: 0.7rem !important;
}

.system-submenu-toggle:hover,
.system-nav.is-open .system-submenu-toggle {
    background: var(--hubr-accent-soft) !important;
    color: var(--hubr-accent) !important;
}

.system-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: -0.75rem;
    z-index: 30;
    width: min(18rem, calc(100vw - 2rem));
    max-height: min(72vh, 32rem);
    overflow-y: auto;
    padding: 0.45rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.7rem;
    background: var(--hubr-panel);
    box-shadow: 0 14px 32px rgba(26, 35, 52, 0.18);
    font-size: 0.9rem;
}

.system-nav:hover .system-submenu,
.system-nav.is-open .system-submenu {
    display: grid;
    gap: 0.15rem;
}

.system-submenu a {
    display: block;
    padding: 0.58rem 0.7rem !important;
    border-radius: 0.45rem;
    color: var(--hubr-text) !important;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
}

.system-submenu a:hover,
.system-submenu a:focus-visible,
.system-submenu a.active {
    background: var(--hubr-accent-soft);
    color: var(--hubr-accent) !important;
}

.system-submenu a.active::after {
    display: none;
}

.monitor-title {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 0.55rem;
    color: #173a5e;
    text-align: center;
}

.monitor-title h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.12;
}

.monitor-title mark {
    display: inline-block;
    padding: 0 0.25rem;
    border-radius: 0.3rem;
    background: #dff2fd;
    color: #066aab;
}

.dashboard-title-label {
    color: #173a5e;
}

.monitor-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto 1rem;
    width: 100%;
}

.export-actions {
    display: inline-flex;
    overflow: hidden;
    border-radius: 999px;
    background: #707982;
}

.export-actions button {
    padding: 0.15rem 0.75rem;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 1.3rem;
    line-height: 1.2;
}

.export-actions button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #07184b;
    font-size: 1.05rem;
}

.search-field input {
    width: min(250px, 48vw);
    height: 2.6rem;
    border: 1px solid #b8b8b8;
    border-radius: 0.2rem;
    padding: 0.35rem 0.55rem;
}

.monitor-table-wrap {
    width: 100%;
    margin: 0 auto;
    overflow: visible;
}

.monitor-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #07184b;
    font-size: 1.1rem;
}

.monitor-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid #222222;
    background: #ffffff;
}

.monitor-table thead th {
    background: #f0f7fb;
    box-shadow: 0 1px 0 #d8e4ed;
}

.monitor-table th,
.monitor-table td {
    padding: 0.58rem 0.75rem;
    vertical-align: middle;
}

.monitor-table th {
    font-weight: 900;
}

.monitor-table tbody tr:nth-child(odd) {
    background: #f8fbfd;
}

.monitor-table .number-col {
    width: 8.5rem;
}

.sort-button {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 900;
}

.sort-button::after {
    content: " \2195";
    color: #c9c9c9;
    font-weight: 400;
}

.sort-button.active::after {
    content: " \2191";
    color: var(--hubr-accent-dark);
}

.equipment-icon {
    color: #111111;
    font-size: 0.85rem;
}

.external-link {
    color: #000000;
    font-size: 0.95rem;
    text-decoration: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-width: 7.5rem;
    color: var(--hubr-accent-dark);
    font-weight: 800;
}

.status-online {
    color: var(--hubr-accent-dark);
}

.status-alarm {
    color: #b54708;
}

.status-offline {
    color: var(--hubr-danger);
}

.status-pending,
.status-unsupported,
.status-disabled {
    color: var(--hubr-muted);
}

.disabled-equipment .status-pill,
.disabled-equipment .equipment-name {
    color: var(--hubr-muted);
}

.status-detail,
.analysis-detail {
    display: block;
    margin-top: 0.15rem;
    color: var(--hubr-muted);
    font-size: 0.82rem;
    line-height: 1.2;
}

.analysis-cell {
    max-width: 34rem;
}

.analysis-pill {
    min-width: 6rem;
}

.analysis-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    word-break: normal;
}

.analysis-alarm-item {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.4rem;
    border: 1px solid #f0b37e;
    border-radius: 0.25rem;
    background: #fff7ed;
    color: #8a3b12;
    line-height: 1.2;
}

.analysis-alarm-item strong {
    font-weight: 800;
}

.analysis-alarm-item .badge {
    flex: 0 0 auto;
    border-radius: 0.25rem;
    font-size: 0.72rem;
}

.monitor-message {
    width: min(100%, 1400px);
    margin: 0.75rem auto 0;
}

.monitor-config-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.monitor-config-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 5.5rem;
    padding: 0.8rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.5rem;
    background: #ffffff;
}

.monitor-config-control strong,
.monitor-config-control small {
    display: block;
}

.monitor-config-control small {
    margin-top: 0.25rem;
    color: var(--hubr-muted);
    line-height: 1.25;
}

.monitor-config-control .form-check-input {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 1.35rem;
    margin: 0;
}

.monitor-config-control .form-select {
    flex: 0 0 6.5rem;
}

.monitor-config-value {
    flex: 0 0 8rem;
    min-width: 0;
}

.monitor-config-value .form-control {
    width: 100%;
}

.monitor-config-value small {
    margin-top: 0.3rem;
    line-height: 1.15;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .monitor-table-wrap {
        overflow-x: auto;
    }

    .monitor-config-grid {
        grid-template-columns: 1fr;
    }
}

.login-screen {
    min-height: 100vh;
}

.login-panel {
    width: min(100%, 410px);
}

.admin-nav {
    overflow-x: auto;
    scrollbar-width: thin;
}

.admin-nav .nav-link {
    min-width: max-content;
    color: var(--hubr-muted);
    font-weight: 800;
}

.admin-nav .nav-link:hover {
    color: var(--hubr-text);
    background: #f1f5f8;
}

.admin-nav .nav-link.active {
    background: var(--hubr-accent);
    color: #ffffff;
}

.shortcut-card,
.info-card,
.content-panel,
.editor-pane,
.config-section,
.config-subsection {
    border-color: var(--hubr-line);
    box-shadow: 0 10px 28px rgba(26, 35, 52, 0.05);
}

.content-panel,
.editor-pane,
.info-card {
    border-radius: 0.85rem;
    background: var(--hubr-panel);
}

.app-shell > .content-panel,
.app-shell > .editor-pane {
    margin-bottom: 1rem;
}

.app-shell h1 {
    color: #173a5e;
    font-weight: 800;
}

.form-control,
.form-select,
.input-group-text {
    border-color: #cbd9e5;
}

.form-control:focus,
.form-select:focus {
    border-color: #78bee9;
    box-shadow: 0 0 0 0.2rem rgba(46, 163, 242, 0.16);
}

.table-responsive,
.monitor-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--hubr-line);
    border-radius: 0.75rem;
    background: #ffffff;
}

.config-mode-switch {
    padding: 0.75rem 1rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.65rem;
    background: #f8fafb;
}

.config-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0;
    white-space: nowrap;
}

.config-mode-toggle .form-check-input,
.config-switch .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: 0 !important;
}

.config-section {
    padding: 1rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.65rem;
    background: var(--hubr-panel);
}

.config-section-heading {
    margin-bottom: 1rem;
}

.config-section-heading p {
    font-size: 0.88rem;
}

.config-switch {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.5rem;
    background: #f8fafb;
}

.config-subsection {
    padding: 0.75rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.5rem;
    background: #fbfcfd;
}

.config-password-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.config-password-row:first-child {
    margin-top: 0;
}

.config-password-row .form-control {
    min-width: 0;
}

.config-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.config-masters-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.config-masters-table th,
.config-masters-table td {
    padding: 0.55rem;
    border-bottom: 1px solid var(--hubr-line);
    vertical-align: top;
}

.config-masters-table th {
    color: var(--hubr-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.config-masters-table textarea {
    min-height: 4.5rem;
    resize: vertical;
    font-family: inherit;
    font-size: 0.82rem;
}

.config-masters-table .master-id {
    width: 3rem;
    color: var(--hubr-muted);
    font-weight: 800;
}

.config-masters-table .master-active {
    width: 4.5rem;
    text-align: center;
}

.config-masters-table .master-action {
    width: 3.5rem;
}

.config-section > summary {
    cursor: pointer;
    color: var(--hubr-text);
    font-weight: 800;
}

.dependency-card {
    display: flex;
    flex-direction: column;
    border-left: 4px solid transparent;
    transition: opacity 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.dependency-card.dependency-actionable {
    opacity: 1;
}

.dependency-card .dependency-action {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 0.45rem;
}

.dependency-installed {
    border-left-color: #198754;
    background: #f0faf4;
}

.dependency-installed .dependency-status {
    color: #198754;
    font-weight: 700;
}

.dependency-missing {
    border-left-color: #adb5bd;
    background: #f4f5f6;
    color: #6c757d;
    opacity: 0.72;
}

.dependency-missing .dependency-status {
    color: #9a6700;
    font-weight: 700;
}

.shortcut-card {
    min-height: 142px;
    color: var(--hubr-text);
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

/* Router system dashboard */
.sys-page {
    --sys-ink: #173a5e;
    --sys-muted: #64758a;
}

.sys-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    overflow: hidden;
    border: 1px solid #d3e6f3;
    border-radius: 1rem;
    background: linear-gradient(115deg, #ffffff 0%, #eef8fe 68%, #e2f3fc 100%);
    color: var(--sys-ink);
}

.sys-hero h1 {
    margin: 0 0 0.45rem;
    color: var(--sys-ink);
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    font-weight: 800;
}

.page-heading {
    display: flex;
    min-height: 5.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.3rem;
    border: 1px solid #d3e6f3;
    border-radius: 0.9rem;
    background: linear-gradient(110deg, #ffffff, #eef8fe);
    color: #173a5e;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 800;
}

.page-heading h1,
.page-heading .h3 {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.page-heading p {
    margin: 0.35rem 0 0;
    color: var(--hubr-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.content-panel > h1:first-child,
.editor-pane > h1:first-child {
    margin: -0.1rem 0 1rem;
    color: #173a5e;
    font-weight: 800;
}

.sys-hero p:last-child {
    max-width: 42rem;
    color: var(--sys-muted);
}

.sys-hero-icon {
    display: grid;
    width: clamp(3.5rem, 10vw, 5rem);
    height: clamp(3.5rem, 10vw, 5rem);
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(46, 163, 242, 0.2);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--hubr-accent);
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.dashboard-hero-side {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-temperature {
    display: grid;
    gap: 0.2rem;
    color: var(--sys-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
    text-transform: uppercase;
}

.dashboard-hero mark {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 0.4rem;
    background: #dff2fd;
    color: #066aab;
    font-size: 1.15rem;
    text-transform: none;
}

.sys-section {
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--hubr-line);
    border-radius: 0.9rem;
    background: var(--hubr-panel);
    box-shadow: 0 8px 24px rgba(26, 35, 52, 0.045);
}

.sys-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.sys-section-heading h2 {
    margin: 0 0 0.3rem;
    color: var(--sys-ink);
    font-size: 1.2rem;
    font-weight: 800;
}

.sys-section-heading p:not(.eyebrow) {
    margin: 0;
    color: var(--sys-muted);
    font-size: 0.9rem;
}

.sys-board-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.sys-metric {
    display: flex;
    min-height: 5.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e2e9ef;
    border-radius: 0.7rem;
    background: #f8fafc;
}

.sys-metric-primary {
    border-color: #cfe8f7;
    background: #f1f9fe;
}

.sys-metric strong {
    color: var(--sys-ink);
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.voltage-chart-frame {
    overflow: hidden;
    border: 1px solid #e2e9ef;
    border-radius: 0.7rem;
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.voltage-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 12rem;
    color: var(--hubr-muted);
    font-family: inherit;
}

.voltage-chart-grid {
    stroke: #e2e9ef;
    stroke-width: 1;
}

.voltage-chart-axis {
    fill: var(--hubr-muted);
    font-size: 12px;
}

.voltage-chart-line {
    fill: none;
    stroke: var(--hubr-accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.voltage-chart-point {
    fill: #ffffff;
    stroke: var(--hubr-accent-dark);
    stroke-width: 2.5;
}

.voltage-chart-empty {
    fill: var(--hubr-muted);
    font-size: 14px;
}

.sys-links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.sys-link-card:focus-visible,
.sys-breadcrumb a:focus-visible {
    outline: 3px solid rgba(46, 163, 242, 0.32);
    outline-offset: 3px;
}

.sys-link-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid #e0e7ed;
    border-radius: 0.75rem;
    background: #ffffff;
    color: var(--sys-ink);
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sys-link-card:hover {
    transform: translateY(-1px);
    border-color: #91cbee;
    box-shadow: 0 8px 20px rgba(26, 35, 52, 0.075);
    color: var(--sys-ink);
}

.sys-link-card-featured {
    min-height: 6rem;
    border-color: #cce5f4;
    background: linear-gradient(100deg, #f1f9fe, #ffffff);
}

.sys-link-icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.7rem;
    background: var(--hubr-accent-soft);
    color: var(--hubr-accent-dark);
    font-size: 1.05rem;
}

.sys-link-copy {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
}

.sys-link-copy strong {
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.sys-link-copy small {
    line-height: 1.35;
}

.sys-link-arrow {
    margin-left: auto;
    padding-left: 0.35rem;
    color: #7890a2;
    font-size: 0.85rem;
}

.sys-section-warning {
    border-color: #f0d7c7;
    background: #fffdfa;
}

.sys-section-warning .eyebrow {
    color: #a35524;
}

.sys-section-warning .sys-section-heading h2 {
    color: #694327;
}

.sys-warning-icon {
    color: #b66a37;
    font-size: 1.15rem;
}

.sys-reset-details {
    padding: 0.9rem 1rem;
    border-left: 3px solid #e6b790;
    border-radius: 0.35rem;
    background: #fff7f0;
}

.sys-reset-details p:first-child {
    margin-bottom: 0.4rem;
}

.sys-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: -0.25rem 0 1rem;
    color: var(--hubr-muted);
    font-size: 0.88rem;
}

.sys-breadcrumb a {
    color: var(--hubr-accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.sys-breadcrumb a:hover {
    text-decoration: underline;
}

.login-screen {
    min-height: 100vh;
    background: radial-gradient(circle at 15% 10%, #e8f5fd, transparent 34%),
        linear-gradient(145deg, #f9fcfe, #edf5fa);
}

.login-panel {
    width: min(100%, 29rem);
    border: 1px solid #d8e5ef !important;
    border-radius: 1rem;
    box-shadow: 0 18px 46px rgba(23, 58, 94, 0.1) !important;
}

.login-panel .eyebrow {
    color: var(--hubr-accent-dark);
    letter-spacing: 0.04em;
}

.login-panel .input-group-text {
    color: var(--hubr-accent-dark);
    background: #f3f9fd;
}

.monitor-tools {
    margin-top: 1rem;
}

.export-actions {
    background: #e7f3fa;
}

.export-actions button {
    color: #175582;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.45rem 0.9rem;
}

.export-actions button:hover {
    background: #d4eafa;
}

.search-field input {
    border-color: #cbd9e5;
    border-radius: 0.5rem;
}

.monitor-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.monitor-table th {
    background: #f0f7fb;
    color: #28506d;
    font-size: 0.8rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.monitor-table th,
.monitor-table td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid #e3ebf1;
}

.monitor-table tr:last-child td {
    border-bottom: 0;
}

.sort-button {
    color: inherit;
    font: inherit;
    text-transform: inherit;
}

@media (max-width: 767.98px) {
    .topbar {
        align-items: stretch;
        padding-bottom: 0.65rem;
    }

    .top-menu {
        justify-content: flex-start;
        gap: 1rem;
        flex-wrap: wrap;
        font-size: 0.9rem;
    }

    .top-menu .active::after {
        bottom: -0.3rem;
    }

    .top-menu .active::after {
        display: none;
    }

    .topbar.is-compact {
        align-items: center;
        gap: 0.5rem;
        min-height: 3.25rem;
        padding: 0.25rem 0.55rem;
    }

    .topbar.is-compact .comba-logo {
        font-size: 1.65rem;
    }

    .topbar.is-compact .project-version {
        font-size: 0.52rem;
    }

    .topbar.is-compact .menu-toggle {
        width: 2.75rem;
        height: 2.75rem;
    }

    .topbar.is-compact .top-menu {
        gap: 0.25rem;
        font-size: 1rem;
    }

    .app-shell > .topbar.is-compact,
    .monitor-shell > .topbar.is-compact {
        margin-bottom: 0.45rem !important;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sys-hero {
        align-items: flex-start;
    }

    .sys-board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sys-links-grid {
        grid-template-columns: 1fr;
    }
}

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

@media (max-width: 420px) {
    .sys-board-grid {
        grid-template-columns: 1fr;
    }

    .sys-link-card {
        gap: 0.65rem;
        padding: 0.85rem;
    }
}

.hubr-setup-notice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: max-content;
    max-width: min(23rem, calc(100vw - 2rem));
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--hubr-line);
    border-left: 4px solid #d99a28;
    border-radius: 0.75rem;
    background: var(--hubr-panel);
    color: inherit;
    box-shadow: 0 8px 24px rgba(26, 35, 52, 0.16);
    font-size: 0.82rem;
    line-height: 1.35;
}

.hubr-setup-notice__text {
    flex: 1 1 auto;
}

.hubr-setup-notice a {
    flex: 0 0 auto;
    color: var(--bs-primary);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.hubr-setup-notice a:hover,
.hubr-setup-notice a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .hubr-setup-notice {
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        left: 0.75rem;
        width: auto;
        max-width: none;
        padding: 0.65rem 0.8rem;
    }

}

.shortcut-card:hover {
    border-color: var(--hubr-accent);
    box-shadow: 0 12px 30px rgba(26, 35, 52, 0.1);
    color: var(--hubr-text);
    transform: translateY(-1px);
}

.shortcut-icon {
    display: inline-flex;
    width: 2.8rem;
    height: 2.8rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--hubr-accent-soft);
    color: var(--hubr-accent-dark);
    font-size: 1rem;
}

.field-label {
    color: var(--hubr-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.info-card strong,
.shortcut-card strong,
.sms-meta strong,
.sms-meta span,
.sms-item p,
.pane-title span {
    overflow-wrap: anywhere;
}

.signal-meter {
    width: 100%;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf3;
}

.signal-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--hubr-accent);
    transition: width 0.2s ease;
}

.raw-response {
    min-height: 110px;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.update-progress-track {
    height: 1rem;
    overflow: hidden;
    border-radius: 999px;
}

.update-progress-bar {
    transition: width 0.12s linear;
}

.update-progress-bar.is-indeterminate {
    width: 35%;
    animation: hubr-update-progress 1.35s ease-in-out infinite alternate;
}

@keyframes hubr-update-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(285%); }
}

@media (prefers-reduced-motion: reduce) {
    .update-progress-bar.is-indeterminate {
        animation: none;
        margin-left: auto;
        margin-right: auto;
    }
}

textarea.form-control {
    min-height: 360px;
    resize: vertical;
    font-family: "Courier New", monospace;
    font-size: 0.84rem;
    line-height: 1.45;
}

.config-masters-table textarea.form-control {
    min-height: 4.5rem;
    font-family: inherit;
    font-size: 0.82rem;
}

.json-tree-editor {
    height: min(68vh, 760px);
    min-height: 520px;
}

.json-tree-editor div.jsoneditor {
    border-color: var(--hubr-line);
}

.json-tree-editor div.jsoneditor-menu {
    background: var(--hubr-accent);
    border-bottom-color: var(--hubr-accent-dark);
}

.json-editor-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--hubr-muted);
    font-size: 0.82rem;
}

.json-editor-status .ok {
    color: var(--hubr-accent-dark);
}

.json-editor-status .error {
    color: var(--hubr-danger);
}

textarea.sms-compose-text {
    min-height: 112px;
    font-family: inherit;
    font-size: 1rem;
}

.message {
    min-height: 1.25rem;
    margin: 0;
    color: var(--hubr-muted);
    font-size: 0.875rem;
}

.message.error {
    color: var(--hubr-danger);
}

.message.ok {
    color: var(--hubr-accent-dark);
}

.theme-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.theme-control-label {
    color: inherit;
    font-size: 0.78rem;
    font-weight: 700;
}

.theme-control-select {
    width: auto;
    min-width: 6.6rem;
    min-height: 2rem;
    padding: 0.2rem 1.65rem 0.2rem 0.5rem;
    border: 1px solid var(--hubr-line);
    border-radius: 0.4rem;
    background-color: var(--hubr-panel);
    color: var(--hubr-text);
    font: inherit;
    font-size: 0.78rem;
}

.theme-control-select:focus-visible {
    outline: 3px solid rgba(46, 163, 242, 0.32);
    outline-offset: 2px;
}

.login-panel .theme-control {
    justify-content: flex-end;
    margin-bottom: 1rem;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --hubr-bg: #0d1722;
    --hubr-panel: #152433;
    --hubr-text: #e6eff7;
    --hubr-muted: #a8b9c8;
    --hubr-line: #304354;
    --hubr-accent: #54b5f2;
    --hubr-accent-dark: #82caf3;
    --hubr-accent-soft: #1b3a4f;
    --hubr-danger: #ff8178;
    --bs-body-color: var(--hubr-text);
    --bs-body-bg: var(--hubr-bg);
    --bs-body-color-rgb: 230, 239, 247;
    --bs-body-bg-rgb: 13, 23, 34;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: #a8b9c8;
    --bs-tertiary-color: #8298aa;
    --bs-secondary-bg: #1c2c3a;
    --bs-tertiary-bg: #1a2937;
    --bs-border-color: var(--hubr-line);
    --bs-border-color-translucent: rgba(196, 215, 230, 0.16);
    --bs-link-color: var(--hubr-accent);
    --bs-link-hover-color: #9bd8fb;
    --bs-heading-color: var(--hubr-text);
}

html[data-theme="dark"] body {
    background: radial-gradient(ellipse at 50% 0, #15283a 0, transparent 38%), var(--hubr-bg);
    color: var(--hubr-text);
}

html[data-theme="dark"] .topbar {
    border-bottom-color: var(--hubr-line);
}

html[data-theme="dark"] .top-menu,
html[data-theme="dark"] .monitor-title,
html[data-theme="dark"] .dashboard-title-label,
html[data-theme="dark"] .app-shell h1,
html[data-theme="dark"] .content-panel > h1:first-child,
html[data-theme="dark"] .editor-pane > h1:first-child,
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .monitor-table {
    color: var(--hubr-text);
}

html[data-theme="dark"] .monitor-title mark {
    background: #173a52;
    color: #9bd8fb;
}

html[data-theme="dark"] .search-field input,
html[data-theme="dark"] .monitor-config-control,
html[data-theme="dark"] .config-mode-switch,
html[data-theme="dark"] .config-switch,
html[data-theme="dark"] .config-subsection,
html[data-theme="dark"] .sys-metric,
html[data-theme="dark"] .sys-link-card,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .monitor-table-wrap {
    border-color: var(--hubr-line);
    background-color: var(--hubr-panel);
    color: var(--hubr-text);
}

html[data-theme="dark"] .monitor-table thead,
html[data-theme="dark"] .monitor-table thead th,
html[data-theme="dark"] .monitor-table th {
    border-color: var(--hubr-line);
    background: #1c2e3d;
    color: #c5d5e2;
    box-shadow: none;
}

html[data-theme="dark"] .monitor-table tbody tr:nth-child(odd) {
    background: #182a38;
}

html[data-theme="dark"] .monitor-table tbody tr:nth-child(even) {
    background: #132330;
}

html[data-theme="dark"] .equipment-icon,
html[data-theme="dark"] .external-link {
    color: var(--hubr-text);
}

html[data-theme="dark"] .analysis-alarm-item {
    border-color: #7d4e2f;
    background: #38291f;
    color: #ffc18f;
}

html[data-theme="dark"] .admin-nav .nav-link:hover {
    background: #203547;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .search-field input {
    border-color: #425769;
    background-color: #101d29;
    color: var(--hubr-text);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .search-field input::placeholder {
    color: #91a5b7;
}

html[data-theme="dark"] .config-masters-table th,
html[data-theme="dark"] .config-masters-table td,
html[data-theme="dark"] .monitor-table th,
html[data-theme="dark"] .monitor-table td {
    border-color: var(--hubr-line);
}

html[data-theme="dark"] .dependency-installed {
    border-left-color: #46b982;
    background: #173629;
}

html[data-theme="dark"] .dependency-missing {
    border-left-color: #566675;
    background: #202b34;
    color: #a8b2bb;
}

html[data-theme="dark"] .dependency-missing .dependency-status {
    color: #e7bf63;
}

html[data-theme="dark"] .sys-page {
    --sys-ink: #e5f0f8;
    --sys-muted: #a8b9c8;
}

html[data-theme="dark"] .sys-hero,
html[data-theme="dark"] .page-heading {
    border-color: #294357;
    background: linear-gradient(115deg, #172a3a 0%, #183447 68%, #1c3d53 100%);
    color: var(--sys-ink);
}

html[data-theme="dark"] .dashboard-hero mark {
    background: #173a52;
    color: #9bd8fb;
}

html[data-theme="dark"] .sys-section,
html[data-theme="dark"] .content-panel,
html[data-theme="dark"] .editor-pane,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .config-section {
    border-color: var(--hubr-line);
    background-color: var(--hubr-panel);
}

html[data-theme="dark"] .sys-link-card {
    background: #152433;
    color: var(--sys-ink);
}

html[data-theme="dark"] .sys-link-card-featured {
    border-color: #31556e;
    background: linear-gradient(100deg, #1a3548, #172b3b);
}

html[data-theme="dark"] .sys-section-warning {
    border-color: #704a32;
    background: #30261f;
}

html[data-theme="dark"] .sys-section-warning .sys-section-heading h2 {
    color: #f2c6a4;
}

html[data-theme="dark"] .sys-reset-details {
    border-left-color: #a86d43;
    background: #382a20;
}

html[data-theme="dark"] .login-screen {
    background: radial-gradient(circle at 15% 10%, #183b53, transparent 34%), linear-gradient(145deg, #101d29, #0d1722);
}

html[data-theme="dark"] .login-panel {
    border-color: #30495c !important;
    background-color: var(--hubr-panel);
}

html[data-theme="dark"] .login-panel .input-group-text {
    background: #1b3040;
}

html[data-theme="dark"] .export-actions {
    background: #1b394e;
}

html[data-theme="dark"] .export-actions button {
    color: #d9ecf8;
}

html[data-theme="dark"] .export-actions button:hover {
    background: #28506a;
}

html[data-theme="dark"] .signal-meter {
    background: #263746;
}

html[data-theme="dark"] .voltage-chart-frame {
    border-color: var(--hubr-line);
    background: linear-gradient(180deg, #172735, #111e2a);
}

html[data-theme="dark"] .voltage-chart-grid {
    stroke: #324858;
}

html[data-theme="dark"] .voltage-chart-point {
    fill: #152433;
}

html[data-theme="dark"] .text-bg-light,
html[data-theme="dark"] .bg-light {
    border-color: var(--hubr-line) !important;
    background-color: #20303e !important;
    color: #e3edf5 !important;
}

html[data-theme="dark"] .raw-response {
    border-color: var(--hubr-line) !important;
    background-color: #101d29 !important;
    color: #dce7ef;
}

html[data-theme="dark"] .json-tree-editor div.jsoneditor {
    border-color: var(--hubr-line);
    background-color: var(--hubr-panel);
    color: var(--hubr-text);
}

html[data-theme="dark"] .json-tree-editor .jsoneditor-outer,
html[data-theme="dark"] .json-tree-editor .jsoneditor-tree,
html[data-theme="dark"] .json-tree-editor .jsoneditor textarea,
html[data-theme="dark"] .json-tree-editor .jsoneditor input {
    background-color: #101d29;
    color: var(--hubr-text);
}

.sys-hardware-accordion {
    padding: 0;
}

.sys-hardware-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.9rem;
    color: var(--hubr-text);
    cursor: pointer;
    list-style: none;
}

.sys-hardware-summary::-webkit-details-marker {
    display: none;
}

.sys-hardware-summary:focus-visible {
    outline: 3px solid rgba(46, 163, 242, 0.42);
    outline-offset: 2px;
}

.sys-hardware-summary-title {
    font-size: 1.05rem;
    font-weight: 800;
}

.sys-hardware-chevron {
    flex: 0 0 auto;
    color: var(--hubr-muted);
    transition: transform 0.16s ease;
}

.sys-hardware-accordion[open] .sys-hardware-chevron {
    transform: rotate(180deg);
}

.sys-hardware-content {
    padding: 0 1.25rem 1.25rem;
}

.sys-hardware-accordion[open] .sys-hardware-summary {
    border-bottom: 1px solid var(--hubr-line);
    border-radius: 0.9rem 0.9rem 0 0;
}

@media (max-width: 420px) {
    .sys-hardware-summary,
    .sys-hardware-content {
        padding-right: 0.9rem;
        padding-left: 0.9rem;
    }
}

@media (max-width: 767.98px) {
    body {
        background: var(--hubr-bg);
    }

    .monitor-shell {
        width: min(100%, calc(100% - 1rem));
    }

    .topbar {
        align-items: center;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .topbar .brand-block {
        max-width: calc(100% - 3.5rem);
    }

    .comba-logo {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .top-menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        z-index: 20;
        width: min(17rem, calc(100vw - 2rem));
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.25rem;
        max-height: min(70vh, 25rem);
        overflow-y: auto;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        border: 1px solid var(--hubr-line);
        border-radius: 0.65rem;
        background: var(--hubr-panel);
        box-shadow: 0 14px 32px rgba(26, 35, 52, 0.18);
        font-size: 1rem;
    }

    .top-menu.is-open {
        display: flex;
    }

    .top-menu a,
    .top-menu button {
        display: flex;
        width: 100%;
        min-height: 2.75rem;
        align-items: center;
        padding: 0.65rem 0.75rem;
        border-radius: 0.5rem;
        text-align: left;
    }

    .top-menu a:hover,
    .top-menu button:hover,
    .top-menu .active {
        background: var(--hubr-accent-soft);
    }

    .top-menu [data-advanced-link] {
        justify-content: flex-start;
        gap: 0.65rem;
    }

    .system-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    .system-nav-link {
        width: auto !important;
        flex: 1 1 auto;
    }

    .top-menu .system-submenu-toggle {
        min-height: 2.75rem;
        width: 2.75rem;
        flex: 0 0 2.75rem;
    }

    .system-submenu {
        position: static;
        width: 100%;
        max-height: min(55vh, 24rem);
        margin: 0 0 0.35rem;
        box-shadow: none;
    }

    .system-nav:not(.is-open):not(:hover) .system-submenu {
        display: none;
    }

    .monitor-tools {
        align-items: stretch;
        flex-direction: column;
        gap: 0.75rem;
    }

    .export-actions {
        width: fit-content;
        max-width: 100%;
    }

    .export-actions button {
        min-height: 2.5rem;
    }

    .search-field {
        width: 100%;
    }

    .search-field input {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
    }

    .monitor-title {
        justify-content: flex-start;
        text-align: left;
    }

    .monitor-table {
        min-width: 760px;
    }

    .admin-nav {
        margin-right: -0.75rem;
        margin-left: -0.75rem;
        padding-right: 0.75rem !important;
        padding-left: 0.75rem !important;
        border-right: 0 !important;
        border-left: 0 !important;
        border-radius: 0 !important;
        box-shadow: none;
    }

    .shortcut-card {
        min-height: 0;
    }

    .content-panel .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .config-mode-switch {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .config-mode-toggle {
        align-self: stretch;
        justify-content: space-between;
    }

    .config-section {
        padding: 0.8rem;
    }

    .config-password-row {
        align-items: stretch;
    }

    .config-password-row .btn {
        flex: 0 0 auto;
    }

    .monitor-config-control {
        align-items: flex-start;
        flex-direction: column;
    }

    .monitor-config-control .form-check-input,
    .monitor-config-control .form-select,
    .monitor-config-value {
        align-self: stretch;
        width: 100%;
        flex-basis: auto;
    }

    textarea.form-control {
        min-height: 260px;
    }

    .json-tree-editor {
        min-height: 420px;
    }

    textarea.sms-compose-text {
        min-height: 112px;
    }
}
