/* Mobile experience */
@media (max-width: 768px) {
    :root {
        --mobile-spacing: 12px;
        --mobile-header-height: 56px;
        --mobile-control-height: 46px;
        --mobile-radius: 10px;
        --mobile-radius-lg: 14px;
        --mobile-card-bg: var(--white);
        --mobile-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
        --mobile-bottom-gap: 16px;
        --tree-indent-width: 18px;
        --pon-agg-card-padding: 10px 12px;
        --pon-agg-card-width: min(320px, calc(100% - var(--tree-indent-width)));
        --pon-agg-label-font-size: 0.75rem;
        --pon-agg-label-font-weight: 500;
        --chip-list-columns: repeat(3, minmax(0, 1fr));
        --chip-list-gap: 6px 8px;
        --chip-font-size: 0.68rem;
        --chip-min-height: 22px;
        --chip-padding: 5px 10px;
        --tree-node-margin-bottom: 6px;
        --tree-node-content-padding: 6px 8px;
        --tree-node-content-min-height: 30px;
        --tree-node-toggle-size: 18px;
        --tree-node-toggle-margin-right: 6px;
        --tree-node-name-font-size: 0.8rem;
        --tree-node-details-font-size: 0.7rem;
        --cto-card-header-padding: 12px 14px;
        --cto-card-header-min-height: 52px;
        --client-count-font-size: 0.7rem;
        --cto-mode-toggle-padding: 4px;
        --cto-mode-toggle-min-height: 52px;
        --cto-mode-toggle-gap: 6px;
        --cto-mode-toggle-margin: 0 14px 10px;
        --cto-mode-toggle-radius: 10px;
        --cto-mode-toggle-wrap: nowrap;
        --cto-mode-toggle-height: var(--cto-mode-toggle-min-height);
        --cto-mode-tab-padding: 10px 12px;
        --cto-mode-tab-font-size: 0.82rem;
        --header-height: var(--mobile-header-height);
        --footer-height: 0px;
    }

    html[data-theme="dark"] {
        --mobile-card-bg: var(--gray-100);
        --mobile-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
    }

    .dashboard-container {
        height: calc(100dvh - var(--header-height));
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .main-content {
        min-height: 0;
        height: calc(100dvh - var(--header-height));
        overflow: hidden;
    }

    .header-nav,
    .header-menu-btn,
    .user-details,
    .panel-resizer,
    .sidebar-collapse-btn {
        display: none !important;
    }

    .header {
        height: var(--mobile-header-height);
    }

    .header-content {
        padding: 0 var(--mobile-spacing);
    }

    .logo-svg {
        width: 34px;
        height: 34px;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .user-menu-btn {
        width: 40px;
        height: 40px;
    }

    .user-dropdown {
        position: fixed;
        top: calc(var(--mobile-header-height) + 8px);
        right: var(--mobile-spacing);
        z-index: 600;
    }

    .main-panel {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .topology-header {
        padding: 10px var(--mobile-spacing) 8px;
        gap: 8px;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
    }

    .topology-actions {
        gap: 6px;
        margin-left: 0;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }

    .siren-sensitivity-group {
        height: var(--mobile-control-height);
        padding: 0 4px;
        border-radius: var(--mobile-radius-lg);
        gap: 6px;
    }

    .sensitivity-bar {
        padding: 4px;
        border-radius: 10px;
    }

    #toggle-expand-btn,
    #refresh-btn,
    #siren-btn {
        width: var(--mobile-control-height);
        height: var(--mobile-control-height);
    }

    .topology-content {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0 var(--mobile-spacing);
    }

    .topology-tree {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 12px;
        padding-bottom: calc(var(--mobile-control-height) + var(--mobile-bottom-gap) * 2);
        background: var(--mobile-card-bg);
        border: 1px solid var(--gray-200);
        border-radius: var(--mobile-radius-lg);
        box-shadow: var(--shadow-sm);
    }

    html[data-theme="dark"] .topology-tree {
        border-color: var(--gray-300);
    }

    .filter-dropdown-container {
        position: fixed;
        left: var(--mobile-spacing);
        bottom: var(--mobile-bottom-gap);
        width: var(--mobile-control-height);
        height: var(--mobile-control-height);
        z-index: 300;
    }

    .filter-dropdown-btn {
        width: 100%;
        height: 100%;
        background: var(--mobile-card-bg);
        border: 1px solid var(--gray-200);
        box-shadow: var(--mobile-shadow);
        border-radius: var(--mobile-radius-lg);
        color: var(--primary-color);
    }

    html[data-theme="dark"] .filter-dropdown-btn {
        border-color: var(--gray-300);
    }

    .header-search-container {
        position: fixed;
        left: calc(var(--mobile-spacing) + var(--mobile-control-height) + 10px);
        right: var(--mobile-spacing);
        bottom: var(--mobile-bottom-gap);
        height: var(--mobile-control-height);
        z-index: 290;
    }

    .header-search-wrapper {
        height: 100%;
        background: var(--mobile-card-bg);
        border: 1px solid var(--gray-200);
        box-shadow: var(--mobile-shadow);
        border-radius: var(--mobile-radius-lg);
        padding: 0 12px;
    }

    .header-search-wrapper:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    }

    html[data-theme="dark"] .header-search-wrapper {
        border-color: rgba(255, 255, 255, 0.12);
        box-shadow: none;
        background: var(--mobile-card-bg);
    }

    html[data-theme="dark"] .header-search-wrapper:focus-within {
        border-color: rgba(10, 132, 255, 0.6);
        box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.35);
    }

    .header-search-input {
        height: 100%;
        font-size: 16px;
        border: none;
        background: transparent;
        box-shadow: none;
        outline: none;
    }

    .header-search-input:focus {
        border: none;
        box-shadow: none;
    }

    html[data-theme="dark"] .header-search-wrapper .header-search-input {
        border: none;
        background: transparent;
        box-shadow: none;
        color: var(--gray-900);
    }

    html[data-theme="dark"] .header-search-wrapper .header-search-input:focus {
        border: none;
        background: transparent;
        box-shadow: none;
    }

    html[data-theme="dark"] .header-search-wrapper .header-search-clear {
        background: transparent;
        color: var(--gray-600);
    }

    html[data-theme="dark"] .header-search-wrapper .header-search-clear:hover {
        background: transparent;
        color: var(--gray-500);
    }

    .header-search-suggestions {
        bottom: calc(var(--mobile-control-height) + var(--mobile-bottom-gap) + 8px);
        top: auto;
        border-radius: 16px;
        max-height: 40vh;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
        z-index: 305;
    }

    .filter-dropdown-panel {
        position: fixed;
        left: var(--mobile-spacing);
        right: var(--mobile-spacing);
        bottom: calc(var(--mobile-control-height) + var(--mobile-bottom-gap) + 8px);
        min-width: 0;
        max-width: none;
        max-height: 60vh;
        border-radius: 18px;
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.2);
        z-index: 320;
        opacity: 0;
        visibility: hidden;
        transform: translateY(12px);
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
        pointer-events: none;
    }

    .filter-dropdown-panel.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .filter-dropdown-content {
        max-height: 60vh;
        overflow-y: auto;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        z-index: 400;
    }

    .mobile-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .sidebar {
        top: var(--mobile-header-height);
        height: calc(100dvh - var(--mobile-header-height));
        width: min(85vw, 320px);
        max-width: 320px;
        z-index: 450;
        background: var(--sidebar-bg);
        border-right: 1px solid var(--gray-200);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar-header {
        padding: var(--mobile-spacing);
        border-bottom: 1px solid var(--gray-200);
    }

    .sidebar-close-btn {
        display: inline-flex;
        width: 36px;
        height: 36px;
    }

    .sidebar-content {
        padding: var(--mobile-spacing);
    }

    /* ===========================================
       TOPOLOGY TREE - Mobile Styles (Rewritten)
       =========================================== */

    /* Tree Node Base */
    .tree-node {
        margin-bottom: var(--tree-node-margin-bottom);
    }

    .tree-node::before {
        display: block;
    }

    .tree-node-content {
        border-radius: 8px;
        box-shadow: var(--shadow-xs);
    }

    .tree-node-content::after {
        display: none;
    }

    .tree-node-name {
        line-height: 1.2;
    }

    .tree-node-details {
        line-height: 1.2;
    }

    /* Tree Indentation */
    .tree-node-children {
        margin-left: var(--tree-indent-width);
        padding-left: 0;
    }

    .tree-node-olt > .tree-node-children,
    .tree-node-slot > .tree-node-children,
    .tree-node-pon > .tree-node-children,
    .tree-node-box > .tree-node-children {
        margin-left: calc(var(--tree-indent-width) * 1.1);
    }

    /* Tree Node Status Colors - Light Mode */
    .tree-node-olt > .tree-node-content,
    .tree-node-slot > .tree-node-content,
    .tree-node-pon > .tree-node-content,
    .tree-node-box > .tree-node-content {
        background: var(--white);
        background-image: none;
    }

    .tree-node-slot > .tree-node-content.status-online,
    .tree-node-pon > .tree-node-content.status-online {
        background: rgba(22, 163, 74, 0.1);
    }

    .tree-node-slot > .tree-node-content.status-warning,
    .tree-node-pon > .tree-node-content.status-warning {
        background: rgba(250, 204, 21, 0.14);
    }

    .tree-node-slot > .tree-node-content.status-offline,
    .tree-node-pon > .tree-node-content.status-offline {
        background: rgba(239, 68, 68, 0.12);
    }

    .tree-node-slot > .tree-node-content.status-neutral,
    .tree-node-pon > .tree-node-content.status-neutral {
        background: rgba(148, 163, 184, 0.12);
    }

    /* Tree Node Status Colors - Dark Mode (must match topology.css but with mobile specificity) */
    html[data-theme="dark"] .tree-node-slot > .tree-node-content.status-online,
    html[data-theme="dark"] .tree-node-pon > .tree-node-content.status-online {
        background: linear-gradient(135deg, rgba(48, 209, 88, 0.55) 0%, rgba(48, 209, 88, 0.2) 100%);
        border-left-color: rgba(48, 209, 88, 0.95);
        box-shadow: 0 0 0 1px rgba(48, 209, 88, 0.3), 0 16px 32px rgba(48, 209, 88, 0.25);
    }

    html[data-theme="dark"] .tree-node-slot > .tree-node-content.status-warning,
    html[data-theme="dark"] .tree-node-pon > .tree-node-content.status-warning {
        background: linear-gradient(135deg, rgba(255, 214, 10, 0.58) 0%, rgba(255, 214, 10, 0.2) 100%);
        border-left-color: rgba(255, 214, 10, 0.95);
        box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.3), 0 16px 32px rgba(255, 214, 10, 0.28);
    }

    html[data-theme="dark"] .tree-node-slot > .tree-node-content.status-offline,
    html[data-theme="dark"] .tree-node-pon > .tree-node-content.status-offline {
        background: linear-gradient(135deg, rgba(255, 69, 58, 0.55) 0%, rgba(255, 69, 58, 0.18) 100%);
        border-left-color: rgba(255, 69, 58, 0.95);
        box-shadow: 0 0 0 1px rgba(255, 69, 58, 0.3), 0 16px 32px rgba(255, 69, 58, 0.28);
    }

    html[data-theme="dark"] .tree-node-slot > .tree-node-content.status-neutral,
    html[data-theme="dark"] .tree-node-pon > .tree-node-content.status-neutral {
        background: linear-gradient(135deg, rgba(142, 142, 147, 0.45) 0%, rgba(142, 142, 147, 0.18) 100%);
        border-left-color: rgba(142, 142, 147, 0.85);
        box-shadow: 0 0 0 1px rgba(142, 142, 147, 0.28), 0 16px 32px rgba(142, 142, 147, 0.25);
    }

    /* ===========================================
       CTO AGGREGATED CARD - Mobile Styles
       =========================================== */

    .pon-agg-card {
        box-sizing: border-box;
        background: rgba(148, 163, 184, 0.08);
        border: 1px solid rgba(148, 163, 184, 0.2);
    }

    /* pon-agg-card dark mode: inherit from theme.css */

    .pon-agg-label {
        text-align: center;
        margin-bottom: 8px;
        color: var(--gray-600);
    }

    /* pon-agg-label dark mode: inherit from theme.css */

    .pon-agg-footer {
        text-align: center;
        margin-top: 8px;
        color: var(--gray-500);
    }

    /* pon-agg-footer dark mode: inherit from theme.css */

    /* Chip List in CTO Card */
    .pon-agg-card .chip {
        width: 100%;
        min-width: 0;
        max-width: none;
        text-align: center;
        box-sizing: border-box;
    }

    /* Chip Colors - Dark Mode: inherit from theme.css */

    .details-panel {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 500;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        background: var(--white);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .details-panel,
    .details-panel:not(.hidden) {
        flex-basis: auto;
        min-width: 0;
        max-width: 100vw;
    }

    html[data-theme="dark"] .details-panel {
        background: var(--gray-50);
    }

    .details-panel:not(.hidden) {
        transform: translateX(0);
    }

    .details-panel.hidden {
        visibility: hidden;
    }

    .details-content {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .cto-table-container {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .details-header {
        padding: var(--mobile-spacing);
        border-bottom: 1px solid var(--gray-200);
        gap: 10px;
    }

    .details-breadcrumb {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .breadcrumb-item {
        min-width: 0;
    }

    .breadcrumb-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .details-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .cto-cards-container {
        padding: var(--mobile-spacing);
        padding-bottom: calc(var(--mobile-control-height) + var(--mobile-bottom-gap) * 2);
    }

    .cto-card {
        background: var(--white);
        border-radius: 12px;
        border: 1px solid var(--gray-200);
        overflow: hidden;
        margin-bottom: var(--mobile-spacing);
    }

    html[data-theme="dark"] .cto-card {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .cto-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .cto-mode-toggle-inside .power-tab-actions {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        visibility: hidden;
        pointer-events: none;
        width: var(--power-actions-size);
        height: var(--power-actions-size);
    }

    .cto-mode-toggle-inside .power-tab-actions.is-visible {
        visibility: visible;
        pointer-events: auto;
    }

    .cto-mode-toggle-inside .power-tab-actions .modern-refresh-btn {
        width: var(--power-actions-size);
        height: var(--power-actions-size);
        padding: 0;
        margin-left: 0;
        background: var(--white);
        border: 1px solid var(--gray-300);
        border-radius: 8px;
    }

    .cto-mode-toggle-inside .power-tab-actions .modern-refresh-btn.is-disabled,
    .cto-mode-toggle-inside .power-tab-actions .modern-refresh-btn:disabled {
        background: rgba(220, 38, 38, 0.08);
        border-color: rgba(220, 38, 38, 0.55);
        color: var(--error-color);
        opacity: 1;
    }

    html[data-theme="dark"] .cto-mode-toggle-inside .power-tab-actions .modern-refresh-btn {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }

    html[data-theme="dark"] .cto-mode-toggle-inside .power-tab-actions .modern-refresh-btn.is-disabled,
    html[data-theme="dark"] .cto-mode-toggle-inside .power-tab-actions .modern-refresh-btn:disabled {
        background: rgba(255, 69, 58, 0.16);
        border-color: rgba(255, 69, 58, 0.5);
        color: #ffb4ad;
    }

    .cto-card-content {
        padding: 0;
    }

    .cto-card-content.expanded {
        padding: 0 14px 14px;
    }

    .cto-card-content .client-table-container {
        padding: 0;
        overflow-x: hidden;
        background: transparent;
    }

    .client-table thead {
        display: none;
    }

    .client-table {
        width: 100%;
        min-width: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        border-collapse: separate;
        border-spacing: 0;
    }

    .client-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .client-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        background: var(--gray-50);
        border-radius: 12px;
        border: 1px solid var(--gray-200);
        overflow: hidden;
        position: relative;
        min-height: 108px;
    }

    .client-table tbody tr.client-row-highlight {
        border-color: transparent !important;
        box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
        background-color: rgba(59, 130, 246, 0.04) !important;
    }

    .client-table tbody tr.client-row-highlight::after {
        content: "";
        position: absolute;
        inset: 0;
        border: 2px solid rgba(29, 78, 216, 0.9);
        border-radius: 12px;
        pointer-events: none;
        z-index: 10;
    }

    .client-table tbody tr.client-row-highlight td {
        border: none !important;
        border-radius: 0 !important;
    }

    html[data-theme="light"] .client-table tbody tr {
        background: #f8fafc;
        border-color: rgba(148, 163, 184, 0.22);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    html[data-theme="dark"] .client-table tbody tr {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    html[data-theme="dark"] .client-table tbody tr.client-row-highlight {
        border-color: transparent !important;
        box-shadow: 0 4px 12px rgba(191, 219, 254, 0.1);
        background-color: rgba(59, 130, 246, 0.15) !important;
    }

    html[data-theme="dark"] .client-table tbody tr.client-row-highlight::after {
        border-color: rgba(191, 219, 254, 0.9);
    }

    .client-table td {
        padding: 0;
        border: none;
        background: transparent;
    }

    .client-table tbody tr:nth-child(odd) td,
    .client-table tbody tr:nth-child(even) td {
        background: transparent;
    }

    .client-table td.identity-col {
        display: flex;
        grid-column: 1;
        grid-row: 1 / 4;
        flex-direction: column;
        justify-content: center;
        padding: 12px;
        gap: 4px;
        border-right: 1px solid rgba(148, 163, 184, 0.12);
    }

    .client-table td.identity-col,
    .client-table td.status-col,
    .client-table td.reason-col,
    .client-table td.disconnect-col,
    .client-table td.power-col,
    .client-table td.timestamp-col {
        min-width: 0;
        width: auto;
    }

    html[data-theme="dark"] .client-table td.identity-col {
        border-right-color: rgba(255, 255, 255, 0.12);
    }

    .client-table td.status-col {
        display: flex;
        grid-column: 2;
        grid-row: 1;
        align-items: center;
        justify-content: center;
        padding: 12px 12px 4px;
        text-align: center;
    }

    .client-table td.reason-col {
        display: flex;
        grid-column: 2;
        grid-row: 2;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px 12px;
        gap: 4px;
        text-align: center;
    }

    .client-table td.disconnect-col {
        display: flex;
        grid-column: 2;
        grid-row: 3;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px 12px 12px;
        font-size: 0.7rem;
        color: var(--gray-400);
        text-align: center;
    }

    .client-table td.reason-col > * {
        margin-left: 0;
        margin-right: 0;
    }

    .status-pill,
    .reason-pill {
        width: min(120px, 100%);
        max-width: 100%;
        min-height: 24px;
        justify-content: center;
        text-align: center;
        font-size: 0.72rem;
        align-self: center;
        box-sizing: border-box;
    }

    .client-table[data-view-mode="power"] tbody tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: 1fr;
        align-items: stretch;
    }

    .client-table[data-view-mode="power"] td.identity-col {
        grid-row: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .client-table[data-view-mode="power"] td.status-col,
    .client-table[data-view-mode="power"] td.reason-col,
    .client-table[data-view-mode="power"] td.disconnect-col {
        display: none;
    }

    .client-table[data-view-mode="power"] td.power-col {
        display: flex;
        grid-column: 2;
        grid-row: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 8px;
        gap: 4px;
        text-align: center;
    }

    .client-table[data-view-mode="power"] td.timestamp-col {
        display: none;
    }

    .client-table[data-view-mode="power"] .power-content-wrapper {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .client-table[data-view-mode="power"] .power-values {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .client-table[data-view-mode="power"] .power-values--empty {
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    .client-table[data-view-mode="power"] .power-values--empty .power-reading--empty {
        text-align: center;
    }

    .client-table[data-view-mode="power"] .power-mobile-timestamp {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 0.68rem;
        color: var(--gray-400);
        margin-top: 2px;
    }

    .client-table[data-view-mode="power"] .power-timestamp-wrapper {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .client-table[data-view-mode="power"] .power-row-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .client-table[data-view-mode="power"] .power-line {
        display: flex;
        flex-wrap: nowrap;
        white-space: nowrap;
        row-gap: 0;
        justify-content: center;
        align-items: center;
        font-size: 0.78rem;
    }

    .client-table[data-view-mode="power"] .power-label {
        flex: 0 0 28px;
        font-size: 0.72rem;
    }

    .client-table[data-view-mode="power"] .power-reading {
        font-size: 0.78rem;
    }

    .client-table[data-view-mode="power"] .diff-inline {
        margin-left: 2px;
        font-size: 0.62rem;
        white-space: nowrap;
    }

    .client-table[data-view-mode="power"] .power-reading--empty {
        display: inline-block;
        min-width: 32px;
        text-align: left;
        color: var(--gray-500);
    }

    .client-table .timestamp-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 0.68rem;
        font-weight: 400;
        color: var(--gray-400);
    }

    .client-table .ts-date,
    .client-table .ts-time {
        color: inherit;
        font-weight: 400;
        font-size: inherit;
    }

    .identity-token.identity-login {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .client-table td.identity-col .identity-token {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .identity-token.identity-serial,
    .identity-token.identity-ip {
        font-size: 0.7rem;
    }

    .status-pill {
        padding: 4px 12px;
        border-radius: 16px;
    }

    .reason-pill {
        padding: 4px 12px;
    }

    .mobile-power-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 14px;
        border-bottom: 1px solid var(--gray-200);
    }

    html[data-theme="dark"] .mobile-power-actions {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .mobile-power-actions .modern-refresh-btn {
        width: var(--power-actions-size);
        height: var(--power-actions-size);
        padding: 0;
        gap: 0;
        margin-left: auto;
        background: var(--white);
        border: 1px solid var(--gray-300);
        border-radius: 8px;
        order: 2;
    }

    .mobile-power-actions .modern-refresh-btn.is-disabled,
    .mobile-power-actions .modern-refresh-btn:disabled {
        background: rgba(220, 38, 38, 0.08);
        border-color: rgba(220, 38, 38, 0.55);
        color: var(--error-color);
        opacity: 1;
    }

    html[data-theme="dark"] .mobile-power-actions .modern-refresh-btn {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }

    html[data-theme="dark"] .mobile-power-actions .modern-refresh-btn.is-disabled,
    html[data-theme="dark"] .mobile-power-actions .modern-refresh-btn:disabled {
        background: rgba(255, 69, 58, 0.16);
        border-color: rgba(255, 69, 58, 0.5);
        color: #ffb4ad;
    }

    .mobile-timestamp {
        font-size: 0.7rem;
        color: var(--gray-400);
        order: 1;
    }

    .footer {
        display: none !important;
    }
}

@media (max-width: 480px) {
    :root {
        --mobile-spacing: 10px;
        --tree-node-name-font-size: 0.78rem;
        --tree-node-details-font-size: 0.68rem;
        --chip-font-size: 0.6rem;
    }

    .sidebar {
        width: 100vw;
        max-width: 100vw;
    }

}

@media (max-width: 768px) and (orientation: landscape) {
    .details-panel {
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 70vw;
    }

    .sidebar {
        width: 50vw;
        max-width: 320px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .cto-card-header {
        min-height: 56px;
    }

    .cto-card:active {
        transform: scale(0.99);
        transition: transform 0.1s;
    }

    .tree-node-content:active {
        opacity: 0.85;
        transition: opacity 0.1s;
    }

    .topology-tree,
    .cto-table-container,
    .cto-cards-container,
    .sidebar-content {
        overscroll-behavior: contain;
    }
}
