* {
    color: #888;
    font-family: monospace;
    font-size: 12px;
    margin: 0;
    padding: 0;
}

html {
    background: #262626;
}

h1 {
    font-size: 1.4em;
}

h2 {
    font-size: 1.2em;
}

#error {
    background-color: #B00020;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    top: -50px;
    left: 0;
    transition: top 0.5s ease;
    z-index: 10000;
    width: 100%;
    position: fixed;
}

#error.show {
    top: 0; /* Slide down into view */
}

.prio-2 {
    color: gray !important;
}

.prio-3 {
    color: #2a536d !important;
}

.prio-4 {
    color: #5f7c4f !important;
}

.prio-5 {
    color: #b3ac25 !important;
}

.prio-6 {
    color: #c8514c !important;
}

.prio-7 {
    color: #ae2a25 !important;
}

.prio-2 .p { /* verbose */
    background: #5394EC;
}

.prio-3 .p { /* debug */
    background: #326586;
}

.prio-4 .p { /* info */
    background: #5d9801;
    color: #111;
}

.prio-5 .p { /* warn */
    background: #ABC023;
    color: #111;
}

.prio-6 .p { /* err */
    background: #CC666E;
}

.prio-7 .p {  /* assert */
    background: #FF6B68;
}

/* msg */

.prio-2 .m { /* verbose */
    color: #5394EC;
}

.prio-3 .m { /* debug */
    color: #299999;
}

.prio-4 .m { /* info */
    color: #cccccc;
}

.prio-5 .m { /* warn */
    color: #ABC023;
}

.prio-6 .m { /* err */
    color: #CC666E;
}

.prio-7 .m {  /* assert */
    color: #FF6B68;
}

/* spans */

.c, .cc {
    display: inline-block;
    font-size: 0.9em;
    color: #666e77;
}

.cc {
    min-width: 126px;
}

.cc {
    min-width: 54px;
}

.p {
    display: inline-block;
    width: 30px;
    text-align: center;
    color: #aaa;
}

.t {
    display: inline-block;
    color:rgb(139, 112, 151);
}

.m {
    display: inline-block;
}

.mp {
    color: #666e77;
}

.sp {
    margin-right: 4px;
}

.tag {
    font-size: 0.9em;
}

.hash-size-badge {
    display: inline-block;
    font-size: 0.85em;
    color: #c9cdd2;
    background: #4b5058;
    border: 1px solid #666e77;
    border-radius: 10px;
    padding: 0 6px;
    line-height: 1.4;
    margin-right: 6px;
    white-space: nowrap;
}

.scope-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    color: #dcefe8;
    background: #35524a;
    border: 1px solid #4f7a6c;
    border-radius: 10px;
    padding: 0 4px;
    line-height: 1.4;
    margin-right: 4px;
    white-space: nowrap;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    color: #e4e8ee;
    background: #444a53;
    border: 1px solid #626a74;
    border-radius: 10px;
    padding: 0 4px;
    line-height: 1.4;
    margin-right: 4px;
    white-space: nowrap;
}

.tag-badge,
.type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #edf6ff;
    letter-spacing: 0.01em;
}

.type-badge-adv {
    background: rgba(108, 199, 184, 0.14);
    border-color: rgba(146, 223, 210, 0.36);
    color: #d8f7f0;
}

.type-badge-raw {
    background: rgba(231, 179, 111, 0.14);
    border-color: rgba(240, 207, 158, 0.32);
    color: #f8e7ca;
}

.tag-badge-direct {
    background: rgba(100, 144, 216, 0.18);
    border-color: rgba(147, 181, 238, 0.35);
    color: #e3eeff;
}

.sm {
    font-size: 0.9em;
}

.ti {
    height: 14px;
    width: 14px;
}

.log-entry:hover,
.log-entry.hover {
    background:rgb(52, 53, 54);
    cursor: pointer;
}

.log-entry {
    border-bottom: solid 1px #343536;
    padding: 2px;
    align-items: center;
}

.log-entry-info {
    margin: 0;
    display: flex;
    align-items: center;
}

.log-entry-msg {
    margin: 0;
    align-items: center;
}

.t-bright {
    background: #d87dff;
    color: #161616;
    padding: 1px;
    border-radius: 2px;
    margin-bottom: 2px;
    display: inline-block;
}

.t-white {
    /* orbackground: #f5f5f5; */
    color: #f5f5f5;
    border-radius: 2px;
    padding: 1px;
    display: inline-block;
}

.log-entry-reports {
    border-left: 2px solid #888888;
    margin-left: 2px;
}

.log-entry-cehckbox {
    margin-left: auto;
    white-space: nowrap;
}

.dot {
    font-size: .8rem;
    border-radius: 0.35rem;
    display: inline-block;
    margin-right: 4px;
    color: #fff;
    padding: 1px 2px;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 80px;
}

.stripe {
    width: 2px;
    height: 1rem;
}

#container {
    display: flex;
    flex-direction: row;
}

#logs, #contacts {
    padding: 8px;
}

#leftbar {
    background: #262626;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#leftbar.bar-collapsed {
    overflow: hidden;
}

/* Sidebar tab bar */
#sidebar-tabs {
    display: flex;
    flex-shrink: 0;
    background: #1e1e1e;
    border-bottom: 1px solid #444;
    position: sticky;
    top: 0;
    z-index: 5;
}

.sidebar-tab {
    flex: 1;
    padding: 9px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #aaa;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.15s, border-color 0.15s;
}

.sidebar-tab:hover {
    color: #ddd;
    background: rgba(255,255,255,0.04);
}

.sidebar-tab.active {
    color: #fff;
    border-bottom-color: #4a9eff;
}

.sidebar-tab-panel {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#midbar {
    display: flex;
    flex-direction: row;
    height: 100vh;
}

.resize-bar {
    background: #444857;
    height: 100vh;
    width: 8px;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    user-select: none;
}

.resize-bar.compact {
    width: 18px;
}

.resize-bar::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 15px;
    border-inline: 1px solid #fff;
}

.collapse-toggle {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    background: rgba(14, 17, 22, 0.92);
    color: #d7e4ef;
    font-size: 0.72rem;
    padding: 0;
    z-index: 11;
}

.collapse-toggle:hover {
    background: rgba(36, 49, 66, 0.96);
}

.btn {
    border: solid 1px #2a536d;
    background: #262626;
    color: #fff;
    padding: 4px;
    border-radius: 4px;
    margin: 2px;
}

.btn:hover {
    cursor: pointer;
    border: solid 1px #2a536d;
    background: #2a536d;
    color: #fff;
}

.btn.active {
    background: #2a536d;
}

.pin {
    height: 1rem;
    width: 1rem;
}

.chighlight {
    background: rgb(216, 125, 255);
    color: #fff;
}

#map {
    height: 100%;
    flex: auto;
}

/* Map layer toggle — Dark / Light / Topo badges */
.map-layer-toggle {
    display: flex;
    gap: 4px;
    padding: 5px 6px;
    background: rgba(10, 10, 14, 0.78);
    border-radius: 20px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 2px 10px rgba(0,0,0,0.55);
    margin-bottom: 6px;
    margin-left: 6px;
}
.map-layer-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.45);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 12px;
    border-radius: 14px;
    transition: background 0.18s, color 0.18s;
    user-select: none;
    white-space: nowrap;
}
.map-layer-btn:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
}
.map-layer-btn.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Dark-themed distance tooltip on hop lines */
.leaflet-tooltip.hop-tooltip {
    background: rgba(12, 12, 14, 0.88);
    border: 1px solid #444;
    color: #e8e8e8;
    font-size: 0.72rem;
    padding: 3px 7px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.leaflet-tooltip.hop-tooltip::before {
    border-top-color: #444;
}

.leaflet-tooltip.mini-tooltip {
    background: rgba(18, 18, 20, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f4f4f4;
    font-size: 0.68rem;
    line-height: 1.05;
    padding: 2px 5px;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaflet-tooltip.mini-tooltip::before {
    border-top-color: rgba(255, 255, 255, 0.18);
}

.mini-tooltip-label {
    display: block;
    font-weight: 600;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-control {
    width: 220px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.map-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    background: rgba(20, 20, 24, 0.94);
    color: #fff;
    font-size: 0.83rem;
    outline: none;
    box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}

.map-search-input::placeholder {
    color: rgba(255,255,255,0.58);
}

.map-search-input:focus {
    border-color: rgba(255,255,255,0.38);
}

.map-search-results {
    margin-top: 7px;
    max-height: 132px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    background: rgba(18, 18, 22, 0.97);
    box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

.map-search-result {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 11px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: transparent;
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.map-search-result:last-child {
    border-bottom: none;
}

.map-search-result:hover,
.map-search-result:focus {
    background: rgba(255,255,255,0.08);
    outline: none;
}

.map-search-result-name {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.1;
}

.map-search-result-meta {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.66);
    line-height: 1.1;
}

.leaflet-popup.compact-marker-popup,
.leaflet-popup.compact-marker-popup .leaflet-popup-content-wrapper {
    pointer-events: auto;
    padding: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(24, 24, 28, 0.98), rgba(16, 16, 20, 0.98));
    color: #f4f4f4;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 10px 30px rgba(0,0,0,0.38);
}

.leaflet-popup.compact-marker-popup .leaflet-popup-content {
    pointer-events: auto;
    margin: 0;
    line-height: 1.2;
    min-width: 0;
}

.leaflet-popup.compact-marker-popup .leaflet-popup-tip {
    background: rgba(16, 16, 20, 0.98);
}

.leaflet-popup.compact-marker-popup .leaflet-popup-close-button {
    top: 4px;
    right: 5px;
    padding: 0 5px;
    color: rgba(255,255,255,0.72);
    font-size: 18px;
}

.leaflet-popup.compact-marker-popup .leaflet-popup-close-button:hover {
    color: #fff;
}

.device-popup-card {
    pointer-events: auto;
    min-width: 250px;
    max-width: 320px;
    padding: 10px 10px 9px;
}

.device-popup-header {
    margin-bottom: 8px;
    padding-right: 18px;
}

.device-popup-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    word-break: break-word;
}

.device-popup-subtitle {
    color: rgba(255,255,255,0.72);
    font-size: 0.76rem;
    font-family: monospace;
    margin-top: 3px;
}

.device-popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.device-popup-tabs {
    pointer-events: auto;
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.device-popup-tab,
.device-popup-range,
.device-popup-neighbors-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.82);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 2;
    appearance: none;
    -webkit-appearance: none;
}

.device-popup-tab:hover,
.device-popup-range:hover,
.device-popup-neighbors-btn:hover {
    background: rgba(255,255,255,0.09);
    color: #fff;
}

.device-popup-tab-active,
.device-popup-range-active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.24);
}

.device-popup-panel {
    pointer-events: auto;
    min-height: 120px;
}

.device-popup-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.device-popup-badge-status {
    background: rgba(79, 169, 108, 0.16);
}

.device-popup-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.device-popup-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.device-popup-mini-map {
    height: 168px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.14);
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    margin-top: 4px;
}

.device-popup-mini-map-empty {
    opacity: 0.55;
}

.device-popup-mini-map .leaflet-control-container {
    display: none;
}

.leaflet-tooltip.device-popup-mini-dot-tooltip {
    background: rgba(20, 22, 26, 0.94);
    border: 1px solid rgba(255,255,255,0.16);
    color: #f4f6f8;
    font-size: 0.68rem;
    padding: 3px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.34);
}

.leaflet-popup.device-popup-mini-dot-popup-wrap .leaflet-popup-content-wrapper {
    border-radius: 7px;
    background: rgba(18, 20, 24, 0.96);
    border: 1px solid rgba(255,255,255,0.14);
}

.leaflet-popup.device-popup-mini-dot-popup-wrap .leaflet-popup-content {
    margin: 8px 10px;
    color: #f4f6f8;
}

.device-popup-mini-dot-popup {
    font-size: 0.73rem;
    line-height: 1.3;
}

.device-popup-section-title {
    color: rgba(255,255,255,0.92);
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}

.device-popup-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.device-popup-range-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.device-popup-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    margin-top: 4px;
}

.device-popup-key,
.device-popup-key-block {
    color: rgba(255,255,255,0.64);
    font-size: 0.72rem;
}

.device-popup-value,
.device-popup-note,
.device-popup-list-row {
    color: #fff;
    font-size: 0.8rem;
    word-break: break-word;
}

.device-popup-reporter-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.device-popup-reporter-row .device-popup-badge {
    gap: 6px;
    padding: 2px 7px;
    font-size: 0.66rem;
    background: rgba(255,255,255,0.1);
}

.device-popup-key-block {
    margin-bottom: 4px;
}

.device-popup-mono {
    font-family: monospace;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.88);
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.2;
}

.device-popup-warning {
    background: rgba(180, 82, 58, 0.1);
    border-radius: 6px;
    padding: 8px;
    border-top: none;
}

.device-popup-chart-wrap {
    margin-top: 8px;
    padding: 8px 8px 4px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.device-popup-chart {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 284 / 110;
    max-height: 112px;
}

.device-popup-chart-axis {
    stroke: rgba(255,255,255,0.16);
    stroke-width: 1;
}

.device-popup-chart-bars rect {
    fill: rgba(96, 183, 255, 0.82);
}

.device-popup-chart-label {
    fill: rgba(255,255,255,0.58);
    font-size: 10px;
}

@media (max-width: 640px) {
    .map-search-control {
        width: min(200px, calc(100vw - 28px));
    }

    .map-search-input {
        padding: 8px 11px;
        font-size: 0.78rem;
    }

    .leaflet-tooltip.mini-tooltip {
        font-size: 0.62rem;
        padding: 1px 4px;
        max-width: 110px;
    }

    .device-popup-card {
        min-width: 220px;
        max-width: 270px;
        padding: 9px 9px 8px;
    }

    .device-popup-title {
        font-size: 0.9rem;
    }

    .device-popup-row {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 6px;
    }

    .device-popup-chart-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .device-popup-value,
    .device-popup-note,
    .device-popup-list-row,
    .device-popup-mono {
        font-size: 0.72rem;
    }
}

#warning {
    background: #262626;
    position: absolute;
    bottom: 0;
    z-index: 999;
    margin: 12px;
    margin-left: 20px;
    padding: 4px;
}

.warnings {
    color: #ff0;
    font-size: 0.8em;
    margin: 2px;
}

.settings {
    padding: 4px 8px;
    border-bottom: solid 1px #888;
}

.settings-panel {
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding-bottom: 2px;
}

.settings-panel-title {
    color: #f6f9fc;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 10px 2px;
    font-weight: 700;
}

.settings-panel-subtitle {
    color: rgba(205,220,238,0.6);
    font-size: 0.74rem;
    padding: 0 10px 6px;
    line-height: 1.35;
}

.settings-card {
    display: grid;
    gap: 3px;
    padding: 5px 8px;
    border-bottom: solid 1px rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
}

.settings-card:last-child {
    border-bottom: none;
}

.general-stats-shell {
    gap: 10px;
    padding: 10px;
}

.general-stats-toolbar,
.general-stats-chart-head,
.general-stats-footnotes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.general-stats-range-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.general-stats-range {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.04);
    color: rgba(220,235,248,0.72);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.general-stats-range:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.general-stats-range-active {
    background: rgba(82,130,200,0.34);
    border-color: rgba(100,160,230,0.5);
    color: #d8ebff;
}

.general-stats-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.general-stats-card {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(72,96,128,0.18), rgba(18,24,32,0.52));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.general-stats-card-label,
.general-stats-meta,
.general-stats-note {
    font-size: 0.74rem;
    line-height: 1.4;
}

.general-stats-card-label,
.general-stats-meta {
    color: rgba(205,220,238,0.66);
}

.general-stats-card-value {
    margin-top: 4px;
    color: #f6fbff;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.general-stats-note {
    color: rgba(220,235,248,0.76);
}

.general-stats-note-error {
    color: #ffb5b5;
}

.collector-stats-list {
    display: grid;
    gap: 10px;
}

.collector-stats-row {
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(7, 11, 16, 0.34);
}

.collector-stats-head,
.collector-stats-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.collector-stats-head {
    justify-content: space-between;
}

.collector-stats-name-wrap {
    min-width: 0;
}

.collector-stats-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.collector-stats-name,
.collector-stats-total {
    color: #f6fbff;
    font-weight: 700;
}

.collector-stats-name {
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collector-stats-total {
    font-size: 0.92rem;
    flex-shrink: 0;
}

.collector-stats-key,
.collector-stats-breakdown {
    color: rgba(205,220,238,0.62);
    font-size: 0.72rem;
}

.collector-stats-key {
    letter-spacing: 0.04em;
}

.collector-stats-bar {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.collector-stats-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 4px;
}

.general-stats-shell .device-popup-chart-wrap {
    margin-top: 2px;
}

@media (max-width: 900px) {
    .general-stats-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* About & Admin card at the bottom of the Settings tab */
.settings-about-card {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.settings-about-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 4px;
}

.settings-about-version {
    font-size: 0.78rem;
    color: rgba(200,220,240,0.45);
}

.settings-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.settings-card-title {
    color: #f3f7fb;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.settings-help-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    margin-left: 0;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05);
    color: rgba(220,235,248,0.7);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.settings-help-btn:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
    border-color: rgba(255,255,255,0.34);
    transform: none;
}

.settings-collapse-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    color: rgba(220,235,248,0.55);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.settings-collapse-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.28);
    transform: none;
}

.settings-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.collector-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    width: 100%;
    padding-top: 2px;
}

.collector-filter-label {
    font-size: 0.72rem;
    color: rgba(200,220,240,0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.collector-btn {
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.04);
    color: rgba(200,220,240,0.65);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.5;
    white-space: nowrap;
}

.collector-btn:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

.collector-btn.active {
    background: rgba(82,130,200,0.3);
    border-color: rgba(100,160,230,0.5);
    color: #c8e0ff;
}

/* Raw packet sub-type filter row (inside Live Feed Filters) */
.raw-subtype-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding-left: 10px;
    padding-top: 2px;
    margin-bottom: 2px;
    width: 100%;
}

.raw-subtype-btn {
    font-size: 0.68rem !important;
    padding: 1px 5px !important;
    line-height: 1.4 !important;
}

/* Decoded payload summary line inside a raw packet feed entry */
.raw-decoded-line {
    padding-left: 6px;
    padding-bottom: 2px;
}

.raw-decoded-text {
    font-size: 0.78em;
    color: rgba(240, 220, 180, 0.75);
    font-family: monospace;
    letter-spacing: 0.01em;
}

.settings-badge-row[hidden] {
    display: none !important;
}

/* App-wide help dialog (fired by ? buttons in the sidebar filter panels) */
#app-help-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.62);
    z-index: 20000;
    padding: 20px;
}

#app-help-modal[hidden] {
    display: none;
}

.app-help-card {
    width: min(400px, 100%);
    background: #10151e;
    border: 1px solid rgba(145, 175, 205, 0.28);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    padding: 18px 20px;
}

.app-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.app-help-header > span {
    color: #f0f6ff;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-help-header > button {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    margin-left: 0;
    border-radius: 50%;
    font-size: 0.82rem;
    line-height: 1;
}

#app-help-body {
    color: #8da0b5;
    font-size: 0.88rem;
    line-height: 1.65;
    white-space: pre-line;
    margin: 0;
}

.selector-badge {
    --badge-bg: rgba(255,255,255,0.06);
    --badge-border: rgba(255,255,255,0.12);
    --badge-text: rgba(236,243,248,0.78);
    --badge-solid: #4ea4c4;
    border: 1px solid var(--badge-border);
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.selector-badge:hover {
    color: #f8fbff;
    border-color: color-mix(in srgb, var(--badge-border) 65%, #fff 35%);
    transform: translateY(-1px);
}

.selector-badge.active {
    background: color-mix(in srgb, var(--badge-solid) 24%, rgba(255,255,255,0.08));
    border-color: color-mix(in srgb, var(--badge-solid) 55%, rgba(255,255,255,0.16));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 10px 22px rgba(0,0,0,0.16);
}

.selector-badge.is-disabled,
.selector-badge:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.channel-tag {
    font-weight: 700;
}

.highlight {
    background: #ff0;
}

.settings-cb {
    display: inline-block;
    margin-right: 12px;
}

.settings-cb > label > input {
    margin-right: 6px;
}

.settings-cb > label > img {
    margin-right: 6px;
}

.settings-input {
    display: flex;
}

.settings-input > input {
    background-color: #262626;
    border: solid 1px #2a536d;
    border-radius: 4px;
    padding: 4px;
    margin-top: 4px;
    flex: 1;
}

.icon-16 {
    height: 16px;
    vertical-align: middle;
}

@media only screen and (max-width: 900px) {
    #container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    #leftbar {
        flex: auto;
        background: #262626;
        height: 50vh;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }

    #midbar {
        flex: auto;
        height: 50vh;
    }

    .collapse-toggle {
        display: none;
    }

    .collector-filter-row {
        gap: 5px;
    }

    .collector-btn {
        padding: 3px 9px;
        font-size: 0.75rem;
        min-height: 28px;
    }

    .settings-badge-row > .btn,
    .settings-badge-row > button {
        min-height: 26px;
    }
}

.detail-name {
    font-weight: bold;
}

.detail-value {
    text-overflow: ellipsis;
    display: block;
    overflow: hidden;
    margin-bottom: 4px;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: #607e8c;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
}

.marker-pin::after {
    content: '';
    width: 24px;
    height: 24px;
    margin: 3px 0 0 3px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
}

.marker-pin.missing {
    background: #bb6363;
}

.marker-pin.ghosted {
    background: #dfae54;
}

.marker-pin.custom {
    filter: invert(42%) sepia(93%) saturate(1352%) hue-rotate(87deg) brightness(119%) contrast(119%);
}

.custom-div-icon img {
   position: absolute;
   width: 20px;
   height: 20px;
   left: 0;
   right: 0;
   margin: 10px auto;
   text-align: center;
   z-index: 2;
   fill: #607e8c;
    pointer-events: none;
}

.custom-div-icon span {
    position: absolute;
    color: #607e8c;
    font-size: 16px;
    left: 0;
    right: 0;
    margin: 10px auto;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

.marker-warning-badge {
    top: -2px;
    right: -2px;
    left: auto;
    margin: 0;
    width: 15px;
    height: 15px;
    font-size: 11px;
    z-index: 3;
}

.tooltip-title {
    color: #111;
    font-weight: bold;
}

.tooltip-detail {
    color: #444;
    font-size: 0.8em;
}

.tooltip-hash {
    color: #444;
    font-weight: normal;
    font-family: monospace;
    font-size: 0.8em;
    letter-spacing: 0;
    background: none;
    border-radius: 0;
    padding: 0;
    vertical-align: baseline;
    display: inline;
    line-height: inherit;
    margin: 0;
    white-space: nowrap;
}

#login {
    display: flex;
    justify-content: center;
}

#login > section {
    min-width: 400px;
    width: 600px;
    margin-top: 32px;
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    flex-direction: column;
    align-items: center;
}

.form-group {
    align-items: center;
    margin: 8px 0;
}

.form-group label {
    margin-right: 8px;
    display: block
}

.form-group input {
    width: 100%;
    display: block;
    margin-right: 8px;
}


.form-title {
    text-align: center;
    margin: 10px;
}

.right {
    justify-content: right;
}

.error {
    color: #ca0025;
}

.code {
    background-color: #f3f3f3;
    border: solid 1px #e6e6e6;
    border-radius: 2px;
    padding: 2px;
    font-family: monospace;
    margin: 2px 0;
}

.menu {
    position: absolute;
    background: #262626;
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 150px;
    display: none;
    z-index: 9999;
    font-family: monospace;
}

.menu-item {
    padding: 6px;
    cursor: pointer;
}

.menu-item:hover {
    background: #8b7097;
    color: #fff;
    border-radius: 4px;
}

.warn-icon {
    margin: 0 4px;
}

.time-sync-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border-radius: 999px;
    background: #d8b420;
    border: 1px solid #f5df73;
    color: #1d1a07;
    font-weight: bold;
    line-height: 1;
    cursor: help;
}

.time-sync-badge[hidden] {
    display: none;
}

.warn-tooltip {
    position: absolute;
    background: black;
    color: yellow;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
    z-index: 9999;
    max-width: 260px;
}

.tooltip-warning {
    color: #8d5e00;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
}

.tooltip-warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #d8b420;
    color: #1d1a07;
    font-weight: bold;
}
