﻿:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-rgb: 99, 102, 241;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --secondary: #64748b;
    /* Slate 500 */
    --bg-dark: #0f172a;
    /* Slate 900 */
    --bg-light: #f8fafc;
    /* Slate 50 */
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --success: #10b981;
    --success-rgb: 16, 185, 129;
    /* Emerald 500 */
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    /* Red 500 */
    --warning: #f59e0b;
    --warning-rgb: 245, 158, 11;
    /* Amber 500 */
    --info: #0ea5e9;
    --info-rgb: 14, 165, 233;
    /* Sky 500 */

    /* Shadows & Transitions */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Final cascade for compact provider cards (kept at EOF so legacy provider
   themes cannot expand the controls again). */
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) {
    --proxy-ui-gap: 7px;
}
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header {
    min-height: 46px !important;
    margin-bottom: 7px !important;
    padding: 6px 9px !important;
}
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header h2 {
    font-size: 16px !important;
}
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header :is(p, .section-subtitle) {
    font-size: 9px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-page-grid {
    gap: var(--proxy-ui-gap) !important;
    margin-bottom: 7px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.shoplike-card, .shoplike-list-card),
#suiproxy-section :is(.suiproxy-account-card, .suiproxy-list-card) {
    border-radius: 10px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-key-card,
#suiproxy-section .suiproxy-account-card {
    padding: 9px 10px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-form-grid {
    gap: 5px 7px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(input, select, .form-control) {
    min-height: 29px !important;
    height: 29px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-form-actions,
#suiproxy-section .suiproxy-account-actions {
    margin-top: 7px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.shoplike-list-head, .kiotproxy-list-head, .nestproxy-list-head),
#suiproxy-section .suiproxy-list-head {
    min-height: 42px !important;
    padding: 6px 8px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.shoplike-list-actions, .shoplike-bulk-actions, .nestproxy-bulk-actions),
#suiproxy-section .suiproxy-list-tools {
    gap: 4px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.bulk-webrtc-control, .nestproxy-bulk-dns),
#suiproxy-section :is(.bulk-webrtc-control, .suiproxy-bulk-dns) {
    min-height: 28px !important;
    padding: 2px 4px 2px 6px !important;
    border-radius: 7px !important;
}
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.bulk-webrtc-control, .nestproxy-bulk-dns) :is(select, button),
#suiproxy-section :is(.bulk-webrtc-control, .suiproxy-bulk-dns) :is(select, button) {
    min-height: 23px !important;
    height: 23px !important;
    font-size: 9px !important;
}
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip, .kiotproxy-summary-strip) {
    gap: 5px !important;
    padding: 5px 7px !important;
}
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip, .kiotproxy-summary-strip) > div {
    min-height: 44px !important;
    padding: 5px 7px !important;
    border-radius: 8px !important;
}
#kiotproxy-section .kiotproxy-commandbar {
    gap: 5px !important;
    padding: 6px 8px !important;
}
#kiotproxy-section .kiotproxy-commandbar .btn,
#kiotproxy-section .nestproxy-auto-select {
    min-height: 28px !important;
    height: 28px !important;
}
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section) :is(.shoplike-key-card-v2, .nestproxy-key-card, .kiotproxy-key-card, .suiproxy-proxy-card) {
    margin: 0 5px 5px !important;
}
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section) :is(.shoplike-key-card-v2 > section, .nestproxy-key-card > section, .kiotproxy-key-card > section, .suiproxy-proxy-card > section) {
    padding: 7px 8px !important;
}
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section) :is(.shoplike-action-btn, .nestproxy-action-btn, .suiproxy-action-btn) {
    min-height: 27px !important;
    height: 27px !important;
    padding: 0 7px !important;
    font-size: 9px !important;
}
@media (max-width: 720px) {
    :is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-page-grid { grid-template-columns: 1fr !important; }
    :is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-note-card { display: none !important; }
}

/* ===== BULK WEBRTC CONTROL 2026-08-28 ===== */
.bulk-webrtc-control {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 5px;
    padding: 2px 3px 2px 8px;
    border: 1px solid rgba(16, 185, 129, .28);
    border-radius: 9px;
    background: rgba(236, 253, 245, .96);
    color: #0f172a;
    white-space: nowrap;
}

.bulk-webrtc-control > i {
    color: #059669;
    font-size: 11px;
}

.bulk-webrtc-control select {
    min-width: 116px;
    min-height: 24px;
    padding: 0 16px 0 3px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
}

.bulk-webrtc-control > span {
    max-width: 96px;
    overflow: hidden;
    color: #64748b;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bulk-webrtc-control button {
    min-height: 24px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: #059669;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.bulk-webrtc-control button:hover:not(:disabled) {
    background: #047857;
}

.bulk-webrtc-control :is(button, select):disabled {
    opacity: .55;
    cursor: wait;
}

.provider-webrtc-control {
    display: inline-flex;
    min-width: 0;
    min-height: 27px;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border: 1px solid rgba(245, 158, 11, .22);
    border-radius: 9px;
    background: rgba(245, 158, 11, .07);
    color: #b45309;
    white-space: nowrap;
}

.provider-webrtc-control.is-proxy {
    border-color: rgba(16, 185, 129, .24);
    background: rgba(16, 185, 129, .08);
    color: #047857;
}

.provider-webrtc-control > i { flex: 0 0 auto; font-size: 10px; }

.provider-webrtc-control select {
    width: auto;
    min-width: 0;
    max-width: 120px;
    min-height: 21px;
    padding: 0 15px 0 2px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.provider-webrtc-control select:disabled { cursor: wait; opacity: .6; }
.provider-webrtc-control option { background: #fff; color: #0f172a; }
body.dark-mode .provider-webrtc-control option { background: #111827; color: #f8fafc; }

#proxies .regular-bulk-webrtc {
    min-height: 30px;
    height: 30px;
    padding-top: 1px;
    padding-bottom: 1px;
    border-radius: 8px;
}

#proxies .regular-bulk-webrtc select,
#proxies .regular-bulk-webrtc button {
    min-height: 24px;
}

body.dark-mode .bulk-webrtc-control {
    border-color: rgba(52, 211, 153, .28);
    background: rgba(6, 78, 59, .42);
    color: #e2e8f0;
}

body.dark-mode .bulk-webrtc-control select {
    color: #e2e8f0;
}

body.dark-mode .bulk-webrtc-control > span {
    color: #a7f3d0;
}

@media (max-width: 768px) {
    #proxies .regular-bulk-webrtc,
    #shoplike-section .bulk-webrtc-control,
    #nestproxy-section .bulk-webrtc-control,
    #suiproxy-section .bulk-webrtc-control,
    #kiotproxy-section .bulk-webrtc-control {
        width: 100%;
        height: auto;
        min-height: 34px;
    }

    .bulk-webrtc-control select {
        min-width: 0;
        flex: 1;
    }
}

/* ========================================================================== */
/* Unified compact proxy workspace — regular + every provider catalog         */
/* ========================================================================== */
:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) {
    --proxy-compact-gap: 8px;
    --proxy-compact-radius: 11px;
    --proxy-compact-control: 30px;
    --proxy-compact-border: #e2e8f0;
    --proxy-compact-bg: #ffffff;
    --proxy-compact-soft: #f8fafc;
    --proxy-compact-text: #0f172a;
    --proxy-compact-muted: #64748b;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section).content-section {
    gap: var(--proxy-compact-gap) !important;
    padding-bottom: 12px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header {
    min-height: 48px !important;
    margin-bottom: 8px !important;
    padding: 7px 10px !important;
    gap: 10px !important;
    border: 1px solid var(--proxy-compact-border) !important;
    border-radius: var(--proxy-compact-radius) !important;
    background: var(--proxy-compact-bg) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .035) !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.proxy-page-heading, .shoplike-heading-v2, .suiproxy-heading, .nestproxy-heading) {
    min-width: 0;
    gap: 8px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.proxy-page-icon, .shoplike-heading-icon-v2, .suiproxy-heading-icon, .nestproxy-heading-icon) {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header h2 {
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    .section-header :is(.section-subtitle, p) {
    max-width: 620px !important;
    margin-top: 2px !important;
    overflow: hidden;
    color: var(--proxy-compact-muted) !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
    gap: var(--proxy-compact-gap) !important;
    margin-bottom: 8px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.shoplike-card, .nestproxy-mcp-card),
#suiproxy-section :is(.suiproxy-account-card, .suiproxy-list-card) {
    border-radius: var(--proxy-compact-radius) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .035) !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-key-card,
#suiproxy-section .suiproxy-account-card {
    padding: 10px 12px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-title {
    margin-bottom: 8px !important;
    gap: 8px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-title h3,
#suiproxy-section .suiproxy-card-heading h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-title p,
#suiproxy-section .suiproxy-card-heading p {
    margin-top: 1px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-icon,
#suiproxy-section .suiproxy-card-heading-icon {
    width: 29px !important;
    height: 29px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-form-grid {
    gap: 6px 8px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .form-group,
#suiproxy-section .form-group {
    margin-bottom: 0 !important;
    gap: 3px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .form-group label,
#suiproxy-section .form-group label {
    font-size: 9px !important;
    line-height: 1.1 !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(input, select, .form-control),
#suiproxy-section :is(input, select, .form-control) {
    min-height: var(--proxy-compact-control) !important;
    height: var(--proxy-compact-control) !important;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-form-actions,
#suiproxy-section .suiproxy-account-actions {
    gap: 6px !important;
    margin-top: 8px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.btn, button) {
    min-height: var(--proxy-compact-control);
    border-radius: 8px;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-note-card {
    min-height: 0 !important;
    padding: 10px !important;
    gap: 8px !important;
    font-size: 9px !important;
    line-height: 1.35 !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-note-icon {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.shoplike-list-head, .kiotproxy-list-head, .nestproxy-list-head),
#suiproxy-section .suiproxy-list-head {
    min-height: 44px !important;
    padding: 7px 10px !important;
    gap: 7px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.shoplike-list-head h3, .nestproxy-list-head h3),
#suiproxy-section .suiproxy-list-title h3 {
    font-size: 13px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.shoplike-list-actions, .shoplike-bulk-actions, .nestproxy-bulk-actions),
#suiproxy-section .suiproxy-list-tools {
    gap: 5px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #nestproxy-section)
    :is(.bulk-webrtc-control, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .shoplike-bulk-dns) {
    min-height: 30px !important;
    padding: 3px 4px 3px 7px !important;
    gap: 4px !important;
    border-radius: 8px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #nestproxy-section)
    :is(.bulk-webrtc-control, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .shoplike-bulk-dns) :is(select, button) {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 7px !important;
    border-radius: 6px !important;
    font-size: 9px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip),
#kiotproxy-section .kiotproxy-summary-strip {
    gap: 6px !important;
    margin: 0 !important;
    padding: 6px 8px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) > div,
#kiotproxy-section .kiotproxy-summary-strip > div {
    min-height: 48px !important;
    padding: 6px 9px !important;
    border-radius: 9px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) strong,
#kiotproxy-section .kiotproxy-summary-strip strong {
    font-size: 16px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) small,
#kiotproxy-section .kiotproxy-summary-strip small {
    font-size: 9px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-device-overview, .nestproxy-device-overview) {
    margin: 6px 8px !important;
    border-radius: 8px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-device-overview-head, .nestproxy-device-overview-head) {
    min-height: 31px !important;
    padding: 5px 9px !important;
    font-size: 10px !important;
}

#kiotproxy-section .kiotproxy-commandbar {
    gap: 6px !important;
    padding: 7px 9px !important;
}

#kiotproxy-section .kiotproxy-commandbar .btn,
#kiotproxy-section .nestproxy-auto-select {
    min-height: 30px !important;
    height: 30px !important;
}

/* Dense provider records: preserve all controls while removing excess air. */
#shoplike-section .shoplike-key-card-v2,
#nestproxy-section .nestproxy-key-card,
#kiotproxy-section .kiotproxy-key-card,
#suiproxy-section .suiproxy-proxy-card {
    min-height: 0 !important;
    margin: 0 7px 6px !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .035) !important;
}

#shoplike-section .shoplike-key-card-v2 > section,
#nestproxy-section .nestproxy-key-card > section,
#kiotproxy-section .kiotproxy-key-card > section,
#suiproxy-section .suiproxy-proxy-card > section {
    min-width: 0 !important;
    padding: 8px 9px !important;
}

#shoplike-section :is(.shoplike-meta-chip, .shoplike-proxy-pill, .shoplike-health-chip),
#nestproxy-section :is(.nestproxy-meta-chip, .shoplike-proxy-pill),
#kiotproxy-section :is(.kiotproxy-meta-chip, .shoplike-proxy-pill),
#suiproxy-section :is(.suiproxy-key-pill, .suiproxy-health) {
    min-height: 24px !important;
    padding: 3px 6px !important;
    border-radius: 7px !important;
    font-size: 9px !important;
}

:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section)
    :is(.shoplike-device-input, .nestproxy-device-input, .suiproxy-device-input) {
    min-height: 28px !important;
    height: 28px !important;
    font-size: 9px !important;
}

:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section)
    :is(.shoplike-action-btn, .nestproxy-action-btn, .suiproxy-action-btn) {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 8px !important;
    border-radius: 7px !important;
    font-size: 9px !important;
}

:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section) .provider-webrtc-control {
    min-height: 27px !important;
    padding: 3px 5px !important;
    border-radius: 7px !important;
}

:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section) .provider-webrtc-control select {
    min-height: 20px !important;
    height: 20px !important;
    padding: 0 3px !important;
    font-size: 9px !important;
}

:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section)
    :is(.shoplike-key-list-v2, .nestproxy-key-list, .kiotproxy-card-list, .suiproxy-card-list) {
    max-height: calc(100vh - 285px);
    overflow: auto;
    scrollbar-gutter: stable;
}

#tmproxy-section .shoplike-table-wrap {
    max-height: calc(100vh - 275px);
    overflow: auto;
}

#tmproxy-section .shoplike-table :is(th, td) {
    padding: 6px 8px !important;
    font-size: 10px !important;
}

body.dark-mode :is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) {
    --proxy-compact-border: rgba(148, 163, 184, .18);
    --proxy-compact-bg: #0f172a;
    --proxy-compact-soft: #0b1220;
    --proxy-compact-text: #f8fafc;
    --proxy-compact-muted: #94a3b8;
}

@media (max-width: 1100px) {
    :is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-page-grid {
        grid-template-columns: 1fr !important;
    }

    :is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-note-card {
        display: none !important;
    }

    :is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section)
        :is(.shoplike-key-list-v2, .nestproxy-key-list, .kiotproxy-card-list, .suiproxy-card-list) {
        max-height: none;
    }
}

@media (max-width: 720px) {
    :is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    :is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
        .section-header :is(.section-subtitle, p) {
        max-width: 100% !important;
        white-space: normal;
    }

    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip),
    #kiotproxy-section .kiotproxy-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* KiotProxy dashboard layout */
#kiotproxy-section {
    --kiot-accent: #2563eb;
    --kiot-accent-soft: #eff6ff;
    --kiot-border: #e4eaf2;
    --kiot-muted-bg: #f8fafc;
}
#kiotproxy-section .shoplike-page-header h2 i { color: var(--kiot-accent); }
#kiotproxy-section .shoplike-page-grid { grid-template-columns: minmax(0, 1fr) 300px; }
#kiotproxy-section .shoplike-key-card { position: relative; overflow: hidden; }
#kiotproxy-section .shoplike-key-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
    content: '';
}
#kiotproxy-section .shoplike-form-grid { grid-template-columns: .8fr 1.35fr 1.35fr .85fr .8fr; }
#kiotproxy-section .shoplike-note-card {
    justify-content: center;
    background: linear-gradient(145deg, #f8fbff, #f5f3ff);
}
#kiotproxy-section .kiotproxy-list-card { border-radius: 16px; }
#kiotproxy-section .kiotproxy-list-head {
    align-items: center;
    padding: 17px 18px;
    background: #fff;
}
#kiotproxy-section .kiotproxy-list-head .badge { min-width: 64px; text-align: center; }

#kiotproxy-section .kiotproxy-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--kiot-border);
    background: var(--kiot-muted-bg);
}
#kiotproxy-section .kiotproxy-summary-strip > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--kiot-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .03);
}
#kiotproxy-section .kiotproxy-summary-strip > div > span:last-child { display: grid; gap: 1px; }
#kiotproxy-section .kiotproxy-summary-strip small { color: #64748b; font-size: 11px; font-weight: 700; }
#kiotproxy-section .kiotproxy-summary-strip strong { color: #0f172a; font-size: 20px; line-height: 1; }
#kiotproxy-section .kiotproxy-summary-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
}
#kiotproxy-section .kiotproxy-summary-icon.is-blue { color: #2563eb; background: #dbeafe; }
#kiotproxy-section .kiotproxy-summary-icon.is-green { color: #059669; background: #d1fae5; }
#kiotproxy-section .kiotproxy-summary-icon.is-violet { color: #7c3aed; background: #ede9fe; }
#kiotproxy-section .kiotproxy-summary-icon.is-amber { color: #d97706; background: #fef3c7; }

#kiotproxy-section .kiotproxy-commandbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--kiot-border);
    background: #fff;
    flex-wrap: wrap;
}
#kiotproxy-section .kiotproxy-command-group { display: inline-flex; min-width: 0; align-items: center; gap: 7px; flex-wrap: wrap; }
#kiotproxy-section .kiotproxy-command-actions { flex: 1 1 520px; }
#kiotproxy-section .kiotproxy-command-auto {
    margin-left: auto;
    padding-left: 9px;
    border-left: 1px solid var(--kiot-border);
}
#kiotproxy-section .kiotproxy-commandbar .btn { min-height: 36px; border-radius: 10px; white-space: nowrap; }
#kiotproxy-section .kiotproxy-auto-label { display: inline-flex; align-items: center; gap: 6px; color: #475569; font-size: 11px; font-weight: 800; white-space: nowrap; }
#kiotproxy-section .nestproxy-bulk-dns {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 3px 4px 3px 10px;
    border: 1px solid rgba(14, 165, 233, .25);
    border-radius: 11px;
    background: #f0f9ff;
    color: #0f172a;
}
#kiotproxy-section .nestproxy-bulk-dns > i { color: #0284c7; }
#kiotproxy-section .nestproxy-bulk-dns select {
    min-width: 135px;
    min-height: 28px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
}
#kiotproxy-section .nestproxy-bulk-dns > span {
    max-width: 100px;
    overflow: hidden;
    color: #64748b;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#kiotproxy-section .nestproxy-bulk-dns button {
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: #0284c7;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
#kiotproxy-section .nestproxy-select-all {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--kiot-border);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
#kiotproxy-section .nestproxy-select-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--kiot-accent); }
#kiotproxy-section .nestproxy-auto-select { width: 138px; min-height: 36px; border-radius: 10px; font-size: 11px; }
#kiotproxy-section .nestproxy-timer-label {
    display: inline-flex;
    min-width: 82px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
#kiotproxy-section .nestproxy-timer-label:empty { display: none; }

#kiotproxy-section .kiotproxy-card-header,
#kiotproxy-section .kiotproxy-key-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(245px, 1.08fr) minmax(250px, 1.12fr) minmax(245px, .95fr);
}
#kiotproxy-section .kiotproxy-card-header {
    padding: 9px 14px;
    border-bottom: 1px solid var(--kiot-border);
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}
#kiotproxy-section .kiotproxy-card-header span { padding: 0 12px; }
#kiotproxy-section .kiotproxy-card-list { display: grid; background: #f8fafc; }
#kiotproxy-section .kiotproxy-key-card {
    position: relative;
    margin: 10px 12px 0;
    overflow: hidden;
    border: 1px solid var(--kiot-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .045);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#kiotproxy-section .kiotproxy-key-card:last-child { margin-bottom: 12px; }
#kiotproxy-section .kiotproxy-key-card:hover { border-color: #c7d2fe; box-shadow: 0 10px 24px rgba(37, 99, 235, .09); transform: translateY(-1px); }
#kiotproxy-section .kiotproxy-key-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #94a3b8; content: ''; }
#kiotproxy-section .kiotproxy-key-card.is-online::before { background: #10b981; }
#kiotproxy-section .kiotproxy-key-card.is-warning::before { background: #f59e0b; }
#kiotproxy-section .kiotproxy-key-card.nestproxy-auth-row-selected { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
#kiotproxy-section .kiotproxy-key-card > section { min-width: 0; padding: 14px 15px; }
#kiotproxy-section .kiotproxy-key-card > section + section { border-left: 1px solid var(--kiot-border); }

#kiotproxy-section .kiotproxy-identity-top { display: grid; grid-template-columns: 22px 38px minmax(0, 1fr); align-items: center; gap: 9px; }
#kiotproxy-section .kiotproxy-identity-top strong { display: block; overflow: hidden; color: #0f172a; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
#kiotproxy-section .kiotproxy-identity-top small { display: block; margin-top: 2px; color: #64748b; font-size: 11px; }
#kiotproxy-section .kiotproxy-provider-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #eef2ff; color: #4f46e5; }
#kiotproxy-section .kiotproxy-card-check { display: grid; width: 20px; height: 20px; place-items: center; }
#kiotproxy-section .kiotproxy-card-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--kiot-accent); cursor: pointer; }
#kiotproxy-section .kiotproxy-card-check.is-disabled { border-radius: 6px; background: #f1f5f9; color: #94a3b8; font-size: 9px; }
#kiotproxy-section .kiotproxy-meta-row { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }
#kiotproxy-section .kiotproxy-meta-chip { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #475569; font-size: 10px; font-weight: 700; }
#kiotproxy-section .kiotproxy-meta-chip code { max-width: 100px; overflow: hidden; color: inherit; font-family: 'JetBrains Mono', monospace; text-overflow: ellipsis; white-space: nowrap; }
#kiotproxy-section .kiotproxy-meta-chip.is-secure { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
#kiotproxy-section .kiotproxy-meta-chip.is-warning { border-color: #fde68a; background: #fffbeb; color: #b45309; }
#kiotproxy-section .kiotproxy-time-row { display: grid; gap: 4px; margin-top: 9px; color: #64748b; font-size: 10px; }
#kiotproxy-section .kiotproxy-time-row span { display: flex; align-items: center; gap: 6px; }

#kiotproxy-section .kiotproxy-card-label { display: flex; min-height: 22px; align-items: center; justify-content: space-between; gap: 8px; color: #475569; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
#kiotproxy-section .kiotproxy-card-label .shoplike-next { margin: 0; color: #64748b; font-size: 9px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#kiotproxy-section .kiotproxy-fixed-endpoint { margin-top: 5px; }
#kiotproxy-section .kiotproxy-fixed-endpoint .shoplike-proxy-pill { width: 100%; max-width: none; justify-content: space-between; border-radius: 10px; }
#kiotproxy-section .kiotproxy-fixed-endpoint .shoplike-proxy-pill code { flex: 1; }
#kiotproxy-section .kiotproxy-pending-value { display: flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 10px; border: 1px dashed #cbd5e1; border-radius: 10px; color: #64748b; font-size: 11px; }
#kiotproxy-section .kiotproxy-upstream { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: #64748b; font-size: 10px; }
#kiotproxy-section .kiotproxy-upstream code { max-width: 155px; overflow: hidden; color: #334155; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#kiotproxy-section .kiotproxy-upstream em { color: #94a3b8; font-size: 10px; }
#kiotproxy-section .kiotproxy-dns-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed #e2e8f0; }
#kiotproxy-section .kiotproxy-dns-row > span { display: inline-flex; align-items: center; gap: 5px; color: #64748b; font-size: 10px; font-weight: 700; }
#kiotproxy-section .kiotproxy-dns-row select { max-width: 135px; min-height: 28px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; color: #334155; font-size: 10px; font-weight: 700; }
#kiotproxy-section .kiotproxy-dns-row em { color: #94a3b8; font-size: 10px; }

#kiotproxy-section .kiotproxy-card-device .shoplike-device-cell { width: 100%; margin-top: 7px; }
#kiotproxy-section .kiotproxy-card-device .shoplike-device-input { min-width: 0; flex: 1; }
#kiotproxy-section .kiotproxy-card-device .shoplike-webrtc-badge { padding: 4px 7px; font-size: 9px; letter-spacing: 0; text-transform: none; }
#kiotproxy-section .kiotproxy-card-device .provider-webrtc-control { max-width: 148px; }
#kiotproxy-section .kiotproxy-device-note { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: #64748b; font-size: 10px; }

#kiotproxy-section .kiotproxy-card-health { display: flex; flex-direction: column; }
#kiotproxy-section .kiotproxy-health-head { min-height: 29px; }
#kiotproxy-section .kiotproxy-health-message { display: -webkit-box; min-height: 31px; margin: 7px 0 10px; overflow: hidden; color: #b45309; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#kiotproxy-section .kiotproxy-health-message.is-ok { color: #64748b; }
#kiotproxy-section .kiotproxy-card-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
#kiotproxy-section .kiotproxy-card-actions .shoplike-action-btn { min-height: 32px; padding: 0 9px; border-radius: 9px; font-size: 10px; }
#kiotproxy-section .kiotproxy-card-actions .icon-only { width: 32px; padding: 0; }
#kiotproxy-section .kiotproxy-empty-state { display: grid; min-height: 210px; place-items: center; align-content: center; gap: 7px; padding: 30px; color: #64748b; text-align: center; }
#kiotproxy-section .kiotproxy-empty-state > i { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; background: #eef2ff; color: #4f46e5; font-size: 20px; }
#kiotproxy-section .kiotproxy-empty-state strong { color: #334155; font-size: 14px; }
#kiotproxy-section .kiotproxy-empty-state span { font-size: 11px; }

body.dark-mode #kiotproxy-section { --kiot-border: #263244; --kiot-muted-bg: #0f172a; }
body.dark-mode #kiotproxy-section :is(.kiotproxy-list-head, .kiotproxy-commandbar, .kiotproxy-key-card, .kiotproxy-summary-strip > div) { background: #111827; }
body.dark-mode #kiotproxy-section :is(.kiotproxy-summary-strip strong, .kiotproxy-identity-top strong, .kiotproxy-empty-state strong) { color: #f8fafc; }
body.dark-mode #kiotproxy-section .kiotproxy-card-header { background: #0f172a; }
body.dark-mode #kiotproxy-section .kiotproxy-card-list { background: #0b1220; }
body.dark-mode #kiotproxy-section .shoplike-note-card { background: linear-gradient(145deg, #111827, #17152c); }
body.dark-mode #kiotproxy-section .nestproxy-bulk-dns { border-color: #164e63; background: #082f49; color: #e2e8f0; }
body.dark-mode #kiotproxy-section .nestproxy-bulk-dns select { color: #e2e8f0; }
body.dark-mode #kiotproxy-section .nestproxy-select-all { border-color: #334155; background: #111827; color: #e2e8f0; }
body.dark-mode #kiotproxy-section .kiotproxy-meta-chip { border-color: #334155; background: #1e293b; color: #cbd5e1; }
body.dark-mode #kiotproxy-section .kiotproxy-upstream code { color: #e2e8f0; }
body.dark-mode #kiotproxy-section .kiotproxy-dns-row select { border-color: #334155; background: #0f172a; color: #e2e8f0; }

@media (max-width: 1250px) {
    #kiotproxy-section .shoplike-form-grid { grid-template-columns: 1fr 1.4fr 1.4fr; }
    #kiotproxy-section .kiotproxy-command-auto { margin-left: 0; }
}
@media (max-width: 1080px) {
    #kiotproxy-section .shoplike-page-grid { grid-template-columns: 1fr; }
    #kiotproxy-section .kiotproxy-card-header { display: none; }
    #kiotproxy-section .kiotproxy-key-card { grid-template-columns: 1fr 1fr; }
    #kiotproxy-section .kiotproxy-key-card > section:nth-child(3) { border-top: 1px solid var(--kiot-border); border-left: 0; }
    #kiotproxy-section .kiotproxy-key-card > section:nth-child(4) { border-top: 1px solid var(--kiot-border); }
}
@media (max-width: 760px) {
    #kiotproxy-section .shoplike-form-grid { grid-template-columns: 1fr; }
    #kiotproxy-section .kiotproxy-summary-strip { grid-template-columns: 1fr 1fr; }
    #kiotproxy-section .kiotproxy-command-group { width: 100%; }
    #kiotproxy-section .kiotproxy-command-actions { display: grid; grid-template-columns: 1fr 1fr; }
    #kiotproxy-section .kiotproxy-command-actions .btn { width: 100%; justify-content: center; }
    #kiotproxy-section .kiotproxy-command-auto { padding-top: 8px; padding-left: 0; border-top: 1px solid var(--kiot-border); border-left: 0; }
    #kiotproxy-section .kiotproxy-key-card { grid-template-columns: 1fr; }
    #kiotproxy-section .kiotproxy-key-card > section + section { border-top: 1px solid var(--kiot-border); border-left: 0; }
}
@media (max-width: 520px) {
    #kiotproxy-section .kiotproxy-summary-strip { gap: 7px; padding: 9px; }
    #kiotproxy-section .kiotproxy-summary-strip > div { padding: 9px; }
    #kiotproxy-section .kiotproxy-command-primary { align-items: stretch; flex-direction: column; }
    #kiotproxy-section .nestproxy-bulk-dns { width: 100%; }
    #kiotproxy-section .bulk-webrtc-control { width: 100%; }
    #kiotproxy-section .nestproxy-bulk-dns select { min-width: 0; flex: 1; }
    #kiotproxy-section .nestproxy-select-all { justify-content: center; }
    #kiotproxy-section .kiotproxy-command-actions { grid-template-columns: 1fr; }
    #kiotproxy-section .kiotproxy-command-auto { display: grid; grid-template-columns: 1fr 1fr; }
    #kiotproxy-section .kiotproxy-auto-label { grid-column: 1 / -1; }
    #kiotproxy-section .nestproxy-auto-select { width: 100%; }
    #kiotproxy-section .kiotproxy-key-card { margin-inline: 8px; }
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-light: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --bg-dark: #020617;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-fast);
}

.sidebar-header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    /* Reduced from 28px for better balance */
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.1));
    letter-spacing: 0;
}

.logo i {
    color: #6366f1;
    -webkit-text-fill-color: initial;
    font-size: 24px;
    /* Reduced from 26px to match text */
    margin-right: 2px;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
}

.avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-size: 14px;
    font-weight: 600;
}

.user-info small {
    font-size: 12px;
    color: #94a3b8;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    max-width: calc(100vw - 260px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper,
.content-section {
    min-width: 0;
    max-width: 100%;
}

.top-bar {
    height: 72px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 16px;
    border-radius: 100px;
    width: 300px;
    gap: 12px;
}

body.dark-mode .search-container {
    background: rgba(255, 255, 255, 0.05);
}

.search-container input {
    background: none;
    border: none;
    outline: none;
    color: inherit;
    font-size: 14px;
    width: 100%;
}

.header-stats {
    display: flex;
    gap: 20px;
    margin: 0 30px;
    flex: 1;
    justify-content: center;
}

.h-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.h-stat:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.h-stat i {
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* Icon Colors */
.h-stat .fa-microchip {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.h-stat .fa-memory {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.h-stat .fa-clock {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.h-stat span {
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.2px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.server-info-hint {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.server-info-hint i {
    font-size: 14px;
}

/* Content Wrapper */
.content-wrapper {
    padding: 40px;
}

.content-section {
    display: none;
    animation: slideUp var(--transition-fast);
}

.content-section.active {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Glass Card */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-icon.blue {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.proxy-types {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.type-item {
    font-size: 11px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Actions Bar */
.actions-bar {
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* Table Area */
.table-area {
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

/* Merged Table Header styles later in the file */

.table-container {
    overflow-x: auto;
    overflow-y: hidden;
    /* ? Prevent layout shift with scrollbar-gutter */
    scrollbar-gutter: stable;
}

/* ? Smooth scrollbar for Chrome/Edge */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.5);
    border-radius: 4px;
    transition: background 0.3s;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.8);
}

.proxies-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Vertical spacing between rows */
    margin-top: -8px; /* Offset spacing for top row */
}

.proxies-table th {
    background: transparent;
    padding: 12px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.1);
}

.proxies-table td {
    padding: 12px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
    transition: background 0.15s ease;
}

.proxies-table td:first-child {
    border-left: 1px solid var(--glass-border);
    border-radius: 12px 0 0 12px;
}

.proxies-table td:last-child {
    border-right: 1px solid var(--glass-border);
    border-radius: 0 12px 12px 0;
}

.proxies-table tbody tr:hover td {
    background: rgba(var(--primary-rgb), 0.08) !important;
}

body.dark-mode .proxies-table td {
    background: rgba(30, 41, 59, 0.4);
}

body.dark-mode .proxies-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Bigger, modern checkboxes */
.pppoe-checkbox,
.proxy-checkbox,
#selectAllPPPoE,
#selectAllProxy {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.pppoe-checkbox:hover,
.proxy-checkbox:hover,
#selectAllPPPoE:hover,
#selectAllProxy:hover {
    accent-color: var(--primary-hover);
}

/* Checkbox column - center both th and td */
.proxies-table th.col-check,
.proxies-table td:first-child {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0 8px !important;
    width: 36px !important;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

#bulkData {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    resize: none;
    margin-bottom: 15px;
}

#bulkData:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(77, 148, 255, 0.2);
}

.help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.help-text code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-quick-assign {
    padding: 4px 8px;
    font-size: 11px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
}

.btn-quick-assign:hover {
    background: #10b981;
    color: white;
}

.proxies-table tr.active td {
    border-top-color: rgba(var(--primary-rgb), 0.15) !important;
    border-bottom-color: rgba(var(--primary-rgb), 0.15) !important;
}

/* Active row: ch? vi?n tr?i nh?, kh?ng t? m?u n?n */
.proxies-table tr.active td:first-child {
    border-left: 3px solid var(--primary) !important;
    border-radius: 10px 0 0 10px !important;
}

/* Zebra striping - subtle alternating rows for readability */
.proxies-table tbody tr:nth-child(even) td {
    background: rgba(var(--primary-rgb), 0.018);
}

body.dark-mode .proxies-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.btn-icon.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-icon.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.row-actions.compact {
    gap: 4px;
}

.row-actions.compact .btn-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* Compact Table Row Styles */
.proxies-table td {
    padding: 8px 12px;
    /* Reduced padding from 16px */
    height: 48px;
    /* Fixed height for consistency */
}

.proxies-table th {
    padding: 10px 12px;
    font-size: 11px;
}

.host-text {
    font-size: 13px;
    color: var(--primary);
}

.user-text {
    font-size: 12px;
    opacity: 0.8;
}

.pass-code {
    font-size: 10px;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Compact Status Badge */
.status-badge.compact {
    padding: 6px 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 130px;
    border-radius: 100px;
    font-weight: 600;
}

.status-badge.online { background: rgba(var(--success-rgb), 0.1); color: var(--success); border: 1px solid rgba(var(--success-rgb), 0.2); }
.status-badge.offline { background: rgba(var(--danger-rgb), 0.1); color: var(--danger); border: 1px solid rgba(var(--danger-rgb), 0.2); }
.status-badge.checking { background: rgba(var(--warning-rgb), 0.1); color: var(--warning); border: 1px solid rgba(var(--warning-rgb), 0.2); }

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge.online .dot { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-badge.offline .dot { background: var(--danger); }
.status-badge.checking .dot { background: var(--warning); animation: pulse 1.5s infinite; }

.status-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ip-info {
    font-size: 9px;
    opacity: 0.7;
    font-family: 'JetBrains Mono', monospace;
}

.btn-tiny {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 9px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-tiny:hover {
    background: var(--primary);
    color: white;
}

.country-info.compact .flag {
    font-size: 16px;
}

.country-info.compact .country-name {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
}

/* Column Widths Update */
.proxies-table th:nth-child(1),
.proxies-table td:nth-child(1) {
    width: 40px;
}

/* # */
.proxies-table th:nth-child(2),
.proxies-table td:nth-child(2) {
    width: 80px;
}

/* Protocol */
.proxies-table th:nth-child(3),
.proxies-table td:nth-child(3) {
    width: 140px;
}

/* Status */
.proxies-table th:nth-child(4),
.proxies-table td:nth-child(4) {
    width: 70px;
}

/* Country */
.proxies-table th:nth-child(8),
.proxies-table td:nth-child(8) {
    width: 140px;
}

/* Device IP */
.proxies-table th:last-child,
.proxies-table td:last-child {
    width: 110px;
}

/* Actions */

.type-item.compact {
    font-size: 10px;
    padding: 1px 6px;
}

.inline-edit-input.compact {
    padding: 4px 8px;
    font-size: 12px;
    height: 28px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--secondary);
    color: white;
}

/* Micro & Compact Utilities */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
}

.btn-micro {
    padding: 2px 4px;
    font-size: 10px;
    width: 24px;
    height: 24px;
    justify-content: center;
}

.btn-icon.btn-xs {
    width: 24px;
    height: 24px;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.compact-table td {
    padding: 4px 8px !important;
    font-size: 12px !important;
}

.compact-table th {
    padding: 6px 8px !important;
    font-size: 10px !important;
}

.ip-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
}

.pppoe-ip-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.25;
    max-width: 320px;
    text-align: center;
}

.pppoe-ip-stack .pppoe-ipv4 {
    white-space: nowrap;
    text-align: center;
}

.pppoe-ip-stack .pppoe-ipv6 {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    max-width: 320px;
    transform: none;
    direction: ltr;
    unicode-bidi: plaintext;
}

.pppoe-ip-stack .pppoe-ipv6:hover {
    color: var(--primary);
}

.nowrap {
    white-space: nowrap !important;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

/* Specific column widths for better alignment */
.proxies-table th:nth-child(1),
.proxies-table td:nth-child(1) {
    width: 100px;
}

/* Protocol */
.proxies-table th:nth-child(2),
.proxies-table td:nth-child(2) {
    width: 160px;
}

/* Status */
.proxies-table th:nth-child(3),
.proxies-table td:nth-child(3) {
    width: 150px;
}

/* Country */
.proxies-table th:nth-child(7),
.proxies-table td:nth-child(7) {
    width: 180px;
}

/* Device IP */
.proxies-table th:last-child,
.proxies-table td:last-child {
    width: 140px;
    text-align: left;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading i {
    animation: fa-spin 1s infinite linear;
}

.ip-assign-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ip-assign-box span {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

body.dark-mode .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-mikrotik {
    background: var(--danger);
    color: white;
}

.btn-mikrotik.connected {
    background: var(--success);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
}

.inline-edit-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 13px;
    width: 100%;
    min-width: 160px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.inline-edit-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.inline-edit-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
    min-width: 200px;
}

.inline-edit-input.text-muted {
    opacity: 0.4;
    font-style: italic;
}

.btn-action {
    background: none;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-action:hover {
    background: rgba(0, 0, 0, 0.03);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Statuses */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.checking {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 32px;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal.show .modal-content {
    transform: scale(1);
}

#pppoe-section .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 32px;
    position: sticky;
    top: 72px;
    z-index: 120;
    background: var(--bg-light) !important;
    /* Solid background to prevent bleed-through */
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    /* Remove filters that might cause stacking issues */
    backdrop-filter: none !important;
}

body.dark-mode #pppoe-section .table-header {
    background: var(--bg-dark) !important;
}

/* Specific styling for the table container when paired with sticky header */
#pppoe-section .table-container.glass {
    border-top: none;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* Sticky column labels with solid background */
#pppoe-section .proxies-table thead th {
    position: sticky;
    top: 148px;
    /* 72px (top bar) + Approx 76px (toolbar height) */
    z-index: 115;
    background: var(--bg-light) !important;
    border-bottom: 2px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.dark-mode #pppoe-section .proxies-table thead th {
    background: var(--bg-dark) !important;
}

.title-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-all {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-http {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-socks {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-port {
    background: #6366f1;
    color: white !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    border: none !important;
    white-space: nowrap;
}

.badge-empty {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-info { background: rgba(99,102,241,0.15); color: #6366f1; }

.btn-sm { padding: 5px 12px !important; font-size: 12px !important; }

.badge-ikev2 {
    background: rgba(6, 182, 212, 0.1);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.status-badge.checking {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}


.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

input:focus,
select:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

/* Progress Bar */
.progress-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.progress-bar-wrapper {
    width: 200px;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width var(--transition-slow);
}

/* Premium Modal Enhancements */
.premium-modal {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    max-width: 550px !important;
}

body:not(.dark-mode) .premium-modal {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.header-with-icon {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-with-icon i {
    font-size: 24px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 12px;
    border-radius: 12px;
}

.form-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    font-weight: 800;
    margin: 25px 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(99, 102, 241, 0.2), transparent);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group label i {
    font-size: 12px;
    opacity: 0.6;
}

input:focus,
select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    border: none;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-item input:checked+.checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-item span {
    font-weight: 500;
}

/* Modal Responsive */
@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
    }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: toastSlide var(--transition-fast) forwards;
}

@keyframes toastSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--info);
}

.toast.warning {
    background: var(--warning);
}

/* Responsive */
/* Removed old 1024px media query to consolidate into 991px */

@media (max-width: 991px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    #mobile-menu-btn {
        display: flex;
    }

    .header-stats {
        display: none;
    }

    .top-bar-actions .btn span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .proxies-table th,
    .proxies-table td {
        white-space: nowrap;
        padding: 8px 10px !important;
    }

    /* Hide less critical columns on mobile */
    .proxies-table th:nth-child(2),
    .proxies-table td:nth-child(2) {
        display: none;
    }

    /* Column Widths on Mobile */
    .proxies-table th,
    .proxies-table td {
        width: auto !important;
        min-width: 80px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .actions-bar {
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .actions-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .actions-group span {
        grid-column: span 2;
    }

    .pagination-container {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .top-bar {
        height: 52px;
        padding: 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .top-bar-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
        justify-content: flex-end;
    }

    .sidebar {
        width: 240px !important;
        padding: 15px;
        border-radius: 0 4px 4px 0 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        visibility: hidden;
        z-index: 2000;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .app-layout.sidebar-open .sidebar {
        transform: translateX(0) !important;
        visibility: visible;
    }

    .app-layout.sidebar-open #sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .nav-item {
        padding: 10px 15px;
        font-size: 14px;
        gap: 10px;
    }

    .nav-item i {
        font-size: 18px;
    }

    .nav-item span {
        display: inline !important;
        /* Force show text in sidebar drawer */
    }

    .logo {
        flex: 0 0 auto;
        font-size: 18px;
    }

    #mobile-menu-btn {
        order: -1;
    }

    .server-info-hint span {
        max-width: 80px;
        font-size: 10px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 8px;
    }

    .top-bar {
        padding: 0 8px;
        height: 46px;
    }

    .logo {
        font-size: 16px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .modal-content {
        width: 98%;
        padding: 16px 12px;
    }

    /* Hide # column too on very small screens */
    .compact-table th:nth-child(2),
    .compact-table td:nth-child(2) {
        display: none;
    }

    /* Also hide X?c Th?c (7th col, now 5th visible) */
    .compact-table th:nth-child(7),
    .compact-table td:nth-child(7) {
        display: none;
    }

    .section-header h2 {
        font-size: 14px;
    }

    .pppoe-sticky-header {
        top: 46px !important;
    }

    /* Stack bulk buttons 2-col */
    .pppoe-bulk-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
}

/* Country Column Styles */
.country-info {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.country-info .flag {
    font-size: 20px;
    line-height: 1;
}

.country-info .country-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

/* Enhanced PPPoE Action Buttons */
.pppoe-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.pppoe-actions .btn-action {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: white;
    font-size: 11px;
}

.pppoe-actions .btn-action i {
    pointer-events: none;
}

.pppoe-actions .btn-action.btn-primary {
    background: #6366f1;
}

.pppoe-actions .btn-action.btn-danger {
    background: #ef4444;
}

.pppoe-actions .btn-action.btn-warning {
    background: #f59e0b;
    color: #451a03;
}

.pppoe-actions .btn-action.btn-warning.is-active {
    background: #10b981;
    color: #052e1f;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.pppoe-rotate-enabled-row {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.055), transparent 42%);
}

.pppoe-interface-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 130px;
}

.pppoe-interface-cell strong {
    font-size: 11px;
    color: var(--text-primary);
}

.pppoe-rotate-row-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.26);
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.pppoe-rotate-row-badge i {
    font-size: 10px;
}

.pppoe-actions .btn-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.pppoe-actions .btn-action:active {
    transform: scale(0.95);
}

/* Bulk Toolbar Styling */
.pppoe-bulk-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-bulk {
    padding: 5px 12px;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.15s ease;
    border: none !important;
    color: white !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.btn-bulk i {
    font-size: 11px;
}

.btn-bulk.btn-create {
    background: #6366f1 !important;
}

.btn-bulk.btn-delete {
    background: #ef4444 !important;
}

.btn-bulk.btn-copy {
    background: #6366f1 !important;
}

.btn-bulk.btn-export {
    background: #10b981 !important;
}

.btn-bulk:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.btn-bulk:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {

    .btn,
    .btn-bulk,
    .btn-action,
    .btn-icon,
    .status-badge,
    .badge,
    .form-group input,
    .form-group select,
    .form-group textarea,
    .modal-content,
    .card,
    .glass,
    .stat-card,
    .table-area,
    .sidebar {
        border-radius: 4px !important;
    }

    /* Compact table for mobile */
    .proxies-table {
        border-spacing: 0 2px;
        margin-top: -2px;
    }

    .proxies-table td {
        padding: 6px 6px !important;
        font-size: 11px !important;
        border-radius: 0 !important;
    }

    .proxies-table th {
        padding: 6px 6px !important;
        font-size: 9px !important;
    }

    .compact-table td {
        padding: 3px 5px !important;
        font-size: 11px !important;
    }

    .compact-table th {
        padding: 5px 5px !important;
        font-size: 9px !important;
    }

    /* Hide V? Tr? & Uptime columns on mobile (5th & 6th columns) */
    .compact-table th:nth-child(5),
    .compact-table td:nth-child(5),
    .compact-table th:nth-child(6),
    .compact-table td:nth-child(6) {
        display: none;
    }

    /* Tighter bulk toolbar */
    .pppoe-bulk-toolbar {
        gap: 4px;
        flex-wrap: wrap;
    }

    .btn-bulk {
        padding: 4px 8px;
        font-size: 11px !important;
        gap: 3px;
    }

    .btn-bulk i {
        font-size: 10px;
    }

    /* Compact badge-port on mobile */
    .badge-port {
        font-size: 11px !important;
        padding: 1px 6px !important;
    }

    .badge-port small {
        display: none !important;
    }

    /* Compact action buttons */
    .pppoe-actions .btn-action {
        width: 24px;
        height: 24px;
        font-size: 10px;
        border-radius: 4px;
    }

    /* Pagination compact */
    .pagination-container {
        padding: 8px 12px;
        font-size: 11px;
        border-radius: 0 0 4px 4px;
    }

    .pagination-controls {
        gap: 10px;
    }

    .page-size-selector span {
        display: none;
    }

    /* Section header compact */
    .section-header h2 {
        font-size: 16px;
    }

    .table-header h3 {
        font-size: 13px;
        margin: 0;
    }

    .table-header {
        padding: 8px 12px !important;
    }

    .pppoe-sticky-header {
        padding: 8px 12px !important;
        top: 52px !important;
    }

    /* Toast compact */
    .toast-container {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        padding: 10px 14px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Content area */
    .content-wrapper {
        padding: 10px;
    }

    .table-area {
        margin-bottom: 16px;
    }

    .table-container {
        max-height: 70vh !important;
    }
}

/* Dark mode adjustment for toolbar */
body.dark-mode .pppoe-bulk-toolbar {
    background: rgba(0, 0, 0, 0.2);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 32px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 16px 16px;
    margin-top: -1px;
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 30px;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-size-selector select {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
}

body.dark-mode .page-size-selector select {
    background: rgba(255, 255, 255, 0.05);
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-number {
    font-weight: 600;
    color: var(--text-main);
    min-width: 90px;
    text-align: center;
}

.page-nav .btn-tiny {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

body.dark-mode .page-nav .btn-tiny {
    background: rgba(255, 255, 255, 0.05);
}

.page-nav .btn-tiny:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-nav .btn-tiny:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* FINAL STICKY HEADER FIX 5.0 - CLEAN & SYNCED */
.pppoe-sticky-header {
    position: sticky !important;
    top: 72px !important;
    z-index: 110 !important;
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 12px 24px !important;
    margin-bottom: 0 !important;
    will-change: transform;
}

.table-container {
    max-height: 600px !important;
    overflow-y: auto !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
}

.proxies-table.compact-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background-color: var(--bg-light) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    padding: 12px !important;
}

body.dark-mode .proxies-table.compact-table thead th {
    background-color: #1e293b !important;
}


/* --- Antigravity UI Refinement --- */
.status-badge.compact {
    padding: 2px 10px !important;
    font-size: 11px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100px !important;
    justify-content: center !important;
    height: 26px !important;
    border-radius: 100px !important;
}

.proxies-table th,
.proxies-table td {
    text-align: left;
}

.proxies-table th:nth-child(1),
.proxies-table td:nth-child(1),
.proxies-table th:nth-child(2),
.proxies-table td:nth-child(2) {
    width: 50px !important;
    text-align: center !important;
}

.proxies-table th:nth-child(3),
.proxies-table td:nth-child(3) {
    width: 100px !important;
    text-align: center !important;
}

.proxies-table th:nth-child(4),
.proxies-table td:nth-child(4) {
    width: 130px !important;
    text-align: center !important;
}

.proxies-table th:nth-child(5),
.proxies-table td:nth-child(5) {
    width: 80px !important;
    text-align: center !important;
}

.proxies-table th:nth-child(8),
.proxies-table td:nth-child(8) {
    width: 160px !important;
}

.proxies-table th:last-child,
.proxies-table td:last-child {
    width: 140px !important;
    text-align: center !important;
}

/* --- PPPoE UI Alignment Fix --- */
.table-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.title-badges {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.pppoe-bulk-toolbar {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Ensure main table widths dont affect PPPoE */
#pppoe-section .proxies-table th,
#pppoe-section .proxies-table td {
    width: auto !important;
    text-align: left !important;
}

#pppoe-section .proxies-table th:nth-child(1),
#pppoe-section .proxies-table td:nth-child(1),
#pppoe-section .proxies-table th:nth-child(2),
#pppoe-section .proxies-table td:nth-child(2) {
    width: 40px !important;
    text-align: center !important;
}

/* --- Premium Copy Preview Styles --- */
.copy-preview-textarea {
    width: 100%;
    min-height: 320px;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    border-radius: 16px !important;
    color: #a5b4fc !important;
    padding: 20px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    resize: none;
    box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);
    outline: none;
    transition: all 0.3s ease;
}

.copy-preview-textarea:focus {
    border-color: rgba(99, 102, 241, 0.8) !important;
    box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.3);
}

.copy-preview-textarea::-webkit-scrollbar {
    width: 8px;
}

.copy-preview-textarea::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.copy-preview-textarea::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 10px;
}

.copy-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 15px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-summary-badge {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5) !important;
    font-size: 14px !important;
    padding: 8px 20px !important;
}

/* --- WireGuard Professional Action Buttons --- */
.wg-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.btn-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-circle:hover::after {
    opacity: 1;
}

.btn-circle:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn-circle:active {
    transform: translateY(-1px) scale(0.95);
}

.btn-circle.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.btn-circle.btn-danger {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.btn-circle.btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
    color: #451a03;
}

.btn-circle.btn-edit {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.4);
}

/* Status indicator refinements */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-green 2s infinite;
}

.status-indicator.offline {
    background-color: var(--danger);
    opacity: 0.6;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.btn-mini-refresh {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--primary);
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini-refresh:hover {
    background: var(--primary);
    color: white;
    transform: rotate(180deg);
}



.progress-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    height: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

.progress-bar-wrapper {
    width: 100%;
    height: 100%;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #0ea5e9);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.btn-glow {
    position: relative;
    z-index: 1;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), #0ea5e9, var(--primary));
    border-radius: 10px;
    z-index: -1;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-glow:hover::before {
    opacity: 0.6;
}



.log-line {
    border-left: 2px solid transparent;
    padding-left: 8px;
    transition: all 0.2s;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary);
}

/* --- Status Glow Indicator --- */
.status-glow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

body.dark-mode .status-glow {
    background: rgba(255, 255, 255, 0.05);
}

.glow-dot {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 5px var(--danger);
}

.glow-text {
    color: var(--text-muted);
}

/* Connected State */
.status-glow.online .glow-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success), 0 0 20px var(--success);
    animation: pulse-glow 1.5s infinite;
}

.status-glow.online .glow-text {
    color: var(--success);
}

@keyframes pulse-glow {
    0% { transform: scale(1); box-shadow: 0 0 10px var(--success), 0 0 20px var(--success); }
    50% { transform: scale(1.2); box-shadow: 0 0 15px var(--success), 0 0 30px var(--success); }
    100% { transform: scale(1); box-shadow: 0 0 10px var(--success), 0 0 20px var(--success); }
}


/* --- Premium Table (General purpose elegant table) --- */
.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.02);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--glass-border);
}

body.dark-mode .premium-table th {
    background: rgba(255, 255, 255, 0.02);
}

.premium-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
    vertical-align: middle;
}

.premium-table tr:hover {
    background: rgba(var(--primary-rgb), 0.03);
}

/* Specific alignments for User Management */
#users-section .premium-table th:nth-child(1),
#users-section .premium-table td:nth-child(1) { width: 140px; } /* Username */

#users-section .premium-table th:nth-child(3),
#users-section .premium-table td:nth-child(3) { width: 120px; text-align: center; } /* Password */

#users-section .premium-table th:nth-child(4),
#users-section .premium-table td:nth-child(4) { width: 110px; text-align: center; } /* Role */

#users-section .premium-table th:nth-child(7),
#users-section .premium-table td:nth-child(7) { width: 160px; } /* Router Pass */

#users-section .premium-table th:last-child,
#users-section .premium-table td:last-child { text-align: center; }

/* Compact Settings Modal UI */
#settingsModal .modal-content {
    padding: 24px !important;
    max-width: 480px !important;
}
#settingsModal .form-group {
    margin-bottom: 12px !important;
}
#settingsModal .form-section-title {
    margin: 18px 0 10px 0 !important;
    font-size: 10px !important;
}
#settingsModal input, #settingsModal select {
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
}
#settingsModal .checkbox-group {
    padding: 6px 10px !important;
    gap: 6px !important;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Modern Switch Toggle Implementation */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(var(--primary-rgb), 0.1);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
  border: 1px solid var(--glass-border);
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
input:checked + .slider {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.switch-warning input:checked + .slider {
  background-color: var(--warning) !important;
  border-color: var(--warning) !important;
}
.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}
.toggle-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}
.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toggle-info span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}
.toggle-info small {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== PROXY LIST UI OPTIMIZATION ===== */

/* Proxy View Toggle Buttons */
/* ===== PROXY LIST HEADER - Professional Layout ===== */

.proxy-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--glass-border);
}

.proxy-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.proxy-list-title i {
    color: var(--primary);
    font-size: 16px;
}

.proxy-list-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.proxy-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    transition: all 0.2s;
}

.proxy-stat-badge i {
    font-size: 11px;
    opacity: 0.8;
}

.proxy-stat-badge span {
    font-variant-numeric: tabular-nums;
    min-width: 16px;
    text-align: right;
}

.proxy-stat-badge.http {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.proxy-stat-badge.socks {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

/* Proxy progress bar */
.proxy-progress-wrap {
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(var(--primary-rgb), 0.03);
}

.proxy-progress-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.proxy-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #0ea5e9);
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
}

.proxy-progress-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 140px;
    text-align: right;
}

/* Column widths for the proxies table */
.proxies-table .col-check  { width: 36px; }
.proxies-table .col-num    { width: 32px; text-align: center; }
.proxies-table .col-proto  { width: 96px; }
.proxies-table .col-status { width: 140px; }
.proxies-table .col-device { width: 150px; }
.proxies-table .col-fp     { width: 90px; text-align: center; }
.proxies-table .col-actions{ width: 116px; text-align: center; }

@media (max-width: 768px) {
    .proxy-list-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* --- iPhone Mobile Polish --- */
@media (max-width: 640px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .content-wrapper {
        padding: 10px 8px 18px !important;
    }

    .top-bar {
        height: 52px !important;
        padding: 0 10px !important;
        gap: 8px !important;
    }

    .section-header {
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    .section-header h2 {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }

    .header-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .header-actions .btn,
    .actions-group .btn,
    .btn-action {
        min-height: 38px !important;
        justify-content: center !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
    }

    .actions-bar {
        padding: 8px !important;
        margin-bottom: 12px !important;
        gap: 8px !important;
        border-radius: 8px !important;
    }

    .actions-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .actions-group > span {
        grid-column: 1 / -1 !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        text-transform: uppercase !important;
        letter-spacing: 0 !important;
    }

    .table-area {
        border-radius: 8px !important;
        margin-bottom: 14px !important;
        overflow: hidden !important;
    }

    .proxy-list-header {
        padding: 12px !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    .proxy-list-title {
        font-size: 14px !important;
    }

    .proxy-list-stats {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: 6px !important;
    }

    .proxy-stat-badge {
        justify-content: center !important;
        padding: 6px 8px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        min-width: 0 !important;
    }

    .proxy-progress-wrap {
        padding: 8px 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }

    .proxy-progress-text {
        min-width: 0 !important;
        text-align: left !important;
    }

    #proxies .table-container {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 8px 8px !important;
    }

    #proxies .proxies-table,
    #proxies .proxies-table tbody,
    #proxies .proxies-table tr,
    #proxies .proxies-table td {
        display: block !important;
        width: 100% !important;
    }

    #proxies .proxies-table {
        border-spacing: 0 !important;
        margin-top: 0 !important;
    }

    #proxies .proxies-table thead {
        display: none !important;
    }

    #proxies .proxies-table tbody tr {
        background: var(--card-bg) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: 8px !important;
        margin: 0 0 10px !important;
        padding: 8px !important;
        box-shadow: var(--shadow-sm) !important;
        overflow: hidden !important;
    }

    #proxies .proxies-table tr.active {
        border-left: 3px solid var(--primary) !important;
    }

    #proxies .proxies-table td {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 7px 2px !important;
        min-width: 0 !important;
        white-space: normal !important;
        font-size: 12px !important;
    }

    #proxies .proxies-table td:first-child {
        padding: 2px 0 6px !important;
        text-align: left !important;
    }

    #proxies .proxies-table td:nth-child(2) {
        display: none !important;
    }

    #proxies .proxies-table td:not(:first-child):not(:nth-child(2)):not(:last-child) {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        align-items: center !important;
        column-gap: 8px !important;
        border-top: 1px solid rgba(var(--primary-rgb), 0.08) !important;
    }

    #proxies .proxies-table td:not(:first-child):not(:nth-child(2)):not(:last-child)::before {
        content: '';
        font-size: 10px !important;
        font-weight: 800 !important;
        color: var(--text-muted) !important;
        text-transform: uppercase !important;
        letter-spacing: 0 !important;
    }

    #proxies .proxies-table td:nth-child(3)::before { content: 'Giao th?c' !important; }
    #proxies .proxies-table td:nth-child(4)::before { content: 'Tr?ng th?i' !important; }
    #proxies .proxies-table td:nth-child(5)::before { content: 'IP Public' !important; }
    #proxies .proxies-table td:nth-child(6)::before { content: 'WebRTC' !important; }
    #proxies .proxies-table td:nth-child(7)::before { content: 'K?t n?i g?c' !important; }
    #proxies .proxies-table td:nth-child(8)::before { content: 'IP:Port convert' !important; }
    #proxies .proxies-table td:nth-child(9)::before { content: 'Thi?t b?' !important; }
    #proxies .proxies-table td:nth-child(10)::before { content: 'Fingerprint' !important; }
    #proxies .proxies-table td:nth-child(11)::before { content: 'T?i kho?n' !important; }

    #proxies .proxies-table td:last-child {
        padding-top: 10px !important;
        border-top: 1px solid rgba(var(--primary-rgb), 0.08) !important;
    }

    #proxies .proxies-table td > *,
    #proxies .proxies-table td span,
    #proxies .proxies-table td code,
    #proxies .proxies-table td div {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
    }

    #proxies .status-badge.compact {
        width: auto !important;
        min-width: 92px !important;
        height: 24px !important;
        padding: 2px 8px !important;
    }

    #proxies .ip-input-wrapper {
        min-width: 0 !important;
        width: 100% !important;
    }

    #proxies .inline-edit-input.compact {
        min-height: 30px !important;
        font-size: 12px !important;
    }

    #proxies .row-actions.compact {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    #proxies .row-actions.compact .btn-icon {
        width: 100% !important;
        height: 36px !important;
        min-height: 36px !important;
        border-radius: 7px !important;
    }

    .proxy-checkbox,
    #selectAllProxy,
    .pppoe-checkbox,
    #selectAllPPPoE {
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
    }

    .modal {
        align-items: flex-start !important;
        padding: 10px 8px !important;
        overflow-y: auto !important;
    }

    .modal-content,
    .premium-modal {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100dvh - 20px) !important;
        overflow-y: auto !important;
        padding: 14px !important;
        border-radius: 8px !important;
    }

    .form-row,
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .toast-container {
        left: 8px !important;
        right: 8px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }

    .toast {
        width: 100% !important;
        min-width: 0 !important;
        padding: 11px 12px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }
}

@media (max-width: 380px) {
    .header-actions,
    .actions-group {
        grid-template-columns: 1fr !important;
    }

    .actions-group > span {
        grid-column: 1 !important;
    }

    .proxy-list-stats {
        grid-template-columns: 1fr !important;
    }

    #proxies .proxies-table td:not(:first-child):not(:nth-child(2)):not(:last-child) {
        grid-template-columns: 82px minmax(0, 1fr) !important;
    }
}

/* --- iPhone Proxy List Height Fix --- */
@media (max-width: 640px) {
    #proxies .table-area {
        overflow: visible !important;
    }

    #proxies .table-container {
        display: block !important;
        max-height: calc(100dvh - 250px) !important;
        min-height: 260px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    #proxies .proxies-table tbody {
        display: block !important;
        padding-bottom: 8px !important;
    }

    #proxies .proxies-table tbody tr {
        display: block !important;
        contain: layout paint !important;
    }
}

/* --- Dashboard Consistent Scrollbars --- */
.table-container,
.modal-content,
.premium-modal {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-rgb), 0.55) rgba(var(--primary-rgb), 0.08);
}

.table-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.premium-modal::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.premium-modal::-webkit-scrollbar-track {
    background: rgba(var(--primary-rgb), 0.07);
    border-radius: 999px;
}

.table-container::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.premium-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.78), rgba(14, 165, 233, 0.72));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.table-container::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.premium-modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary), #0ea5e9);
    border: 2px solid transparent;
    background-clip: content-box;
}

@media (max-width: 640px) {
    #proxies .table-container {
        scrollbar-color: rgba(var(--primary-rgb), 0.62) rgba(var(--primary-rgb), 0.08);
    }

    #proxies .table-container::-webkit-scrollbar {
        width: 6px;
    }

    #proxies .table-container::-webkit-scrollbar-track {
        background: rgba(var(--primary-rgb), 0.06);
        border-radius: 999px;
    }

    #proxies .table-container::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.85), rgba(14, 165, 233, 0.75));
        border-radius: 999px;
        border: 1px solid transparent;
        background-clip: content-box;
    }
}

/* --- Sidebar Theme Alignment --- */
.sidebar {
    background:
        radial-gradient(circle at 18% 8%, rgba(var(--primary-rgb), 0.22), transparent 34%),
        linear-gradient(180deg, #111827 0%, #0f172a 46%, #08111f 100%) !important;
    border-right: 1px solid rgba(var(--primary-rgb), 0.16) !important;
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.18) !important;
}

.logo {
    background: linear-gradient(135deg, #818cf8 0%, #38bdf8 58%, #22d3ee 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    filter: drop-shadow(0 8px 22px rgba(var(--primary-rgb), 0.22)) !important;
}

.logo i {
    color: #818cf8 !important;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.35)) !important;
}

.nav-item {
    color: #a8b6cf !important;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
}

.nav-item i {
    color: #93c5fd !important;
    opacity: 0.9 !important;
}

.nav-item:hover {
    background: rgba(var(--primary-rgb), 0.12) !important;
    border-color: rgba(var(--primary-rgb), 0.18) !important;
    color: #e0e7ff !important;
}

.nav-item:hover i {
    color: #bfdbfe !important;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.96), rgba(14, 165, 233, 0.78)) !important;
    color: #ffffff !important;
    border-left: 0 !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.26) !important;
}

.nav-item.active i {
    color: #ffffff !important;
    opacity: 1 !important;
}

.sidebar-divider,
.sidebar-footer {
    border-color: rgba(148, 163, 184, 0.16) !important;
}

.sidebar-divider {
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.28), transparent) !important;
}


.user-card {
    background: rgba(248, 250, 252, 0.08) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.18) !important;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22) !important;
}

.user-card:hover {
    background: rgba(248, 250, 252, 0.11) !important;
    border-color: rgba(56, 189, 248, 0.28) !important;
}

.avatar {
    background: linear-gradient(135deg, #818cf8, #38bdf8) !important;
    border-radius: 10px !important;
}

.status-dot {
    border-color: #0f172a !important;
}

.user-info span {
    color: #f8fafc !important;
}

.user-info small {
    color: #93c5fd !important;
}

@media (max-width: 768px) {
    .sidebar {
        border-radius: 0 10px 10px 0 !important;
        box-shadow: 20px 0 46px rgba(2, 6, 23, 0.42) !important;
    }
}

/* --- TSProxy-like Light Dashboard Theme --- */
:root {
    --ts-bg: #f8fafc;
    --ts-panel: #ffffff;
    --ts-panel-soft: #f1f5f9;
    --ts-border: #e5e7eb;
    --ts-text: #0f172a;
    --ts-muted: #64748b;
    --ts-blue: #2563eb;
    --ts-blue-soft: #eff6ff;
    --ts-sidebar: #ffffff;
}

body,
body.dark-mode {
    --bg-light: var(--ts-bg) !important;
    --card-bg: #ffffff !important;
    --glass-border: var(--ts-border) !important;
    --text-main: var(--ts-text) !important;
    --text-muted: var(--ts-muted) !important;
    background: var(--ts-bg) !important;
    color: var(--ts-text) !important;
}

.sidebar,
body.dark-mode .sidebar {
    background: var(--ts-sidebar) !important;
    color: var(--ts-text) !important;
    border-right: 1px solid var(--ts-border) !important;
    box-shadow: none !important;
}

.logo,
body.dark-mode .logo {
    background: none !important;
    -webkit-text-fill-color: var(--ts-text) !important;
    color: var(--ts-text) !important;
    filter: none !important;
    font-size: 18px !important;
    letter-spacing: 0 !important;
}

.logo i,
body.dark-mode .logo i {
    color: var(--ts-blue) !important;
    filter: none !important;
    font-size: 20px !important;
}

.nav-item,
body.dark-mode .nav-item {
    color: #111827 !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    margin-bottom: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.nav-item i,
body.dark-mode .nav-item i {
    color: #111827 !important;
    opacity: 0.78 !important;
    font-size: 15px !important;
}

.nav-item:hover,
body.dark-mode .nav-item:hover {
    background: var(--ts-panel-soft) !important;
    color: var(--ts-text) !important;
    box-shadow: none !important;
}

.nav-item.active,
body.dark-mode .nav-item.active {
    background: var(--ts-blue-soft) !important;
    color: var(--ts-blue) !important;
    border: 0 !important;
    box-shadow: none !important;
}

.nav-item.active i,
body.dark-mode .nav-item.active i {
    color: var(--ts-blue) !important;
    opacity: 1 !important;
}

.sidebar-divider,
body.dark-mode .sidebar-divider {
    background: var(--ts-border) !important;
    height: 1px !important;
}

.sidebar-footer,
body.dark-mode .sidebar-footer {
    border-top: 1px solid var(--ts-border) !important;
}



.user-card,
body.dark-mode .user-card {
    background: #ffffff !important;
    border: 1px solid var(--ts-border) !important;
    box-shadow: none !important;
    border-radius: 12px !important;
}

.user-card:hover,
body.dark-mode .user-card:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.avatar,
body.dark-mode .avatar {
    background: var(--ts-blue-soft) !important;
    color: var(--ts-blue) !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}

.status-dot,
body.dark-mode .status-dot {
    border-color: #ffffff !important;
}

.user-info span,
body.dark-mode .user-info span {
    color: var(--ts-text) !important;
}

.user-info small,
body.dark-mode .user-info small {
    color: var(--ts-muted) !important;
}

.top-bar,
body.dark-mode .top-bar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--ts-border) !important;
    box-shadow: none !important;
}

.glass,
.table-area,
.stat-card,
body.dark-mode .glass,
body.dark-mode .table-area,
body.dark-mode .stat-card {
    background: #ffffff !important;
    border: 1px solid var(--ts-border) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.stat-card,
.table-area,
.actions-bar {
    border-radius: 10px !important;
}

.actions-bar,
body.dark-mode .actions-bar {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 14px !important;
}

.actions-group .btn,
.header-actions .btn,
body.dark-mode .actions-group .btn,
body.dark-mode .header-actions .btn {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid var(--ts-border) !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}

.actions-group .btn:hover,
.header-actions .btn:hover,
body.dark-mode .actions-group .btn:hover,
body.dark-mode .header-actions .btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: none !important;
}

.btn-primary,
.btn-info,
body.dark-mode .btn-primary,
body.dark-mode .btn-info {
    background: var(--ts-blue) !important;
    color: #ffffff !important;
    border-color: var(--ts-blue) !important;
}

.proxy-list-header,
.table-header,
body.dark-mode .proxy-list-header,
body.dark-mode .table-header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--ts-border) !important;
}

.proxy-list-title,
body.dark-mode .proxy-list-title {
    color: var(--ts-text) !important;
}

.proxy-stat-badge,
body.dark-mode .proxy-stat-badge {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid var(--ts-border) !important;
    border-radius: 8px !important;
}

.proxy-stat-badge.http,
.proxy-stat-badge.socks,
body.dark-mode .proxy-stat-badge.http,
body.dark-mode .proxy-stat-badge.socks {
    background: var(--ts-blue-soft) !important;
    color: var(--ts-blue) !important;
    border-color: #bfdbfe !important;
}

.proxies-table,
body.dark-mode .proxies-table {
    border-spacing: 0 !important;
    margin-top: 0 !important;
}

.proxies-table th,
body.dark-mode .proxies-table th {
    background: #f8fafc !important;
    color: #334155 !important;
    border-bottom: 1px solid var(--ts-border) !important;
    padding: 11px 14px !important;
    letter-spacing: 0 !important;
    font-size: 12px !important;
    text-transform: none !important;
}

.proxies-table td,
body.dark-mode .proxies-table td {
    background: #ffffff !important;
    color: var(--ts-text) !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--ts-border) !important;
    padding: 12px 14px !important;
    border-radius: 0 !important;
}

.proxies-table td:first-child,
.proxies-table td:last-child,
body.dark-mode .proxies-table td:first-child,
body.dark-mode .proxies-table td:last-child {
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
}

.proxies-table tbody tr:hover td,
body.dark-mode .proxies-table tbody tr:hover td {
    background: #f8fafc !important;
}

.proxies-table tr.active td,
body.dark-mode .proxies-table tr.active td {
    background: #eff6ff !important;
    border-bottom-color: #bfdbfe !important;
}

.status-badge.compact.online,
body.dark-mode .status-badge.compact.online {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border: 1px solid #bbf7d0 !important;
}

.status-badge.compact.offline,
body.dark-mode .status-badge.compact.offline {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
}

@media (max-width: 768px) {
    .sidebar,
    body.dark-mode .sidebar {
        border-radius: 0 12px 12px 0 !important;
        box-shadow: 20px 0 44px rgba(15, 23, 42, 0.16) !important;
    }
}

/* --- TSProxy-like Dark Theme Toggle Fix --- */
body.dark-mode {
    --ts-bg: #0f172a;
    --ts-panel: #111827;
    --ts-panel-soft: #1e293b;
    --ts-border: rgba(148, 163, 184, 0.18);
    --ts-text: #e5e7eb;
    --ts-muted: #94a3b8;
    --ts-blue: #60a5fa;
    --ts-blue-soft: rgba(96, 165, 250, 0.14);
    --ts-sidebar: #0b1220;
    --bg-light: #0f172a !important;
    --card-bg: #111827 !important;
    --glass-border: rgba(148, 163, 184, 0.18) !important;
    --text-main: #e5e7eb !important;
    --text-muted: #94a3b8 !important;
    background: #0f172a !important;
    color: #e5e7eb !important;
}

body.dark-mode .sidebar {
    background: #0b1220 !important;
    color: #e5e7eb !important;
    border-right-color: rgba(148, 163, 184, 0.16) !important;
}

body.dark-mode .top-bar,
body.dark-mode .glass,
body.dark-mode .table-area,
body.dark-mode .stat-card,
body.dark-mode .user-card,
body.dark-mode .proxy-list-header,
body.dark-mode .table-header,
body.dark-mode .proxies-table td {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

body.dark-mode .proxies-table th,
body.dark-mode .proxies-table.compact-table thead th {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

body.dark-mode .proxies-table tbody tr:hover td {
    background: #172033 !important;
}

body.dark-mode .proxies-table tr.active td {
    background: rgba(96, 165, 250, 0.12) !important;
    border-bottom-color: rgba(96, 165, 250, 0.24) !important;
}

body.dark-mode .nav-item,
body.dark-mode .nav-item i {
    color: #cbd5e1 !important;
}

body.dark-mode .nav-item:hover {
    background: rgba(96, 165, 250, 0.10) !important;
    color: #f8fafc !important;
}

body.dark-mode .nav-item.active {
    background: rgba(96, 165, 250, 0.16) !important;
    color: #60a5fa !important;
}

body.dark-mode .nav-item.active i {
    color: #60a5fa !important;
}

body.dark-mode .logo,
body.dark-mode .user-info span,
body.dark-mode .proxy-list-title {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

body.dark-mode .logo i,
body.dark-mode .user-info small {
    color: #60a5fa !important;
}

body.dark-mode .actions-group .btn,
body.dark-mode .header-actions .btn,
body.dark-mode .proxy-stat-badge {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

body.dark-mode .actions-group .btn:hover,
body.dark-mode .header-actions .btn:hover {
    background: #1e293b !important;
}

body.dark-mode body.dark-mode .btn-icon[onclick="toggleDarkMode()"] {
    background: #1e293b !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.18) !important;
}

body:not(.dark-mode) .btn-icon[onclick="toggleDarkMode()"] {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #e5e7eb !important;
}

/* --- PPPoE Mobile Uptime Visibility --- */
@media (max-width: 768px) {
    #pppoe-section .compact-table th:nth-child(6),
    #pppoe-section .compact-table td:nth-child(6) {
        display: table-cell !important;
        min-width: 82px !important;
        width: 82px !important;
        text-align: center !important;
        white-space: normal !important;
    }

    #pppoe-section .compact-table td:nth-child(6) span[id^="uptime-pppoe-"] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        max-width: 78px !important;
        padding: 2px 6px !important;
        border: 1px solid rgba(var(--primary-rgb), 0.18) !important;
        border-radius: 999px !important;
        background: rgba(var(--primary-rgb), 0.08) !important;
        color: var(--primary) !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 480px) {
    #pppoe-section .compact-table th:nth-child(6),
    #pppoe-section .compact-table td:nth-child(6) {
        min-width: 72px !important;
        width: 72px !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    #pppoe-section .compact-table td:nth-child(6) span[id^="uptime-pppoe-"] {
        max-width: 68px !important;
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
}


/* Compact API & Domain NAT layout */
.api-nat-header {
    align-items: flex-start;
    gap: 16px;
}

.section-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.api-nat-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.api-nat-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.4fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.api-nat-card,
.api-url-card {
    padding: 18px;
    border-radius: 12px !important;
}

.api-card-title,
.api-table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.api-card-title h3,
.api-table-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--text-main);
}

.api-card-title span,
.api-table-header span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.api-card-title-row {
    align-items: center;
}

.api-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.api-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    color: var(--text-main);
}

.api-info-grid > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
}

.api-info-grid > div > div,
.api-whitelist-toggle {
    padding: 10px 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.045);
}

.api-whitelist-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
}

.api-whitelist-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(130px, 0.8fr) auto;
    gap: 10px;
    margin-bottom: 12px;
}

.api-whitelist-form .form-control {
    background: var(--bg-card);
    min-width: 0;
}

.api-whitelist-table {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 8px;
}

.api-url-card {
    overflow: hidden;
}

.api-url-table code {
    font-size: 12px !important;
    word-break: break-all;
}

@media (max-width: 1100px) {
    .api-nat-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .api-nat-header,
    .api-card-title-row,
    .api-table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .api-nat-actions,
    .api-card-actions {
        justify-content: flex-start;
    }

    .api-whitelist-form {
        grid-template-columns: 1fr;
    }

    .api-nat-card,
    .api-url-card {
        padding: 14px;
    }
}


/* PPPoE Proxy control toolbar refresh */
#pppoe-section .pppoe-page-header {
    align-items: flex-start;
}

#pppoe-section .pppoe-control-header {
    padding: 14px 18px !important;
    gap: 16px !important;
    background: var(--bg-card) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

body.dark-mode #pppoe-section .pppoe-control-header {
    background: #111827 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
}

.pppoe-title-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 180px;
}

.pppoe-title-block h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.pppoe-title-block span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.pppoe-bulk-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-left: auto;
}

.pppoe-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.035);
}

body.dark-mode .pppoe-tool-group {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.035);
}

.pppoe-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pppoe-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 16px;
}

.pppoe-quick-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

body.dark-mode .pppoe-quick-options label {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.18);
}

.pppoe-quick-options input {
    width: 16px;
    height: 16px;
}

.pppoe-quick-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.06);
    font-size: 12px;
}

.quick-result-list {
    margin-top: 8px;
    display: grid;
    gap: 4px;
    max-height: 220px;
    overflow: auto;
}

.quick-ok {
    color: var(--success);
}

.quick-fail {
    color: var(--danger);
}

.pppoe-dns-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 130px;
}

.pppoe-dns-select,
.pppoe-dns-custom {
    width: 100%;
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 11px;
    padding: 4px 8px;
}

.pppoe-dns-custom {
    font-family: 'JetBrains Mono', monospace;
}

.btn-bulk {
    min-height: 32px;
    padding: 7px 10px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    gap: 6px !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.btn-bulk i {
    font-size: 11px !important;
}

.btn-bulk.btn-neutral {
    background: var(--bg-light) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .btn-bulk.btn-neutral {
    background: #0f172a !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

.btn-bulk.btn-create {
    background: #2563eb !important;
    color: #ffffff !important;
}

.btn-bulk.btn-copy {
    background: #eef2ff !important;
    color: #3730a3 !important;
    border-color: #c7d2fe !important;
}

body.dark-mode .btn-bulk.btn-copy {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #c7d2fe !important;
    border-color: rgba(129, 140, 248, 0.26) !important;
}

.btn-bulk.btn-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

body.dark-mode .btn-bulk.btn-warning {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.26) !important;
}

.btn-bulk.btn-delete {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

body.dark-mode .btn-bulk.btn-delete {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.26) !important;
}

.btn-bulk:hover {
    transform: translateY(-1px);
    filter: none !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12) !important;
}

@media (max-width: 900px) {
    #pppoe-section .pppoe-control-header {
        align-items: stretch !important;
        flex-direction: column;
    }

    .pppoe-bulk-toolbar {
        justify-content: flex-start !important;
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .pppoe-quick-grid {
        grid-template-columns: 1fr;
    }

    .pppoe-bulk-toolbar {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px !important;
    }

    .pppoe-tool-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .pppoe-tool-group:first-child {
        grid-template-columns: 1fr;
    }

    .btn-bulk {
        justify-content: center;
        width: 100%;
    }
}


/* Unified dashboard visual refresh */
:root {
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8fafc;
    --ui-border: #e2e8f0;
    --ui-border-soft: #eef2f7;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --ui-blue: #2563eb;
    --ui-blue-soft: #eff6ff;
    --ui-green: #059669;
    --ui-green-soft: #ecfdf5;
    --ui-red: #dc2626;
    --ui-red-soft: #fef2f2;
    --ui-amber: #d97706;
    --ui-amber-soft: #fffbeb;
    --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --ui-shadow-md: 0 10px 26px rgba(15, 23, 42, 0.08);
}

body.dark-mode {
    --ui-surface: #111827;
    --ui-surface-soft: #0f172a;
    --ui-border: rgba(148, 163, 184, 0.18);
    --ui-border-soft: rgba(148, 163, 184, 0.12);
    --ui-text: #e5e7eb;
    --ui-muted: #94a3b8;
    --ui-blue-soft: rgba(37, 99, 235, 0.16);
    --ui-green-soft: rgba(5, 150, 105, 0.14);
    --ui-red-soft: rgba(220, 38, 38, 0.14);
    --ui-amber-soft: rgba(217, 119, 6, 0.14);
    --ui-shadow-sm: none;
    --ui-shadow-md: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.content-wrapper {
    background: var(--bg-main);
}

.content-section > .section-header {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.content-section > .section-header h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--ui-text);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0;
}

.content-section > .section-header h2 i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--ui-blue-soft);
    color: var(--ui-blue);
    font-size: 14px;
}

.header-actions,
.actions-bar {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px !important;
    flex-wrap: wrap;
}

.actions-bar.glass {
    padding: 12px !important;
    border-radius: 12px !important;
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: var(--ui-shadow-sm) !important;
}

.glass,
.table-area.glass,
.table-container.glass,
.pagination-container.glass,
.stat-card.glass,
.modal-content.glass,
.premium-modal {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: var(--ui-shadow-sm) !important;
    backdrop-filter: none !important;
}

.table-area.glass,
.table-container.glass,
.api-nat-card,
.api-url-card,
.stat-card.glass,
.pagination-container.glass {
    border-radius: 12px !important;
}

.stat-card.glass {
    min-height: 104px;
    padding: 18px !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat-card.glass:hover,
.table-area.glass:hover,
.api-nat-card:hover,
.api-url-card:hover {
    border-color: rgba(var(--primary-rgb), 0.22) !important;
    box-shadow: var(--ui-shadow-md) !important;
}

.stat-card .stat-label,
.stat-label {
    color: var(--ui-muted) !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.stat-card .stat-value,
.stat-value {
    color: var(--ui-text) !important;
    font-weight: 800 !important;
}

.stat-icon {
    border-radius: 10px !important;
    box-shadow: none !important;
}

.table-header {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 14px 18px !important;
    box-shadow: none !important;
}

.table-header h3 {
    color: var(--ui-text) !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

.table-header h3 i {
    color: var(--ui-blue);
}

.premium-table,
.proxies-table,
.compact-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.premium-table thead th,
.proxies-table thead th,
.compact-table thead th {
    background: var(--ui-surface-soft) !important;
    color: var(--ui-muted) !important;
    border-bottom: 1px solid var(--ui-border) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
}

.premium-table tbody td,
.proxies-table tbody td,
.compact-table tbody td {
    border-bottom: 1px solid var(--ui-border-soft) !important;
    color: var(--ui-text);
}

.premium-table tbody tr,
.proxies-table tbody tr,
.compact-table tbody tr {
    transition: background 0.14s ease;
}

.premium-table tbody tr:hover,
.proxies-table tbody tr:hover,
.compact-table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.035) !important;
}

.btn {
    border-radius: 8px !important;
    min-height: 34px;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease !important;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10) !important;
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary,
.btn-glow.btn-primary {
    background: var(--ui-blue) !important;
    border: 1px solid var(--ui-blue) !important;
    color: #ffffff !important;
}

.btn-secondary,
.btn-glass,
button.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-bulk):not(.btn-icon):not(.btn-tiny):not(.btn-action):not(.btn-mikrotik) {
    background: var(--ui-surface-soft) !important;
    border: 1px solid var(--ui-border) !important;
    color: var(--ui-text) !important;
}

.btn-success {
    background: var(--ui-green-soft) !important;
    border: 1px solid rgba(5, 150, 105, 0.22) !important;
    color: var(--ui-green) !important;
}

.btn-danger {
    background: var(--ui-red-soft) !important;
    border: 1px solid rgba(220, 38, 38, 0.22) !important;
    color: var(--ui-red) !important;
}

.btn-warning {
    background: var(--ui-amber-soft) !important;
    border: 1px solid rgba(217, 119, 6, 0.22) !important;
    color: var(--ui-amber) !important;
}

.btn-icon,
.btn-circle,
.btn-tiny,
.btn-action {
    border-radius: 8px !important;
    box-shadow: none !important;
}

.badge {
    border-radius: 999px !important;
    border: 1px solid var(--ui-border) !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

.badge-info,
.badge-all,
.badge-ikev2 {
    background: var(--ui-blue-soft) !important;
    color: var(--ui-blue) !important;
    border-color: rgba(37, 99, 235, 0.18) !important;
}

.badge-warning {
    background: var(--ui-amber-soft) !important;
    color: var(--ui-amber) !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.pagination-container.glass {
    margin-top: 12px;
    padding: 12px 16px !important;
    color: var(--ui-muted);
}

.page-size-selector select,
.form-control,
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    border-radius: 8px !important;
    border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10) !important;
    outline: none !important;
}

.modal-content,
.premium-modal {
    border-radius: 14px !important;
}

.modal-header {
    border-bottom: 1px solid var(--ui-border) !important;
}

.modal-footer {
    border-top: 1px solid var(--ui-border) !important;
}

.sidebar .nav-item {
    border-radius: 8px !important;
}

.sidebar .nav-item.active {
    background: var(--ui-blue-soft) !important;
    color: var(--ui-blue) !important;
    border: 1px solid rgba(37, 99, 235, 0.18) !important;
}

body.dark-mode .sidebar .nav-item.active {
    background: rgba(37, 99, 235, 0.18) !important;
    color: #93c5fd !important;
}

.user-card {
    border-radius: 12px !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
}

#fw-cleanup-log {
    border-radius: 10px !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

#wireguard-section .header-actions,
#proxies .header-actions,
#firewall-section .header-actions,
#users-section .header-actions,
#dashboard .header-actions {
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.035);
}

#wireguard-section .header-actions .btn,
#proxies .header-actions .btn,
#firewall-section .header-actions .btn,
#users-section .header-actions .btn,
#dashboard .header-actions .btn {
    min-height: 32px;
    padding: 7px 10px !important;
}

@media (max-width: 900px) {
    .content-section > .section-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .header-actions,
    #wireguard-section .header-actions,
    #proxies .header-actions,
    #firewall-section .header-actions,
    #users-section .header-actions,
    #dashboard .header-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .content-section > .section-header h2 {
        font-size: 18px;
    }

    .header-actions .btn,
    .actions-bar .btn {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
        min-width: 0;
    }

    .stats-grid {
        gap: 10px !important;
    }

    .stat-card.glass {
        min-height: 88px;
        padding: 14px !important;
    }

    .table-header {
        padding: 12px 14px !important;
    }
}


/* Compact proxy list controls */
#proxies .section-header h2::before {
    content: "\f542";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--ui-blue-soft);
    color: var(--ui-blue);
    font-size: 14px;
}

#proxies .section-header h2 {
    gap: 9px;
}

.proxy-header-badges {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
}

.proxy-control-bar.actions-bar.glass {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    flex-wrap: wrap;
    padding: 10px !important;
    margin-bottom: 14px;
}

.proxy-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    background: rgba(var(--primary-rgb), 0.035);
}

body.dark-mode .proxy-tool-group {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.035);
}

.proxy-tool-group.danger-zone {
    background: rgba(220, 38, 38, 0.035);
    border-color: rgba(220, 38, 38, 0.12);
}

.tool-group-label {
    padding: 0 7px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.proxy-control-bar .btn-action {
    min-height: 31px !important;
    padding: 7px 9px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    line-height: 1 !important;
    gap: 6px !important;
    white-space: nowrap;
}

.proxy-control-bar .btn-action i {
    font-size: 11px;
}

.proxy-control-bar .btn-action.btn-soft {
    background: var(--ui-surface-soft) !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

body.dark-mode .proxy-control-bar .btn-action.btn-soft {
    background: #0f172a !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

.proxy-control-bar .btn-action.btn-primary {
    background: var(--ui-blue) !important;
    color: #fff !important;
    border-color: var(--ui-blue) !important;
}

.proxy-control-bar .btn-action.btn-danger {
    background: var(--ui-red-soft) !important;
    color: var(--ui-red) !important;
    border-color: rgba(220, 38, 38, 0.22) !important;
}

.proxy-control-bar .btn-action:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.proxy-action-dropdown {
    position: relative;
    display: inline-flex;
    min-width: 0;
}

.proxy-dropdown-trigger .dropdown-chevron {
    font-size: 9px !important;
    opacity: 0.65;
}

.proxy-action-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 80;
    display: none;
    min-width: 168px;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.proxy-action-menu.show {
    display: grid;
    gap: 3px;
}

.proxy-action-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.proxy-action-menu button:hover {
    background: var(--ui-surface-soft);
}

.proxy-action-menu button.danger {
    color: var(--ui-red);
}

.proxy-action-menu button.danger:hover {
    background: var(--ui-red-soft);
}

body.dark-mode .proxy-action-menu {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.proxy-list-header {
    padding: 14px 18px !important;
    border-bottom: 1px solid var(--ui-border) !important;
    background: var(--ui-surface) !important;
}

.proxy-list-title {
    color: var(--ui-text) !important;
    font-weight: 800 !important;
}

.proxy-stat-badge {
    border-radius: 999px !important;
    border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface-soft) !important;
    box-shadow: none !important;
}

.proxy-stat-badge.http {
    background: var(--ui-blue-soft) !important;
    color: var(--ui-blue) !important;
    border-color: rgba(37, 99, 235, 0.18) !important;
}

.proxy-stat-badge.socks {
    background: rgba(124, 58, 237, 0.10) !important;
    color: #7c3aed !important;
    border-color: rgba(124, 58, 237, 0.18) !important;
}

.row-actions.compact {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px !important;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--ui-border-soft);
    background: var(--ui-surface-soft);
}

.row-actions.compact .btn-icon {
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-muted) !important;
}

.row-actions.compact .btn-icon.btn-success {
    background: var(--ui-green-soft) !important;
    color: var(--ui-green) !important;
    border-color: rgba(5, 150, 105, 0.2) !important;
}

.row-actions.compact .btn-icon.btn-secondary {
    background: var(--ui-amber-soft) !important;
    color: var(--ui-amber) !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.row-actions.compact .btn-icon.btn-danger {
    background: var(--ui-red-soft) !important;
    color: var(--ui-red) !important;
    border-color: rgba(220, 38, 38, 0.22) !important;
}

.row-actions.compact .btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10) !important;
}

@media (max-width: 1100px) {
    .proxy-control-bar.actions-bar.glass {
        align-items: stretch;
    }

    .proxy-tool-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .proxy-control-bar.actions-bar.glass {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .proxy-tool-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .proxy-tool-group .tool-group-label {
        grid-column: 1 / -1;
        padding: 2px 4px 0;
    }

    .proxy-control-bar .btn-action {
        justify-content: center;
        width: 100%;
    }

    .proxy-action-dropdown {
        width: 100%;
    }

    .proxy-action-menu {
        left: 0;
        right: 0;
        min-width: 100%;
    }

    .proxy-list-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
}


/* Compact WireGuard controls */
.wireguard-header-badges {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wireguard-header-api {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(680px, 58vw);
    min-height: 34px;
    padding: 6px 8px 6px 10px;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.055);
    color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.08);
}

.wireguard-header-api.is-empty {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
}

.wireguard-header-api code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    background: transparent;
}

.wireguard-header-api button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    flex: 0 0 auto;
}

.wireguard-header-api button:hover {
    background: var(--primary-color);
    color: #fff;
}

body.dark-mode .wireguard-header-api {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: none;
}

body.dark-mode .wireguard-header-api button {
    background: rgba(15, 23, 42, 0.88);
}

.wireguard-control-bar.actions-bar.glass {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    flex-wrap: wrap;
    padding: 10px !important;
    margin-bottom: 14px;
}

.wireguard-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    background: rgba(var(--primary-rgb), 0.035);
}

body.dark-mode .wireguard-tool-group {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.035);
}

.wireguard-control-bar .btn-action {
    min-height: 31px !important;
    padding: 7px 9px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    line-height: 1 !important;
    gap: 6px !important;
    white-space: nowrap;
}

.wireguard-control-bar .btn-action i {
    font-size: 11px;
}

#wireguard-section #wireguardTableBody td:nth-child(7) {
    text-align: center !important;
}

#wireguard-section #wireguardTableBody td:nth-child(7) > .btn-circle[onclick*="openDeviceSelector"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 6px auto 0 !important;
    font-size: 9px !important;
}

#wireguard-section .wireguard-device-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    margin: 2px;
    padding: 3px 7px;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 7px;
    background: rgba(var(--primary-rgb), 0.07);
    color: var(--primary);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

#wireguard-section .wireguard-device-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    padding: 0;
}

#wireguard-section .wireguard-device-empty {
    display: inline-flex;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

#wireguard-section .wireguard-rotate-api {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 118px;
    margin: 2px auto 0;
    padding: 3px 4px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: var(--ui-surface-soft);
    color: var(--ui-muted);
}

#wireguard-section .wireguard-rotate-api code {
    min-width: 0;
    max-width: 70px;
    overflow: hidden;
    color: var(--primary);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wireguard-section .wireguard-rotate-api button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    height: 20px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: var(--ui-surface);
    color: var(--primary);
    cursor: pointer;
}

#wireguard-section .wireguard-vpn-picker {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: var(--ui-surface-soft);
}

#wireguard-section .wireguard-vpn-picker select {
    width: 84px;
    height: 26px;
    border: 0;
    border-radius: 7px;
    padding: 0 5px;
    background: transparent;
    color: var(--ui-text);
    font-size: 10px;
    font-weight: 800;
    outline: none;
}

body.dark-mode #wireguard-section .wireguard-vpn-picker {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.18);
}

#wireguard-section #wireguardTableBody tr {
    height: 64px;
}

#wireguard-section #wireguardTableBody td {
    padding: 8px 6px !important;
    vertical-align: middle;
}

#wireguard-section .wireguard-endpoint-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 150px;
    max-width: 190px;
    line-height: 1.15;
}

#wireguard-section .wireguard-endpoint-text {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wireguard-section .wireguard-device-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 128px;
    max-width: 170px;
}

#wireguard-section .wireguard-device-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    max-width: 168px;
    padding: 2px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wireguard-section .wireguard-device-select {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin-top: 0 !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    box-shadow: none !important;
}

body.dark-mode #wireguard-section .wireguard-device-chip {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(147, 197, 253, 0.28);
}

#wireguard-section .wireguard-uptime-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 58px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

#wireguard-section .wireguard-uptime-chip.is-active {
    color: #047857;
    background: #d1fae5;
    border: 1px solid #86efac;
}

#wireguard-section .wireguard-uptime-chip.is-offline {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

#wireguard-section .wireguard-location-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 78px;
    max-width: 130px;
    line-height: 1.15;
}

#wireguard-section .wireguard-location-cell strong {
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wireguard-section .wireguard-location-cell small {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode #wireguard-section .wireguard-uptime-chip.is-active {
    color: #86efac;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(74, 222, 128, 0.28);
}

body.dark-mode #wireguard-section .wireguard-uptime-chip.is-offline {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.2);
}

.wireguard-control-bar .btn-action.btn-soft {
    background: var(--ui-surface-soft) !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

body.dark-mode .wireguard-control-bar .btn-action.btn-soft {
    background: #0f172a !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

.wireguard-control-bar .btn-action.btn-primary {
    background: var(--ui-blue) !important;
    color: #fff !important;
    border-color: var(--ui-blue) !important;
}

.wireguard-control-bar .btn-action.btn-danger {
    background: var(--ui-red-soft) !important;
    color: var(--ui-red) !important;
    border-color: rgba(220, 38, 38, 0.22) !important;
}

.wg-actions {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 3px !important;
    padding: 2px;
    border-radius: 10px;
    border: 1px solid var(--ui-border-soft);
    background: var(--ui-surface-soft);
    flex-wrap: nowrap;
}

.wg-actions .btn-circle {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 7px !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
    font-size: 10px !important;
    background: var(--ui-surface) !important;
    color: var(--ui-muted) !important;
}

.wg-actions .btn-circle::after {
    display: none !important;
}

.wg-actions .btn-circle:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10) !important;
}

.wg-actions .btn-circle.btn-primary {
    background: var(--ui-green-soft) !important;
    color: var(--ui-green) !important;
    border-color: rgba(5, 150, 105, 0.2) !important;
}

.wg-actions .btn-circle.btn-danger {
    background: var(--ui-red-soft) !important;
    color: var(--ui-red) !important;
    border-color: rgba(220, 38, 38, 0.22) !important;
}

.wg-actions .btn-circle.btn-warning {
    background: var(--ui-amber-soft) !important;
    color: var(--ui-amber) !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.wg-actions .btn-circle.btn-edit,
.wg-actions .btn-circle.btn-info,
.wg-actions .btn-circle.btn-secondary {
    background: var(--ui-surface) !important;
    color: var(--ui-muted) !important;
    border-color: var(--ui-border) !important;
}

#wireguard-section .table-header {
    padding: 14px 18px !important;
}

@media (max-width: 900px) {
    .wireguard-control-bar.actions-bar.glass {
        align-items: stretch;
    }

    .wireguard-tool-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .wireguard-control-bar.actions-bar.glass {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .wireguard-tool-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .wireguard-tool-group .tool-group-label {
        grid-column: 1 / -1;
        padding: 2px 4px 0;
    }

    .wireguard-control-bar .btn-action {
        justify-content: center;
        width: 100%;
    }
}


/* Contextual proxy search */
.top-bar > .top-search {
    width: clamp(220px, 28vw, 360px) !important;
    height: 42px;
    padding: 0 8px 0 14px !important;
    gap: 10px !important;
    border-radius: 14px !important;
    background: var(--ui-surface-soft) !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
    transition: width 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    flex-shrink: 0;
}

.top-bar > .top-search:focus-within {
    width: clamp(260px, 34vw, 430px) !important;
    background: var(--ui-surface) !important;
    border-color: rgba(37, 99, 235, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08) !important;
}

.top-bar > .top-search > i {
    color: var(--ui-muted);
    font-size: 15px;
    flex: 0 0 auto;
}

.top-bar > .top-search input {
    height: 100%;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ui-text) !important;
    font-size: 14px !important;
    font-weight: 600;
    min-width: 0;
}

.top-bar > .top-search input::placeholder {
    color: var(--ui-muted);
    font-weight: 500;
}

.search-clear-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border: 0;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--ui-border-soft);
    color: var(--ui-muted);
    cursor: pointer;
}

.top-search.has-value .search-clear-btn {
    display: inline-flex;
}

.search-clear-btn:hover {
    background: var(--ui-red-soft);
    color: var(--ui-red);
}

body.dark-mode .top-bar > .top-search {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

body.dark-mode .top-bar > .top-search:focus-within {
    background: #111827 !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
}

@media (max-width: 991px) {
    .top-bar > .top-search {
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
        max-width: none;
        height: 40px;
        border-radius: 12px !important;
    }

    .top-bar > .top-search:focus-within {
        width: auto !important;
    }
}

@media (max-width: 480px) {
    .top-bar > .top-search {
        height: 36px;
        padding-left: 12px !important;
        gap: 8px !important;
    }

    .top-bar > .top-search input {
        font-size: 13px !important;
    }

    .search-clear-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }
}


/* Polished top status bar */
.top-bar {
    height: 64px !important;
    padding: 0 26px !important;
    gap: 14px !important;
    background: var(--ui-surface) !important;
    border-bottom: 1px solid var(--ui-border) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

.header-stats {
    flex: 1 1 auto !important;
    display: flex;
    justify-content: center !important;
    align-items: center;
    gap: 8px !important;
    margin: 0 10px !important;
    min-width: 0;
}

.h-stat {
    height: 38px;
    min-width: 86px;
    padding: 0 12px !important;
    gap: 9px !important;
    border-radius: 11px !important;
    background: var(--ui-surface-soft) !important;
    border: 1px solid var(--ui-border) !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.h-stat:hover {
    transform: translateY(-1px) !important;
    background: var(--ui-surface) !important;
    border-color: rgba(37, 99, 235, 0.22) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
}

.h-stat i {
    width: 24px !important;
    height: 24px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    flex: 0 0 24px;
}

.h-stat span {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: var(--ui-text) !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
}

.top-bar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex: 0 0 auto;
}

.status-glow,
.server-info-hint,
.router-context-chip,
#mikrotikConnectBtn,
.top-bar-actions > .btn-icon {
    height: 38px !important;
    border-radius: 11px !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
}

.status-glow {
    padding: 0 13px !important;
    gap: 8px !important;
    background: var(--ui-surface-soft) !important;
    color: var(--ui-muted) !important;
    font-size: 12px !important;
}

.status-glow.online {
    background: var(--ui-green-soft) !important;
    border-color: rgba(5, 150, 105, 0.18) !important;
}

.glow-dot {
    width: 9px !important;
    height: 9px !important;
    box-shadow: none !important;
}

.status-glow.online .glow-dot {
    background: var(--ui-green) !important;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12) !important;
    animation: none !important;
}

.status-glow.online .glow-text {
    color: var(--ui-green) !important;
    font-weight: 800 !important;
}


.router-selector-wrap {
    position: relative;
    display: inline-flex;
}

.router-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px !important;
    background: var(--ui-surface-soft) !important;
    color: var(--ui-text) !important;
    width: 200px;
    max-width: 200px;
    cursor: pointer;
    text-align: left;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

.router-context-chip i {
    color: var(--ui-blue);
    font-size: 13px;
}

.router-context-chip > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.05;
}

.router-context-chip span,
.router-context-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.router-context-chip span {
    display: block;
    max-width: 128px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.router-context-chip small {
    display: block;
    max-width: 128px;
    margin-top: 2px;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

.router-context-chip.online {
    border-color: rgba(5, 150, 105, 0.2) !important;
}

.router-context-chip.online i {
    color: var(--ui-green);
}


.router-chevron {
    margin-left: 2px;
    color: var(--ui-muted) !important;
    font-size: 9px !important;
}

.router-selector-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 90;
    display: none;
    width: 265px;
    padding: 8px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.router-selector-menu.show {
    display: block;
}

.router-menu-title {
    padding: 4px 6px 8px;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.router-selector-list {
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.router-menu-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--ui-text);
    text-align: left;
    cursor: pointer;
}

.router-menu-item span {
    font-size: 12px;
    font-weight: 850;
}

.router-menu-item small {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 700;
}

.router-menu-item:hover {
    background: var(--ui-surface-soft);
}

.router-menu-item.active {
    background: var(--ui-blue-soft);
    border-color: rgba(37, 99, 235, 0.18);
}

.router-menu-item.online span::after {
    content: ' Online';
    color: var(--ui-green);
    font-size: 10px;
    font-weight: 850;
}

.router-menu-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.router-menu-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: var(--ui-surface-soft);
    color: var(--ui-text);
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.router-menu-actions button:hover {
    background: var(--ui-blue-soft);
    border-color: rgba(37, 99, 235, 0.18);
}

.router-menu-actions button.danger {
    color: #dc2626;
    background: rgba(254, 226, 226, 0.62);
    border-color: rgba(220, 38, 38, 0.15);
}

body.dark-mode .router-selector-menu {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.server-info-hint {
    padding: 0 13px !important;
    gap: 8px !important;
    background: var(--ui-blue-soft) !important;
    color: var(--ui-blue) !important;
    border-color: rgba(37, 99, 235, 0.18) !important;
    font-size: 13px !important;
    max-width: 280px;
}

.server-info-hint span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.top-bar-actions > .btn-icon {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    background: var(--ui-surface-soft) !important;
    color: var(--ui-text) !important;
}

#mikrotikConnectBtn {
    padding: 0 15px !important;
    gap: 8px !important;
    background: var(--ui-green) !important;
    border-color: var(--ui-green) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

#mikrotikConnectBtn i {
    font-size: 12px;
}

#mobile-menu-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 11px !important;
    background: var(--ui-surface-soft) !important;
    border: 1px solid var(--ui-border) !important;
    color: var(--ui-text) !important;
}

body.dark-mode .top-bar {
    background: var(--ui-surface) !important;
    border-bottom-color: var(--ui-border) !important;
}

body.dark-mode .h-stat,
body.dark-mode .status-glow,
body.dark-mode .router-context-chip,
body.dark-mode .top-bar-actions > .btn-icon,
body.dark-mode #mobile-menu-btn {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

body.dark-mode .server-info-hint {
    background: rgba(37, 99, 235, 0.16) !important;
    border-color: rgba(96, 165, 250, 0.22) !important;
    color: #93c5fd !important;
}

@media (max-width: 1200px) {
    .header-stats {
        justify-content: flex-start !important;
    }

    .h-stat {
        min-width: auto;
    }

    .server-info-hint {
        max-width: 210px;
    }

    .server-info-hint span {
        max-width: 120px;
    }
}

@media (max-width: 991px) {
    .top-bar {
        height: 54px !important;
        padding: 0 10px !important;
    }

    .top-bar-actions {
        gap: 6px !important;
        flex: 0 0 auto !important;
    }

    .server-info-hint,
    .status-glow {
        display: none !important;
    }

    #mikrotikConnectBtn {
        width: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .top-bar {
        height: 48px !important;
        gap: 8px !important;
        padding: 0 8px !important;
    }

    #mobile-menu-btn,
    #mikrotikConnectBtn,
    .top-bar-actions > .btn-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 10px !important;
    }
}


/* MikroTik button Vietnamese font fix */
#mikrotikConnectBtn {
    min-width: 132px !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

#mikrotikConnectBtn span {
    display: inline-block;
    white-space: nowrap;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    transform: translateY(0);
}

#mikrotikConnectBtn i {
    line-height: 1 !important;
    flex: 0 0 auto;
}

@media (max-width: 991px) {
    #mikrotikConnectBtn {
        min-width: 38px !important;
    }
}

@media (max-width: 480px) {
    #mikrotikConnectBtn {
        min-width: 36px !important;
    }
}


/* PPPoE download speed column */
.pppoe-speed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--ui-green-soft);
    color: var(--ui-green);
    border: 1px solid rgba(5, 150, 105, 0.18);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 768px) {
    #pppoe-section .compact-table th:nth-child(7),
    #pppoe-section .compact-table td:nth-child(7) {
        min-width: 82px;
        width: 82px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    #pppoe-section .compact-table th:nth-child(7),
    #pppoe-section .compact-table td:nth-child(7) {
        display: none !important;
    }
}


/* Device selector compact buttons */
#deviceSelectorModal .premium-table thead th:last-child,
#deviceSelectorModal .premium-table tbody td:last-child {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    text-align: center !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.device-select-row {
    cursor: pointer;
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.device-select-row.is-selected {
    background: rgba(37, 99, 235, 0.045) !important;
    box-shadow: inset 3px 0 0 var(--ui-blue);
}

.device-select-row:hover {
    background: rgba(37, 99, 235, 0.055) !important;
}

.device-select-action {
    text-align: center;
    vertical-align: middle;
}

.device-select-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 8px;
    border: 1px solid rgba(5, 150, 105, 0.22);
    background: var(--ui-green-soft);
    color: var(--ui-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.device-select-btn i {
    font-size: 11px;
    line-height: 1;
}

.device-select-btn.selected {
    background: var(--ui-blue-soft);
    color: var(--ui-blue);
    border-color: rgba(37, 99, 235, 0.24);
}

.device-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.10);
}

body.dark-mode .device-select-row.is-selected {
    background: rgba(37, 99, 235, 0.12) !important;
}

body.dark-mode .device-select-btn {
    background: rgba(5, 150, 105, 0.14);
    border-color: rgba(5, 150, 105, 0.26);
    color: #6ee7b7;
}

body.dark-mode .device-select-btn.selected {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(96, 165, 250, 0.28);
    color: #93c5fd;
}


/* Full mobile precision pass */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        -webkit-text-size-adjust: 100%;
    }

    .app-layout {
        min-width: 0 !important;
        width: 100% !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .top-bar {
        position: sticky !important;
        top: 0 !important;
        height: 52px !important;
        padding: 0 calc(8px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left)) !important;
        gap: 8px !important;
        z-index: 1500 !important;
    }

    #mobile-menu-btn {
        order: 0 !important;
        display: inline-flex !important;
        flex: 0 0 38px !important;
    }

    .top-bar > .top-search {
        order: 1 !important;
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        height: 38px !important;
    }

    .top-bar-actions {
        order: 2 !important;
        flex: 0 0 auto !important;
        gap: 6px !important;
        min-width: 0 !important;
    }

    .top-bar-actions > .btn-icon,
    #mikrotikConnectBtn,
    #mobile-menu-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
    }

    .top-bar-actions .server-info-hint,
    .top-bar-actions .status-glow,
    .header-stats {
        display: none !important;
    }

    .content-wrapper {
        padding: 12px 10px calc(18px + env(safe-area-inset-bottom)) !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .content-section > .section-header {
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    .content-section > .section-header h2 {
        font-size: 18px !important;
        line-height: 1.2 !important;
        width: 100% !important;
    }

    .section-subtitle {
        font-size: 12px !important;
        line-height: 1.35 !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .stat-card.glass {
        min-height: 84px !important;
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .stat-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }

    .stat-card .stat-label {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .stat-card .stat-value {
        font-size: 20px !important;
        line-height: 1.1 !important;
    }

    .header-actions,
    .actions-bar,
    .proxy-control-bar.actions-bar.glass,
    .wireguard-control-bar.actions-bar.glass,
    .pppoe-bulk-toolbar {
        width: 100% !important;
        align-items: stretch !important;
    }

    .proxy-control-bar.actions-bar.glass,
    .wireguard-control-bar.actions-bar.glass {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 8px !important;
        border-radius: 10px !important;
    }

    .proxy-tool-group,
    .wireguard-tool-group,
    .pppoe-tool-group {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        padding: 6px !important;
        border-radius: 10px !important;
    }

    .proxy-tool-group .tool-group-label,
    .wireguard-tool-group .tool-group-label {
        grid-column: 1 / -1 !important;
        padding: 0 2px 2px !important;
        font-size: 10px !important;
    }

    .proxy-control-bar .btn-action,
    .wireguard-control-bar .btn-action,
    .btn-bulk {
        width: 100% !important;
        min-height: 36px !important;
        justify-content: center !important;
        padding: 8px 8px !important;
        font-size: 12px !important;
        line-height: 1 !important;
    }

    .table-area.glass,
    .table-container.glass,
    .api-nat-card,
    .api-url-card,
    .pagination-container.glass {
        border-radius: 10px !important;
    }

    .table-header,
    .proxy-list-header {
        padding: 12px !important;
        border-radius: 10px 10px 0 0 !important;
    }

    .table-container {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #wireguard-section .table-container,
    #pppoe-section .table-container,
    #api-section .table-container,
    #firewall-section .table-container,
    #users-section .table-container {
        overflow-x: auto !important;
        padding-bottom: 4px !important;
    }

    #wireguard-section .proxies-table,
    #pppoe-section .proxies-table,
    #api-section .premium-table,
    #firewall-section .premium-table,
    #users-section .premium-table {
        min-width: 860px !important;
    }

    #pppoe-section .pppoe-control-header {
        position: sticky !important;
        top: 52px !important;
        z-index: 120 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 10px !important;
    }

    #pppoe-section .proxies-table thead th {
        top: 128px !important;
    }

    #pppoe-section .compact-table th:nth-child(5),
    #pppoe-section .compact-table td:nth-child(5),
    #pppoe-section .compact-table th:nth-child(8),
    #pppoe-section .compact-table td:nth-child(8) {
        display: none !important;
    }

    #pppoe-section .compact-table th:nth-child(6),
    #pppoe-section .compact-table td:nth-child(6),
    #pppoe-section .compact-table th:nth-child(7),
    #pppoe-section .compact-table td:nth-child(7) {
        display: table-cell !important;
        min-width: 78px !important;
        width: 78px !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    #pppoe-section .compact-table td:nth-child(6) span[id^="uptime-pppoe-"],
    #pppoe-section .compact-table td:nth-child(7) .pppoe-speed-badge {
        max-width: 74px !important;
        font-size: 9px !important;
        padding: 2px 5px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .pagination-container.glass {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    .pagination-controls {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .page-size-selector,
    .page-nav {
        width: 100% !important;
        justify-content: center !important;
    }

    .modal {
        padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)) !important;
        align-items: flex-start !important;
    }

    .modal-content,
    .premium-modal {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
        padding: 14px !important;
    }

    .modal-header,
    .modal-footer {
        gap: 10px !important;
    }

    .modal-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .modal-footer .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    #deviceSelectorModal .modal-content {
        padding: 12px !important;
    }

    #deviceSelectorModal .table-container {
        max-height: calc(100dvh - 230px) !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 480px) {
    .top-bar {
        height: 48px !important;
        gap: 6px !important;
    }

    .top-bar > .top-search {
        height: 36px !important;
        border-radius: 10px !important;
    }

    .top-bar > .top-search input {
        font-size: 13px !important;
    }

    #mobile-menu-btn,
    #mikrotikConnectBtn,
    .top-bar-actions > .btn-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    .content-wrapper {
        padding: 10px 8px calc(16px + env(safe-area-inset-bottom)) !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card.glass {
        min-height: 74px !important;
        display: flex !important;
        align-items: center !important;
    }

    .proxy-tool-group,
    .wireguard-tool-group,
    .pppoe-tool-group {
        grid-template-columns: 1fr !important;
    }

    .proxy-tool-group .tool-group-label,
    .wireguard-tool-group .tool-group-label {
        grid-column: 1 !important;
    }

    #proxies .proxies-table td:not(:first-child):not(:nth-child(2)):not(:last-child) {
        grid-template-columns: 86px minmax(0, 1fr) !important;
        column-gap: 6px !important;
    }

    #proxies .proxies-table tbody tr {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    #proxies .row-actions.compact .btn-icon {
        height: 34px !important;
        min-height: 34px !important;
    }

    #pppoe-section .compact-table th:nth-child(6),
    #pppoe-section .compact-table td:nth-child(6),
    #pppoe-section .compact-table th:nth-child(7),
    #pppoe-section .compact-table td:nth-child(7) {
        display: table-cell !important;
        min-width: 70px !important;
        width: 70px !important;
    }

    #wireguard-section .proxies-table,
    #pppoe-section .proxies-table,
    #api-section .premium-table,
    #firewall-section .premium-table,
    #users-section .premium-table {
        min-width: 760px !important;
    }

    .modal-footer {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 380px) {
    .content-section > .section-header h2 {
        font-size: 16px !important;
    }

    #proxies .proxies-table td:not(:first-child):not(:nth-child(2)):not(:last-child) {
        grid-template-columns: 78px minmax(0, 1fr) !important;
    }

    .proxy-stat-badge {
        font-size: 10px !important;
        padding: 5px 6px !important;
    }
}


/* PPPoE mobile table header alignment */
@media (max-width: 768px) {
    #pppoe-section .compact-table thead th {
        height: 42px !important;
        min-height: 42px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        line-height: 42px !important;
        white-space: nowrap !important;
    }

    #pppoe-section .compact-table thead th:first-child,
    #pppoe-section .compact-table tbody td:first-child {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #pppoe-section .compact-table thead th:first-child {
        line-height: 1 !important;
    }

    #pppoe-section .compact-table thead th:first-child input[type="checkbox"],
    #pppoe-section .compact-table tbody td:first-child input[type="checkbox"] {
        display: inline-block !important;
        vertical-align: middle !important;
        transform: none !important;
        margin: 0 !important;
        position: static !important;
    }

    #pppoe-section .compact-table thead th:nth-child(2),
    #pppoe-section .compact-table tbody td:nth-child(2) {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
}


/* PPPoE mobile checkbox and number column lock */
@media (max-width: 768px) {
    #pppoe-section .compact-table thead th:nth-child(1),
    #pppoe-section .compact-table tbody td:nth-child(1) {
        display: table-cell !important;
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        padding: 0 !important;
        text-align: center !important;
        vertical-align: middle !important;
        box-sizing: border-box !important;
        position: static !important;
    }

    #pppoe-section .compact-table thead th:nth-child(2),
    #pppoe-section .compact-table tbody td:nth-child(2) {
        display: table-cell !important;
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        padding: 0 !important;
        text-align: center !important;
        vertical-align: middle !important;
        box-sizing: border-box !important;
        position: static !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    #pppoe-section .compact-table thead th:nth-child(2) {
        line-height: 42px !important;
    }

    #pppoe-section .compact-table tbody td:nth-child(2) {
        font-size: 11px !important;
        line-height: 1 !important;
    }

    #pppoe-section .compact-table thead th:nth-child(1) input,
    #pppoe-section .compact-table tbody td:nth-child(1) input {
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 480px) {
    #pppoe-section .compact-table thead th:nth-child(2),
    #pppoe-section .compact-table tbody td:nth-child(2) {
        display: table-cell !important;
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
}


/* Dense proxy list layout */
@media (min-width: 769px) {
    #proxies .table-area.glass {
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    #proxies .proxy-list-header {
        min-height: 50px !important;
        padding: 10px 16px !important;
    }

    #proxies .proxy-list-title {
        font-size: 15px !important;
        gap: 8px !important;
    }

    #proxies .proxy-list-title i {
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: var(--ui-blue-soft);
        color: var(--ui-blue);
        font-size: 13px;
    }

    #proxies .proxy-list-stats {
        gap: 6px !important;
    }

    #proxies .proxy-stat-badge {
        min-height: 28px !important;
        padding: 4px 9px !important;
        font-size: 11px !important;
        gap: 5px !important;
    }

    #proxies .table-container {
        overflow-x: auto !important;
        max-height: calc(100vh - 275px);
    }

    #proxies .proxies-table {
        table-layout: fixed !important;
        min-width: 1280px !important;
        width: 100% !important;
    }

    #proxies .proxies-table thead th {
        height: 38px !important;
        padding: 0 8px !important;
        vertical-align: middle !important;
        font-size: 10px !important;
        white-space: nowrap !important;
    }

    #proxies .proxies-table tbody td {
        height: 54px !important;
        padding: 6px 8px !important;
        vertical-align: middle !important;
        font-size: 11px !important;
    }

    #proxies .proxies-table .col-check,
    #proxies .proxies-table td:nth-child(1) {
        width: 38px !important;
        text-align: center !important;
    }

    #proxies .proxies-table .col-num,
    #proxies .proxies-table td:nth-child(2) {
        width: 42px !important;
        text-align: center !important;
    }

    #proxies .proxies-table .col-proto,
    #proxies .proxies-table td:nth-child(3) { width: 78px !important; }
    #proxies .proxies-table .col-status,
    #proxies .proxies-table td:nth-child(4) { width: 112px !important; }
    #proxies .proxies-table .col-public,
    #proxies .proxies-table td:nth-child(5) { width: 190px !important; }
    #proxies .proxies-table .col-webrtc,
    #proxies .proxies-table td:nth-child(6) { width: 130px !important; }
    #proxies .proxies-table .col-source,
    #proxies .proxies-table td:nth-child(7) { width: 150px !important; }
    #proxies .proxies-table .col-device,
    #proxies .proxies-table td:nth-child(8) { width: 180px !important; }
    #proxies .proxies-table .col-fp,
    #proxies .proxies-table td:nth-child(9) { width: 96px !important; text-align: center !important; }
    #proxies .proxies-table .col-auth,
    #proxies .proxies-table td:nth-child(10) { width: 170px !important; }
    #proxies .proxies-table .col-actions,
    #proxies .proxies-table td:nth-child(11) { width: 132px !important; text-align: center !important; }

    #proxies .type-item.compact {
        min-width: 46px !important;
        padding: 3px 7px !important;
        border-radius: 999px !important;
        font-size: 10px !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    #proxies .status-badge.compact {
        min-width: 82px !important;
        height: 28px !important;
        padding: 3px 8px !important;
        border-radius: 999px !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }

    #proxies .status-badge.compact .dot {
        width: 7px !important;
        height: 7px !important;
        min-width: 7px !important;
    }

    #proxies .col-ip-port > div,
    #proxies .col-host-ip > div,
    #proxies .col-auth > div,
    #proxies .col-device-ip .ip-input-wrapper {
        gap: 2px !important;
    }

    #proxies .col-ip-port > div > div:first-child {
        padding: 3px 8px !important;
        gap: 5px !important;
        max-width: 170px !important;
        overflow: hidden !important;
    }

    #proxies .ip-info,
    #proxies .host-text,
    #proxies .user-text {
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 132px !important;
        display: inline-block !important;
    }

    #proxies .country-info.compact span:last-child {
        max-width: 132px !important;
        font-size: 10px !important;
    }

    #proxies .pass-code {
        display: inline-block !important;
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        padding: 2px 6px !important;
        border-radius: 6px !important;
        background: var(--ui-surface-soft) !important;
    }

    #proxies .col-device-ip span[style*="JetBrains Mono"] {
        max-width: 118px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #proxies .inline-edit-input.compact {
        height: 24px !important;
        min-height: 24px !important;
        padding: 3px 6px !important;
        font-size: 10px !important;
    }

    #proxies .col-device-ip .btn-xs {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        padding: 0 !important;
    }

    #proxies .col-fingerprint .badge {
        max-width: 78px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        padding: 3px 7px !important;
        border-radius: 999px !important;
        font-size: 10px !important;
    }

    #proxies .row-actions.compact {
        gap: 3px !important;
        padding: 3px !important;
        border-radius: 9px !important;
        flex-wrap: nowrap !important;
    }

    #proxies .row-actions.compact .btn-icon {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        border-radius: 7px !important;
    }

    #proxies .row-actions.compact .btn-icon i {
        font-size: 10px !important;
    }
}


/* Converted proxy IP:Port column */
.proxies-table .col-converted { width: 240px; min-width: 240px; }
.converted-port-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: none;
    white-space: nowrap;
}
.converted-port-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}
.converted-port-badge code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: inherit;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
}
.converted-copy-btn {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.14);
}
.converted-copy-btn:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.12);
}
.converted-empty {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}
@media (max-width: 768px) {
    #proxies .proxies-table td:nth-child(8)::before { content: 'IP:Port convert' !important; }
    #proxies .proxies-table td:nth-child(9)::before { content: 'Thi?t b?' !important; }
    #proxies .proxies-table td:nth-child(10)::before { content: 'Fingerprint' !important; }
    #proxies .proxies-table td:nth-child(11)::before { content: 'T?i kho?n' !important; }
}


.system-health-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
}

.system-health-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.system-health-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 850;
    color: var(--ui-text);
}

.system-health-head span {
    display: block;
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 650;
}

.system-health-result {
    min-height: 54px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface-soft);
    padding: 13px;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 700;
}

.system-health-result.loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-container-backup {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface-soft);
}

.manual-container-backup[hidden] {
    display: none !important;
}

.manual-backup-heading,
.manual-backup-heading > div,
.manual-backup-details {
    display: flex;
    align-items: center;
}

.manual-backup-heading {
    justify-content: space-between;
    gap: 12px;
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 800;
}

.manual-backup-heading > div {
    gap: 10px;
}

.manual-backup-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.manual-backup-track {
    height: 10px;
    margin: 12px 0 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--ui-surface);
    box-shadow: inset 2px 2px 5px rgba(15, 23, 42, 0.12);
}

.manual-backup-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    transition: width 0.45s ease;
}

.manual-container-backup.is-running .manual-backup-bar {
    background-size: 30px 30px;
    background-image: linear-gradient(135deg, rgba(255,255,255,.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.2) 50%, rgba(255,255,255,.2) 75%, transparent 75%, transparent), linear-gradient(90deg, #2563eb, #06b6d4);
    animation: manual-backup-stripes 1s linear infinite;
}

.manual-container-backup.is-success .manual-backup-bar { background: #10b981; }
.manual-container-backup.is-failure .manual-backup-bar { background: #ef4444; }

.manual-backup-details {
    justify-content: space-between;
    gap: 12px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
}

.manual-backup-details code {
    max-width: 48%;
    overflow: hidden;
    color: var(--ui-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#manualContainerBackupButton.is-loading i {
    animation: fa-spin 1s linear infinite;
}

@keyframes manual-backup-stripes {
    from { background-position: 0 0, 0 0; }
    to { background-position: 30px 0, 0 0; }
}

@media (max-width: 768px) {
    .manual-backup-details {
        align-items: flex-start;
        flex-direction: column;
    }
    .manual-backup-details code { max-width: 100%; }
}

.health-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.health-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
}

.health-pill.ok {
    color: var(--ui-green);
    background: var(--ui-green-soft);
}

.health-pill.warning {
    color: #b45309;
    background: rgba(254, 243, 199, 0.8);
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.health-grid div {
    min-width: 0;
    padding: 10px;
    border-radius: 9px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
}

.health-grid span {
    display: block;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.health-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--ui-text);
    font-size: 14px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.health-warnings {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    color: #b45309;
}

.health-warnings div {
    display: flex;
    gap: 7px;
    align-items: center;
}

.log-cleanup-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) minmax(210px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.log-cleanup-row label {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface-soft);
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 800;
}

.log-cleanup-row input[type="number"] {
    width: 74px;
    height: 30px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: var(--ui-surface);
    color: var(--ui-text);
    padding: 0 8px;
    font-weight: 850;
}

.log-cleanup-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.log-cleanup-files {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.log-cleanup-files div {
    padding: 10px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: var(--ui-surface);
}

.log-cleanup-files span {
    display: block;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.log-cleanup-files strong {
    display: block;
    margin-top: 4px;
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 850;
}

.rotating-ipv4-panel {
    margin-top: 18px;
}

.rotating-ipv4-grid {
    display: grid;
    grid-template-columns: minmax(160px, 190px) minmax(135px, 150px) minmax(210px, 240px) minmax(360px, 1fr);
    gap: 7px;
    align-items: center;
    margin-top: 14px;
}

.rotating-ipv4-toggle,
.rotating-ipv4-port,
.rotating-ipv4-field,
.rotating-ipv4-endpoint,
.rotating-ipv4-device,
.rotating-ipv4-assignment {
    min-height: 38px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: var(--ui-surface-soft);
    padding: 6px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 850;
}

.rotating-ipv4-toggle input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: var(--primary);
}

.rotating-ipv4-port input,
.rotating-ipv4-field input,
.rotating-ipv4-field select {
    width: 82px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    color: var(--ui-text);
    padding: 0 10px;
    font-weight: 850;
}

.rotating-ipv4-field input,
.rotating-ipv4-field select {
    width: 100%;
    min-width: 0;
}

.rotating-ipv4-mode select {
    cursor: pointer;
}

.rotating-ipv4-endpoint {
    justify-content: flex-start;
    min-width: 0;
}

.rotating-ipv4-device {
    grid-column: 1 / -1;
}

.rotating-ipv4-assignment {
    grid-column: 1 / -1;
}

.rotating-ipv4-device.has-dropdown {
    display: block;
    padding: 0;
    overflow: hidden;
}

.rotating-ipv4-device-dropdown {
    width: 100%;
}

.rotating-ipv4-device-dropdown > summary {
    min-height: 44px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.rotating-ipv4-device-dropdown > summary::-webkit-details-marker {
    display: none;
}

.rotating-ipv4-device-dropdown > summary > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.rotating-ipv4-device-dropdown > summary > span > i {
    color: var(--primary);
}

.rotating-ipv4-device-chevron {
    color: var(--ui-muted);
    transition: transform .2s ease;
}

.rotating-ipv4-device-dropdown[open] .rotating-ipv4-device-chevron {
    transform: rotate(180deg);
}

.rotating-ipv4-device-dropdown-panel {
    padding: 12px;
    border-top: 1px solid var(--ui-border);
    background: var(--ui-surface);
}

.rotating-ipv4-subnet-box {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(99, 102, 241, .22);
    border-radius: 14px;
    background: rgba(99, 102, 241, .055);
}

.rotating-ipv4-subnet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.rotating-ipv4-subnet-head > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 900;
}

.rotating-ipv4-subnet-head > span i { color: var(--primary); }
.rotating-ipv4-subnet-head small { color: var(--ui-muted); font-weight: 750; }

.rotating-ipv4-assigned-subnet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 9px;
}

.rotating-ipv4-assigned-subnet-list:empty { display: none; }

.rotating-ipv4-subnet-chip {
    min-height: 32px;
    padding: 4px 4px 4px 9px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(99, 102, 241, .28);
    border-radius: 999px;
    color: #4f46e5;
    background: rgba(99, 102, 241, .09);
}

.rotating-ipv4-subnet-chip code {
    color: inherit;
    font-size: 12px;
    font-weight: 900;
}

.rotating-ipv4-subnet-chip > span {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.rotating-ipv4-subnet-chip > span small {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 800;
}

.rotating-ipv4-subnet-controls {
    display: grid;
    grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    gap: 9px;
    align-items: end;
}

.rotating-ipv4-subnet-controls label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.rotating-ipv4-subnet-controls label > span {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.rotating-ipv4-device .rotating-ipv4-subnet-controls input {
    width: 100%;
    min-width: 0;
    margin: 0;
}
.rotating-ipv4-subnet-btn {
    width: auto;
    min-width: 132px;
    min-height: 38px;
    height: 38px;
    padding: 0 14px;
    white-space: nowrap;
}

.rotating-ipv4-range-balance {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(16, 185, 129, .22);
    border-radius: 11px;
    background: rgba(16, 185, 129, .07);
    cursor: pointer;
}

.rotating-ipv4-device .rotating-ipv4-range-balance input {
    width: 17px;
    height: 17px;
    min-width: 17px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    padding: 0;
}

.rotating-ipv4-range-balance > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rotating-ipv4-range-balance strong {
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 900;
}

.rotating-ipv4-range-balance small {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 750;
}

.rotating-ipv4-subnet-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
}

body.dark-mode .rotating-ipv4-subnet-box {
    border-color: rgba(129, 140, 248, .28);
    background: rgba(99, 102, 241, .1);
}

body.dark-mode .rotating-ipv4-subnet-chip { color: #a5b4fc; }

.rotating-ipv4-assigned-device-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 11px;
}

.rotating-ipv4-assigned-device-chip {
    min-height: 32px;
    padding: 4px 4px 4px 6px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(16, 185, 129, .28);
    border-radius: 999px;
    background: rgba(16, 185, 129, .08);
    color: #047857;
}

.rotating-ipv4-assigned-device-chip small {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(16, 185, 129, .16);
    font-size: 10px;
    font-weight: 900;
}

.rotating-ipv4-assigned-device-chip code {
    color: inherit;
    font-size: 12px;
    font-weight: 900;
}

.rotating-ipv4-device-remove-btn {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, .1);
    color: #dc2626;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.rotating-ipv4-device-remove-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.06);
}

.rotating-ipv4-device-remove-btn:disabled {
    opacity: .45;
    cursor: wait;
}

.rotating-ipv4-assigned-device-empty {
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 750;
}

.rotating-ipv4-device-controls {
    display: flex;
    align-items: center;
    gap: 9px;
}

.rotating-ipv4-device-controls input {
    margin: 0;
}

body.dark-mode .rotating-ipv4-assigned-device-chip {
    border-color: rgba(52, 211, 153, .3);
    background: rgba(16, 185, 129, .12);
    color: #6ee7b7;
}

.rotating-ipv4-assignment.has-dropdown {
    display: block;
    padding: 0;
    overflow: hidden;
}

.rotating-ipv4-assignment-dropdown {
    width: 100%;
}

.rotating-ipv4-assignment-dropdown > summary {
    min-height: 44px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.rotating-ipv4-assignment-dropdown > summary::-webkit-details-marker { display: none; }

.rotating-ipv4-assignment-dropdown > summary > span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.rotating-ipv4-assignment-dropdown > summary > span > i { color: var(--primary); }

.rotating-ipv4-assignment-dropdown > summary small {
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
}

.rotating-ipv4-assignment-chevron {
    color: var(--ui-muted);
    transition: transform .2s ease;
}

.rotating-ipv4-assignment-dropdown[open] .rotating-ipv4-assignment-chevron { transform: rotate(180deg); }

.rotating-ipv4-assignment-panel {
    padding: 12px;
    border-top: 1px solid var(--ui-border);
    background: var(--ui-surface);
}

.rotating-ipv4-assignment-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.rotating-ipv4-assignment-search {
    min-height: 36px;
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: var(--ui-muted);
    background: var(--ui-surface-soft);
}

.rotating-ipv4-assignment-search input {
    width: 100%;
    min-width: 0;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--ui-text);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
}

.rotating-ipv4-assignment-summary {
    display: grid;
    gap: 9px;
    margin-bottom: 10px;
}

.rotating-ipv4-failover-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(16, 185, 129, .22);
    border-radius: 10px;
    color: #047857;
    background: rgba(16, 185, 129, .07);
    font-size: 11px;
    font-weight: 800;
}

body.dark-mode .rotating-ipv4-failover-note { color: #6ee7b7; }

.rotating-ipv4-assignment-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 8px;
}

.rotating-ipv4-assignment-metrics > span {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface-soft);
}

.rotating-ipv4-assignment-metrics small {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.rotating-ipv4-assignment-metrics strong {
    color: var(--ui-text);
    font-size: 15px;
    font-weight: 950;
}

.rotating-ipv4-assignment-source-list {
    max-height: 82px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: auto;
    padding: 2px;
}

.rotating-ipv4-assignment-source-chip {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    color: var(--ui-text);
    background: var(--ui-surface-soft);
    font-size: 10px;
    font-weight: 800;
}

.rotating-ipv4-assignment-source-chip > i { font-size: 7px; }
.rotating-ipv4-assignment-source-chip.is-online > i { color: #10b981; }
.rotating-ipv4-assignment-source-chip.has-warning > i { color: #f59e0b; }
.rotating-ipv4-assignment-source-chip.is-ejected {
    border-color: rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .07);
}
.rotating-ipv4-assignment-source-chip.is-ejected > i,
.rotating-ipv4-assignment-source-chip.is-ejected strong { color: #dc2626; }
.rotating-ipv4-assignment-source-chip strong { color: var(--primary); font-size: 11px; }

.rotating-ipv4-assignment-table-wrap {
    max-height: 480px;
    overflow: auto;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
}

.rotating-ipv4-assignment-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.rotating-ipv4-assignment-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 9px 10px;
    border-bottom: 1px solid var(--ui-border);
    color: var(--ui-muted);
    background: var(--ui-surface-soft);
    font-size: 10px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
}

.rotating-ipv4-assignment-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--ui-border);
    color: var(--ui-text);
    font-size: 11px;
    font-weight: 750;
    vertical-align: middle;
}

.rotating-ipv4-assignment-table tbody tr:last-child td { border-bottom: 0; }
.rotating-ipv4-assignment-table tbody tr:hover td { background: rgba(99, 102, 241, .045); }

.rotating-ipv4-assignment-device,
.rotating-ipv4-assignment-proxy {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rotating-ipv4-assignment-device > i { font-size: 7px; }
.rotating-ipv4-assignment-device > i.is-online { color: #10b981; }
.rotating-ipv4-assignment-device > i.is-offline { color: #94a3b8; }

.rotating-ipv4-assignment-device > span,
.rotating-ipv4-assignment-proxy {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.rotating-ipv4-assignment-device code,
.rotating-ipv4-assignment-proxy strong {
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 900;
}

.rotating-ipv4-assignment-device small,
.rotating-ipv4-assignment-proxy small {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 750;
}

.rotating-ipv4-assignment-provider {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 999px;
    color: #4f46e5;
    background: rgba(99, 102, 241, .1);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.rotating-ipv4-assignment-endpoint {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: 8px;
    color: #4f46e5;
    background: rgba(99, 102, 241, .07);
    font-size: 11px;
    font-weight: 850;
}

.rotating-ipv4-assignment-health {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 850;
}

.rotating-ipv4-assignment-health i { font-size: 7px; }
.rotating-ipv4-assignment-health.is-online { color: #059669; }
.rotating-ipv4-assignment-health.is-offline { color: #dc2626; }

.rotating-ipv4-assignment-pagination {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 9px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
}

.rotating-ipv4-assignment-pagination .btn { min-width: 34px; padding: 0 9px; }

body.dark-mode .rotating-ipv4-assignment-provider,
body.dark-mode .rotating-ipv4-assignment-endpoint { color: #a5b4fc; }

@media (max-width: 640px) {
    .rotating-ipv4-subnet-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .rotating-ipv4-subnet-controls { grid-template-columns: 1fr; }
    .rotating-ipv4-subnet-btn { width: 100%; }
    .rotating-ipv4-assignment-toolbar { align-items: stretch; flex-direction: column; }
    .rotating-ipv4-assignment-search { flex-basis: auto; }
    .rotating-ipv4-assignment-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rotating-ipv4-auth {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
    gap: 10px;
}

.rotating-ipv4-auth-toggle {
    min-height: 44px;
    margin: 0;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface-soft);
    padding: 9px 11px;
}

.rotating-ipv4-auth .rotating-ipv4-field {
    min-width: 0;
}

.rotating-ipv4-auth input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.rotating-ipv4-device input {
    flex: 1 1 auto;
    min-width: 220px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    color: var(--ui-text);
    padding: 0 12px;
    font-weight: 750;
}

.rotating-ipv4-endpoint code {
    min-width: 0;
    max-width: 100%;
    color: var(--primary);
    font-weight: 850;
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 999px;
    padding: 5px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rotating-ipv4-copy-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 66px;
    height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    line-height: 1;
}

.rotating-ipv4-device-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 84px;
    height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.rotating-ipv4-copy-btn i {
    width: 14px;
    text-align: center;
    font-size: 12px;
}

.rotating-ipv4-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.rotating-ipv4-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface-soft);
}

.rotating-ipv4-mini-btn {
    min-width: 0;
    width: auto;
    height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    line-height: 1;
}

.rotating-ipv4-mini-btn i {
    width: 14px;
    text-align: center;
    font-size: 12px;
}

.rotating-ipv4-toolbar #rotatingIPv4Status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--ui-surface-soft);
}

.rotating-ipv4-auto-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #047857;
    font-size: 10px;
    font-weight: 850;
}

.rotating-ipv4-ejected-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #dc2626;
    font-size: 10px;
    font-weight: 900;
}

body.dark-mode .rotating-ipv4-auto-source-badge {
    color: #6ee7b7;
}

body.dark-mode .rotating-ipv4-ejected-badge { color: #fca5a5; }

.rotating-ipv4-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.rotating-ipv4-stat {
    min-width: 0;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface-soft);
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.rotating-ipv4-stat i { color: var(--primary); }
.rotating-ipv4-stat small { color: var(--ui-muted); font-weight: 750; }
.rotating-ipv4-stat strong { color: var(--ui-text); font-size: 16px; }

.rotating-ipv4-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

#rotatingIPv4ProxyList.rotating-ipv4-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rotating-ipv4-provider-group {
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface-soft);
    padding: 10px;
}

.rotating-ipv4-provider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 2px 9px;
    color: var(--ui-text);
}

.rotating-ipv4-provider-head strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.rotating-ipv4-provider-head strong i { color: var(--primary); }
.rotating-ipv4-provider-head span { color: var(--ui-muted); font-size: 12px; font-weight: 750; }

.rotating-ipv4-provider-health {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rotating-ipv4-provider-health i {
    font-size: 7px;
}

.rotating-ipv4-provider-health.is-online {
    color: #059669;
}

.rotating-ipv4-provider-health.has-warning {
    color: #d97706;
}

.rotating-ipv4-provider-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.rotating-ipv4-item {
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface);
    padding: 10px 11px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.rotating-ipv4-item.is-offline {
    border-style: dashed;
    background: color-mix(in srgb, var(--ui-surface) 78%, transparent);
}

.rotating-ipv4-iface {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rotating-ipv4-iface strong,
.rotating-ipv4-iface small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rotating-ipv4-iface small {
    color: var(--ui-muted);
}

.rotating-ipv4-source-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 850;
}

.rotating-ipv4-source-status i { font-size: 7px; }
.rotating-ipv4-source-status.online { width: 10px; color: #10b981; }
.rotating-ipv4-source-status.offline { color: #d97706; }

.rotating-ipv4-source-status.online i,
.rotating-ipv4-provider-health.is-online i {
    animation: rotatingIPv4OnlinePulse 1.25s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(16, 185, 129, .75));
}

@keyframes rotatingIPv4OnlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .32; transform: scale(.68); }
}

@media (prefers-reduced-motion: reduce) {
    .rotating-ipv4-source-status.online i,
    .rotating-ipv4-provider-health.is-online i {
        animation: none;
    }
}

.rotating-ipv4-item-tail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.rotating-ipv4-item-tail label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
}

.rotating-ipv4-weight {
    width: 42px;
    height: 24px;
    padding: 0 4px;
    border: 1px solid var(--ui-border);
    border-radius: 7px;
    background: var(--ui-surface);
    color: var(--ui-text);
    text-align: center;
    font-weight: 850;
}

.rotating-ipv4-item code {
    color: #f59e0b;
    font-weight: 900;
}

.rotating-ipv4-test-result {
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
    background: var(--ui-surface-soft);
    color: var(--ui-text);
}

.rotating-ipv4-test-result.success { border-color: rgba(16, 185, 129, .35); }
.rotating-ipv4-test-result.error { border-color: rgba(239, 68, 68, .35); color: #dc2626; }
.rotating-ipv4-test-result > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.rotating-ipv4-test-chip { padding: 5px 8px; border-radius: 999px; background: var(--ui-surface); border: 1px solid var(--ui-border); font-weight: 850; }
.rotating-ipv4-test-chip.ok { color: #059669; }
.rotating-ipv4-test-chip.error { color: #dc2626; }
.rotating-ipv4-test-chip small { color: var(--ui-muted); }

@media (max-width: 768px) {
    .system-health-head {
        align-items: stretch;
        flex-direction: column;
    }
    .health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .log-cleanup-row,
    .log-cleanup-files {
        grid-template-columns: 1fr;
    }
    .rotating-ipv4-grid {
        grid-template-columns: 1fr;
    }
    .rotating-ipv4-auth {
        grid-template-columns: 1fr;
    }
    .rotating-ipv4-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .rotating-ipv4-endpoint {
        align-items: flex-start;
        flex-direction: column;
    }
    .rotating-ipv4-device {
        align-items: stretch;
        flex-direction: column;
    }
    .rotating-ipv4-device input,
    .rotating-ipv4-device-btn {
        width: 100%;
    }
    .rotating-ipv4-device-controls {
        align-items: stretch;
        flex-direction: column;
    }
    .rotating-ipv4-toolbar-actions {
        width: 100%;
    }
    .rotating-ipv4-mini-btn {
        flex: 1 1 0;
    }
    .log-cleanup-row .btn {
        width: 100%;
    }
}

.system-health-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.system-health-actions .btn {
    flex: 0 0 auto;
}

@media (max-width: 1500px) {
    .system-health-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .system-health-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .system-health-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .system-health-actions .btn {
        width: 100%;
    }
}
/* ===== GLOBAL FONT NORMALIZATION 2026-04-29 ===== */
:root {
    --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
    --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html, body, input, select, textarea, button,
.nav-item, .btn, .badge, .status-badge, .router-context-chip,
.router-menu-item, .table-container, table, th, td,
.modal, .form-group, .top-bar, .sidebar, .content-section,
.stat-card, .glass, .toast, .user-card {
    font-family: var(--ui-font) !important;
    font-variant-ligatures: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0 !important;
}

.fa, .fas, .far, .fal, .fab,
i[class^="fa-"], i[class*=" fa-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    line-height: 1;
}

code, pre, kbd, samp, .glass-code,
.ip-info, .host-text, .server-info-hint span,
[id^="uptime-pppoe-"], .mono,
span[style*="JetBrains Mono"], td[style*="monospace"], div[style*="monospace"], textarea[style*="monospace"] {
    font-family: var(--mono-font) !important;
}

button, .btn, .router-context-chip, .status-glow, .server-info-hint,
.nav-item, .form-section-title, .section-header h2,
.stat-label, .stat-value, th, td {
    font-synthesis-weight: none;
}

.btn, button, .status-glow, .router-context-chip, .server-info-hint {
    white-space: nowrap;
}

#mikrotikConnectBtn span,
.glow-text,
#current-router-name,
#current-router-host,
.sidebar .nav-item,
.user-info span,
.user-info small {
    line-height: 1.25;
}
/* ===== MOBILE UI POLISH 2026-04-29 ===== */
@media (max-width: 768px) {
    .top-bar {
        height: auto !important;
        min-height: 96px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-content: flex-start !important;
        align-items: center !important;
        gap: 8px !important;
        padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left)) !important;
    }

    #mobile-menu-btn {
        order: 0 !important;
        flex: 0 0 38px !important;
    }

    .top-bar > .top-search {
        order: 1 !important;
        flex: 1 1 calc(100% - 92px) !important;
        min-width: 0 !important;
        height: 38px !important;
        margin: 0 !important;
    }

    .top-bar > .top-search input {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .top-bar-actions {
        order: 2 !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: minmax(128px, 1fr) auto minmax(110px, auto) auto auto !important;
        gap: 6px !important;
        align-items: center !important;
        overflow: visible !important;
    }

    .top-bar-actions .router-selector-wrap {
        min-width: 0 !important;
        width: 100% !important;
    }

    .top-bar-actions .router-context-chip {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 36px !important;
        padding: 0 9px !important;
    }

    .router-context-chip span,
    .router-context-chip small {
        max-width: none !important;
    }

    .top-bar-actions .status-glow,
    .top-bar-actions .server-info-hint {
        display: inline-flex !important;
        height: 36px !important;
        min-width: 0 !important;
        padding: 0 9px !important;
        border-radius: 10px !important;
    }

    .top-bar-actions .status-glow {
        justify-content: center !important;
        min-width: 78px !important;
    }

    .top-bar-actions .server-info-hint {
        max-width: none !important;
        justify-content: flex-start !important;
    }

    .top-bar-actions .server-info-hint span {
        max-width: 112px !important;
    }

    #mikrotikConnectBtn,
    .top-bar-actions > .btn-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 10px !important;
    }

    #mikrotikConnectBtn span,
    .top-bar-actions .btn span {
        display: none !important;
    }

    .router-selector-menu {
        left: 0 !important;
        right: auto !important;
        width: min(310px, calc(100vw - 20px)) !important;
    }

    .content-wrapper {
        padding-top: 12px !important;
    }

    .table-container,
    .table-area {
        scrollbar-gutter: stable both-edges !important;
        overscroll-behavior-x: contain !important;
    }

    .proxies-table th,
    .premium-table th {
        height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        vertical-align: middle !important;
        line-height: 1.2 !important;
    }

    .proxies-table td,
    .premium-table td {
        vertical-align: middle !important;
    }

    .table-container::after {
        content: '';
        display: block;
        height: 1px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        min-height: 92px !important;
        padding-top: calc(7px + env(safe-area-inset-top)) !important;
        gap: 6px !important;
    }

    .top-bar-actions {
        grid-template-columns: minmax(112px, 1fr) auto auto auto !important;
    }

    .top-bar-actions .server-info-hint {
        display: none !important;
    }

    .top-bar-actions .status-glow {
        min-width: 72px !important;
        padding: 0 8px !important;
    }

    .glow-text {
        font-size: 11px !important;
    }

    .router-context-chip span {
        font-size: 11px !important;
    }

    .router-context-chip small {
        font-size: 9px !important;
    }

    .content-wrapper {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

@media (max-width: 380px) {
    .top-bar-actions {
        grid-template-columns: minmax(96px, 1fr) auto auto !important;
    }

    .top-bar-actions .status-glow {
        display: none !important;
    }
}
/* ===== DOMAIN UPDATE BUTTON FIX 2026-04-29 ===== */
#settingsModal button[onclick="refreshCloudflareDDNS()"],
button[onclick="refreshCloudflareDDNS()"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 38px !important;
    height: 38px !important;
    width: max-content !important;
    max-width: 100% !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    box-sizing: border-box !important;
}

#settingsModal button[onclick="refreshCloudflareDDNS()"] i,
button[onclick="refreshCloudflareDDNS()"] i {
    width: 14px !important;
    min-width: 14px !important;
    height: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

@media (max-width: 480px) {
    #settingsModal button[onclick="refreshCloudflareDDNS()"],
    button[onclick="refreshCloudflareDDNS()"] {
        width: 100% !important;
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }
}
/* ===== COMPACT PROXY TOOLBAR 2026-04-29 ===== */
.proxy-control-bar.compact-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    padding: 8px !important;
}

.proxy-control-bar.compact-toolbar .proxy-tool-group {
    min-height: 42px;
    padding: 5px !important;
    gap: 5px !important;
}

.proxy-control-bar.compact-toolbar .main-actions {
    flex: 1 1 520px;
}

.proxy-control-bar.compact-toolbar .selected-actions {
    flex: 1 1 520px;
}

.proxy-control-bar.compact-toolbar .tool-group-label {
    height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px !important;
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.08);
    color: var(--ui-muted);
    font-size: 10px !important;
    text-transform: uppercase;
}

.proxy-control-bar.compact-toolbar .btn-action {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.proxy-control-bar.compact-toolbar .icon-compact {
    padding: 0 9px !important;
}

.proxy-more-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.proxy-more-dropdown > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 13px !important;
    border-radius: 11px !important;
    user-select: none;
}

.proxy-more-dropdown > summary::-webkit-details-marker {
    display: none;
}

.proxy-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 120;
    width: 210px;
    padding: 7px;
    display: grid;
    gap: 5px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.proxy-more-menu button {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}

.proxy-more-menu button:hover {
    background: var(--ui-surface-soft);
    border-color: var(--ui-border);
}

.proxy-more-menu button.danger {
    color: var(--ui-red);
    background: var(--ui-red-soft);
}

.proxy-more-menu button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.dark-mode .proxy-more-menu {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1280px) {
    .proxy-control-bar.compact-toolbar .main-actions,
    .proxy-control-bar.compact-toolbar .selected-actions {
        flex-basis: 100%;
    }
}

@media (max-width: 768px) {
    .proxy-control-bar.compact-toolbar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .proxy-control-bar.compact-toolbar .proxy-tool-group {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .proxy-control-bar.compact-toolbar .tool-group-label {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .proxy-more-dropdown,
    .proxy-more-dropdown > summary {
        width: 100% !important;
    }

    .proxy-more-menu {
        left: 0;
        right: auto;
        width: 100%;
    }
}
/* ===== PROXY TABLE POLISH 2026-04-29 ===== */
#proxies .table-area.glass {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
}

#proxies .proxy-list-header {
    min-height: 58px !important;
    padding: 14px 18px !important;
    background: linear-gradient(180deg, rgba(248,250,252,0.92), rgba(255,255,255,0.86)) !important;
    border-bottom: 1px solid var(--ui-border) !important;
}

#proxies .proxy-list-title {
    gap: 11px !important;
    font-size: 16px !important;
    font-weight: 850 !important;
    color: var(--ui-text) !important;
}

#proxies .proxy-list-title i {
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9px !important;
    background: var(--ui-blue-soft) !important;
    color: var(--ui-blue) !important;
    font-size: 13px !important;
}

#proxies .proxy-list-stats {
    gap: 7px !important;
}

#proxies .proxy-stat-badge {
    height: 28px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface-soft) !important;
}

#proxies .table-container {
    background: linear-gradient(180deg, rgba(248,250,252,0.64), rgba(255,255,255,0.98)) !important;
    max-height: calc(100vh - 292px) !important;
}

#proxies .proxies-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 0 !important;
}

#proxies .proxies-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    height: 44px !important;
    padding: 0 10px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    text-transform: none !important;
}

#proxies .proxies-table tbody tr {
    background: rgba(255,255,255,0.86) !important;
    transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease !important;
}

#proxies .proxies-table tbody tr:hover {
    background: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--ui-blue), 0 8px 18px rgba(15,23,42,0.05) !important;
}

#proxies .proxies-table tbody tr.active {
    background: rgba(37, 99, 235, 0.045) !important;
}

#proxies .proxies-table tbody td {
    height: 58px !important;
    padding: 7px 10px !important;
    border-bottom: 1px solid #edf2f7 !important;
    color: var(--ui-text) !important;
}

#proxies .proxies-table input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
    accent-color: var(--ui-blue) !important;
}

#proxies .type-item.compact {
    min-width: 58px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    background: rgba(99, 102, 241, 0.10) !important;
    color: #4f46e5 !important;
    font-size: 11px !important;
    font-weight: 850 !important;
}

#proxies .status-badge.compact {
    min-width: 104px !important;
    height: 34px !important;
    padding: 0 12px !important;
    justify-content: center !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}

#proxies .status-badge.compact .status-info span {
    display: block !important;
    max-width: 76px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: 11px !important;
    font-weight: 850 !important;
}

#proxies .status-badge.compact.online {
    background: rgba(16,185,129,0.11) !important;
    border-color: rgba(16,185,129,0.26) !important;
    color: #059669 !important;
}

#proxies .status-badge.compact.offline {
    background: rgba(239,68,68,0.10) !important;
    border-color: rgba(239,68,68,0.24) !important;
    color: #dc2626 !important;
}

#proxies .status-badge.compact .dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    box-shadow: 0 0 0 5px rgba(16,185,129,0.10) !important;
}

#proxies .col-ip-port > div > div:first-child {
    min-height: 31px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: rgba(99,102,241,0.08) !important;
    border-color: rgba(99,102,241,0.18) !important;
    box-shadow: 0 3px 10px rgba(99,102,241,0.08) !important;
}

#proxies .ip-info {
    color: #6366f1 !important;
    font-weight: 850 !important;
    letter-spacing: 0 !important;
}

#proxies .country-info.compact {
    margin-top: 4px !important;
    padding-left: 2px !important;
}

#proxies .country-info.compact .flag {
    font-size: 13px !important;
}

#proxies .converted-port-badge,
#proxies .col-device-ip span[style*="JetBrains Mono"],
#proxies .pass-code {
    border-radius: 8px !important;
}

#proxies .row-actions.compact {
    background: transparent !important;
    border: 0 !important;
    justify-content: center !important;
}

#proxies .row-actions.compact .btn-icon {
    width: 31px !important;
    height: 31px !important;
    min-width: 31px !important;
    border-radius: 9px !important;
}

body.dark-mode #proxies .table-area.glass,
body.dark-mode #proxies .proxies-table tbody tr {
    background: #0f172a !important;
}

body.dark-mode #proxies .proxy-list-header,
body.dark-mode #proxies .proxies-table thead th {
    background: #111827 !important;
    border-color: rgba(148,163,184,0.18) !important;
    color: #94a3b8 !important;
}

body.dark-mode #proxies .proxies-table tbody td {
    border-bottom-color: rgba(148,163,184,0.12) !important;
}

/* ===== Per-proxy domain split routing ===== */
#proxies .row-actions.compact {
    width: 103px;
    grid-template-columns: repeat(3, 31px);
}

#proxies .proxy-domain-route-btn.is-active {
    border-color: rgba(16, 185, 129, .42) !important;
    background: rgba(16, 185, 129, .13) !important;
    color: #059669 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .06);
}

#proxies .proxy-domain-route-btn.is-active.is-proxy-mode {
    border-color: rgba(124, 58, 237, .42) !important;
    background: rgba(124, 58, 237, .13) !important;
    color: #7c3aed !important;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, .06);
}

.proxy-domain-routing-modal {
    width: min(680px, calc(100vw - 28px));
    max-width: 680px;
    overflow: hidden;
}

.proxy-domain-routing-modal .modal-header small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
}

.proxy-domain-routing-modal .modal-header code {
    color: var(--primary);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

.proxy-domain-routing-body {
    display: grid;
    gap: 14px;
    padding: 18px 22px 6px;
}

.proxy-domain-routing-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.proxy-domain-routing-modes label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.proxy-domain-routing-modes input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.proxy-domain-routing-modes span {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 2px 8px;
    min-height: 62px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 11px;
    background: var(--card-bg, #fff);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.proxy-domain-routing-modes i {
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--text-muted);
    text-align: center;
}

.proxy-domain-routing-modes strong {
    color: var(--text-main);
    font-size: 12px;
}

.proxy-domain-routing-modes small {
    color: var(--text-muted);
    font-size: 10px;
}

.proxy-domain-routing-modes input:checked + span {
    border-color: rgba(37, 99, 235, .45);
    background: rgba(37, 99, 235, .075);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .07);
}

.proxy-domain-routing-modes input[value="proxy-list"]:checked + span {
    border-color: rgba(124, 58, 237, .45);
    background: rgba(124, 58, 237, .075);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, .07);
}

.proxy-domain-routing-modes input:checked + span i {
    color: #2563eb;
}

.proxy-domain-routing-modes input[value="proxy-list"]:checked + span i {
    color: #7c3aed;
}

.proxy-domain-routing-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 12px;
    background: rgba(37, 99, 235, .055);
    cursor: pointer;
}

.proxy-domain-routing-toggle > span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.proxy-domain-routing-toggle strong {
    color: var(--text-main);
    font-size: 13px;
}

.proxy-domain-routing-toggle small {
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.proxy-domain-routing-toggle input {
    width: 42px;
    height: 22px;
    flex: 0 0 auto;
    accent-color: #2563eb;
    cursor: pointer;
}

.proxy-domain-routing-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.proxy-domain-routing-presets > span {
    margin-right: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.proxy-domain-routing-presets button {
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid rgba(239, 68, 68, .2);
    border-radius: 9px;
    background: rgba(239, 68, 68, .07);
    color: #dc2626;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.proxy-domain-routing-presets button.is-outlook {
    border-color: rgba(37, 99, 235, .24);
    background: rgba(37, 99, 235, .08);
    color: #2563eb;
}

.proxy-domain-routing-presets button.is-clear {
    border-color: rgba(100, 116, 139, .2);
    background: rgba(100, 116, 139, .07);
    color: var(--text-muted);
}

.proxy-domain-routing-field {
    margin: 0;
}

.proxy-domain-routing-field textarea {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .28));
    border-radius: 11px;
    background: var(--card-bg, #fff);
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.55;
}

.proxy-domain-routing-field > small {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.proxy-domain-routing-summary {
    padding: 9px 11px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-size: 11px;
    font-weight: 750;
}

.proxy-domain-routing-summary.is-empty {
    border-color: rgba(245, 158, 11, .2);
    background: rgba(245, 158, 11, .07);
    color: #b45309;
}

.proxy-domain-routing-summary.is-enabled::before {
    content: '\2713';
    margin-right: 6px;
    font-weight: 900;
}

.proxy-domain-routing-warning {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 10px;
    background: rgba(245, 158, 11, .075);
    color: #92400e;
    font-size: 10.5px;
    line-height: 1.45;
}

.proxy-domain-routing-warning i {
    margin-top: 2px;
    color: #d97706;
}

body.dark-mode .proxy-domain-routing-toggle,
body.dark-mode .proxy-domain-routing-modes span,
body.dark-mode .proxy-domain-routing-field textarea {
    background: #0f172a;
    border-color: rgba(148, 163, 184, .2);
}

body.dark-mode .proxy-domain-routing-summary {
    color: #6ee7b7;
}

@media (max-width: 540px) {
    .proxy-domain-routing-modes {
        grid-template-columns: 1fr;
    }

}

body.dark-mode .proxy-domain-routing-warning {
    color: #fcd34d;
}

@media (max-width: 720px) {
    #proxies .row-actions.compact {
        width: auto;
        grid-template-columns: repeat(5, 34px);
    }

    .proxy-domain-routing-body {
        padding: 14px 14px 4px;
    }

    .proxy-domain-routing-toggle {
        align-items: flex-start;
    }

    .proxy-domain-routing-presets button {
        flex: 1;
    }
}

@media (max-width: 768px) {
    #proxies .proxy-list-header {
        padding: 12px !important;
    }

    #proxies .proxy-list-title {
        font-size: 15px !important;
    }

    #proxies .proxy-list-stats {
        width: 100% !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        padding-bottom: 2px !important;
    }
}


/* ===== MIKROTIK AGENT CARD ===== */
.mik-agent-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
}

.mik-agent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.mik-agent-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mik-agent-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    background: linear-gradient(180deg, #eff6ff 0%, #e8f0ff 100%);
    border: 1px solid #dbe7ff;
    box-shadow: inset 0 -10px 22px rgba(37, 99, 235, 0.08);
    flex: 0 0 auto;
}

.mik-agent-icon i {
    font-size: 20px;
    line-height: 1;
}

.mik-agent-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 850;
    color: var(--ui-text);
}

.mik-agent-title span,
.mik-agent-note {
    display: block;
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 650;
}

.mik-agent-body {
    display: grid;
    gap: 12px;
}

.mik-agent-status {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface-soft);
}

.mik-agent-status strong {
    color: var(--ui-text);
    font-size: 14px;
    font-weight: 850;
}

.mik-agent-status small {
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--ui-muted);
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
    flex: 0 0 auto;
}

.mik-agent-status.online .agent-dot { background: var(--ui-green); box-shadow: 0 0 0 4px var(--ui-green-soft); }
.mik-agent-status.warning .agent-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }
.mik-agent-status.offline .agent-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14); }
.agent-dot.muted { background: var(--ui-muted); }

.mik-agent-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mik-agent-grid div {
    min-width: 0;
    padding: 10px;
    border-radius: 9px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface-soft);
}

.mik-agent-grid span {
    display: block;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.mik-agent-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--ui-text);
    font-size: 14px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-agent-check {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .mik-agent-head {
        align-items: stretch;
        flex-direction: column;
    }
    .btn-agent-check {
        width: 100%;
    }
    .mik-agent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mik-agent-status {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .mik-agent-status small {
        width: 100%;
        margin-left: 19px;
        white-space: normal;
    }
}


.mik-agent-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .mik-agent-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
}


/* Proxy Rotation */
.proxy-rotation-modal {
    width: min(640px, calc(100vw - 32px));
    max-width: 640px;
    border-radius: 18px;
    overflow: hidden;
}

.proxy-rotation-modal .modal-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--ui-border);
}

.proxy-rotation-modal .header-with-icon {
    gap: 12px;
}

.proxy-rotation-modal .header-with-icon i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 20px;
}

.proxy-rotation-modal .header-with-icon h2 {
    font-size: 24px;
    line-height: 1.15;
    margin: 0;
}

.proxy-rotation-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 22px 16px;
}

.proxy-rotation-modal .form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.proxy-rotation-modal .form-section-title::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--ui-border);
}

.proxy-rotation-modal .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.035), rgba(255,255,255,0));
}

.proxy-rotation-modal .form-group {
    margin: 0;
}

.proxy-rotation-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--ui-text);
}

.proxy-rotation-modal select,
.proxy-rotation-modal input[type="number"],
.proxy-rotation-modal textarea {
    border-radius: 12px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    box-shadow: none;
}

.rotation-ip-list {
    width: 100%;
    min-height: 98px;
    max-height: 180px;
    resize: vertical;
    line-height: 1.45;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.rotation-help {
    display: block;
    margin-top: 7px;
    color: var(--ui-muted);
    font-size: 12px;
    line-height: 1.35;
}

.rotation-toggle-row {
    align-self: stretch;
}

.rotation-check {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    border-radius: 14px;
    background: var(--ui-surface-soft);
    font-weight: 850;
    color: var(--ui-text);
}

.rotation-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

#rotationStatusText {
    color: var(--ui-muted);
    font-size: 12px;
    margin-top: 8px;
    display: block;
    line-height: 1.35;
}

.rotation-api-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    border-radius: 16px;
    background: var(--ui-surface-soft);
}

.rotation-api-box div {
    grid-column: 1 / -1;
    color: var(--ui-text);
    font-size: 15px;
}

.rotation-api-box code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ui-blue);
    font-size: 12px;
    line-height: 1.6;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.055);
}

.rotation-api-box .btn {
    height: 36px;
    min-width: 92px;
    justify-content: center;
    border-radius: 11px;
    padding: 0 12px;
    white-space: nowrap;
}

.proxy-rotation-modal .modal-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 22px 20px;
    border-top: 1px solid var(--ui-border);
}

.proxy-rotation-modal .modal-footer .btn {
    min-height: 42px;
    border-radius: 12px;
    justify-content: center;
    font-weight: 850;
}

@media (max-width: 640px) {
    .proxy-rotation-modal {
        width: calc(100vw - 18px);
        border-radius: 16px;
    }
    .proxy-rotation-modal .modal-header,
    .proxy-rotation-modal .modal-body,
    .proxy-rotation-modal .modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }
    .proxy-rotation-modal .form-row,
    .proxy-rotation-modal .modal-footer,
    .rotation-api-box {
        grid-template-columns: 1fr;
    }
    .rotation-api-box code {
        white-space: normal;
        word-break: break-word;
    }
}

/* Proxy bulk power toggle */
.proxy-power-toggle {
    min-width: 108px;
}
.proxy-power-toggle.btn-danger-soft {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.28);
    color: #dc2626;
}
.proxy-power-toggle.btn-danger-soft:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.38);
}
.proxy-power-toggle:disabled {
    opacity: 0.72;
    cursor: wait;
}

.rotation-ip-list {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    line-height: 1.45;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.rotation-help {
    display: block;
    margin-top: 6px;
    color: var(--ui-muted);
    font-size: 12px;
}

/* ShopLike API key modal */
.shoplike-modal { max-width: 1180px; }
.shoplike-form-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(260px, 2fr) minmax(160px, 1fr) minmax(140px, 1fr) auto auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.8);
    margin-bottom: 14px;
}
.shoplike-key-field { position: relative; }
.shoplike-key-field input { padding-right: 44px; }
.shoplike-key-field .btn-tiny { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; padding: 0; }
.shoplike-table-wrap { overflow: auto; border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; }
.shoplike-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.shoplike-table th, .shoplike-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-color, #edf2f7); text-align: left; vertical-align: middle; }
.shoplike-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #64748b; background: #f8fafc; }
.shoplike-table td small { display: block; margin-top: 4px; color: #64748b; }
.shoplike-table code { display: inline-flex; align-items: center; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 8px; border-radius: 8px; background: #f1f5f9; color: #2563eb; }
.shoplike-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted-cell { color: #64748b; font-style: italic; }
@media (max-width: 900px) {
    .shoplike-form-grid { grid-template-columns: 1fr; }
    .shoplike-modal { max-width: calc(100vw - 20px); }
}
.shoplike-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 700;
}
.shoplike-note i { color: #2563eb; }
.shoplike-section-panel {
    padding: 18px;
}
.shoplike-section-panel .shoplike-form-grid {
    margin-bottom: 16px;
}


/* ShopLike redesigned page */
.shoplike-page-header h2 { display:flex; align-items:center; gap:10px; }
.shoplike-page-grid { display:grid; grid-template-columns:minmax(0, 1fr) 320px; gap:16px; margin-bottom:16px; }
.shoplike-card { border-radius:14px; border:1px solid #e5e7eb; background:#fff; box-shadow:0 10px 28px rgba(15,23,42,.06); }
.shoplike-key-card, .shoplike-note-card, .shoplike-list-card { padding:18px; }
.shoplike-card-title { display:flex; align-items:flex-start; gap:12px; margin-bottom:16px; }
.shoplike-card-title h3, .shoplike-list-head h3 { margin:0; font-size:18px; color:#0f172a; }
.shoplike-card-title p, .shoplike-list-head p { margin:4px 0 0; color:#64748b; font-size:13px; }
.shoplike-card-icon, .shoplike-note-icon { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; color:#2563eb; background:#eff6ff; flex:0 0 auto; }
.shoplike-form-grid { display:grid; grid-template-columns:1fr 1.7fr 1fr 1fr; gap:12px; align-items:end; padding:0; border:0; background:transparent; margin:0; }
.shoplike-form-grid .form-group { min-width:0; }
.shoplike-key-field { position:relative; }
.shoplike-key-field input { padding-right:42px; }
.shoplike-key-field .btn-tiny { position:absolute; right:8px; bottom:8px; width:30px; height:30px; padding:0; }
.shoplike-form-actions { display:flex; gap:10px; margin-top:14px; justify-content:flex-end; }
.shoplike-note-card { display:flex; flex-direction:column; gap:8px; color:#334155; }
.shoplike-note-card strong { color:#0f172a; font-size:16px; }
.shoplike-note-card span { color:#64748b; line-height:1.45; }
.shoplike-note-card code { background:#f1f5f9; color:#2563eb; padding:2px 6px; border-radius:6px; }
.shoplike-list-card { padding:0; overflow:hidden; }
.shoplike-list-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 18px; border-bottom:1px solid #e5e7eb; }
.shoplike-table-wrap { overflow:auto; border:0; border-radius:0; }
.shoplike-table { width:100%; border-collapse:collapse; min-width:920px; }
.shoplike-table th, .shoplike-table td { padding:13px 16px; border-bottom:1px solid #edf2f7; text-align:left; vertical-align:middle; }
.shoplike-table th { font-size:12px; text-transform:uppercase; letter-spacing:.03em; color:#64748b; background:#f8fafc; white-space:nowrap; }
.shoplike-table tr:hover td { background:#f8fafc; }
.shoplike-info-cell strong { display:block; color:#0f172a; }
.shoplike-info-cell small, .shoplike-api-cell small, .shoplike-next { display:block; margin-top:5px; color:#64748b; font-size:12px; }
.shoplike-api-cell code, .shoplike-proxy-pill code { font-family:'JetBrains Mono','Consolas',monospace; font-size:13px; }
.shoplike-api-cell code { display:inline-flex; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:5px 8px; border-radius:8px; background:#f1f5f9; color:#2563eb; }
.shoplike-proxy-pill { display:inline-flex; align-items:center; gap:8px; max-width:260px; padding:7px 10px; border-radius:999px; background:#eef2ff; color:#4f46e5; border:1px solid #c7d2fe; }
.shoplike-proxy-pill code { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#4f46e5; }
.shoplike-status { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.shoplike-status.ok { background:#dcfce7; color:#15803d; }
.shoplike-status.warn { background:#fff7ed; color:#c2410c; max-width:260px; white-space:normal; }
.shoplike-status.idle { background:#f1f5f9; color:#64748b; }
.shoplike-dns-egress-badge { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:999px; font-size:11px; font-weight:700; border:1px solid #cbd5e1; background:#f8fafc; color:#64748b; white-space:nowrap; }
.shoplike-dns-egress-badge.is-online { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.shoplike-dns-egress-badge.is-checking { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }
.shoplike-egress-dns { border-color:#bfdbfe; background:#eff6ff; }
.shoplike-egress-dns > i { color:#2563eb; }
.shoplike-egress-dns select { min-width:178px; }
body.dark-mode .shoplike-dns-egress-badge { background:#172033; border-color:#334155; color:#cbd5e1; }
body.dark-mode .shoplike-dns-egress-badge.is-online { background:#063b2b; border-color:#065f46; color:#a7f3d0; }
body.dark-mode .shoplike-egress-dns { background:#172554; border-color:#1d4ed8; }
.shoplike-actions { display:flex; gap:8px; flex-wrap:nowrap; align-items:center; }
.shoplike-actions .btn-tiny { min-height:34px; white-space:nowrap; border-radius:9px; }
.muted-cell { color:#64748b; font-style:italic; }
@media (max-width: 1100px) { .shoplike-page-grid { grid-template-columns:1fr; } .shoplike-form-grid { grid-template-columns:1fr 1fr; } }
@media (max-width: 700px) { .shoplike-key-card, .shoplike-note-card { padding:14px; } .shoplike-form-grid { grid-template-columns:1fr; } .shoplike-form-actions { flex-direction:column; } .shoplike-form-actions .btn { width:100%; } .shoplike-list-head { align-items:flex-start; flex-direction:column; } .shoplike-table { min-width:760px; } }
body.dark-mode .shoplike-card { background:#111827; border-color:#263244; }
body.dark-mode .shoplike-card-title h3, body.dark-mode .shoplike-list-head h3, body.dark-mode .shoplike-note-card strong, body.dark-mode .shoplike-info-cell strong { color:#f8fafc; }
body.dark-mode .shoplike-table th { background:#0f172a; color:#94a3b8; }
body.dark-mode .shoplike-table th, body.dark-mode .shoplike-table td, body.dark-mode .shoplike-list-head { border-color:#263244; }
body.dark-mode .shoplike-table tr:hover td { background:#172033; }

/* ShopLike action buttons fix */
.shoplike-table th:last-child,
.shoplike-table td:last-child {
    width: 260px;
    min-width: 260px;
}
.shoplike-actions {
    display: grid;
    grid-template-columns: minmax(82px, 1fr) minmax(92px, 1fr) 38px;
    gap: 7px;
    align-items: center;
    width: 100%;
}
.shoplike-action-btn {
    height: 36px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.shoplike-action-btn:hover { transform: translateY(-1px); }
.shoplike-action-btn.primary { background:#2563eb; border-color:#2563eb; color:#fff; }
.shoplike-action-btn.secondary { background:#f8fafc; color:#334155; }
.shoplike-action-btn.danger { background:#fff1f2; border-color:#fecdd3; color:#e11d48; }
.shoplike-action-btn.icon-only { padding:0; width:38px; }
.shoplike-action-btn i { font-size: 13px; flex: 0 0 auto; }
@media (max-width: 900px) {
    .shoplike-table th:last-child,
    .shoplike-table td:last-child { width: 230px; min-width: 230px; }
    .shoplike-actions { grid-template-columns: 1fr 1fr 36px; gap:6px; }
    .shoplike-action-btn { height:34px; padding:0 8px; font-size:12px; }
}
body.dark-mode .shoplike-action-btn.secondary { background:#172033; border-color:#334155; color:#e2e8f0; }
body.dark-mode .shoplike-action-btn.danger { background:rgba(225,29,72,.12); border-color:rgba(225,29,72,.35); color:#fb7185; }

/* ShopLike device binding */
.shoplike-device-cell {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 36px 36px;
    gap: 7px;
    align-items: center;
    min-width: 200px;
}
.shoplike-device-input {
    height: 36px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 650;
    color: #0f172a;
    background: #fff;
    min-width: 0;
}
.shoplike-mini-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}
.shoplike-action-btn.success { background:#10b981; border-color:#10b981; color:#fff; }
.shoplike-actions { grid-template-columns: minmax(82px, 1fr) minmax(92px, 1fr) minmax(82px, 1fr) 38px; }
.shoplike-table th:last-child,
.shoplike-table td:last-child { width: 350px; min-width: 350px; }
@media (max-width: 1100px) {
    .shoplike-actions { grid-template-columns: 1fr 1fr; }
    .shoplike-table th:last-child,
    .shoplike-table td:last-child { width: 260px; min-width: 260px; }
}
body.dark-mode .shoplike-device-input { background:#0f172a; border-color:#334155; color:#f8fafc; }
body.dark-mode .shoplike-mini-btn { background:#172033; border-color:#334155; color:#93c5fd; }

/* ShopLike WebRTC badge */
.shoplike-webrtc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.shoplike-webrtc-badge i { font-size: 12px; }
body.dark-mode .shoplike-webrtc-badge {
    background: rgba(34,197,94,.12);
    border-color: rgba(34,197,94,.35);
    color: #86efac;
}

/* ShopLike compact auto-apply layout */
.shoplike-device-cell {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) 36px 36px;
    gap: 8px;
    align-items: center;
}
.shoplike-device-cell .shoplike-device-input {
    min-width: 0;
}
.shoplike-actions {
    display: grid;
    grid-template-columns: minmax(118px, 1fr) 38px;
    gap: 8px;
    align-items: center;
}
.shoplike-table th:last-child,
.shoplike-table td:last-child {
    width: 210px;
    min-width: 210px;
}
.shoplike-action-btn.icon-only {
    width: 38px;
    min-width: 38px;
    padding-left: 0;
    padding-right: 0;
}
@media (max-width: 768px) {
    .shoplike-device-cell {
        grid-template-columns: minmax(150px, 1fr) 36px 36px;
    }
    .shoplike-actions {
        grid-template-columns: minmax(118px, 1fr) 38px;
    }
    .shoplike-table th:last-child,
    .shoplike-table td:last-child {
        width: 190px;
        min-width: 190px;
    }
}

/* ShopLike Viettel DNS badge */
.shoplike-proxy-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.shoplike-dns-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.shoplike-dns-select {
    height: 26px;
    min-width: 92px;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    background: #ffffff;
    color: #047857;
    font-weight: 800;
    font-size: 12px;
    padding: 0 24px 0 10px;
    outline: none;
}
.shoplike-dns-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}
body.dark-mode .shoplike-dns-select {
    background: rgba(15, 23, 42, 0.92);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.34);
}
.shoplike-dns-pill code {
    font-family: 'JetBrains Mono','Consolas',monospace;
    font-size: 12px;
    color: #065f46;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .shoplike-dns-pill {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.34);
}
body.dark-mode .shoplike-dns-pill code {
    color: #a7f3d0;
}

/* ShopLike API docs chip */
.shoplike-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.shoplike-api-doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(560px, 100%);
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #dbeafe;
    color: #2563eb;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}
.shoplike-api-doc-chip span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}
.shoplike-api-doc-chip code {
    min-width: 0;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'JetBrains Mono','Consolas',monospace;
    font-size: 12px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px 8px;
}
.shoplike-doc-copy {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    flex: 0 0 auto;
}
.shoplike-doc-copy:hover { background: #1d4ed8; }
body.dark-mode .shoplike-api-doc-chip {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(96, 165, 250, 0.28);
    color: #93c5fd;
}
body.dark-mode .shoplike-api-doc-chip code {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.24);
    color: #dbeafe;
}
@media (max-width: 768px) {
    .shoplike-header-actions {
        width: 100%;
        justify-content: stretch;
    }
    .shoplike-api-doc-chip {
        width: 100%;
    }
    .shoplike-api-doc-chip code {
        max-width: none;
        flex: 1;
    }
}

/* NestProxy compact actions */
.nestproxy-actions {
    grid-template-columns: minmax(96px, 1fr) 38px 38px !important;
    max-width: 190px;
    margin-left: auto;
}
.nestproxy-main-action span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
.shoplike-action-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
}
@media (max-width: 1100px) {
    .nestproxy-actions { grid-template-columns: minmax(88px, 1fr) 36px 36px !important; max-width: 172px; }
}

/* NestProxy current proxy card */
.nestproxy-current-card {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #071221;
    border: 1px solid rgba(20,184,166,.22);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.nestproxy-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.nestproxy-card-top code { color:#22e6a5; font-size:17px; font-weight:800; background:transparent; padding:0; max-width:none; }
.nestproxy-copy-btn { height:28px; border:0; border-radius:7px; padding:0 9px; display:inline-flex; align-items:center; gap:5px; color:#22e6a5; background:rgba(34,230,165,.12); font-weight:750; cursor:pointer; }
.nestproxy-card-meta { display:flex; gap:14px; color:#8aa3b8; font-size:12px; flex-wrap:wrap; }
.nestproxy-card-meta span { display:inline-flex; align-items:center; gap:6px; }
.nestproxy-dns-inline { align-self:flex-start; background:rgba(148,163,184,.1); border-color:rgba(148,163,184,.2); color:#cbd5e1; }
.shoplike-action-btn.warning { background:#f59e0b; border-color:#f59e0b; color:#111827; }
.nestproxy-actions { grid-template-columns: minmax(78px, 1fr) 38px 38px 38px !important; max-width: 226px; }
@media (max-width: 1100px) { .nestproxy-current-card { min-width:240px; } .nestproxy-actions { grid-template-columns: 1fr 36px 36px 36px !important; max-width: 210px; } }
body.dark-mode .nestproxy-current-card { background:#071221; border-color:rgba(20,184,166,.24); }

/* NestProxy reference layout using dashboard palette */
.nestproxy-list-wrap { padding: 0; }
.nestproxy-list { display:flex; flex-direction:column; }
.nestproxy-empty { padding: 22px; }
.nestproxy-key-row {
    display:grid;
    grid-template-columns: 36px minmax(360px, 1fr) minmax(330px, 430px);
    gap: 18px;
    align-items:center;
    padding: 20px 22px;
    border-top:1px solid #e5e7eb;
    background:#fff;
}
.nestproxy-key-row:first-child { border-top:0; }
.nestproxy-select-box { display:flex; align-items:center; justify-content:center; }
.nestproxy-select-box input { width:20px; height:20px; accent-color: var(--primary); }
.nestproxy-key-info { min-width:0; display:flex; flex-direction:column; gap:8px; }
.nestproxy-key-title { display:flex; align-items:center; gap:10px; min-width:0; }
.nestproxy-key-title strong { font-family:'JetBrains Mono','Consolas',monospace; font-size:15px; color:#0f172a; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nestproxy-inline-copy { border:0; background:transparent; color:#64748b; cursor:pointer; width:28px; height:28px; border-radius:8px; display:grid; place-items:center; }
.nestproxy-inline-copy:hover { background:#f1f5f9; color:var(--primary); }
.nestproxy-key-badges { display:flex; gap:8px; flex-wrap:wrap; }
.nestproxy-chip { display:inline-flex; align-items:center; height:24px; padding:0 10px; border-radius:999px; background:#eef2ff; color:#4f46e5; font-size:12px; font-weight:800; }
.nestproxy-chip.success { background:#dcfce7; color:#15803d; }
.nestproxy-key-times { display:flex; gap:20px; flex-wrap:wrap; color:#64748b; font-size:13px; }
.nestproxy-key-times span { display:inline-flex; align-items:center; gap:7px; }
.nestproxy-note { display:flex; align-items:center; gap:10px; color:#94a3b8; font-size:13px; }
.nestproxy-device-inline { max-width: 330px; margin-top: 2px; }
.nestproxy-proxy-side { display:flex; flex-direction:column; align-items:flex-end; gap:10px; min-width:0; }
.nestproxy-current-card {
    width:100%;
    min-width:0;
    max-width:330px;
    padding: 13px 14px;
    border-radius: 13px;
    background:#f8fafc;
    border:1px solid #dbeafe;
    box-shadow:none;
}
.nestproxy-card-top code { color:var(--primary); font-size:16px; font-weight:850; background:transparent; padding:0; }
.nestproxy-copy-btn { background:#eff6ff; color:var(--primary); }
.nestproxy-card-meta { color:#64748b; }
.nestproxy-dns-inline { background:#fff; color:#475569; }
.nestproxy-no-proxy { color:#64748b; min-height:74px; justify-content:center; }
.nestproxy-side-actions { display:flex; justify-content:flex-end; gap:8px; width:100%; max-width:330px; }
.nestproxy-side-actions .shoplike-action-btn { height:38px; border-radius:10px; }
.nestproxy-side-actions .shoplike-action-btn.warning { min-width:92px; }
.nestproxy-side-actions .shoplike-action-btn.primary { min-width:86px; }
@media (max-width: 1100px) {
    .nestproxy-key-row { grid-template-columns: 32px minmax(0,1fr); }
    .nestproxy-proxy-side { grid-column: 2; align-items:stretch; }
    .nestproxy-current-card, .nestproxy-side-actions { max-width:none; }
}
@media (max-width: 700px) {
    .nestproxy-key-row { grid-template-columns:1fr; gap:12px; padding:16px; }
    .nestproxy-select-box { justify-content:flex-start; }
    .nestproxy-proxy-side { grid-column:auto; }
    .nestproxy-side-actions { flex-wrap:wrap; justify-content:flex-start; }
}
body.dark-mode .nestproxy-key-row { background:#111827; border-color:#263244; }
body.dark-mode .nestproxy-key-title strong { color:#f8fafc; }
body.dark-mode .nestproxy-inline-copy:hover { background:#172033; }
body.dark-mode .nestproxy-current-card { background:#0f172a; border-color:#263244; }
body.dark-mode .nestproxy-dns-inline { background:#111827; }

/* NestProxy density override */
.nestproxy-key-row {
    grid-template-columns: 30px minmax(300px, 1fr) minmax(285px, 360px);
    gap: 12px;
    padding: 12px 16px;
}

/* NestProxy MCP / AI */
.nestproxy-mcp-card {
    gap: 12px;
}
.nestproxy-mcp-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.2fr);
    gap: 10px;
    align-items: center;
}
.nestproxy-mcp-endpoint {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #dbe7ff;
    border-radius: 10px;
    background: #f8fbff;
    color: var(--primary);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nestproxy-mcp-actions {
    gap: 8px;
    flex-wrap: wrap;
}
.nestproxy-mcp-status {
    color: #64748b;
    font-size: 12px;
}
.nestproxy-mcp-status code {
    color: var(--primary);
    background: #eef4ff;
    border-radius: 7px;
    padding: 2px 6px;
}
.nestproxy-ai-console {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #e6eefb;
}
.nestproxy-ai-console-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.nestproxy-ai-console textarea {
    min-height: 76px;
    font-family: 'JetBrains Mono','Consolas',monospace;
    font-size: 12px;
    line-height: 1.45;
    resize: vertical;
}
.nestproxy-ai-result {
    min-height: 84px;
    max-height: 210px;
    overflow: auto;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dbe7ff;
    border-radius: 10px;
    background: #f8fbff;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}
body.dark-mode .nestproxy-mcp-endpoint {
    background: #0f172a;
    border-color: #263244;
}
body.dark-mode .nestproxy-mcp-status code {
    background: #111827;
}
body.dark-mode .nestproxy-ai-console {
    border-color: #263244;
}
body.dark-mode .nestproxy-ai-result {
    background: #0f172a;
    border-color: #263244;
    color: #e5e7eb;
}

/* SUI Proxy — compact, uniform card layout */
.suiproxy-page {
    --sui-border: rgba(148, 163, 184, .24);
    --sui-soft: rgba(248, 250, 252, .86);
    --sui-blue: #4f46e5;
    --sui-green: #10b981;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.suiproxy-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.suiproxy-heading,
.suiproxy-card-heading,
.suiproxy-list-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.suiproxy-heading h2,
.suiproxy-card-heading h3,
.suiproxy-list-title h3,
.suiproxy-heading p,
.suiproxy-card-heading p,
.suiproxy-list-title p { margin: 0; }
.suiproxy-heading h2 { font-size: 22px; }
.suiproxy-heading-icon,
.suiproxy-card-heading > span,
.suiproxy-card-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--sui-blue);
    background: rgba(79, 70, 229, .09);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .08);
}
.suiproxy-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.suiproxy-header-actions .btn { height: 38px; border-radius: 11px; }
.suiproxy-live-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    color: #047857;
    background: rgba(16, 185, 129, .1);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .18);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.suiproxy-live-status > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .42);
    animation: suiproxy-live-pulse 1.8s infinite;
}
.suiproxy-live-status.is-error { color: #b45309; background: rgba(245, 158, 11, .1); }
.suiproxy-live-status.is-error > i { background: #f59e0b; animation: none; }
@keyframes suiproxy-live-pulse {
    70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.suiproxy-api-button { max-width: 370px; gap: 8px; }
.suiproxy-api-button code {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}
.suiproxy-account-card,
.suiproxy-list-card {
    border: 1px solid var(--sui-border);
    border-radius: 16px;
    overflow: hidden;
}
.suiproxy-account-card { padding: 16px 18px; margin-bottom: 14px; }
.suiproxy-account-head,
.suiproxy-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.suiproxy-card-heading h3,
.suiproxy-list-title h3 { font-size: 15px; }
.suiproxy-card-heading p,
.suiproxy-list-title p { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.suiproxy-security-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #047857;
    background: rgba(16, 185, 129, .09);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.suiproxy-account-head-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.suiproxy-auto-control {
    display: grid;
    grid-template-columns: 20px minmax(120px, auto) minmax(92px, auto);
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 3px 7px;
    border: 1px solid var(--sui-border);
    border-radius: 10px;
    background: var(--sui-soft);
    color: var(--text-muted);
}
.suiproxy-auto-control > i { color: var(--sui-blue); text-align: center; }
.suiproxy-auto-control select {
    min-width: 0;
    height: 28px;
    padding: 0 24px 0 7px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 10px;
    font-weight: 800;
}
.suiproxy-auto-control span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 750;
}
.suiproxy-auto-control span.is-running { color: #047857; }
.suiproxy-account-body {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(360px, 1.65fr) 156px;
    gap: 12px;
    align-items: stretch;
    margin-top: 14px;
}
.suiproxy-key-control { display: flex; flex-direction: column; gap: 6px; }
.suiproxy-key-control label { font-size: 10px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.suiproxy-key-input { position: relative; }
.suiproxy-key-input input {
    width: 100%;
    height: 44px;
    padding: 0 42px 0 13px;
    border-radius: 11px;
    box-sizing: border-box;
}
.suiproxy-key-input button {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    background: rgba(148, 163, 184, .1);
    cursor: pointer;
}
.suiproxy-account-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(78px, 1fr));
    gap: 7px;
    min-height: 58px;
}
.suiproxy-meta-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--sui-border);
    border-radius: 11px;
    background: var(--sui-soft);
}
.suiproxy-meta-tile > i { color: var(--sui-blue); font-size: 12px; }
.suiproxy-meta-tile > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suiproxy-meta-tile small { color: var(--text-muted); font-size: 8px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.suiproxy-meta-tile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.suiproxy-empty-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 54px;
    border: 1px dashed var(--sui-border);
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 11px;
}
.suiproxy-account-actions { display: grid; grid-template-rows: 1fr 1fr; gap: 7px; }
.suiproxy-account-actions .btn { width: 100%; min-width: 0; height: 100%; min-height: 34px; padding: 0 10px; border-radius: 10px; }
.suiproxy-list-card { padding: 0; }
.suiproxy-list-head { padding: 14px 17px; }
.suiproxy-list-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.suiproxy-bulk-dns {
    display: inline-grid;
    grid-template-columns: 28px minmax(142px, 1fr) auto auto;
    min-height: 40px;
    width: min(520px, 100%);
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(79, 70, 229, .24);
    border-radius: 12px;
    background: rgba(79, 70, 229, .06);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .05);
}
.suiproxy-bulk-dns > i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--sui-blue);
    background: rgba(79, 70, 229, .1);
}
.suiproxy-bulk-dns select {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0 28px 0 8px;
    border: 0;
    border-radius: 8px;
    outline: 0;
    background: rgba(255, 255, 255, .78);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
}
.suiproxy-bulk-dns > span {
    max-width: 106px;
    overflow: hidden;
    padding: 5px 7px;
    border-radius: 7px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, .56);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.suiproxy-bulk-dns button {
    height: 30px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: var(--sui-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(79, 70, 229, .18);
}
.suiproxy-bulk-dns button:hover { filter: brightness(.97); transform: translateY(-1px); }
.suiproxy-bulk-dns :is(button, select):disabled { cursor: wait; opacity: .65; }
.suiproxy-copy-all-button {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 11px;
    border-radius: 10px;
    white-space: nowrap;
}
.suiproxy-search {
    display: flex;
    align-items: center;
    gap: 7px;
    width: min(240px, 26vw);
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--sui-border);
    border-radius: 10px;
    background: var(--sui-soft);
    color: var(--text-muted);
}
.suiproxy-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.suiproxy-count {
    display: inline-grid;
    place-items: center;
    min-width: 56px;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--sui-blue);
    background: rgba(79, 70, 229, .09);
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}
.suiproxy-column-guide,
.suiproxy-proxy-card {
    display: grid;
    grid-template-columns: minmax(180px, 1.05fr) minmax(230px, 1.25fr) minmax(200px, 1.05fr) minmax(190px, .9fr);
}
.suiproxy-column-guide {
    padding: 8px 17px;
    border-top: 1px solid var(--sui-border);
    border-bottom: 1px solid var(--sui-border);
    color: var(--text-muted);
    background: rgba(248, 250, 252, .66);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.suiproxy-column-guide span { padding: 0 12px; }
.suiproxy-column-guide span:first-child { padding-left: 0; }
.suiproxy-card-list { display: flex; flex-direction: column; }
.suiproxy-proxy-card {
    position: relative;
    min-width: 0;
    border-bottom: 1px solid var(--sui-border);
    background: rgba(255, 255, 255, .36);
    transition: background .16s ease, box-shadow .16s ease;
}
.suiproxy-proxy-card:last-child { border-bottom: 0; }
.suiproxy-proxy-card::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #f59e0b;
}
.suiproxy-proxy-card.is-online::before { background: var(--sui-green); }
.suiproxy-proxy-card:hover { background: rgba(79, 70, 229, .025); }
.suiproxy-card-zone {
    min-width: 0;
    padding: 13px 12px;
    border-left: 1px solid var(--sui-border);
}
.suiproxy-card-zone:first-child { border-left: 0; padding-left: 17px; }
.suiproxy-identity-zone { display: flex; align-items: flex-start; gap: 9px; }
.suiproxy-card-index {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    color: var(--sui-blue);
    background: rgba(79, 70, 229, .09);
    font-size: 10px;
    font-weight: 900;
}
.suiproxy-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.suiproxy-name-line { display: flex; align-items: center; gap: 7px; }
.suiproxy-name-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.suiproxy-status-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.suiproxy-status-dot.online { background: var(--sui-green); box-shadow: 0 0 0 4px rgba(16, 185, 129, .11); }
.suiproxy-info small { display: flex; align-items: center; gap: 5px; max-width: 100%; color: var(--text-muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suiproxy-key-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    max-width: 100%;
    padding: 4px 7px;
    border-radius: 7px;
    color: var(--sui-blue);
    background: rgba(79, 70, 229, .07);
    font-size: 9px;
}
.suiproxy-key-pill code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suiproxy-connection-zone { display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.suiproxy-endpoint-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.suiproxy-endpoint-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suiproxy-endpoint-row small { color: var(--text-muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.suiproxy-endpoint-row strong { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.suiproxy-endpoint-row.is-fixed strong { color: var(--sui-blue); }
.suiproxy-endpoint-row button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--sui-blue);
    background: rgba(79, 70, 229, .09);
    cursor: pointer;
}
.suiproxy-public-ip { display: flex; align-items: center; gap: 7px; font-size: 9px; color: var(--text-muted); }
.suiproxy-public-ip code { color: var(--text-main); font-weight: 800; }
.suiproxy-dns-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 9px; }
.suiproxy-dns-row > span { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
.suiproxy-dns-select {
    min-width: 104px;
    height: 28px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--sui-border);
    border-radius: 8px;
    outline: 0;
    background: var(--sui-soft);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 800;
}
.suiproxy-devices-zone { display: flex; align-items: center; }
.suiproxy-device-details { width: 100%; min-width: 0; }
.suiproxy-device-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid var(--sui-border);
    border-radius: 9px;
    color: var(--sui-blue);
    background: var(--sui-soft);
    cursor: pointer;
    list-style: none;
    font-size: 10px;
}
.suiproxy-device-details summary > span { display: flex; align-items: center; gap: 6px; }
.suiproxy-device-details summary::-webkit-details-marker { display: none; }
.suiproxy-device-chevron { transition: transform .16s ease; }
.suiproxy-device-details[open] .suiproxy-device-chevron { transform: rotate(180deg); }
.suiproxy-device-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; max-height: 96px; overflow: auto; }
.suiproxy-device-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 999px; border: 1px solid rgba(16, 185, 129, .25); background: rgba(16, 185, 129, .09); color: #047857; font-size: 9px; font-weight: 800; }
.suiproxy-device-chip button { display: grid; place-items: center; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; color: #ef4444; background: rgba(239, 68, 68, .09); cursor: pointer; }
.suiproxy-device-empty { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 10px; }
.suiproxy-device-editor { display: grid; grid-template-columns: minmax(110px, 1fr) 34px; gap: 6px; }
.suiproxy-device-editor input { min-width: 0; height: 30px; padding: 0 8px; font-size: 9px; }
.suiproxy-device-editor .btn { width: 34px; height: 30px; padding: 0; }
.suiproxy-device-picker {
    display: inline-grid !important;
    place-items: center;
    align-content: center;
    justify-content: center;
    line-height: 1;
    border-radius: 9px !important;
}
.suiproxy-device-picker i { display: block; margin: 0; font-size: 12px; line-height: 1; }
.suiproxy-actions-zone { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.suiproxy-security-row { display: flex; min-width: 0; align-items: center; }
.suiproxy-security-row .provider-webrtc-control { max-width: 100%; }
.suiproxy-health {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    max-width: 100%;
    padding: 5px 8px;
    border-radius: 999px;
    color: #b45309;
    background: rgba(245, 158, 11, .1);
    font-size: 9px;
    font-weight: 850;
}
.suiproxy-health.online { color: #047857; background: rgba(16, 185, 129, .1); }
.suiproxy-health span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suiproxy-health i { font-size: 6px; }
.suiproxy-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.suiproxy-action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    height: 34px;
    padding: 0 3px;
    border: 1px solid var(--sui-border);
    border-radius: 8px;
    color: var(--text-main);
    background: var(--sui-soft);
    cursor: pointer;
    font-size: 7px;
    font-weight: 800;
}
.suiproxy-action-button i { font-size: 10px; }
.suiproxy-action-button.primary { color: var(--sui-blue); border-color: rgba(79, 70, 229, .22); background: rgba(79, 70, 229, .08); }
.suiproxy-action-button.danger { color: #dc2626; border-color: rgba(239, 68, 68, .2); background: rgba(239, 68, 68, .06); }
.suiproxy-action-button:hover { transform: translateY(-1px); filter: brightness(.98); }
.suiproxy-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 150px;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
    font-size: 11px;
}
.suiproxy-empty-state > i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--sui-blue); background: rgba(79, 70, 229, .09); font-size: 17px; }
body.dark-mode .suiproxy-page { --sui-border: rgba(71, 85, 105, .55); --sui-soft: rgba(15, 23, 42, .72); }
body.dark-mode .suiproxy-column-guide { background: rgba(15, 23, 42, .72); }
body.dark-mode .suiproxy-proxy-card { background: rgba(15, 23, 42, .18); }
body.dark-mode .suiproxy-device-chip { color: #6ee7b7; }
body.dark-mode .suiproxy-security-note,
body.dark-mode .suiproxy-health.online,
body.dark-mode .suiproxy-auto-control span.is-running { color: #6ee7b7; }
body.dark-mode .suiproxy-live-status { color: #6ee7b7; background: rgba(16, 185, 129, .13); }
@media (max-width: 1400px) {
    .suiproxy-account-body { grid-template-columns: minmax(230px, 1fr) minmax(320px, 1.5fr); }
    .suiproxy-account-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: 38px; }
    .suiproxy-column-guide { display: none; }
    .suiproxy-proxy-card { grid-template-columns: 1fr 1.15fr; }
    .suiproxy-card-zone:nth-child(3) { border-left: 0; border-top: 1px solid var(--sui-border); }
    .suiproxy-card-zone:nth-child(4) { border-top: 1px solid var(--sui-border); }
}
@media (max-width: 820px) {
    .suiproxy-page { width: 100% !important; max-width: 100%; }
    .suiproxy-page-header,
    .suiproxy-account-head,
    .suiproxy-list-head { align-items: flex-start; flex-direction: column; }
    .suiproxy-header-actions,
    .suiproxy-list-tools { width: 100%; }
    .suiproxy-live-status { flex: 0 0 auto; }
    .suiproxy-account-head-tools { width: 100%; justify-content: flex-start; }
    .suiproxy-auto-control { flex: 1 1 auto; grid-template-columns: 20px minmax(110px, 1fr) minmax(92px, auto); }
    .suiproxy-api-button { flex: 1 1 auto; max-width: none; }
    .suiproxy-bulk-dns { width: 100%; }
    .suiproxy-copy-all-button { flex: 0 0 auto; }
    .suiproxy-search { width: auto; flex: 1 1 auto; }
    .suiproxy-account-body,
    .suiproxy-proxy-card { grid-template-columns: 1fr; }
    .suiproxy-account-meta { grid-template-columns: 1fr 1fr; }
    .suiproxy-card-zone { border-left: 0; border-top: 1px solid var(--sui-border); }
    .suiproxy-card-zone:first-child { border-top: 0; }
}
@media (max-width: 620px) {
    .suiproxy-bulk-dns {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        row-gap: 3px;
    }
    .suiproxy-bulk-dns > i { grid-row: 1 / 3; }
    .suiproxy-bulk-dns > span {
        grid-column: 2 / 4;
        max-width: none;
        padding: 2px 8px 3px;
        background: transparent;
    }
    .suiproxy-bulk-dns button { grid-column: 3; grid-row: 1; }
}
@media (max-width: 780px) {
    .nestproxy-mcp-grid {
        grid-template-columns: 1fr;
    }
    .nestproxy-ai-console-row {
        grid-template-columns: 1fr;
    }
}

/* WireGuard provider credentials */
.wireguard-provider-tools {
    flex-wrap: wrap;
}

.wireguard-provider-tools .btn {
    min-width: 0;
}

.wireguard-provider-modal {
    width: min(760px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 40px));
    overflow: auto;
}

.wireguard-provider-modal .modal-header .header-with-icon {
    align-items: flex-start;
    gap: 12px;
}

.wireguard-provider-modal .modal-header h2,
.wireguard-provider-modal .modal-header p {
    margin: 0;
}

.wireguard-provider-modal .modal-header p {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 13px;
}

.wireguard-provider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 0 8px;
}

.wireguard-provider-grid > [hidden] {
    display: none !important;
}

.wireguard-provider-grid .full-width {
    grid-column: 1 / -1;
}

.wireguard-provider-grid textarea {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    box-sizing: border-box;
}

.wireguard-provider-grid small,
.wireguard-provider-grid .field-optional {
    color: var(--text-muted);
    font-weight: 500;
}

.wireguard-provider-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wireguard-provider-status {
    min-height: 20px;
    padding: 11px 13px;
    border: 1px solid rgba(99, 102, 241, .22);
    border-radius: 10px;
    background: rgba(99, 102, 241, .07);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

body.dark-mode .wireguard-provider-status {
    border-color: rgba(129, 140, 248, .3);
    background: rgba(79, 70, 229, .14);
}

@media (max-width: 760px) {
    .wireguard-provider-grid {
        grid-template-columns: 1fr;
    }

    .wireguard-provider-grid .full-width {
        grid-column: 1;
    }

    .wireguard-provider-modal .modal-footer {
        flex-wrap: wrap;
    }
}
.nestproxy-select-box input { width:17px; height:17px; }
.nestproxy-key-info { gap:5px; }
.nestproxy-key-title { gap:7px; }
.nestproxy-key-title strong { font-size:13px; }
.nestproxy-inline-copy { width:24px; height:24px; border-radius:7px; }
.nestproxy-key-badges { gap:6px; }
.nestproxy-chip { height:20px; padding:0 8px; font-size:11px; }
.nestproxy-key-times { gap:14px; font-size:12px; }
.nestproxy-key-times span { gap:5px; }
.nestproxy-note { gap:7px; font-size:12px; }
.nestproxy-device-inline { max-width:290px; }
.nestproxy-device-inline .shoplike-device-input,
.nestproxy-device-inline .shoplike-mini-btn { height:32px; }
.nestproxy-device-inline .shoplike-mini-btn { width:32px; }
.nestproxy-proxy-side { gap:7px; }
.nestproxy-current-card { max-width:285px; padding:9px 11px; border-radius:11px; gap:6px; }
.nestproxy-card-top code { font-size:14px; }
.nestproxy-copy-btn { height:24px; padding:0 7px; font-size:11px; border-radius:6px; }
.nestproxy-card-meta { gap:10px; font-size:11px; }
.nestproxy-dns-inline { transform: scale(.92); transform-origin:left center; }
.nestproxy-no-proxy { min-height:54px; }
.nestproxy-side-actions { max-width:285px; gap:6px; }
.nestproxy-side-actions .shoplike-action-btn { height:32px; border-radius:9px; font-size:12px; padding:0 8px; }
.nestproxy-side-actions .shoplike-action-btn.icon-only { width:32px; }
.nestproxy-side-actions .shoplike-action-btn.warning { min-width:78px; }
.nestproxy-side-actions .shoplike-action-btn.primary { min-width:72px; }
@media (max-width: 1100px) {
    .nestproxy-key-row { grid-template-columns: 28px minmax(0,1fr); padding:12px 14px; }
    .nestproxy-current-card, .nestproxy-side-actions { max-width:none; }
}
@media (max-width: 700px) {
    .nestproxy-key-row { padding:12px; gap:10px; }
}

/* NestProxy uses the same table styling as Proxy ShopLike. */


/* NestProxy compact DNS control */
.nestproxy-proxy-line {
    gap: 6px;
}
.nestproxy-dns-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    max-width: 118px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: rgba(99, 102, 241, 0.07);
    color: var(--primary);
    vertical-align: middle;
}
.nestproxy-dns-chip i {
    font-size: 10px;
    opacity: .86;
}
.nestproxy-dns-select {
    width: 82px;
    height: 20px;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    padding: 0 14px 0 0;
    cursor: pointer;
}
.nestproxy-dns-select option {
    color: #0f172a;
    background: #fff;
}
body.dark-mode .nestproxy-dns-chip {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(129, 140, 248, 0.24);
    color: #c7d2fe;
}
body.dark-mode .nestproxy-dns-select option {
    color: #f8fafc;
    background: #111827;
}
@media (max-width: 700px) {
    .nestproxy-dns-chip { max-width: 108px; height: 23px; }
    .nestproxy-dns-select { width: 74px; font-size: 10.5px; }
}


.shoplike-add-device-btn {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}
.shoplike-add-device-btn:hover {
    background: #d1fae5;
    color: #047857;
}
body.dark-mode .shoplike-add-device-btn {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.32);
    color: #6ee7b7;
}


/* ShopLike compact proxy/DNS chips */
.shoplike-proxy-shoplike {
    gap: 5px;
    align-items: center;
}

.shoplike-proxy-shoplike .shoplike-proxy-pill {
    max-width: 210px;
    min-height: 30px;
    padding: 4px 8px;
    gap: 6px;
    border-radius: 14px;
}

.shoplike-proxy-shoplike .shoplike-proxy-pill i {
    font-size: 13px;
}

.shoplike-proxy-shoplike .shoplike-proxy-pill code {
    font-size: 12px;
    line-height: 1.2;
}

.shoplike-proxy-shoplike .shoplike-dns-pill {
    max-width: 210px;
    min-height: 28px;
    padding: 3px 7px;
    gap: 5px;
    border-radius: 14px;
    font-size: 11px;
}

.shoplike-proxy-shoplike .shoplike-dns-pill i {
    font-size: 11px;
}

.shoplike-proxy-shoplike .shoplike-dns-select {
    height: 22px;
    min-width: 74px;
    max-width: 84px;
    font-size: 11px;
    padding: 0 18px 0 8px;
    border-radius: 10px;
}

.shoplike-proxy-shoplike .shoplike-dns-pill code {
    max-width: 82px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .shoplike-proxy-shoplike .shoplike-proxy-pill,
    .shoplike-proxy-shoplike .shoplike-dns-pill {
        max-width: 180px;
    }

    .shoplike-proxy-shoplike .shoplike-dns-pill code {
        max-width: 72px;
    }
}

/* ProxyV6 compact layout */
#proxyv6-section .section-header {
    gap: 14px;
    margin-bottom: 14px;
}

#proxyv6-section .section-subtitle {
    max-width: 760px;
    font-size: 12px;
}

#proxyv6-section .shoplike-header-actions,
#proxyv6-section .shoplike-form-actions {
    gap: 8px;
    flex-wrap: wrap;
}

#proxyv6-section .shoplike-header-actions .btn,
#proxyv6-section .shoplike-form-actions .btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
}

#proxyv6-section .shoplike-page-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 12px;
    margin-bottom: 12px;
}

#proxyv6-section .shoplike-card {
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

#proxyv6-section .shoplike-key-card,
#proxyv6-section .shoplike-note-card {
    padding: 14px;
}

#proxyv6-section .shoplike-card-title {
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}

#proxyv6-section .shoplike-card-icon,
#proxyv6-section .shoplike-note-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

#proxyv6-section .shoplike-card-title h3,
#proxyv6-section .shoplike-list-head h3 {
    font-size: 16px;
}

#proxyv6-section .shoplike-card-title p,
#proxyv6-section .shoplike-list-head p,
#proxyv6-section .shoplike-note-card span {
    font-size: 12px;
}

#proxyv6-section .shoplike-form-grid {
    grid-template-columns: minmax(180px, 1.3fr) minmax(86px, .55fr) minmax(100px, .65fr) minmax(220px, 1.5fr);
    gap: 10px;
}

#proxyv6-section .form-group label {
    font-size: 11px;
    margin-bottom: 5px;
}

#proxyv6-section .form-group input,
#proxyv6-section .form-group select {
    min-height: 48px;
    height: 48px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.35;
}

#proxyv6-section .shoplike-list-head {
    padding: 12px 14px;
}

.proxyv6-api-card {
    margin: 12px 0;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
}

.proxyv6-api-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.proxyv6-api-head h3 {
    margin: 0;
    color: var(--ui-text);
    font-size: 15px;
    font-weight: 850;
}

.proxyv6-api-head p {
    margin: 4px 0 0;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 650;
}

.proxyv6-api-line {
    display: flex;
    min-height: 42px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface-soft);
    overflow: hidden;
}

.proxyv6-api-line code {
    color: var(--primary);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#proxyv6-section .badge {
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
}

#proxyv6-section .proxyv6-table {
    min-width: 1190px;
}

#proxyv6-section .proxyv6-table th,
#proxyv6-section .proxyv6-table td {
    padding: 10px 12px;
}

#proxyv6-section .proxyv6-table th {
    font-size: 11px;
}

#proxyv6-section .proxyv6-table th:first-child,
#proxyv6-section .proxyv6-table td:first-child {
    width: 52px;
    min-width: 52px;
    text-align: center;
}

#proxyv6-section .proxyv6-table th:nth-child(2),
#proxyv6-section .proxyv6-table td:nth-child(2) {
    width: 185px;
    min-width: 185px;
}

#proxyv6-section .proxyv6-table th:nth-child(3),
#proxyv6-section .proxyv6-table td:nth-child(3) {
    width: 300px;
    min-width: 300px;
}

#proxyv6-section .proxyv6-table th:nth-child(4),
#proxyv6-section .proxyv6-table td:nth-child(4) {
    width: 190px;
    min-width: 190px;
}

#proxyv6-section .proxyv6-table th:nth-child(5),
#proxyv6-section .proxyv6-table td:nth-child(5) {
    width: 145px;
    min-width: 145px;
}

#proxyv6-section .proxyv6-table th:nth-child(6),
#proxyv6-section .proxyv6-table td:nth-child(6) {
    width: 120px;
    min-width: 120px;
}

#proxyv6-section .proxyv6-table th:nth-child(7),
#proxyv6-section .proxyv6-table td:nth-child(7) {
    width: 116px;
    min-width: 116px;
}

#proxyv6-section .proxyv6-table th:last-child,
#proxyv6-section .proxyv6-table td:last-child {
    width: 244px;
    min-width: 244px;
}

.proxyv6-index {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.proxyv6-iface {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.proxyv6-iface strong {
    color: var(--text-main, #0f172a);
    font-size: 13px;
    line-height: 1.2;
}

.proxyv6-iface small {
    max-width: 160px;
    margin: 0 !important;
    overflow: hidden;
    color: #64748b;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#proxyv6-section .proxyv6-address {
    max-width: 280px;
    padding: 4px 7px;
    font-size: 12px;
}

#proxyv6-section .proxyv6-port-pill {
    max-width: 210px;
    padding: 6px 9px;
    gap: 7px;
}

#proxyv6-section .proxyv6-port-pill code,
#proxyv6-section .proxyv6-range {
    font-size: 12px;
}

#proxyv6-section .proxyv6-port-pill code {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.proxyv6-port-host {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proxyv6-port-sep,
.proxyv6-port-number {
    flex: 0 0 auto;
    color: #f59e0b;
    font-weight: 900;
}

#proxyv6-section .proxyv6-range {
    padding: 4px 7px;
}

.proxyv6-auth-pill {
    max-width: 135px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #4f46e5);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
}

.proxyv6-auth-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proxyv6-schedule-pill {
    max-width: 110px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
}

.proxyv6-schedule-pill.active {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.proxyv6-schedule-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proxyv6-actions {
    display: grid;
    grid-template-columns: repeat(6, 34px);
    gap: 7px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.proxyv6-action-btn.icon-only {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 9px;
}

body.dark-mode .proxyv6-iface strong {
    color: #f8fafc;
}

@media (max-width: 1100px) {
    #proxyv6-section .shoplike-page-grid {
        grid-template-columns: 1fr;
    }

    #proxyv6-section .shoplike-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .proxyv6-api-head {
        align-items: stretch;
        flex-direction: column;
    }

    .proxyv6-api-head .btn {
        width: 100%;
    }

    #proxyv6-section .shoplike-header-actions .btn,
    #proxyv6-section .shoplike-form-actions .btn {
        width: auto;
        flex: 1 1 150px;
    }

    #proxyv6-section .shoplike-form-grid {
        grid-template-columns: 1fr;
    }

    #proxyv6-section .proxyv6-table {
        min-width: 860px;
    }
}
.proxyv6-lazy-row td {
    padding: 14px 16px !important;
    background: #f8fbff;
}

.proxyv6-lazy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #64748b;
    font-weight: 700;
    flex-wrap: wrap;
}

.proxyv6-lazy-note span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pppoe-rotate-modal {
    max-width: 440px !important;
    padding: 22px 24px !important;
    border-radius: 18px !important;
}

.pppoe-load-balance-modal {
    width: min(560px, calc(100vw - 32px));
    max-width: 560px;
    padding: 0;
    overflow: hidden;
}

.pppoe-load-balance-header {
    padding: 20px 22px 14px;
}

.pppoe-load-balance-header h2 {
    margin: 0 0 4px;
    font-size: 21px;
    line-height: 1.25;
}

.pppoe-load-balance-body {
    display: grid;
    gap: 16px;
    padding: 16px 22px 18px;
}

.pppoe-load-balance-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
}

.pppoe-load-balance-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    font-size: 13px;
    font-weight: 700;
}

.pppoe-load-balance-status.active {
    border-color: rgba(16, 185, 129, 0.35);
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.pppoe-load-balance-running {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.pppoe-load-balance-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.pppoe-load-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 7px;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
    font-size: 12px;
    font-weight: 700;
}

.pppoe-load-balance-empty {
    align-self: center;
    color: var(--text-muted);
    font-size: 13px;
}

.pppoe-load-balance-source {
    width: 100%;
    min-height: 108px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    box-shadow: inset 2px 2px 5px rgba(15, 23, 42, 0.08), inset -2px -2px 5px rgba(255, 255, 255, 0.7);
    font: 700 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pppoe-load-balance-source:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), inset 2px 2px 5px rgba(15, 23, 42, 0.06);
}

.pppoe-load-balance-help {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.pppoe-load-balance-note {
    padding: 10px 12px;
    border-left: 3px solid var(--primary-color);
    color: var(--text-muted);
    background: var(--bg-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.pppoe-load-balance-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px 20px;
    border-top: 1px solid var(--border-color);
}

#btn-pppoe-load-balance.pppoe-load-balance-enabled {
    border-color: rgba(16, 185, 129, 0.4);
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

@media (max-width: 640px) {
    .pppoe-load-balance-header,
    .pppoe-load-balance-body,
    .pppoe-load-balance-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pppoe-load-balance-status-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .pppoe-load-balance-actions .btn {
        flex: 1 1 0;
    }
}

.pppoe-rotate-modal-header {
    align-items: flex-start;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
}

.pppoe-rotate-modal-header h2 {
    font-size: 21px !important;
    line-height: 1.2;
    margin: 0 0 4px;
}

.pppoe-rotate-modal-header .section-subtitle {
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
}

.pppoe-rotate-form {
    display: grid;
    gap: 12px;
}

.pppoe-rotate-minutes {
    margin: 0 !important;
}

.pppoe-rotate-minutes label {
    font-size: 12px;
    margin-bottom: 7px;
}

.pppoe-rotate-minutes input {
    height: 42px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
}

.pppoe-rotate-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
}

.pppoe-rotate-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.pppoe-rotate-toggle-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.pppoe-rotate-note {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.pppoe-rotate-actions {
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-top: 16px !important;
}

.pppoe-rotate-actions .btn {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 11px;
}

@media (max-width: 560px) {
    .pppoe-rotate-modal {
        width: calc(100vw - 28px) !important;
        max-width: none !important;
        padding: 18px !important;
    }
}

/* NestProxy compact table - scoped to NestProxy only */
.nestproxy-device-overview {
    margin: 0 14px 12px;
    overflow: hidden;
    border: 1px solid rgba(20, 184, 166, .2);
    border-radius: 12px;
    background: rgba(20, 184, 166, .035);
}

.nestproxy-device-overview-head {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(20, 184, 166, .14);
}

.nestproxy-device-overview-head > div,
.nestproxy-device-overview-head strong,
.nestproxy-device-overview-head small { display: block; }
.nestproxy-device-overview-head strong { color: var(--text-main); font-size: 13px; }
.nestproxy-device-overview-head strong i { margin-right: 6px; color: #0f9f8f; }
.nestproxy-device-overview-head small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.nestproxy-device-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: rgba(20, 184, 166, .13); color: #0f766e; font-size: 11px; font-weight: 800; }

.nestproxy-assigned-device-list {
    display: grid;
    max-height: 220px;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 7px;
    padding: 10px 12px;
    overflow-y: auto;
}

.nestproxy-assigned-device {
    display: grid;
    min-width: 0;
    min-height: 48px;
    grid-template-columns: 7px minmax(112px, .86fr) minmax(100px, 1fr);
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 9px;
    background: var(--card-bg, #fff);
}

.nestproxy-assigned-device.is-active { border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .055); }
.nestproxy-assigned-state { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .12); }
.nestproxy-assigned-device.is-active .nestproxy-assigned-state { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.nestproxy-assigned-ip { display: flex; min-width: 0; align-items: center; gap: 4px; color: #0f766e; }
.nestproxy-assigned-ip i { flex: 0 0 auto; font-size: 10px; }
.nestproxy-assigned-ip code { flex: 0 0 auto; overflow: visible; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 800; letter-spacing: -.2px; text-overflow: clip; white-space: nowrap; }
.nestproxy-assigned-meta { display: grid; min-width: 0; gap: 2px; }
.nestproxy-assigned-meta strong,
.nestproxy-assigned-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nestproxy-assigned-meta strong { color: var(--text-main); font-size: 11px; }
.nestproxy-assigned-meta small { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 9px; }
.nestproxy-assigned-empty { grid-column: 1 / -1; padding: 7px 2px; color: var(--text-muted); font-size: 11px; font-style: italic; }
body.dark-mode .nestproxy-device-overview { background: rgba(20, 184, 166, .04); }
body.dark-mode .nestproxy-assigned-device { background: #0f172a; }

@media (max-width: 700px) {
    .nestproxy-device-overview { margin-inline: 8px; }
    .nestproxy-device-overview-head { align-items: flex-start; }
    .nestproxy-assigned-device-list { grid-template-columns: 1fr; }
}

#nestproxy-section .shoplike-table {
    min-width: 1540px;
    table-layout: fixed;
}

#nestproxy-section .shoplike-table th,
#nestproxy-section .shoplike-table td {
    padding: 8px 10px;
    vertical-align: middle;
    overflow: hidden;
}

#nestproxy-section .shoplike-table th {
    height: 36px;
    font-size: 11px;
    letter-spacing: .025em;
}

#nestproxy-section .shoplike-table tbody tr {
    height: 68px;
}

#nestproxy-section .shoplike-table th:nth-child(1),
#nestproxy-section .shoplike-table td:nth-child(1) {
    width: 44px;
    min-width: 44px;
    text-align: center;
}

#nestproxy-section .shoplike-table th:nth-child(2),
#nestproxy-section .shoplike-table td:nth-child(2) { width: 160px; }

#nestproxy-section .shoplike-table th:nth-child(3),
#nestproxy-section .shoplike-table td:nth-child(3) { width: 120px; }

#nestproxy-section .shoplike-table th:nth-child(4),
#nestproxy-section .shoplike-table td:nth-child(4) { width: 470px; }

#nestproxy-section .shoplike-table th:nth-child(5),
#nestproxy-section .shoplike-table td:nth-child(5) { width: 88px; }

#nestproxy-section .shoplike-table th:nth-child(6),
#nestproxy-section .shoplike-table td:nth-child(6) { width: 270px; }

#nestproxy-section .shoplike-table th:nth-child(7),
#nestproxy-section .shoplike-table td:nth-child(7) {
    width: 164px;
}

#nestproxy-section .shoplike-table th:nth-child(8),
#nestproxy-section .shoplike-table td:nth-child(8) {
    width: 224px !important;
    min-width: 224px !important;
}

#nestproxy-section .shoplike-info-cell {
    display: grid;
    gap: 2px;
}

#nestproxy-section .shoplike-info-cell strong {
    font-size: 14px;
    line-height: 1.15;
}

#nestproxy-section .shoplike-info-cell small,
#nestproxy-section .shoplike-next {
    margin-top: 0;
    font-size: 11px;
    line-height: 1.25;
}

#nestproxy-section .shoplike-info-cell .shoplike-next {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#nestproxy-section .nestproxy-balance-line {
    color: #047857;
    font-weight: 800;
}

#nestproxy-section .shoplike-api-cell code {
    max-width: 104px;
    height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

#nestproxy-section .nestproxy-proxy-line {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: min-content;
    align-items: center;
    gap: 5px 8px;
}

#nestproxy-section .nestproxy-proxy-line .nestproxy-dns-chip {
    grid-column: 1 / 2;
}

#nestproxy-section .shoplike-proxy-pill {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 32px;
    padding: 0 9px;
    gap: 7px;
    border-radius: 12px;
}

#nestproxy-section .shoplike-proxy-pill code {
    font-size: 12px;
}

#nestproxy-section .converted-port-badge {
    max-width: none;
}

#nestproxy-section .nestproxy-auth-chip {
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: flex-start;
}

#nestproxy-section .converted-port-badge .converted-copy-btn {
    width: 25px;
    height: 25px;
    border-radius: 8px;
}

#nestproxy-section .nestproxy-dns-chip {
    display: none;
}

#nestproxy-section .nestproxy-dns-select {
    width: 88px;
    font-size: 11px;
}

#nestproxy-section .shoplike-webrtc-badge {
    height: 28px;
    padding: 0 9px;
    gap: 5px;
    font-size: 12px;
}

#nestproxy-section .shoplike-device-cell {
    grid-template-columns: minmax(160px, 1fr) 34px 34px;
    min-width: 0;
    gap: 6px;
}

#nestproxy-section .shoplike-device-input {
    height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: 12px;
}

#nestproxy-section .shoplike-mini-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

#nestproxy-section .shoplike-status {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

#nestproxy-section .shoplike-table td:nth-child(7) .shoplike-next {
    max-width: 144px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-row-actions {
    display: grid;
    grid-template-columns: minmax(88px, 1fr) 34px 34px 34px !important;
    gap: 6px;
    width: 100%;
    align-items: center;
}

#nestproxy-section .shoplike-action-btn {
    height: 34px;
    border-radius: 10px;
    padding: 0 9px;
    font-size: 12px;
    gap: 6px;
}

#nestproxy-section .shoplike-action-btn.icon-only {
    width: 34px;
    min-width: 34px;
}

#nestproxy-section .shoplike-action-btn.primary span {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#nestproxy-section .shoplike-list-head {
    padding: 13px 16px;
}

@media (max-width: 900px) {
    #nestproxy-section .shoplike-table {
        min-width: 1420px;
    }
}

/* ===== RouterOS Container ===== */
.container-page-header .header-actions { display: flex; align-items: center; gap: 8px; }
.container-capability-warning { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; padding: 11px 13px; border: 1px solid rgba(245, 158, 11, .28); border-radius: 10px; background: rgba(245, 158, 11, .08); color: #b45309; }
.container-capability-warning[hidden] { display: none; }
.container-capability-warning.is-danger { border-color: rgba(239, 68, 68, .28); background: rgba(239, 68, 68, .07); color: var(--danger); }
.container-capability-warning > i { margin-top: 2px; }
.container-capability-warning strong,
.container-capability-warning span { display: block; }
.container-capability-warning strong { font-size: 12px; }
.container-capability-warning span { margin-top: 2px; color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.container-status-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.container-status-card { min-width: 0; padding: 11px 13px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--card-bg); }
.container-status-card span,
.container-status-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container-status-card span { color: var(--text-muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.container-status-card strong { margin-top: 5px; color: var(--text-main); font-size: 15px; }
.container-status-card strong.is-ready { color: #059669; }
.container-status-card strong.is-error { color: var(--danger); }
.container-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .65fr); gap: 12px; margin-bottom: 12px; }
.container-create-card,
.container-guide-card,
.container-list-card { border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); }
.container-create-card,
.container-guide-card { padding: 14px; }
.container-card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.container-card-title > div { display: flex; align-items: center; gap: 9px; }
.container-card-title > div > i { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: rgba(91, 108, 255, .1); color: var(--primary); }
.container-card-title strong,
.container-card-title small { display: block; }
.container-card-title strong { color: var(--text-main); font-size: 13px; }
.container-card-title small { margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.container-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.container-form-grid label { display: grid; min-width: 0; gap: 5px; }
.container-form-grid label[hidden] { display: none; }
.container-form-grid label > span { color: var(--text-muted); font-size: 9px; font-weight: 700; }
.container-form-grid input,
.container-form-grid select { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 8px; outline: 0; background: var(--input-bg, var(--card-bg)); color: var(--text-main); font-size: 11px; }
.container-form-grid input:focus,
.container-form-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 108, 255, .08); }
.container-form-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 11px 0; }
.container-form-options label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 10px; cursor: pointer; }
.container-form-options input { width: 14px; height: 14px; }
.container-form-options .container-storage-consent { width: 100%; padding: 7px 9px; border-radius: 7px; background: rgba(245, 158, 11, .08); color: #b45309; }
.container-form-options .container-storage-consent[hidden] { display: none; }
.container-create-button { min-height: 36px; }
.container-guide-card ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 10px; line-height: 1.6; }
.container-runtime-info { display: grid; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border-color); }
.container-runtime-info span { display: flex; min-width: 0; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 9px; }
.container-runtime-info strong { max-width: 160px; overflow: hidden; color: var(--text-main); text-overflow: ellipsis; white-space: nowrap; }
.container-list-card { overflow: hidden; }
.container-list-head { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border-bottom: 1px solid var(--border-color); }
.container-list-head h3,
.container-list-head p { margin: 0; }
.container-list-head h3 { color: var(--text-main); font-size: 13px; }
.container-list-head p { margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.container-list-head > span { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.container-table-wrap { overflow-x: auto; border: 0; border-radius: 0; }
.container-table { width: 100%; min-width: 1260px; border-collapse: collapse; table-layout: fixed; }
.container-table th,
.container-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; text-align: left; }
.container-table th { height: 34px; background: rgba(148, 163, 184, .055); color: var(--text-muted); font-size: 9px; letter-spacing: .03em; text-transform: uppercase; }
.container-table th:nth-child(1) { width: 150px; }
.container-table th:nth-child(2) { width: 180px; }
.container-table th:nth-child(3) { width: 180px; }
.container-table th:nth-child(4) { width: 160px; }
.container-table th:nth-child(5) { width: 190px; }
.container-table th:nth-child(6) { width: 140px; }
.container-table th:nth-child(7) { width: 78px; }
.container-table th:nth-child(8) { width: 145px; }
.container-name-cell { display: flex; min-width: 0; align-items: center; gap: 8px; }
.container-name-cell > i { color: var(--primary); }
.container-name-cell span,
.container-name-cell strong,
.container-name-cell small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container-name-cell strong { color: var(--text-main); font-size: 11px; }
.container-name-cell small { margin-top: 2px; color: var(--text-muted); font-size: 8px; }
.container-image-code,
.container-root-code,
.container-network-line { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.container-image-code { color: var(--primary); }
.container-root-code,
.container-network-line { color: var(--text-muted); }
.container-resource-cell { display: grid; gap: 4px; color: var(--text-muted); font-size: 9px; }
.container-resource-cell span { display: inline-flex; min-width: 0; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container-state { display: inline-flex; max-width: 100%; min-height: 25px; align-items: center; gap: 5px; padding: 0 8px; overflow: hidden; border-radius: 999px; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.container-state.is-running { background: rgba(34, 197, 94, .12); color: #15803d; }
.container-state.is-stopped { background: rgba(148, 163, 184, .13); color: var(--text-muted); }
.container-state.is-error { background: rgba(239, 68, 68, .1); color: var(--danger); }
.container-service-check { display: block; margin-top: 5px; overflow: hidden; font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.container-service-check.is-up { color: #15803d; }
.container-service-check.is-down { color: var(--danger); }
.container-boot-toggle { display: inline-flex; min-height: 26px; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 9px; cursor: pointer; }
.container-boot-toggle.is-on { border-color: rgba(34, 197, 94, .25); color: #15803d; }
.container-actions { display: flex; align-items: center; gap: 4px; }
.container-actions button,
.container-actions a { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid var(--border-color); border-radius: 7px; background: var(--card-bg); color: var(--text-muted); text-decoration: none; cursor: pointer; }
.container-actions button:hover,
.container-actions a:hover { border-color: var(--primary); color: var(--primary); }
.container-actions button.is-primary,
.container-actions a.is-primary { color: var(--primary); }
.container-actions button.is-danger { color: var(--danger); }
.container-actions button:disabled,
.container-boot-toggle:disabled { opacity: .5; cursor: wait; }
body.dark-mode .container-status-card,
body.dark-mode .container-create-card,
body.dark-mode .container-guide-card,
body.dark-mode .container-list-card { background: rgba(255, 255, 255, .025); }
@media (max-width: 1050px) {
    .container-layout { grid-template-columns: 1fr; }
    .container-guide-card { order: -1; }
    .container-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .container-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .container-form-grid { grid-template-columns: 1fr; }
    .container-page-header .header-actions,
    .container-page-header .header-actions .btn { width: 100%; }
}

/* ===== IKEv2 ===== */
#ikev2-section { width: min(100%, calc(100vw - 340px)); max-width: 100%; box-sizing: border-box; --ikev2-border: rgba(91, 108, 255, 0.18); }
.ikev2-page-header .header-actions { display: flex; align-items: center; gap: 8px; }
.ikev2-status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ikev2-status-item { min-width: 0; padding: 14px 16px; border: 1px solid var(--ikev2-border); border-radius: 8px; background: var(--card-bg); }
.ikev2-status-item > span { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ikev2-status-item > strong { display: block; overflow: hidden; color: var(--text-main); font-family: 'JetBrains Mono', monospace; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ikev2-state i { margin-right: 6px; }
.ikev2-state.is-online { color: var(--success); }
.ikev2-state.is-offline { color: var(--danger); }
.ikev2-state.is-loading { color: var(--text-muted); }
.ikev2-device-panel { padding: 16px; border: 1px solid var(--ikev2-border); border-radius: 8px; background: var(--card-bg); }
.ikev2-device-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--border-color); }
.ikev2-device-heading h3 { margin: 0 0 4px; color: var(--text-main); font-size: 15px; }
.ikev2-device-heading p { margin: 0; color: var(--text-muted); font-size: 11px; }
.ikev2-device-heading code, .ikev2-device-chip code { font-family: 'JetBrains Mono', monospace; }
.ikev2-device-heading-actions { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: flex-end; gap: 8px; }
.ikev2-visible-api { display: flex; width: min(590px, 55vw); min-width: 280px; height: 38px; align-items: center; gap: 9px; padding: 0 6px 0 11px; overflow: hidden; border: 1px solid rgba(91, 108, 255, 0.2); border-radius: 7px; background: rgba(91, 108, 255, 0.055); color: var(--primary); }
.ikev2-visible-api[hidden] { display: none; }
.ikev2-visible-api > code { min-width: 0; flex: 1; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ikev2-visible-api > button { width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border: 0; border-radius: 5px; background: rgba(91, 108, 255, 0.09); color: var(--primary); cursor: pointer; }
.ikev2-device-list { display: flex; width: 100%; min-height: 48px; max-height: 430px; align-items: stretch; flex-direction: column; flex-wrap: nowrap; gap: 7px; padding: 12px 4px 12px 0; overflow-y: auto; }
.ikev2-device-list-header,
.ikev2-device-chip { display: grid; width: 100%; min-width: 0; grid-template-columns: 28px minmax(135px, .8fr) minmax(180px, 1.4fr) 100px 84px; align-items: center; column-gap: 8px; }
.ikev2-device-list-header { min-height: 24px; padding: 0 7px 0 10px; color: var(--text-muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ikev2-device-chip { min-height: 42px; flex: 0 0 42px; padding: 0 6px 0 10px; border: 1px solid rgba(46, 204, 151, 0.28); border-radius: 7px; background: rgba(46, 204, 151, 0.08); color: var(--success); font-size: 11px; }
.ikev2-device-chip.is-disconnected { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); color: #b45309; }
.ikev2-device-icon { justify-self: center; }
.ikev2-device-ip,
.ikev2-device-endpoint { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ikev2-device-ip { color: inherit; font-size: 11px; font-weight: 800; }
.ikev2-device-endpoint { color: var(--text-muted); font-size: 10px; }
.ikev2-device-uptime { display: inline-flex; min-width: 0; align-items: center; gap: 5px; color: var(--text-main); font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; white-space: nowrap; }
.ikev2-device-uptime i { color: var(--text-muted); font-size: 9px; }
.ikev2-device-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.ikev2-device-chip button { width: 24px; height: 24px; flex: 0 0 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; cursor: pointer; }
.ikev2-device-chip .ikev2-device-rotate { color: var(--primary); }
.ikev2-device-chip .ikev2-device-api { color: var(--text-muted); }
.ikev2-device-chip .ikev2-device-remove { color: var(--danger); }
.ikev2-device-chip button:hover { background: rgba(91, 108, 255, 0.09); }
.ikev2-empty-device { color: var(--text-muted); font-size: 12px; font-style: italic; }
.ikev2-manual-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 8px; }
.ikev2-manual-row input { width: 100%; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--input-bg, var(--card-bg)); color: var(--text-main); }
.ikev2-proxy-port-panel { margin-top: 12px; overflow: hidden; border: 1px solid var(--ikev2-border); border-radius: 7px; background: rgba(91, 108, 255, 0.025); }
.ikev2-proxy-port-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border-color); }
.ikev2-proxy-port-heading strong, .ikev2-proxy-port-heading small { display: block; }
.ikev2-proxy-port-heading strong { color: var(--text-main); font-size: 12px; }
.ikev2-proxy-port-heading small { margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.ikev2-proxy-port-list { display: grid; gap: 6px; padding: 8px; }
.ikev2-proxy-port-item { display: flex; min-width: 0; min-height: 42px; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 7px 6px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-bg); }
.ikev2-proxy-port-main { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 7px; }
.ikev2-proxy-port-main code { max-width: 390px; overflow: hidden; color: var(--primary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ikev2-proxy-port-main span { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 9px; white-space: nowrap; }
.ikev2-proxy-port-main .has-auth { color: #059669; }
.ikev2-proxy-port-main .no-auth { color: #b45309; }
.ikev2-proxy-port-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.ikev2-proxy-port-actions button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--border-color); border-radius: 5px; background: var(--card-bg); color: var(--text-muted); cursor: pointer; }
.ikev2-proxy-port-actions button:hover { border-color: var(--primary); color: var(--primary); }
.ikev2-proxy-port-actions button.is-danger { border-color: rgba(239, 68, 68, 0.2); color: var(--danger); }
.ikev2-proxy-modal { max-width: 520px; }
.ikev2-proxy-modal select, .ikev2-proxy-modal input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border-color); border-radius: 7px; outline: 0; background: var(--input-bg, var(--card-bg)); color: var(--text-main); }
.ikev2-proxy-modal .form-group { margin-bottom: 12px; }
.ikev2-proxy-modal .form-group label { display: block; margin-bottom: 5px; color: var(--text-main); font-size: 11px; font-weight: 700; }
.ikev2-proxy-modal .form-group label small { color: var(--text-muted); font-weight: 400; }
.ikev2-proxy-auth-toggle { display: flex; min-height: 40px; align-items: center; gap: 8px; margin: 2px 0 12px; padding: 8px 10px; border: 1px solid var(--ikev2-border); border-radius: 7px; color: var(--text-main); font-size: 11px; cursor: pointer; }
.ikev2-proxy-auth-toggle input { width: 16px; height: 16px; flex: 0 0 16px; }
.ikev2-proxy-auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ikev2-proxy-auth-grid.is-disabled { opacity: 0.48; }
.ikev2-proxy-warning { margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(245, 158, 11, 0.08); color: #b45309; font-size: 9px; line-height: 1.45; }
.ikev2-device-modal { max-width: 620px; }
.ikev2-device-search { width: 100%; margin-bottom: 10px; }
.ikev2-selector-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--text-muted); font-size: 11px; }
.ikev2-selector-summary button { padding: 4px 7px; border: 0; background: transparent; color: var(--primary); cursor: pointer; }
.ikev2-device-table-wrap { max-height: 430px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 7px; }
.ikev2-device-row { cursor: pointer; }
.ikev2-device-row.is-selected { background: rgba(91, 108, 255, 0.08); }
.ikev2-device-row td:first-child strong, .ikev2-device-row td:first-child code, .ikev2-device-row td:first-child small { display: block; }
.ikev2-device-row td:first-child strong { font-size: 12px; }
.ikev2-device-row td:first-child code { margin-top: 2px; color: var(--primary); font-size: 11px; }
.ikev2-device-row td:first-child small { margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.ikev2-device-row td:last-child { width: 64px; text-align: center; }
.muted-cell.is-error { color: var(--danger); }
body.dark-mode .ikev2-status-item, body.dark-mode .ikev2-device-panel { background: rgba(255, 255, 255, 0.025); }
@media (max-width: 900px) {
    #ikev2-section { width: 100%; }
    .ikev2-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ikev2-device-heading { align-items: stretch; flex-direction: column; }
    .ikev2-device-heading-actions { align-items: stretch; flex-direction: column; }
    .ikev2-visible-api { width: 100%; min-width: 0; }
    .ikev2-device-heading .btn { width: 100%; }
}
@media (max-width: 700px) {
    .ikev2-device-list-header { display: none; }
    .ikev2-device-chip { min-height: 58px; flex-basis: 58px; grid-template-columns: 24px minmax(105px, 1fr) 90px 84px; grid-template-rows: 28px 20px; column-gap: 6px; }
    .ikev2-device-icon { grid-column: 1; grid-row: 1; }
    .ikev2-device-ip { grid-column: 2; grid-row: 1; }
    .ikev2-device-uptime { grid-column: 3; grid-row: 1; }
    .ikev2-device-actions { grid-column: 4; grid-row: 1; }
    .ikev2-device-endpoint { grid-column: 2 / 5; grid-row: 2; }
}
@media (max-width: 560px) {
    .ikev2-page-header .header-actions { width: 100%; }
    .ikev2-page-header .header-actions .btn { flex: 1; }
    .ikev2-status-grid { grid-template-columns: 1fr; }
    .ikev2-manual-row { grid-template-columns: 1fr 1fr; }
    .ikev2-manual-row input { grid-column: 1 / -1; }
    .ikev2-manual-row .btn { width: 100%; }
    .ikev2-proxy-port-heading, .ikev2-proxy-port-item { align-items: stretch; flex-direction: column; }
    .ikev2-proxy-port-heading .btn { width: 100%; }
    .ikev2-proxy-port-main code { max-width: calc(100vw - 74px); }
    .ikev2-proxy-port-actions { justify-content: flex-end; }
    .ikev2-proxy-auth-grid { grid-template-columns: 1fr; gap: 0; }
}

/* ===== IKEv2 library ===== */
.ikev2-library-panel { margin-top: 16px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); }
.ikev2-library-heading, .ikev2-library-toolbar, .ikev2-library-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.ikev2-library-heading { border-bottom: 1px solid var(--border-color); }
.ikev2-library-heading h3 { margin: 0 0 3px; color: var(--text-main); font-size: 15px; }
.ikev2-library-heading p { margin: 0; color: var(--text-muted); font-size: 11px; }
.ikev2-library-head-side { display: flex; align-items: center; gap: 8px; }
.ikev2-library-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.ikev2-library-stats span { min-width: 92px; padding: 7px 10px; border: 1px solid var(--ikev2-border); border-radius: 6px; background: rgba(91, 108, 255, 0.06); color: var(--text-muted); font-size: 11px; }
.ikev2-library-stats strong { color: var(--primary); font-size: 13px; }
.ikev2-paste-panel { padding: 14px 16px; border-bottom: 1px solid var(--border-color); background: rgba(91, 108, 255, 0.035); }
.ikev2-paste-panel > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.ikev2-paste-panel small { color: var(--text-muted); }
.ikev2-paste-panel code { font-family: 'JetBrains Mono', monospace; color: var(--primary); }
.ikev2-paste-panel textarea { display: block; width: 100%; min-height: 138px; resize: vertical; padding: 11px 12px; border: 1px solid var(--border-color); border-radius: 7px; outline: 0; background: var(--input-bg, var(--card-bg)); color: var(--text-main); font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5; }
.ikev2-paste-panel textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.1); }
.ikev2-paste-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.ikev2-paste-actions > span { margin-right: auto; color: var(--text-muted); font-size: 11px; }
.ikev2-library-toolbar { justify-content: flex-start; border-bottom: 1px solid var(--border-color); background: var(--bg-secondary, rgba(128, 128, 128, 0.04)); }
.ikev2-library-search { display: flex; width: min(480px, 100%); height: 38px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--input-bg, var(--card-bg)); }
.ikev2-library-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-main); }
.ikev2-library-toolbar select { min-width: 180px; height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--input-bg, var(--card-bg)); color: var(--text-main); }
.ikev2-library-toolbar .btn-danger { margin-left: auto; }
.ikev2-import-progress { padding: 12px 16px; border-bottom: 1px solid var(--border-color); background: rgba(91, 108, 255, 0.05); }
.ikev2-import-progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--text-muted); font-size: 11px; }
.ikev2-import-progress progress { display: block; width: 100%; height: 7px; accent-color: var(--primary); }
.ikev2-library-table-wrap { width: 100%; overflow-x: auto; }
.ikev2-library-table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.ikev2-library-table th, .ikev2-library-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; font-size: 12px; }
.ikev2-library-table th { background: var(--bg-secondary, rgba(128, 128, 128, 0.04)); color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
.ikev2-library-table th:first-child, .ikev2-library-table td:first-child { width: 42px; text-align: center; }
.ikev2-library-table th:nth-child(2) { width: 25%; }
.ikev2-library-table th:nth-child(3) { width: 18%; }
.ikev2-library-table th:nth-child(4) { width: 22%; }
.ikev2-library-table th:nth-child(5) { width: 18%; }
.ikev2-library-table th:last-child, .ikev2-library-table td:last-child { width: 118px; text-align: center; }
.ikev2-library-table tr.is-selected td { background: rgba(91, 108, 255, 0.06); }
.ikev2-library-table tr.is-active td { background: rgba(16, 185, 129, 0.07); }
.ikev2-library-port-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ikev2-library-port { border: 1px solid rgba(16, 185, 129, 0.28); background: rgba(16, 185, 129, 0.08); color: var(--text-primary); border-radius: 7px; padding: 5px 7px; font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; white-space: nowrap; }
.ikev2-library-port i { color: #10b981; margin-right: 5px; }
.ikev2-library-port:hover { background: rgba(16, 185, 129, 0.16); border-color: rgba(16, 185, 129, 0.5); }
.ikev2-library-port.is-reserved { border-color: rgba(59, 130, 246, 0.24); background: rgba(59, 130, 246, 0.07); }
.ikev2-library-port.is-reserved i { color: #3b82f6; }
.ikev2-use-config { min-width: 88px; height: 32px; justify-content: center; padding: 0 10px; }
.ikev2-use-config.is-active { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.11); color: #059669; }
.ikev2-file-cell, .ikev2-endpoint-cell, .ikev2-location-cell { display: grid; min-width: 0; gap: 3px; }
.ikev2-file-cell strong, .ikev2-file-cell small, .ikev2-endpoint-cell strong, .ikev2-endpoint-cell small, .ikev2-location-cell strong, .ikev2-location-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ikev2-file-cell small, .ikev2-endpoint-cell small, .ikev2-location-cell small { color: var(--text-muted); }
.ikev2-location-cell strong { display: flex; align-items: center; gap: 6px; color: var(--text-main); }
.ikev2-file-devices { display: flex; min-width: 0; flex-wrap: wrap; gap: 4px; }
.ikev2-file-devices code { display: inline-flex; max-width: 145px; align-items: center; gap: 5px; padding: 3px 6px; overflow: hidden; border: 1px solid rgba(16, 185, 129, 0.24); border-radius: 5px; background: rgba(16, 185, 129, 0.08); color: #059669; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ikev2-format-badge, .ikev2-parse-state { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.ikev2-format-badge { background: rgba(91, 108, 255, 0.09); color: var(--primary); }
.ikev2-country-code { margin-left: 6px; font-size: 10px; }
.ikev2-parse-state.is-ready { background: rgba(16, 185, 129, 0.11); color: #059669; }
.ikev2-parse-state.is-unrecognized { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.ikev2-parse-state.is-binary { background: rgba(100, 116, 139, 0.12); color: #64748b; }
.ikev2-library-pagination { color: var(--text-muted); font-size: 11px; }
.ikev2-library-pagination > div { display: flex; align-items: center; gap: 9px; }
body.dark-mode .ikev2-library-panel { background: rgba(255, 255, 255, 0.025); }

@media (max-width: 760px) {
    .ikev2-library-heading, .ikev2-library-toolbar { align-items: stretch; flex-direction: column; }
    .ikev2-library-head-side { align-items: stretch; flex-direction: column; }
    .ikev2-library-search, .ikev2-library-toolbar select, .ikev2-library-toolbar .btn-danger { width: 100%; margin-left: 0; }
    .ikev2-library-stats span { flex: 1; }
    .ikev2-paste-panel > div:first-child, .ikev2-paste-actions { align-items: stretch; flex-direction: column; }
    .ikev2-paste-actions .btn { width: 100%; }
}

/* ===== NestProxy selected-port authentication ===== */
.nestproxy-auth-select-col {
    width: 44px;
    min-width: 44px;
    text-align: center !important;
}
.nestproxy-auth-select-col input,
.nestproxy-auth-row-check {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}
.nestproxy-auth-row-check:disabled {
    cursor: not-allowed;
    opacity: .38;
}
.nestproxy-auth-row-selected td {
    background: rgba(91, 108, 255, .055);
}
.nestproxy-row-actions {
    grid-template-columns: minmax(84px, 1fr) 36px 36px 36px !important;
    gap: 6px !important;
}
#nestproxy-section .shoplike-table {
    min-width: 1540px;
}
.nestproxy-auth-chip {
    display: inline-flex;
    max-width: 180px;
    height: 25px;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    overflow: hidden;
    border: 1px solid rgba(91, 108, 255, .2);
    border-radius: 7px;
    background: rgba(91, 108, 255, .07);
    color: var(--primary);
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
}
.nestproxy-auth-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nestproxy-auth-chip.is-missing {
    border-color: rgba(245, 158, 11, .22);
    background: rgba(245, 158, 11, .08);
    color: #b45309;
}
.nestproxy-auth-modal {
    max-width: 620px;
}
.nestproxy-auth-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(91, 108, 255, .16);
    border-radius: 12px;
    background: rgba(91, 108, 255, .05);
}
.nestproxy-auth-summary > span {
    color: var(--text-muted);
    font-size: 12px;
}
.nestproxy-auth-summary > strong {
    color: var(--text-main);
    font-size: 13px;
}
.nestproxy-auth-port-list {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.nestproxy-auth-port-list code {
    padding: 4px 8px;
    border: 1px solid rgba(16, 185, 129, .22);
    border-radius: 7px;
    background: rgba(16, 185, 129, .08);
    color: #059669;
    font-weight: 800;
}
.nestproxy-custom-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.nestproxy-custom-auth-grid[hidden] {
    display: none;
}
.nestproxy-custom-auth-grid .form-group {
    min-width: 0;
}
.nestproxy-custom-auth-grid small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 10.5px;
}
.nestproxy-password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
}
.nestproxy-password-field input {
    border-radius: 9px 0 0 9px !important;
}
.nestproxy-password-field button {
    border: 1px solid var(--border-color);
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: var(--input-bg, var(--card-bg));
    color: var(--text-muted);
    cursor: pointer;
}
.nestproxy-auth-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-size: 12px;
    font-weight: 700;
}
.nestproxy-auth-note[hidden] {
    display: none;
}
.nestproxy-auth-help {
    margin: 14px 0 0;
    color: var(--text-muted);
}
body.dark-mode .nestproxy-auth-row-selected td {
    background: rgba(129, 140, 248, .08);
}
body.dark-mode .nestproxy-auth-summary,
body.dark-mode .nestproxy-auth-chip {
    border-color: rgba(129, 140, 248, .22);
    background: rgba(129, 140, 248, .09);
}
body.dark-mode .nestproxy-auth-port-list code {
    color: #6ee7b7;
}
@media (max-width: 700px) {
    .nestproxy-custom-auth-grid {
        grid-template-columns: 1fr;
    }
    .nestproxy-auth-modal {
        max-width: calc(100vw - 24px);
    }
}

/* ShopLike assigned-device dropdown */
:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown {
    min-width: 220px;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #c7d2fe;
    border-radius: 11px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown > summary::-webkit-details-marker {
    display: none;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown > summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-chevron {
    font-size: 11px;
    transition: transform .18s ease;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown[open] .shoplike-device-chevron {
    transform: rotate(180deg);
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown-panel {
    display: grid;
    gap: 10px;
    min-width: 300px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .1);
}

:is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    background: #ecfdf5;
    color: #047857;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-chip > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(225, 29, 72, .2);
    border-radius: 7px;
    background: rgba(225, 29, 72, .08);
    color: #e11d48;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-remove-btn:hover {
    border-color: #e11d48;
    background: #e11d48;
    color: #fff;
    transform: scale(1.05);
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-remove-btn:disabled {
    cursor: wait;
    opacity: .55;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-empty {
    padding: 8px;
    border-radius: 9px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown-panel .shoplike-device-cell {
    grid-template-columns: minmax(180px, 1fr) 36px 36px;
    min-width: 0;
}

#nestproxy-section .shoplike-device-dropdown {
    min-width: 0;
}

#nestproxy-section .shoplike-device-dropdown-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#nestproxy-section .shoplike-assigned-device-list {
    grid-template-columns: 1fr;
}

#nestproxy-section .shoplike-device-dropdown-panel .shoplike-device-cell {
    grid-template-columns: minmax(140px, 1fr) 34px 34px;
}

body.dark-mode :is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown > summary {
    border-color: #4338ca;
    background: rgba(79, 70, 229, .15);
    color: #c7d2fe;
}

body.dark-mode :is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown-panel {
    border-color: #334155;
    background: #111827;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

body.dark-mode :is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-chip {
    border-color: rgba(16, 185, 129, .35);
    background: rgba(16, 185, 129, .12);
    color: #6ee7b7;
}

body.dark-mode :is(#shoplike-section, #nestproxy-section) .shoplike-device-remove-btn {
    border-color: rgba(251, 113, 133, .3);
    background: rgba(225, 29, 72, .14);
    color: #fb7185;
}

body.dark-mode :is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-empty {
    background: #0f172a;
    color: #94a3b8;
}

@media (max-width: 700px) {
    :is(#shoplike-section, #nestproxy-section) .shoplike-device-dropdown-panel {
        min-width: 260px;
    }

    :is(#shoplike-section, #nestproxy-section) .shoplike-assigned-device-list {
        grid-template-columns: 1fr;
    }
}

/* ===== NestProxy workspace redesign ===== */
#nestproxy-section {
    --nest-accent: #4f46e5;
    --nest-accent-soft: rgba(79, 70, 229, .08);
    --nest-green: #059669;
    --nest-border: rgba(148, 163, 184, .24);
    width: 100%;
    min-width: 0;
}

#nestproxy-section .nestproxy-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(79, 70, 229, .14);
    border-radius: 16px;
    background:
        radial-gradient(circle at 10% 0%, rgba(99, 102, 241, .1), transparent 38%),
        var(--card-bg, #fff);
    box-shadow: 7px 7px 18px rgba(15, 23, 42, .06), -5px -5px 15px rgba(255, 255, 255, .72);
}

#nestproxy-section .nestproxy-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

#nestproxy-section .nestproxy-heading-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    color: #fff;
    box-shadow: 0 9px 20px rgba(79, 70, 229, .24);
    font-size: 18px;
}

#nestproxy-section .nestproxy-heading h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 22px;
    letter-spacing: -.02em;
}

#nestproxy-section .nestproxy-heading .section-subtitle {
    margin: 3px 0 0;
}

#nestproxy-section .nestproxy-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#nestproxy-section .nestproxy-live-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-size: 12px;
    font-weight: 800;
}

#nestproxy-section .nestproxy-live-chip i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
    animation: nestproxy-live-pulse 1.8s ease-in-out infinite;
}

#nestproxy-section .nestproxy-api-shortcut {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid rgba(79, 70, 229, .18);
    border-radius: 10px;
    background: var(--nest-accent-soft);
    color: var(--nest-accent);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-api-shortcut i:last-child {
    color: #818cf8;
}

@keyframes nestproxy-live-pulse {
    50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}

#nestproxy-section .nestproxy-setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 12px;
    margin-bottom: 12px;
}

#nestproxy-section .nestproxy-setup-card {
    grid-column: 1;
    min-width: 0;
}

#nestproxy-section .nestproxy-note-card {
    grid-column: 2;
    min-width: 0;
    justify-content: center;
    border-color: rgba(16, 185, 129, .18);
    background: linear-gradient(145deg, rgba(236, 253, 245, .82), rgba(248, 250, 252, .84));
}

#nestproxy-section .nestproxy-key-form-grid {
    grid-template-columns: minmax(130px, .58fr) minmax(220px, 1.15fr) minmax(190px, 1fr);
}

#nestproxy-section .nestproxy-key-form-grid .form-group,
#nestproxy-section .nestproxy-key-form-grid input {
    min-width: 0;
}

#nestproxy-section .nestproxy-form-actions {
    justify-content: flex-start;
}

#nestproxy-section .nestproxy-mcp-panel {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

#nestproxy-section .nestproxy-mcp-summary {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 13px 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

#nestproxy-section .nestproxy-mcp-summary::-webkit-details-marker,
#nestproxy-section .nestproxy-device-overview > summary::-webkit-details-marker {
    display: none;
}

#nestproxy-section .nestproxy-mcp-summary h3,
#nestproxy-section .nestproxy-mcp-summary p {
    margin: 0;
}

#nestproxy-section .nestproxy-mcp-summary p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

#nestproxy-section .nestproxy-advanced-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--nest-accent);
    font-size: 11px;
    font-weight: 800;
}

#nestproxy-section .nestproxy-advanced-label i,
#nestproxy-section .nestproxy-device-summary-side > i {
    transition: transform .18s ease;
}

#nestproxy-section .nestproxy-mcp-panel[open] .nestproxy-advanced-label i,
#nestproxy-section .nestproxy-device-overview[open] .nestproxy-device-summary-side > i {
    transform: rotate(180deg);
}

#nestproxy-section .nestproxy-mcp-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    padding: 0 15px 15px;
    border-top: 1px solid var(--nest-border);
}

#nestproxy-section .nestproxy-mcp-content > :first-child {
    margin-top: 14px;
}

#nestproxy-section .nestproxy-mcp-actions,
#nestproxy-section .nestproxy-mcp-status,
#nestproxy-section .nestproxy-ai-console {
    grid-column: 1 / -1;
}

#nestproxy-section .nestproxy-list-card {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

#nestproxy-section .nestproxy-list-head {
    display: grid;
    grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--nest-border);
}

#nestproxy-section .nestproxy-list-head h3,
#nestproxy-section .nestproxy-list-head p {
    margin: 0;
}

#nestproxy-section .nestproxy-list-head p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

#nestproxy-section .nestproxy-bulk-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

#nestproxy-section .nestproxy-bulk-actions .btn {
    min-height: 34px;
    border-radius: 10px;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-bulk-dns {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 3px 4px 3px 10px;
    border: 1px solid rgba(14, 165, 233, .28);
    border-radius: 10px;
    background: rgba(14, 165, 233, .07);
    color: var(--text-main);
}

#nestproxy-section .nestproxy-bulk-dns > i {
    color: #0284c7;
}

#nestproxy-section .nestproxy-bulk-dns select {
    min-width: 138px;
    min-height: 28px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
}

#nestproxy-section .nestproxy-bulk-dns > span {
    max-width: 92px;
    overflow: hidden;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-bulk-dns button {
    min-height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 8px;
    background: #0284c7;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-bulk-dns :is(button, select):disabled {
    cursor: wait;
    opacity: .65;
}

#nestproxy-section .nestproxy-select-all {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--nest-border);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-select-all input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--nest-accent);
}

#nestproxy-section .nestproxy-auto-select {
    width: 150px;
    min-height: 34px;
    border-radius: 10px;
    font-size: 11px;
}

#nestproxy-section .nestproxy-timer-label {
    display: inline-flex;
    min-width: 92px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 8px;
    padding: 10px 14px 0;
}

#nestproxy-section .nestproxy-summary-strip > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--nest-border);
    border-radius: 11px;
    background: rgba(248, 250, 252, .78);
}

#nestproxy-section .nestproxy-summary-strip span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-summary-strip strong {
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 15px;
}

#nestproxy-section .nestproxy-device-overview {
    margin: 10px 14px;
}

#nestproxy-section .nestproxy-device-overview-head {
    border-bottom: 0;
    cursor: pointer;
    list-style: none;
}

#nestproxy-section .nestproxy-device-overview[open] .nestproxy-device-overview-head {
    border-bottom: 1px solid rgba(20, 184, 166, .14);
}

#nestproxy-section .nestproxy-device-summary-side {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    color: #0f766e;
}

#nestproxy-section .nestproxy-key-list {
    display: grid;
    gap: 9px;
    padding: 4px 14px 14px;
}

#nestproxy-section .nestproxy-key-card {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: 30px minmax(145px, .72fr) minmax(280px, 1.36fr) minmax(210px, 1fr) minmax(180px, .82fr);
    gap: 12px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--nest-border);
    border-left: 3px solid #22c55e;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 5px 5px 13px rgba(15, 23, 42, .045), -4px -4px 12px rgba(255, 255, 255, .65);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#nestproxy-section .nestproxy-key-card:hover {
    border-color: rgba(79, 70, 229, .3);
    box-shadow: 0 9px 24px rgba(15, 23, 42, .08);
}

#nestproxy-section .nestproxy-key-card.is-offline {
    border-left-color: #ef4444;
}

#nestproxy-section .nestproxy-key-card.is-unstable {
    border-left-color: #f59e0b;
}

#nestproxy-section .nestproxy-key-card.nestproxy-auth-row-selected {
    border-color: rgba(79, 70, 229, .42);
    background: linear-gradient(145deg, rgba(238, 242, 255, .72), var(--card-bg, #fff));
    box-shadow: 0 0 0 2px rgba(79, 70, 229, .08);
}

#nestproxy-section .nestproxy-card-select {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

#nestproxy-section .nestproxy-card-select input {
    width: 17px;
    height: 17px;
    accent-color: var(--nest-accent);
}

#nestproxy-section :is(.nestproxy-card-identity, .nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) {
    min-width: 0;
}

#nestproxy-section :is(.nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) {
    padding-left: 12px;
    border-left: 1px solid var(--nest-border);
}

#nestproxy-section .nestproxy-card-identity {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#nestproxy-section .nestproxy-card-title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

#nestproxy-section .nestproxy-card-title-row strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-card-title-row > span {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 7px;
    background: var(--nest-accent-soft);
    color: var(--nest-accent);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    font-weight: 850;
}

#nestproxy-section .nestproxy-masked-key {
    align-self: flex-start;
    max-width: 100%;
    padding: 4px 7px;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, .14);
    border-radius: 7px;
    background: var(--nest-accent-soft);
    color: var(--nest-accent);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-card-meta {
    display: grid;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
}

#nestproxy-section .nestproxy-card-meta span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-card-meta i {
    width: 12px;
    color: #94a3b8;
    text-align: center;
}

#nestproxy-section .nestproxy-card-meta .is-balance {
    color: #047857;
    font-weight: 800;
}

#nestproxy-section .nestproxy-card-section-label {
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#nestproxy-section .nestproxy-network-stack {
    display: grid;
    gap: 6px;
}

#nestproxy-section .nestproxy-network-line {
    display: grid;
    min-width: 0;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
}

#nestproxy-section .nestproxy-network-line > span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
}

#nestproxy-section .nestproxy-endpoint-pill {
    display: flex;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    padding: 0 6px 0 9px;
    border: 1px solid rgba(99, 102, 241, .16);
    border-radius: 9px;
    background: rgba(99, 102, 241, .055);
    color: var(--nest-accent);
}

#nestproxy-section .nestproxy-endpoint-pill.is-public {
    border-color: rgba(16, 185, 129, .22);
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#nestproxy-section .nestproxy-endpoint-pill code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-endpoint-pill > button {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: rgba(16, 185, 129, .12);
    color: #047857;
    cursor: pointer;
}

#nestproxy-section .nestproxy-route-empty,
#nestproxy-section .nestproxy-route-pending,
#nestproxy-section .nestproxy-device-pending {
    display: flex;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 10px;
}

#nestproxy-section .nestproxy-auth-chip {
    width: auto;
    max-width: 100%;
    justify-self: start;
}

#nestproxy-section .nestproxy-card-devices .shoplike-device-dropdown {
    width: 100%;
    min-width: 0;
}

#nestproxy-section .nestproxy-card-devices .shoplike-device-dropdown > summary {
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
}

#nestproxy-section .nestproxy-card-devices .shoplike-device-dropdown-panel {
    min-width: 0;
    box-shadow: none;
}

#nestproxy-section .nestproxy-card-devices .shoplike-assigned-device-list {
    grid-template-columns: 1fr;
}

#nestproxy-section .nestproxy-card-devices .shoplike-device-dropdown-panel .shoplike-device-cell {
    grid-template-columns: minmax(110px, 1fr) 32px 32px;
}

#nestproxy-section .nestproxy-card-health {
    display: flex;
    flex-direction: column;
}

#nestproxy-section .nestproxy-health-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#nestproxy-section .nestproxy-security-chip {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid var(--nest-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-security-chip.is-on {
    border-color: rgba(16, 185, 129, .2);
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#nestproxy-section .nestproxy-webrtc-control {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    gap: 5px;
    padding: 0 7px;
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 8px;
    background: rgba(245, 158, 11, .07);
    color: #b45309;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-webrtc-control.is-proxy {
    border-color: rgba(16, 185, 129, .24);
    background: rgba(16, 185, 129, .08);
    color: #047857;
}

#nestproxy-section .nestproxy-webrtc-control select {
    max-width: 118px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font-size: 9.5px;
    font-weight: 800;
    cursor: pointer;
}

#nestproxy-section .nestproxy-webrtc-control select:disabled {
    cursor: wait;
    opacity: .6;
}

#nestproxy-section .nestproxy-webrtc-control option {
    background: #fff;
    color: #0f172a;
}

body.dark-mode #nestproxy-section .nestproxy-webrtc-control option {
    background: #111827;
    color: #f8fafc;
}

#nestproxy-section .nestproxy-health-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nestproxy-section .nestproxy-card-actions {
    display: grid;
    grid-template-columns: minmax(82px, 1fr) 32px 32px 32px;
    gap: 5px;
    margin-top: auto;
    padding-top: 9px;
}

#nestproxy-section .nestproxy-card-actions .shoplike-action-btn {
    height: 32px;
    min-height: 32px;
    border-radius: 9px;
    padding: 0 8px;
    font-size: 10px;
}

#nestproxy-section .nestproxy-card-actions .shoplike-action-btn.icon-only {
    width: 32px;
    min-width: 32px;
    padding: 0;
}

#nestproxy-section .nestproxy-empty-state {
    display: grid;
    min-height: 150px;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--text-muted);
    text-align: center;
}

#nestproxy-section .nestproxy-empty-state > i {
    color: #a5b4fc;
    font-size: 28px;
}

#nestproxy-section .nestproxy-empty-state strong {
    color: var(--text-main);
    font-size: 14px;
}

#nestproxy-section .nestproxy-empty-state span {
    font-size: 11px;
}

body.dark-mode #nestproxy-section .nestproxy-page-header,
body.dark-mode #nestproxy-section .nestproxy-key-card {
    box-shadow: 7px 7px 18px rgba(0, 0, 0, .18), -4px -4px 13px rgba(51, 65, 85, .08);
}

body.dark-mode #nestproxy-section .nestproxy-note-card,
body.dark-mode #nestproxy-section .nestproxy-summary-strip > div {
    background: rgba(15, 23, 42, .72);
}

body.dark-mode #nestproxy-section .nestproxy-select-all {
    background: #0f172a;
}

body.dark-mode #nestproxy-section .nestproxy-key-card.nestproxy-auth-row-selected {
    background: linear-gradient(145deg, rgba(49, 46, 129, .16), var(--card-bg, #111827));
}

body.dark-mode #nestproxy-section .nestproxy-endpoint-pill {
    background: rgba(99, 102, 241, .11);
}

body.dark-mode #nestproxy-section .nestproxy-endpoint-pill.is-public {
    background: rgba(16, 185, 129, .1);
}

@media (max-width: 1050px) {
    #nestproxy-section .nestproxy-key-card {
        grid-template-columns: 30px minmax(200px, .8fr) minmax(300px, 1.2fr);
    }

    #nestproxy-section .nestproxy-card-select {
        grid-row: 1 / span 2;
    }

    #nestproxy-section .nestproxy-card-devices {
        grid-column: 2;
    }

    #nestproxy-section .nestproxy-card-health {
        grid-column: 3;
    }

    #nestproxy-section .nestproxy-card-devices {
        border-left: 0;
    }
}

@media (max-width: 980px) {
    #nestproxy-section .nestproxy-page-header,
    #nestproxy-section .nestproxy-list-head {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    #nestproxy-section .nestproxy-page-header {
        flex-direction: column;
    }

    #nestproxy-section .nestproxy-header-actions,
    #nestproxy-section .nestproxy-bulk-actions {
        justify-content: flex-start;
    }

    #nestproxy-section .nestproxy-setup-grid {
        grid-template-columns: 1fr;
    }

    #nestproxy-section :is(.nestproxy-setup-card, .nestproxy-note-card, .nestproxy-mcp-panel) {
        grid-column: 1;
    }

    #nestproxy-section .nestproxy-key-form-grid,
    #nestproxy-section .nestproxy-mcp-content {
        grid-template-columns: 1fr;
    }

    #nestproxy-section .nestproxy-mcp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    #nestproxy-section .nestproxy-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #nestproxy-section .nestproxy-key-card {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    #nestproxy-section .nestproxy-card-select {
        grid-row: 1 / span 4;
    }

    #nestproxy-section :is(.nestproxy-card-identity, .nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) {
        grid-column: 2;
    }

    #nestproxy-section :is(.nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) {
        padding: 10px 0 0;
        border-top: 1px solid var(--nest-border);
        border-left: 0;
    }

    #nestproxy-section .nestproxy-mcp-summary {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    #nestproxy-section .nestproxy-advanced-label {
        grid-column: 2;
    }
}

@media (max-width: 520px) {
    #nestproxy-section .nestproxy-live-chip {
        display: none;
    }

    #nestproxy-section .nestproxy-bulk-actions > :is(.btn, .nestproxy-select-all, .nestproxy-auto-select, .nestproxy-timer-label, .nestproxy-bulk-dns) {
        width: 100%;
        justify-content: center;
    }

    #nestproxy-section .nestproxy-bulk-dns select {
        flex: 1;
        min-width: 0;
    }

    #nestproxy-section .nestproxy-summary-strip {
        grid-template-columns: 1fr 1fr;
        padding-inline: 10px;
    }

    #nestproxy-section .nestproxy-device-overview {
        margin-inline: 10px;
    }

    #nestproxy-section .nestproxy-key-list {
        padding-inline: 10px;
    }

    #nestproxy-section .nestproxy-key-card {
        padding: 10px;
    }
}

/* NestProxy bulk key import */
.nestproxy-bulk-modal {
    width: min(760px, calc(100vw - 28px));
    max-width: 760px !important;
}

.nestproxy-bulk-modal .header-with-icon {
    min-width: 0;
    align-items: center;
}

.nestproxy-bulk-modal .header-with-icon > div {
    min-width: 0;
}

.nestproxy-bulk-modal .modal-header h2 {
    margin: 0;
}

.nestproxy-bulk-modal .modal-header p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.nestproxy-bulk-modal .close {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    line-height: 1;
}

.nestproxy-bulk-modal .close:hover {
    background: rgba(148, 163, 184, .12);
    color: var(--text-main);
}

.nestproxy-bulk-modal .close:disabled {
    cursor: wait;
    opacity: .45;
}

.nestproxy-bulk-body {
    display: grid;
    gap: 12px;
}

.nestproxy-bulk-format {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 11px 12px;
    border: 1px solid rgba(79, 70, 229, .16);
    border-radius: 12px;
    background: rgba(79, 70, 229, .055);
}

.nestproxy-bulk-format strong {
    flex: 0 0 100%;
    color: var(--text-main);
    font-size: 12px;
}

.nestproxy-bulk-format code {
    padding: 4px 7px;
    border: 1px solid rgba(99, 102, 241, .18);
    border-radius: 7px;
    background: var(--card-bg, #fff);
    color: #4338ca;
    font-size: 10px;
    font-weight: 800;
}

.nestproxy-bulk-format small {
    flex: 0 0 100%;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.55;
}

.nestproxy-bulk-file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
}

.nestproxy-bulk-file-row > span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.nestproxy-bulk-textarea {
    min-height: 270px;
    max-height: 48vh;
    resize: vertical;
    white-space: pre;
    overflow: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.55;
}

.nestproxy-bulk-data-label {
    margin-bottom: -7px;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
}

.nestproxy-bulk-modal[aria-busy="true"] .nestproxy-bulk-textarea,
.nestproxy-bulk-modal[aria-busy="true"] .nestproxy-bulk-file-row {
    opacity: .68;
}

.nestproxy-bulk-summary {
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(16, 185, 129, .08);
    color: #047857;
    font-size: 11px;
    font-weight: 800;
}

.nestproxy-bulk-summary.has-error {
    background: rgba(245, 158, 11, .1);
    color: #b45309;
}

.nestproxy-bulk-errors {
    max-height: 132px;
    margin: 0;
    overflow: auto;
    padding: 10px 11px;
    border: 1px solid rgba(239, 68, 68, .18);
    border-radius: 9px;
    background: rgba(254, 242, 242, .8);
    color: #b91c1c;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.55;
    white-space: pre-wrap;
}

.nestproxy-bulk-safety {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.nestproxy-bulk-safety i {
    margin-top: 2px;
    color: #059669;
}

body.dark-mode .nestproxy-bulk-format,
body.dark-mode .nestproxy-bulk-format code {
    background: rgba(30, 41, 59, .82);
}

body.dark-mode .nestproxy-bulk-format code {
    color: #a5b4fc;
}

body.dark-mode .nestproxy-bulk-summary {
    color: #6ee7b7;
}

body.dark-mode .nestproxy-bulk-summary.has-error {
    color: #fbbf24;
}

body.dark-mode .nestproxy-bulk-errors {
    background: rgba(127, 29, 29, .15);
    color: #fca5a5;
}

@media (max-width: 620px) {
    .nestproxy-bulk-modal .modal-header {
        align-items: flex-start;
    }

    .nestproxy-bulk-format {
        align-items: stretch;
    }

    .nestproxy-bulk-format code {
        flex: 1 1 100%;
        overflow-wrap: anywhere;
    }

    .nestproxy-bulk-file-row > :is(label, span) {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .nestproxy-bulk-textarea {
        min-height: 230px;
    }
}

/* ===== ShopLike responsive card workspace ===== */
#shoplike-section {
    --shop-accent: #2563eb;
    --shop-accent-strong: #1d4ed8;
    --shop-accent-soft: rgba(37, 99, 235, .075);
    --shop-green: #059669;
    --shop-border: rgba(148, 163, 184, .24);
    width: 100%;
    min-width: 0;
}

#shoplike-section .shoplike-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 16px;
    background:
        radial-gradient(circle at 9% 0%, rgba(59, 130, 246, .11), transparent 38%),
        var(--card-bg, #fff);
    box-shadow: 7px 7px 18px rgba(15, 23, 42, .06), -5px -5px 15px rgba(255, 255, 255, .72);
}

#shoplike-section .shoplike-heading-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

#shoplike-section .shoplike-heading-icon-v2 {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .24);
    font-size: 18px;
}

#shoplike-section .shoplike-heading-v2 h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 22px;
    letter-spacing: -.02em;
}

#shoplike-section .shoplike-heading-v2 .section-subtitle {
    margin: 3px 0 0;
}

#shoplike-section .shoplike-header-actions {
    min-width: 0;
}

#shoplike-section .shoplike-live-chip-v2 {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

#shoplike-section .shoplike-live-chip-v2 i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
    animation: shoplike-live-pulse 1.8s ease-in-out infinite;
}

@keyframes shoplike-live-pulse {
    50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}

#shoplike-section .shoplike-api-doc-chip {
    min-height: 36px;
    padding-block: 5px;
    border-radius: 10px;
    box-shadow: none;
}

#shoplike-section .shoplike-api-doc-chip code {
    max-width: 290px;
}

#shoplike-section .shoplike-page-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(275px, .65fr);
    gap: 12px;
    margin-bottom: 12px;
}

#shoplike-section :is(.shoplike-setup-card-v2, .shoplike-note-card-v2) {
    min-width: 0;
}

#shoplike-section .shoplike-setup-card-v2 {
    padding: 16px;
}

#shoplike-section .shoplike-note-card-v2 {
    justify-content: center;
    border-color: rgba(16, 185, 129, .18);
    background: linear-gradient(145deg, rgba(236, 253, 245, .82), rgba(248, 250, 252, .84));
}

#shoplike-section .shoplike-form-grid {
    grid-template-columns: minmax(115px, .62fr) minmax(200px, 1.35fr) minmax(125px, .78fr) minmax(125px, .78fr);
    gap: 10px;
}

#shoplike-section .shoplike-form-grid :is(.form-group, input, select) {
    min-width: 0;
}

#shoplike-section .shoplike-form-actions {
    justify-content: flex-start;
}

#shoplike-section .shoplike-list-card-v2 {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

#shoplike-section .shoplike-list-head {
    display: grid;
    grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr);
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--shop-border);
}

#shoplike-section .shoplike-list-head h3,
#shoplike-section .shoplike-list-head p {
    margin: 0;
}

#shoplike-section .shoplike-list-head p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

#shoplike-section .shoplike-bulk-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

#shoplike-section .shoplike-bulk-actions .btn {
    min-height: 34px;
    border-radius: 10px;
    white-space: nowrap;
}

#shoplike-section .shoplike-bulk-dns {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 3px 4px 3px 10px;
    border: 1px solid rgba(37, 99, 235, .26);
    border-radius: 10px;
    background: rgba(37, 99, 235, .065);
    color: var(--text-main);
}

#shoplike-section .shoplike-bulk-dns > i {
    color: #2563eb;
}

#shoplike-section .shoplike-bulk-dns select {
    min-width: 138px;
    min-height: 28px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
}

#shoplike-section .shoplike-bulk-dns > span {
    max-width: 92px;
    overflow: hidden;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-bulk-dns button {
    min-height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

#shoplike-section .shoplike-bulk-dns :is(button, select):disabled {
    cursor: wait;
    opacity: .65;
}

#shoplike-section .shoplike-auto-select {
    width: 154px;
    min-height: 34px;
    padding: 0 28px 0 10px;
    border-radius: 10px;
    background-color: var(--card-bg, #fff);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 750;
}

#shoplike-section .shoplike-custom-duration {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 5px;
    padding: 3px;
    border: 1px solid rgba(37, 99, 235, .24);
    border-radius: 10px;
    background: rgba(37, 99, 235, .055);
}

#shoplike-section .shoplike-custom-duration[hidden] {
    display: none;
}

#shoplike-section .shoplike-custom-duration input {
    width: 70px;
    min-height: 26px;
    padding: 0 8px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

#shoplike-section .shoplike-custom-duration button {
    min-height: 26px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

#shoplike-section .shoplike-timer-label {
    display: inline-flex;
    min-width: 92px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

#shoplike-section .shoplike-timer-label:empty::before {
    content: '--:--';
}

#shoplike-section .shoplike-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 8px;
    padding: 10px 14px 0;
}

#shoplike-section .shoplike-summary-strip > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--shop-border);
    border-radius: 11px;
    background: rgba(248, 250, 252, .78);
}

#shoplike-section .shoplike-summary-strip span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-summary-strip strong {
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 15px;
}

#shoplike-section .shoplike-device-overview {
    margin: 10px 14px;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 12px;
    background: rgba(37, 99, 235, .035);
}

#shoplike-section .shoplike-device-overview > summary::-webkit-details-marker {
    display: none;
}

#shoplike-section .shoplike-device-overview-head {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

#shoplike-section .shoplike-device-overview-head > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

#shoplike-section .shoplike-device-overview-head strong {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-main);
    font-size: 12px;
}

#shoplike-section .shoplike-device-overview-head strong i {
    color: var(--shop-accent);
}

#shoplike-section .shoplike-device-overview-head small {
    color: var(--text-muted);
    font-size: 10px;
}

#shoplike-section .shoplike-device-summary-side {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    color: var(--shop-accent-strong);
    font-size: 11px;
    font-weight: 800;
}

#shoplike-section .shoplike-device-summary-side > i {
    transition: transform .18s ease;
}

#shoplike-section .shoplike-device-overview[open] .shoplike-device-summary-side > i {
    transform: rotate(180deg);
}

#shoplike-section .shoplike-device-overview[open] .shoplike-device-overview-head {
    border-bottom: 1px solid rgba(37, 99, 235, .12);
}

#shoplike-section .shoplike-overview-device-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 7px;
    max-height: 290px;
    padding: 10px;
    overflow-y: auto;
}

#shoplike-section .shoplike-overview-device {
    display: grid;
    min-width: 0;
    grid-template-columns: 8px minmax(105px, .8fr) minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    padding: 7px 8px;
    border: 1px solid var(--shop-border);
    border-radius: 9px;
    background: var(--card-bg, #fff);
}

#shoplike-section .shoplike-overview-state {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
}

#shoplike-section .shoplike-overview-device.is-active .shoplike-overview-state {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .11);
}

#shoplike-section :is(.shoplike-overview-ip, .shoplike-overview-meta) {
    min-width: 0;
}

#shoplike-section .shoplike-overview-ip {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #047857;
}

#shoplike-section .shoplike-overview-ip code,
#shoplike-section .shoplike-overview-meta :is(strong, small) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-overview-ip code {
    color: inherit;
    font-size: 10px;
    font-weight: 800;
}

#shoplike-section .shoplike-overview-meta {
    display: grid;
    gap: 1px;
}

#shoplike-section .shoplike-overview-meta strong {
    color: var(--text-main);
    font-size: 10px;
}

#shoplike-section .shoplike-overview-meta small,
#shoplike-section .shoplike-overview-empty {
    color: var(--text-muted);
    font-size: 9px;
}

#shoplike-section .shoplike-overview-empty {
    grid-column: 1 / -1;
    padding: 15px;
    text-align: center;
}

#shoplike-section .shoplike-key-list-v2 {
    display: grid;
    gap: 9px;
    padding: 4px 14px 14px;
}

#shoplike-section .shoplike-key-card-v2 {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(145px, .72fr) minmax(280px, 1.32fr) minmax(210px, 1fr) minmax(190px, .84fr);
    gap: 12px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--shop-border);
    border-left: 3px solid #22c55e;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 5px 5px 13px rgba(15, 23, 42, .045), -4px -4px 12px rgba(255, 255, 255, .65);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#shoplike-section .shoplike-key-card-v2:hover {
    border-color: rgba(37, 99, 235, .3);
    box-shadow: 0 9px 24px rgba(15, 23, 42, .08);
}

#shoplike-section .shoplike-key-card-v2.is-offline {
    border-left-color: #ef4444;
}

#shoplike-section .shoplike-key-card-v2.is-warning {
    border-left-color: #f59e0b;
}

#shoplike-section :is(.shoplike-card-identity-v2, .shoplike-card-network-v2, .shoplike-card-devices-v2, .shoplike-card-health-v2) {
    min-width: 0;
}

#shoplike-section :is(.shoplike-card-network-v2, .shoplike-card-devices-v2, .shoplike-card-health-v2) {
    padding-left: 12px;
    border-left: 1px solid var(--shop-border);
}

#shoplike-section .shoplike-card-identity-v2 {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#shoplike-section .shoplike-card-title-row-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

#shoplike-section .shoplike-card-title-row-v2 strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-card-title-row-v2 > span {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 7px;
    background: var(--shop-accent-soft);
    color: var(--shop-accent);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    font-weight: 850;
}

#shoplike-section .shoplike-masked-key-v2 {
    align-self: flex-start;
    max-width: 100%;
    padding: 4px 7px;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 7px;
    background: var(--shop-accent-soft);
    color: var(--shop-accent);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-card-meta-v2 {
    display: grid;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
}

#shoplike-section .shoplike-card-meta-v2 span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-card-meta-v2 i {
    width: 12px;
    color: #94a3b8;
    text-align: center;
}

#shoplike-section .shoplike-card-section-label-v2 {
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#shoplike-section .shoplike-network-stack-v2 {
    display: grid;
    gap: 6px;
}

#shoplike-section .shoplike-network-line-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
}

#shoplike-section .shoplike-network-line-v2 > span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
}

#shoplike-section .shoplike-endpoint-pill-v2 {
    display: flex;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    padding: 0 6px 0 9px;
    border: 1px solid rgba(37, 99, 235, .17);
    border-radius: 9px;
    background: rgba(37, 99, 235, .055);
    color: var(--shop-accent);
}

#shoplike-section .shoplike-endpoint-pill-v2.is-public {
    border-color: rgba(16, 185, 129, .22);
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#shoplike-section .shoplike-endpoint-pill-v2 code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-endpoint-pill-v2 > button {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: rgba(16, 185, 129, .12);
    color: #047857;
    cursor: pointer;
}

#shoplike-section :is(.shoplike-route-empty-v2, .shoplike-route-pending-v2, .shoplike-device-pending-v2) {
    display: flex;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 10px;
}

#shoplike-section .shoplike-card-devices-v2 .shoplike-device-dropdown {
    width: 100%;
    min-width: 0;
}

#shoplike-section .shoplike-card-devices-v2 .shoplike-device-dropdown > summary {
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
}

#shoplike-section .shoplike-card-devices-v2 .shoplike-device-dropdown-panel {
    width: 100%;
    min-width: 0;
    box-shadow: none;
}

#shoplike-section .shoplike-card-devices-v2 .shoplike-assigned-device-list {
    grid-template-columns: 1fr;
}

#shoplike-section .shoplike-card-devices-v2 .shoplike-device-cell {
    min-width: 0;
    grid-template-columns: minmax(90px, 1fr) 32px 32px;
    gap: 6px;
}

#shoplike-section .shoplike-card-devices-v2 :is(.shoplike-device-input, .shoplike-mini-btn) {
    height: 32px;
}

#shoplike-section .shoplike-card-devices-v2 .shoplike-mini-btn {
    width: 32px;
}

#shoplike-section .shoplike-card-health-v2 {
    display: flex;
    flex-direction: column;
}

#shoplike-section .shoplike-health-row-v2 {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#shoplike-section .shoplike-security-chip-v2 {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid var(--shop-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

#shoplike-section .shoplike-security-chip-v2.is-on {
    border-color: rgba(16, 185, 129, .2);
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#shoplike-section .shoplike-webrtc-control-v2 {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border: 1px solid rgba(245, 158, 11, .22);
    border-radius: 999px;
    background: rgba(245, 158, 11, .07);
    color: #b45309;
    white-space: nowrap;
}

#shoplike-section .shoplike-webrtc-control-v2.is-proxy {
    border-color: rgba(16, 185, 129, .24);
    background: rgba(16, 185, 129, .08);
    color: #047857;
}

#shoplike-section .shoplike-webrtc-control-v2 select {
    max-width: 124px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

#shoplike-section .shoplike-webrtc-control-v2 select:disabled {
    cursor: wait;
    opacity: .6;
}

#shoplike-section .shoplike-webrtc-control-v2 option {
    background: #fff;
    color: #0f172a;
}

body.dark-mode #shoplike-section .shoplike-webrtc-control-v2 option {
    background: #111827;
    color: #f8fafc;
}

#shoplike-section .shoplike-health-meta-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#shoplike-section .shoplike-card-actions-v2 {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) 32px;
    gap: 6px;
    margin-top: auto;
    padding-top: 9px;
}

#shoplike-section .shoplike-card-actions-v2 .shoplike-action-btn {
    width: auto;
    min-width: 0;
    height: 32px;
    min-height: 32px;
    border-radius: 9px;
    padding: 0 8px;
    font-size: 10px;
}

#shoplike-section .shoplike-card-actions-v2 .shoplike-action-btn.icon-only {
    width: 32px;
    min-width: 32px;
    padding: 0;
}

#shoplike-section .shoplike-empty-state-v2 {
    display: grid;
    min-height: 150px;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--text-muted);
    text-align: center;
}

#shoplike-section .shoplike-empty-state-v2 > i {
    color: #93c5fd;
    font-size: 28px;
}

#shoplike-section .shoplike-empty-state-v2 strong {
    color: var(--text-main);
    font-size: 14px;
}

#shoplike-section .shoplike-empty-state-v2 span {
    font-size: 11px;
}

body.dark-mode #shoplike-section .shoplike-page-header,
body.dark-mode #shoplike-section .shoplike-key-card-v2 {
    box-shadow: 7px 7px 18px rgba(0, 0, 0, .18), -4px -4px 13px rgba(51, 65, 85, .08);
}

body.dark-mode #shoplike-section .shoplike-note-card-v2,
body.dark-mode #shoplike-section .shoplike-summary-strip > div {
    background: rgba(15, 23, 42, .72);
}

body.dark-mode #shoplike-section .shoplike-endpoint-pill-v2 {
    background: rgba(37, 99, 235, .11);
}

body.dark-mode #shoplike-section .shoplike-endpoint-pill-v2.is-public {
    background: rgba(16, 185, 129, .1);
}

@media (min-width: 981px) {
    #shoplike-section {
        max-width: calc(100vw - 340px);
    }
}

@media (min-width: 981px) and (max-width: 1320px) {
    #shoplike-section .shoplike-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    #shoplike-section .shoplike-header-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1120px) {
    #shoplike-section .shoplike-page-grid,
    #shoplike-section .shoplike-list-head {
        grid-template-columns: 1fr;
    }

    #shoplike-section .shoplike-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    #shoplike-section .shoplike-bulk-actions {
        justify-content: flex-start;
    }

    #shoplike-section .shoplike-key-card-v2 {
        grid-template-columns: minmax(205px, .8fr) minmax(300px, 1.2fr);
    }

    #shoplike-section .shoplike-card-devices-v2 {
        grid-column: 1;
        padding: 10px 0 0;
        border-top: 1px solid var(--shop-border);
        border-left: 0;
    }

    #shoplike-section .shoplike-card-health-v2 {
        grid-column: 2;
        padding-top: 10px;
        border-top: 1px solid var(--shop-border);
    }
}

@media (max-width: 980px) {
    #shoplike-section .shoplike-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    #shoplike-section .shoplike-header-actions,
    #shoplike-section .shoplike-bulk-actions {
        justify-content: flex-start;
    }

    #shoplike-section .shoplike-page-grid,
    #shoplike-section .shoplike-list-head {
        grid-template-columns: 1fr;
    }

    #shoplike-section .shoplike-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    #shoplike-section .shoplike-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #shoplike-section .shoplike-key-card-v2 {
        grid-template-columns: minmax(0, 1fr);
    }

    #shoplike-section :is(.shoplike-card-identity-v2, .shoplike-card-network-v2, .shoplike-card-devices-v2, .shoplike-card-health-v2) {
        grid-column: 1;
    }

    #shoplike-section :is(.shoplike-card-network-v2, .shoplike-card-devices-v2, .shoplike-card-health-v2) {
        padding: 10px 0 0;
        border-top: 1px solid var(--shop-border);
        border-left: 0;
    }

    #shoplike-section .shoplike-api-doc-chip {
        width: 100%;
    }

    #shoplike-section .shoplike-api-doc-chip code {
        max-width: none;
        flex: 1;
    }
}

@media (max-width: 560px) {
    #shoplike-section .shoplike-live-chip-v2 {
        display: none;
    }

    #shoplike-section .shoplike-form-grid {
        grid-template-columns: 1fr;
    }

    #shoplike-section .shoplike-form-actions {
        flex-direction: column;
    }

    #shoplike-section .shoplike-form-actions .btn,
    #shoplike-section .shoplike-bulk-actions > :is(.btn, .shoplike-auto-select, .shoplike-custom-duration, .shoplike-timer-label, .shoplike-bulk-dns) {
        width: 100%;
        justify-content: center;
    }

    #shoplike-section .shoplike-custom-duration input {
        flex: 1;
        width: auto;
    }

    #shoplike-section .shoplike-bulk-dns select {
        flex: 1;
        min-width: 0;
    }

    #shoplike-section .shoplike-summary-strip {
        padding-inline: 10px;
    }

    #shoplike-section .shoplike-device-overview {
        margin-inline: 10px;
    }

    #shoplike-section .shoplike-device-overview-head small {
        display: none;
    }

    #shoplike-section .shoplike-key-list-v2 {
        padding-inline: 10px;
    }

    #shoplike-section .shoplike-key-card-v2 {
        padding: 10px;
    }
}

/* ===== PPPoE Proxy responsive workspace ===== */
#pppoe-section {
    --pppoe-accent: #2563eb;
    --pppoe-accent-strong: #1d4ed8;
    --pppoe-accent-soft: rgba(37, 99, 235, .075);
    --pppoe-green: #059669;
    --pppoe-border: rgba(148, 163, 184, .24);
    width: 100%;
    min-width: 0;
}

#pppoe-section .pppoe-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 16px;
    background:
        radial-gradient(circle at 9% 0%, rgba(59, 130, 246, .11), transparent 38%),
        var(--card-bg, #fff);
    box-shadow: 7px 7px 18px rgba(15, 23, 42, .06), -5px -5px 15px rgba(255, 255, 255, .72);
}

#pppoe-section .pppoe-heading-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

#pppoe-section .pppoe-heading-icon-v2 {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .24);
    font-size: 18px;
}

#pppoe-section .pppoe-heading-v2 h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 22px;
    letter-spacing: -.02em;
}

#pppoe-section .pppoe-heading-v2 .section-subtitle {
    margin: 3px 0 0;
}

#pppoe-section .pppoe-header-actions-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

#pppoe-section .pppoe-header-actions-v2 .btn {
    min-height: 36px;
    border-radius: 10px;
}

#pppoe-section .pppoe-live-chip-v2 {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

#pppoe-section .pppoe-live-chip-v2 > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
    animation: pppoe-live-pulse 1.8s ease-in-out infinite;
}

@keyframes pppoe-live-pulse {
    50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}

#pppoe-section .pppoe-workspace-v2 {
    min-width: 0;
    border: 1px solid var(--pppoe-border);
    border-radius: 16px;
    background: var(--card-bg, #fff);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .055);
}

#pppoe-section .pppoe-control-header {
    position: static !important;
    z-index: auto !important;
    display: grid !important;
    grid-template-columns: minmax(210px, .65fr) minmax(0, 1.35fr) !important;
    gap: 14px !important;
    align-items: center !important;
    padding: 14px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--pppoe-border) !important;
    border-radius: 16px 16px 0 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#pppoe-section .pppoe-title-block {
    min-width: 0;
}

#pppoe-section .pppoe-title-block h3 {
    color: var(--text-main);
}

#pppoe-section .pppoe-title-block span {
    color: var(--text-muted);
    font-size: 10.5px;
}

#pppoe-section .pppoe-title-block strong {
    color: var(--pppoe-accent);
    font-weight: 850;
}

#pppoe-section .pppoe-bulk-toolbar {
    display: flex !important;
    min-width: 0;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    margin-left: 0 !important;
    flex-wrap: wrap !important;
}

#pppoe-section .pppoe-primary-tools-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
}

#pppoe-section .pppoe-primary-tools-v2 .btn-bulk,
#pppoe-section .pppoe-advanced-panel-v2 .btn-bulk {
    min-height: 34px;
    border-radius: 9px !important;
    padding: 0 9px !important;
    font-size: 10.5px;
}

#pppoe-section .pppoe-advanced-actions-v2 {
    position: relative;
    min-width: 0;
}

#pppoe-section .pppoe-advanced-actions-v2 > summary {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--pppoe-border);
    border-radius: 9px;
    background: var(--card-bg, #fff);
    color: var(--text-main);
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 800;
    list-style: none;
    white-space: nowrap;
}

#pppoe-section .pppoe-advanced-actions-v2 > summary::-webkit-details-marker {
    display: none;
}

#pppoe-section .pppoe-advanced-actions-v2 > summary i:last-child {
    color: #94a3b8;
    transition: transform .18s ease;
}

#pppoe-section .pppoe-advanced-actions-v2[open] > summary i:last-child {
    transform: rotate(180deg);
}

#pppoe-section .pppoe-advanced-panel-v2 {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 45;
    display: grid;
    width: min(540px, calc(100vw - 32px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--pppoe-border);
    border-radius: 12px;
    background: var(--card-bg, #fff);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
}

#pppoe-section .pppoe-advanced-panel-v2 .btn {
    width: 100%;
    justify-content: center;
}

#pppoe-section .pppoe-summary-strip-v2 {
    display: grid;
    grid-template-columns: repeat(4, minmax(105px, 1fr)) minmax(130px, auto);
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--pppoe-border);
}

#pppoe-section .pppoe-summary-strip-v2 > div,
#pppoe-section .pppoe-select-page-v2 {
    display: flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 0 10px;
    border: 1px solid var(--pppoe-border);
    border-radius: 10px;
    background: rgba(248, 250, 252, .8);
}

#pppoe-section .pppoe-summary-strip-v2 > div span,
#pppoe-section .pppoe-select-page-v2 span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-summary-strip-v2 > div strong {
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 15px;
}

#pppoe-section .pppoe-select-page-v2 {
    justify-content: center;
    cursor: pointer;
}

#pppoe-section .pppoe-select-page-v2 input,
#pppoe-section .pppoe-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--pppoe-accent);
}

#pppoe-section .pppoe-card-container-v2 {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#pppoe-section .pppoe-card-list-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
    gap: 10px;
    padding: 12px 14px 14px;
}

#pppoe-section .pppoe-proxy-card-v2 {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--pppoe-border);
    border-left: 3px solid #22c55e;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 5px 5px 13px rgba(15, 23, 42, .045), -4px -4px 12px rgba(255, 255, 255, .65);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#pppoe-section .pppoe-proxy-card-v2:hover {
    border-color: rgba(37, 99, 235, .3);
    box-shadow: 0 9px 24px rgba(15, 23, 42, .08);
}

#pppoe-section .pppoe-proxy-card-v2.no-proxy {
    border-left-color: #f59e0b;
}

#pppoe-section .pppoe-proxy-card-v2.is-selected {
    border-color: rgba(37, 99, 235, .45);
    background: linear-gradient(145deg, rgba(239, 246, 255, .72), var(--card-bg, #fff));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .08);
}

#pppoe-section .pppoe-card-head-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: auto 8px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
}

#pppoe-section .pppoe-card-select-v2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    font-weight: 800;
}

#pppoe-section .pppoe-card-select-v2 > span {
    display: grid;
    min-width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 7px;
    background: var(--pppoe-accent-soft);
    color: var(--pppoe-accent);
}

#pppoe-section .pppoe-online-dot-v2 {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .11);
}

#pppoe-section .pppoe-card-title-v2 {
    display: grid;
    min-width: 0;
    gap: 5px;
}

#pppoe-section .pppoe-card-title-v2 > strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-state-badges-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

#pppoe-section .pppoe-state-badge-v2 {
    display: inline-flex;
    min-height: 21px;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    border: 1px solid var(--pppoe-border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 8.5px;
    font-weight: 850;
    white-space: nowrap;
}

#pppoe-section .pppoe-state-badge-v2.is-online {
    border-color: rgba(16, 185, 129, .2);
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#pppoe-section .pppoe-state-badge-v2.is-rotate {
    border-color: rgba(245, 158, 11, .22);
    background: rgba(245, 158, 11, .08);
    color: #b45309;
}

#pppoe-section .pppoe-state-badge-v2.is-api {
    border-color: rgba(99, 102, 241, .2);
    background: rgba(99, 102, 241, .07);
    color: #4f46e5;
}

#pppoe-section .pppoe-port-number-v2 {
    max-width: 145px;
    padding: 5px 8px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(16, 185, 129, .08);
    color: #047857;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-port-number-v2.is-empty {
    background: rgba(245, 158, 11, .09);
    color: #b45309;
}

#pppoe-section .pppoe-card-grid-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 10px;
}

#pppoe-section :is(.pppoe-card-network-v2, .pppoe-card-config-v2) {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--pppoe-border);
    border-radius: 11px;
    background: rgba(248, 250, 252, .66);
}

#pppoe-section .pppoe-card-label-v2 {
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: 8.5px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#pppoe-section .pppoe-public-ip-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
}

#pppoe-section .pppoe-public-ip-v2 > span:first-child,
#pppoe-section .pppoe-config-row-v2 > span:first-child {
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 750;
}

#pppoe-section .pppoe-public-ip-v2 .pppoe-ip-stack {
    display: grid;
    min-width: 0;
    gap: 3px;
    color: #047857;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 850;
}

#pppoe-section .pppoe-public-ip-v2 .pppoe-ipv4 {
    color: #047857;
}

#pppoe-section .pppoe-public-ip-v2 .pppoe-ipv6 {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #64748b;
    font-size: 8.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-live-metrics-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    margin-top: 9px;
}

#pppoe-section .pppoe-live-metrics-v2 > div {
    display: flex;
    min-width: 0;
    min-height: 29px;
    align-items: center;
    gap: 5px;
    padding: 0 7px;
    border: 1px solid var(--pppoe-border);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--text-muted);
    font-size: 9px;
}

#pppoe-section .pppoe-live-metrics-v2 > div span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-live-metrics-v2 i {
    color: var(--pppoe-accent);
}

#pppoe-section .pppoe-speed-badge {
    min-width: 0;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}

#pppoe-section .pppoe-endpoint-v2 {
    display: flex;
    min-width: 0;
    min-height: 31px;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 9px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#pppoe-section .pppoe-endpoint-v2 code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: inherit;
    font-size: 10px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-endpoint-v2 > span {
    flex: 0 0 auto;
    color: inherit;
    font-size: 8px;
    font-weight: 800;
}

#pppoe-section .pppoe-endpoint-v2.is-pending {
    border-color: rgba(245, 158, 11, .22);
    background: rgba(245, 158, 11, .08);
    color: #b45309;
    font-size: 9.5px;
    font-weight: 750;
}

#pppoe-section .pppoe-config-row-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    margin-top: 7px;
}

#pppoe-section .pppoe-config-row-v2 .pppoe-dns-cell {
    min-width: 0;
}

#pppoe-section .pppoe-config-row-v2 :is(.pppoe-dns-select, .pppoe-dns-custom) {
    min-width: 0;
    min-height: 30px;
    font-size: 9.5px;
}

#pppoe-section .pppoe-auth-state-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    padding: 7px 8px;
    border: 1px solid var(--pppoe-border);
    border-radius: 9px;
    color: var(--text-muted);
}

#pppoe-section .pppoe-auth-state-v2 > i {
    color: #94a3b8;
}

#pppoe-section .pppoe-auth-state-v2 > div {
    display: grid;
    min-width: 0;
    gap: 1px;
}

#pppoe-section .pppoe-auth-state-v2 :is(strong, small) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-auth-state-v2 strong {
    color: var(--text-main);
    font-size: 9.5px;
}

#pppoe-section .pppoe-auth-state-v2 small {
    color: var(--text-muted);
    font-size: 8.5px;
}

#pppoe-section .pppoe-auth-state-v2.is-ready {
    border-color: rgba(16, 185, 129, .19);
    background: rgba(16, 185, 129, .055);
}

#pppoe-section .pppoe-auth-state-v2.is-ready > i,
#pppoe-section .pppoe-auth-state-v2.is-ready strong {
    color: #047857;
}

#pppoe-section .pppoe-card-devices-v2 {
    min-width: 0;
    padding-top: 2px;
}

#pppoe-section .pppoe-device-slot-v2 {
    min-width: 0;
}

#pppoe-section .pppoe-device-dropdown-v2 {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--pppoe-border);
    border-radius: 10px;
    background: rgba(248, 250, 252, .66);
}

#pppoe-section .pppoe-device-dropdown-v2 > summary {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 0 10px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    list-style: none;
}

#pppoe-section .pppoe-device-dropdown-v2 > summary::-webkit-details-marker {
    display: none;
}

#pppoe-section .pppoe-device-dropdown-v2 > summary > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

#pppoe-section .pppoe-device-dropdown-v2 > summary > span i {
    color: var(--pppoe-accent);
}

#pppoe-section .pppoe-device-dropdown-v2 > summary > i {
    color: #94a3b8;
    font-size: 9px;
    transition: transform .18s ease;
}

#pppoe-section .pppoe-device-dropdown-v2[open] > summary > i {
    transform: rotate(180deg);
}

#pppoe-section .pppoe-device-panel-v2 {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 9px;
    border-top: 1px solid var(--pppoe-border);
}

#pppoe-section .pppoe-device-list-v2 {
    display: flex;
    min-width: 0;
    gap: 6px;
    flex-wrap: wrap;
}

#pppoe-section .pppoe-device-chip-v2 {
    display: inline-flex;
    min-width: 0;
    min-height: 27px;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 8px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 8px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
}

#pppoe-section .pppoe-device-chip-v2 code {
    color: inherit;
    font-size: 9.5px;
    font-weight: 850;
}

#pppoe-section .pppoe-device-chip-v2 button {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(239, 68, 68, .09);
    color: #ef4444;
    cursor: pointer;
}

#pppoe-section .pppoe-device-empty-v2 {
    color: var(--text-muted);
    font-size: 9.5px;
    font-style: italic;
}

#pppoe-section .pppoe-device-add-v2 {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 6px;
}

#pppoe-section .pppoe-device-add-v2 input {
    width: 100%;
    min-width: 0;
    height: 32px;
    font-size: 10px;
}

#pppoe-section .pppoe-device-add-v2 .btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
}

#pppoe-section .pppoe-card-actions-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: auto;
    padding-top: 9px;
    border-top: 1px solid var(--pppoe-border);
}

#pppoe-section .pppoe-card-action-v2 {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 32px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: 1px solid var(--pppoe-border);
    border-radius: 9px;
    background: var(--card-bg, #fff);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

#pppoe-section .pppoe-card-action-v2:hover {
    transform: translateY(-1px);
}

#pppoe-section .pppoe-card-action-v2.primary {
    flex: 1 1 100px;
    width: auto;
    max-width: 130px;
    padding: 0 10px;
    border-color: var(--pppoe-accent);
    background: var(--pppoe-accent);
    color: #fff;
}

#pppoe-section .pppoe-card-action-v2.create {
    flex: 0 1 94px;
    width: auto;
    padding: 0 9px;
    border-color: rgba(16, 185, 129, .22);
    background: rgba(16, 185, 129, .08);
    color: #047857;
}

#pppoe-section .pppoe-card-action-v2.danger {
    border-color: rgba(239, 68, 68, .2);
    background: rgba(239, 68, 68, .07);
    color: #dc2626;
}

#pppoe-section .pppoe-card-action-v2.is-active {
    border-color: rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .1);
    color: #b45309;
}

#pppoe-section .pppoe-empty-state-v2 {
    display: grid;
    min-height: 180px;
    grid-column: 1 / -1;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
}

#pppoe-section .pppoe-empty-state-v2 > i {
    color: #93c5fd;
    font-size: 28px;
}

#pppoe-section .pppoe-empty-state-v2 strong {
    color: var(--text-main);
    font-size: 13px;
}

#pppoe-section .pppoe-empty-state-v2 span {
    font-size: 10px;
}

#pppoe-section .pppoe-empty-state-v2.is-error > i,
#pppoe-section .pppoe-empty-state-v2.is-error strong {
    color: #dc2626;
}

#pppoe-section .pppoe-pagination-v2 {
    display: flex !important;
    min-width: 0;
    grid-template-columns: none !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px !important;
    margin: 0;
    padding: 10px 14px !important;
    border: 0;
    border-top: 1px solid var(--pppoe-border);
    border-radius: 0 0 16px 16px;
    background: transparent;
    box-shadow: none;
}

#pppoe-section .pppoe-pagination-v2 .pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.dark-mode #pppoe-section .pppoe-page-header,
body.dark-mode #pppoe-section .pppoe-workspace-v2,
body.dark-mode #pppoe-section .pppoe-proxy-card-v2 {
    box-shadow: 7px 7px 18px rgba(0, 0, 0, .18), -4px -4px 13px rgba(51, 65, 85, .08);
}

body.dark-mode #pppoe-section .pppoe-summary-strip-v2 > div,
body.dark-mode #pppoe-section .pppoe-select-page-v2,
body.dark-mode #pppoe-section :is(.pppoe-card-network-v2, .pppoe-card-config-v2, .pppoe-device-dropdown-v2) {
    background: rgba(15, 23, 42, .68);
}

body.dark-mode #pppoe-section .pppoe-advanced-panel-v2,
body.dark-mode #pppoe-section .pppoe-advanced-actions-v2 > summary {
    background: #111827;
}

body.dark-mode #pppoe-section .pppoe-proxy-card-v2.is-selected {
    background: linear-gradient(145deg, rgba(30, 64, 175, .14), var(--card-bg, #111827));
}

@media (min-width: 981px) {
    #pppoe-section {
        max-width: calc(100vw - 340px);
    }
}

@media (max-width: 1320px) {
    #pppoe-section .pppoe-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    #pppoe-section .pppoe-header-actions-v2 {
        justify-content: flex-start;
    }

    #pppoe-section .pppoe-control-header {
        grid-template-columns: 1fr !important;
    }

    #pppoe-section .pppoe-bulk-toolbar,
    #pppoe-section .pppoe-primary-tools-v2 {
        justify-content: flex-start !important;
    }
}

@media (max-width: 920px) {
    #pppoe-section .pppoe-summary-strip-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #pppoe-section .pppoe-select-page-v2 {
        grid-column: 1 / -1;
    }

    #pppoe-section .pppoe-card-grid-v2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    #pppoe-section .pppoe-primary-tools-v2 {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #pppoe-section .pppoe-primary-tools-v2 .btn {
        width: 100%;
        justify-content: center;
    }

    #pppoe-section .pppoe-advanced-actions-v2,
    #pppoe-section .pppoe-advanced-actions-v2 > summary {
        width: 100%;
    }

    #pppoe-section .pppoe-advanced-actions-v2 > summary {
        justify-content: center;
    }

    #pppoe-section .pppoe-advanced-panel-v2 {
        position: static;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 7px;
        box-shadow: none;
    }

    #pppoe-section .pppoe-card-list-v2 {
        padding-inline: 10px;
    }

    #pppoe-section .pppoe-public-ip-v2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    #pppoe-section .pppoe-header-actions-v2 {
        align-items: stretch;
        flex-direction: column;
    }

    #pppoe-section .pppoe-header-actions-v2 > * {
        width: 100%;
        justify-content: center;
    }

    #pppoe-section .pppoe-primary-tools-v2,
    #pppoe-section .pppoe-advanced-panel-v2,
    #pppoe-section .pppoe-summary-strip-v2 {
        grid-template-columns: 1fr;
    }

    #pppoe-section .pppoe-select-page-v2 {
        grid-column: 1;
    }

    #pppoe-section .pppoe-card-head-v2 {
        grid-template-columns: auto 8px minmax(0, 1fr);
    }

    #pppoe-section .pppoe-port-number-v2 {
        grid-column: 3;
        justify-self: start;
    }

    #pppoe-section .pppoe-live-metrics-v2 {
        grid-template-columns: 1fr;
    }

    #pppoe-section .pppoe-card-actions-v2 {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    #pppoe-section .pppoe-card-action-v2.primary {
        max-width: none;
    }

    #pppoe-section .pppoe-pagination-v2,
    #pppoe-section .pppoe-pagination-v2 .pagination-controls {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ===== PPPoE compact list v3 ===== */
#pppoe-section .pppoe-workspace-v2 {
    container-name: pppoe-workspace;
    container-type: inline-size;
}

#pppoe-section .pppoe-list-head-v3 {
    display: none;
}

#pppoe-section .pppoe-compact-list-v3 {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 12px 10px;
}

#pppoe-section .pppoe-list-row-v3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    align-items: center;
    min-height: 0;
    padding: 9px 5px;
    border: 0;
    border-bottom: 1px solid var(--pppoe-border);
    border-left: 3px solid #22c55e;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}

#pppoe-section .pppoe-list-row-v3:first-child {
    border-top: 1px solid var(--pppoe-border);
}

#pppoe-section .pppoe-list-row-v3:hover {
    border-color: var(--pppoe-border);
    border-left-color: #22c55e;
    background: rgba(37, 99, 235, .035);
    box-shadow: none;
    transform: none;
}

#pppoe-section .pppoe-list-row-v3.no-proxy,
#pppoe-section .pppoe-list-row-v3.no-proxy:hover {
    border-left-color: #f59e0b;
}

#pppoe-section .pppoe-list-row-v3.is-selected,
#pppoe-section .pppoe-list-row-v3.is-selected:hover {
    border-color: var(--pppoe-border);
    border-left-color: var(--pppoe-accent);
    background: rgba(37, 99, 235, .065);
    box-shadow: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-head-v2 {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: auto 7px minmax(0, 1fr);
    gap: 7px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-select-v2 > span {
    min-width: 19px;
    height: 19px;
    border-radius: 6px;
    font-size: 9px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 {
    gap: 3px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 > strong {
    font-size: 11.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-state-badge-v2.is-online {
    display: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-state-badge-v2 {
    min-height: 18px;
    padding-inline: 5px;
    font-size: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-port-number-v2 {
    grid-column: 3;
    justify-self: start;
    max-width: 100%;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 9px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

#pppoe-section .pppoe-list-row-v3 :is(.pppoe-card-network-v2, .pppoe-card-config-v2) {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 8px;
    box-shadow: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-label-v2 {
    display: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 > span:first-child {
    font-size: 8.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 .pppoe-ip-stack {
    gap: 1px;
    font-size: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 .pppoe-ipv6 {
    font-size: 7.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 {
    gap: 4px;
    margin-top: 5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 > div {
    min-height: 23px;
    gap: 4px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 {
    min-height: 27px;
    padding-inline: 7px;
    border-radius: 7px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 code {
    font-size: 8.8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 > span {
    display: none;
}

#pppoe-section .pppoe-config-details-v3 {
    min-width: 0;
    margin-top: 4px;
}

#pppoe-section .pppoe-config-details-v3 > summary {
    display: flex;
    min-height: 23px;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 8px;
    font-weight: 800;
    list-style: none;
}

#pppoe-section .pppoe-config-details-v3 > summary::-webkit-details-marker {
    display: none;
}

#pppoe-section .pppoe-config-details-v3 > summary i:first-child {
    color: var(--pppoe-accent);
}

#pppoe-section .pppoe-config-details-v3 > summary i:last-child {
    margin-left: auto;
    transition: transform .18s ease;
}

#pppoe-section .pppoe-config-details-v3[open] > summary i:last-child {
    transform: rotate(180deg);
}

#pppoe-section .pppoe-config-details-body-v3 {
    display: grid;
    gap: 5px;
    padding-top: 3px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-config-row-v2 {
    margin-top: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-auth-state-v2 {
    margin-top: 0;
    padding: 5px 6px;
    border-radius: 7px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2 {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-device-dropdown-v2 {
    border-radius: 7px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-device-dropdown-v2 > summary {
    min-height: 29px;
    padding-inline: 8px;
    font-size: 8.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.primary,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.create {
    flex: 0 0 30px;
    width: 30px;
    max-width: 30px;
    height: 29px;
    padding: 0;
    border-radius: 7px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2 span {
    display: none;
}

#pppoe-section .pppoe-empty-state-v2 {
    width: 100%;
}

body.dark-mode #pppoe-section .pppoe-list-row-v3 {
    background: transparent;
    box-shadow: none;
}

body.dark-mode #pppoe-section .pppoe-list-row-v3:hover,
body.dark-mode #pppoe-section .pppoe-list-row-v3.is-selected {
    background: rgba(59, 130, 246, .08);
}

@container pppoe-workspace (min-width: 860px) {
    #pppoe-section .pppoe-list-head-v3 {
        display: grid;
        grid-template-columns:
            minmax(140px, .82fr)
            minmax(180px, 1fr)
            minmax(210px, 1.12fr)
            minmax(115px, .7fr)
            74px;
        gap: 8px;
        align-items: center;
        padding: 7px 19px;
        border-bottom: 1px solid var(--pppoe-border);
        background: rgba(248, 250, 252, .74);
        color: var(--text-muted);
        font-size: 8px;
        font-weight: 850;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    #pppoe-section .pppoe-list-head-v3 span:last-child {
        text-align: center;
    }

    #pppoe-section .pppoe-list-row-v3 {
        grid-template-columns:
            minmax(140px, .82fr)
            minmax(180px, 1fr)
            minmax(210px, 1.12fr)
            minmax(115px, .7fr)
            74px;
        gap: 8px;
        min-height: 72px;
        padding: 7px 5px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-head-v2 {
        grid-column: 1;
        grid-row: 1;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
        display: contents;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-network-v2 {
        grid-column: 2;
        grid-row: 1;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-config-v2 {
        grid-column: 3;
        grid-row: 1;
    }

    #pppoe-section .pppoe-list-row-v3 :is(.pppoe-card-network-v2, .pppoe-card-config-v2) {
        padding: 5px 6px;
        border: 0;
        background: transparent;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2 {
        grid-column: 4;
        grid-row: 1;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
        display: grid;
        grid-column: 5;
        grid-row: 1;
        grid-template-columns: repeat(2, 30px);
        justify-content: center;
    }

    #pppoe-section .pppoe-list-row-v3:has(.pppoe-device-dropdown-v2[open]) .pppoe-card-devices-v2 {
        grid-column: 1 / 5;
        grid-row: 2;
        padding-top: 4px;
    }
}

@container pppoe-workspace (max-width: 859px) {
    #pppoe-section .pppoe-compact-list-v3 {
        padding-inline: 10px;
    }
}

@container pppoe-workspace (max-width: 560px) {
    #pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
        grid-template-columns: 1fr;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 {
        grid-template-columns: 1fr;
    }
}

/* ===== PPPoE final layout guardrails =====
   Keep the card workspace stable when long interface names, endpoints or
   device lists are present. This block intentionally comes last so legacy
   table/sticky rules cannot reintroduce overlap. */
#pppoe-section,
#pppoe-section * {
    box-sizing: border-box;
}

#pppoe-section {
    overflow-x: clip;
}

#pppoe-section .pppoe-page-header,
#pppoe-section .pppoe-workspace-v2,
#pppoe-section .pppoe-control-header,
#pppoe-section .pppoe-summary-strip-v2,
#pppoe-section .pppoe-card-list-v2,
#pppoe-section .pppoe-list-row-v3,
#pppoe-section .pppoe-card-grid-v2,
#pppoe-section .pppoe-card-network-v2,
#pppoe-section .pppoe-card-config-v2,
#pppoe-section .pppoe-card-devices-v2,
#pppoe-section .pppoe-card-actions-v2,
#pppoe-section .pppoe-pagination-v2 {
    min-width: 0;
}

#pppoe-section .pppoe-page-header {
    width: 100%;
    overflow: visible;
}

#pppoe-section .pppoe-heading-v2,
#pppoe-section .pppoe-heading-v2 > div,
#pppoe-section .pppoe-title-block,
#pppoe-section .pppoe-header-actions-v2,
#pppoe-section .pppoe-bulk-toolbar,
#pppoe-section .pppoe-primary-tools-v2 {
    min-width: 0;
}

#pppoe-section .pppoe-heading-v2 > div {
    overflow: hidden;
}

#pppoe-section .pppoe-heading-v2 .section-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-header-actions-v2 {
    flex-wrap: wrap;
}

#pppoe-section .pppoe-live-chip-v2 {
    max-width: 100%;
    overflow: hidden;
}

#pppoe-section .pppoe-live-chip-v2 > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-control-header {
    overflow: visible !important;
}

#pppoe-section .pppoe-bulk-toolbar {
    align-content: center;
}

#pppoe-section .pppoe-primary-tools-v2 .btn-bulk,
#pppoe-section .pppoe-advanced-actions-v2 > summary {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-advanced-actions-v2[open] {
    z-index: 60;
}

#pppoe-section .pppoe-advanced-panel-v2 {
    max-width: calc(100vw - 28px);
}

#pppoe-section .pppoe-list-row-v3 > * {
    min-width: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 > strong,
#pppoe-section .pppoe-list-row-v3 .pppoe-state-badges-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-device-slot-v2 {
    min-width: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
    flex-wrap: wrap;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2 {
    flex-shrink: 0;
}

#pppoe-section .pppoe-card-list-v2:empty {
    min-height: 120px;
}

#pppoe-section .pppoe-pagination-v2 {
    flex-wrap: wrap;
}

#pppoe-section .pppoe-pagination-v2 .pagination-info,
#pppoe-section .pppoe-pagination-v2 .pagination-controls,
#pppoe-section .pppoe-pagination-v2 .page-nav,
#pppoe-section .pppoe-pagination-v2 .page-size-selector {
    min-width: 0;
}

@media (max-width: 1120px) {
    #pppoe-section .pppoe-control-header {
        grid-template-columns: 1fr !important;
    }

    #pppoe-section .pppoe-bulk-toolbar,
    #pppoe-section .pppoe-primary-tools-v2 {
        justify-content: flex-start !important;
    }
}

@media (max-width: 640px) {
    #pppoe-section .pppoe-page-header {
        padding: 13px;
        border-radius: 13px;
    }

    #pppoe-section .pppoe-heading-icon-v2 {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 16px;
    }

    #pppoe-section .pppoe-heading-v2 h2 {
        font-size: 18px;
    }

    #pppoe-section .pppoe-heading-v2 .section-subtitle {
        font-size: 10px;
    }

    #pppoe-section .pppoe-bulk-toolbar,
    #pppoe-section .pppoe-primary-tools-v2 {
        width: 100%;
    }

    #pppoe-section .pppoe-primary-tools-v2 .btn-bulk {
        min-width: 0;
        padding-inline: 7px !important;
        font-size: 10px;
    }

    #pppoe-section .pppoe-summary-strip-v2 {
        padding: 8px 10px;
    }

    #pppoe-section .pppoe-card-list-v2 {
        padding: 0 8px 8px;
    }

    #pppoe-section .pppoe-pagination-v2 {
        align-items: stretch;
        flex-direction: column;
        padding: 9px 10px !important;
    }

    #pppoe-section .pppoe-pagination-v2 .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 420px) {
    #pppoe-section .pppoe-primary-tools-v2 {
        grid-template-columns: 1fr;
    }

    #pppoe-section .pppoe-primary-tools-v2 .btn-bulk,
    #pppoe-section .pppoe-advanced-actions-v2,
    #pppoe-section .pppoe-advanced-actions-v2 > summary {
        width: 100%;
    }

    #pppoe-section .pppoe-list-row-v3 {
        padding-inline: 3px;
    }
}

/* ===== PPPoE readable workspace v4 =====
   Larger type and controls while keeping the list responsive and overlap-free. */
#pppoe-section {
    --pppoe-readable-border: rgba(100, 116, 139, .24);
}

#pppoe-section .pppoe-page-header {
    padding: 20px 22px;
    border-radius: 18px;
}

#pppoe-section .pppoe-heading-icon-v2 {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 21px;
}

#pppoe-section .pppoe-heading-v2 h2 {
    font-size: clamp(23px, 2vw, 28px);
}

#pppoe-section .pppoe-heading-v2 .section-subtitle {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

#pppoe-section .pppoe-header-actions-v2 .btn,
#pppoe-section .pppoe-live-chip-v2 {
    min-height: 42px;
    padding-inline: 14px;
    border-radius: 12px;
    font-size: 12px;
}

#pppoe-section .pppoe-control-header {
    padding: 18px !important;
}

#pppoe-section .pppoe-title-block h3 {
    margin-bottom: 4px;
    font-size: 18px;
}

#pppoe-section .pppoe-title-block span {
    font-size: 12px;
}

#pppoe-section .pppoe-primary-tools-v2 .btn-bulk,
#pppoe-section .pppoe-advanced-panel-v2 .btn-bulk,
#pppoe-section .pppoe-advanced-actions-v2 > summary {
    min-height: 40px;
    padding-inline: 12px !important;
    border-radius: 11px !important;
    font-size: 12px;
}

#pppoe-section .pppoe-summary-strip-v2 {
    gap: 10px;
    padding: 13px 16px;
}

#pppoe-section .pppoe-summary-strip-v2 > div,
#pppoe-section .pppoe-select-page-v2 {
    min-height: 48px;
    padding-inline: 13px;
    border-color: var(--pppoe-readable-border);
    border-radius: 12px;
}

#pppoe-section .pppoe-summary-strip-v2 > div span,
#pppoe-section .pppoe-select-page-v2 span {
    font-size: 12px;
}

#pppoe-section .pppoe-summary-strip-v2 > div strong {
    font-size: 19px;
}

#pppoe-section .pppoe-compact-list-v3 {
    padding: 0 16px 14px;
}

#pppoe-section .pppoe-list-row-v3 {
    gap: 10px 14px;
    padding: 14px 10px;
    border-bottom-color: var(--pppoe-readable-border);
    border-left-width: 4px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-head-v2 {
    grid-template-columns: auto 9px minmax(0, 1fr);
    gap: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-select-v2 > span {
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 11px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 {
    gap: 5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 > strong {
    font-size: 15px;
    line-height: 1.25;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-state-badge-v2 {
    min-height: 23px;
    padding-inline: 7px;
    border-radius: 7px;
    font-size: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-state-badge-v2.is-online {
    display: inline-flex;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-port-number-v2 {
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 12px;
}

#pppoe-section .pppoe-list-row-v3 :is(.pppoe-card-network-v2, .pppoe-card-config-v2) {
    padding: 10px 11px;
    border-color: var(--pppoe-readable-border);
    border-radius: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 > span:first-child,
#pppoe-section .pppoe-list-row-v3 .pppoe-config-row-v2 > span:first-child {
    font-size: 11px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 .pppoe-ip-stack {
    gap: 3px;
    font-size: 13px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 .pppoe-ipv6 {
    font-size: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 {
    gap: 6px;
    margin-top: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 > div {
    min-height: 31px;
    gap: 6px;
    padding-inline: 8px;
    border-radius: 8px;
    font-size: 10.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 {
    min-height: 35px;
    padding-inline: 10px;
    border-radius: 9px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 code {
    font-size: 11.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 > span {
    display: inline;
    font-size: 9px;
}

#pppoe-section .pppoe-config-details-v3 > summary {
    min-height: 31px;
    font-size: 10.5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-device-dropdown-v2 > summary {
    min-height: 38px;
    padding-inline: 11px;
    font-size: 11px;
}

#pppoe-section .pppoe-device-dropdown-nest-style {
    overflow: visible;
    border: 0;
    border-radius: 11px;
    background: transparent;
}

#pppoe-section .pppoe-device-dropdown-nest-style > summary {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #c7d2fe;
    border-radius: 11px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

#pppoe-section .pppoe-device-dropdown-nest-style > summary:hover {
    border-color: #a5b4fc;
    background: #e0e7ff;
    box-shadow: 0 5px 14px rgba(79, 70, 229, .1);
}

#pppoe-section .pppoe-device-dropdown-nest-style[open] > summary {
    border-color: #818cf8;
    background: #e0e7ff;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-summary-main {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-summary-main i {
    color: #4f46e5;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-summary-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-chevron-v2 {
    flex: 0 0 auto;
    color: #6366f1;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-panel-v2 {
    gap: 10px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-list-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 7px;
    max-height: 150px;
    overflow-y: auto;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-chip-v2 {
    width: 100%;
    min-height: 34px;
    padding: 5px 5px 5px 9px;
    border-color: #bbf7d0;
    border-radius: 9px;
    background: #ecfdf5;
    font-size: 12px;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-chip-v2 code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-chip-v2 button {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(225, 29, 72, .2);
    border-radius: 7px;
    background: rgba(225, 29, 72, .08);
    color: #e11d48;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-chip-v2 button:hover {
    border-color: #e11d48;
    background: #e11d48;
    color: #fff;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-empty-v2 {
    grid-column: 1 / -1;
    padding: 9px;
    border-radius: 9px;
    background: #f8fafc;
    font-size: 12px;
    text-align: center;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-add-v2 {
    grid-template-columns: minmax(145px, 1fr) 38px 38px;
    gap: 7px;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-add-v2 input,
#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-add-v2 .btn {
    width: 100%;
    min-width: 0;
    height: 38px;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-add-v2 .btn {
    border-radius: 9px;
}

#pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-add-button-v2 {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

body.dark-mode #pppoe-section .pppoe-device-dropdown-nest-style > summary {
    border-color: #4338ca;
    background: rgba(79, 70, 229, .15);
    color: #c7d2fe;
}

body.dark-mode #pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-panel-v2 {
    border-color: #334155;
    background: #111827;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

body.dark-mode #pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-chip-v2 {
    border-color: rgba(16, 185, 129, .35);
    background: rgba(16, 185, 129, .12);
    color: #6ee7b7;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
    gap: 7px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.primary,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.create {
    flex: 1 1 58px;
    width: auto;
    max-width: none;
    min-width: 0;
    height: 38px;
    padding-inline: 7px;
    border-radius: 9px;
    font-size: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2 span {
    display: inline;
}

#pppoe-section .pppoe-pagination-v2 {
    min-height: 58px;
    padding: 12px 16px !important;
    font-size: 12px;
}

@container pppoe-workspace (min-width: 1040px) {
    #pppoe-section .pppoe-list-head-v3,
    #pppoe-section .pppoe-list-row-v3 {
        grid-template-columns:
            minmax(185px, .9fr)
            minmax(240px, 1.15fr)
            minmax(240px, 1.15fr)
            minmax(150px, .72fr)
            minmax(128px, .62fr);
        gap: 12px;
    }

    #pppoe-section .pppoe-list-head-v3 {
        padding: 10px 26px;
        font-size: 10px;
    }

    #pppoe-section .pppoe-list-row-v3 {
        min-height: 124px;
    }

    #pppoe-section .pppoe-list-row-v3 :is(.pppoe-card-network-v2, .pppoe-card-config-v2) {
        padding: 8px 9px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: center;
    }
}

@container pppoe-workspace (min-width: 860px) and (max-width: 1039px) {
    #pppoe-section .pppoe-list-head-v3 {
        display: none;
    }

    #pppoe-section .pppoe-list-row-v3 {
        grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
        min-height: 0;
        padding: 15px 10px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-head-v2 {
        grid-column: 1;
        grid-row: 1;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-network-v2,
    #pppoe-section .pppoe-list-row-v3 .pppoe-card-config-v2 {
        grid-column: auto;
        grid-row: auto;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2 {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    #pppoe-section .pppoe-list-row-v3:has(.pppoe-device-dropdown-v2[open]) .pppoe-card-devices-v2 {
        grid-column: 1 / -1;
        grid-row: 3;
        padding-top: 4px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
        display: grid;
        grid-column: 2;
        grid-row: 1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: center;
        justify-content: stretch;
    }
}

/* Keep the assigned-device control in its own column and expand the editor
   directly underneath it instead of moving the control to another grid row.
   The panel stays in normal flow so the current row grows and never covers
   the next PPPoE row. */
@container pppoe-workspace (min-width: 860px) {
    #pppoe-section .pppoe-list-row-v3:has(.pppoe-device-dropdown-v2[open]) {
        position: relative;
        z-index: 30;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2,
    #pppoe-section .pppoe-list-row-v3:has(.pppoe-device-dropdown-v2[open]) .pppoe-card-devices-v2 {
        position: relative;
        z-index: 31;
        padding-top: 0;
    }

    #pppoe-section .pppoe-device-dropdown-nest-style {
        position: relative;
    }

    #pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-panel-v2 {
        position: static;
        width: auto;
        max-width: none;
        margin-top: 8px;
    }
}

@container pppoe-workspace (min-width: 1040px) {
    #pppoe-section .pppoe-list-row-v3:has(.pppoe-device-dropdown-v2[open]) .pppoe-card-devices-v2 {
        grid-column: 4;
        grid-row: 1;
    }
}

@container pppoe-workspace (min-width: 860px) and (max-width: 1039px) {
    #pppoe-section .pppoe-list-row-v3:has(.pppoe-device-dropdown-v2[open]) .pppoe-card-devices-v2 {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}

@media (max-width: 640px) {
    #pppoe-section .pppoe-page-header {
        padding: 16px;
    }

    #pppoe-section .pppoe-heading-icon-v2 {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    #pppoe-section .pppoe-heading-v2 h2 {
        font-size: 21px;
    }

    #pppoe-section .pppoe-heading-v2 .section-subtitle {
        white-space: normal;
    }

    #pppoe-section .pppoe-summary-strip-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #pppoe-section .pppoe-select-page-v2 {
        grid-column: 1 / -1;
    }

    #pppoe-section .pppoe-list-row-v3 {
        padding: 15px 7px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
        grid-column: 1 / -1;
        grid-row: 4;
        justify-content: stretch;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2,
    #pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.primary,
    #pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.create {
        min-height: 42px;
        font-size: 11px;
    }

    #pppoe-section .pppoe-device-dropdown-nest-style .pppoe-device-add-v2 {
        grid-template-columns: minmax(0, 1fr) 38px 38px;
    }
}

/* ===== RouterOS Container workspace v2 ===== */
#container-section {
    --container-accent: #4f46e5;
    --container-accent-soft: rgba(79, 70, 229, .075);
    --container-border: rgba(148, 163, 184, .24);
    width: 100%;
    min-width: 0;
    container-name: container-workspace;
    container-type: inline-size;
}

#container-section .container-page-header-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 16px 18px;
    border: 1px solid rgba(79, 70, 229, .15);
    border-radius: 16px;
    background:
        radial-gradient(circle at 8% 0%, rgba(99, 102, 241, .12), transparent 38%),
        var(--card-bg, #fff);
    box-shadow: 7px 7px 18px rgba(15, 23, 42, .055), -5px -5px 15px rgba(255, 255, 255, .7);
}

#container-section .container-heading-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

#container-section .container-heading-icon-v2 {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    color: #fff;
    box-shadow: 0 9px 20px rgba(79, 70, 229, .23);
    font-size: 18px;
}

#container-section .container-heading-v2 h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 22px;
    letter-spacing: -.02em;
}

#container-section .container-heading-v2 .section-subtitle {
    margin: 3px 0 0;
}

#container-section .container-header-actions-v2 {
    display: flex;
    align-items: center;
    gap: 7px;
}

#container-section .container-header-actions-v2 .btn {
    min-height: 36px;
    border-radius: 10px;
}

#container-section .container-live-chip-v2 {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 10px;
    background: rgba(16, 185, 129, .07);
    color: #047857;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

#container-section .container-live-chip-v2 > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
    animation: pppoe-live-pulse 1.8s ease-in-out infinite;
}

#container-section .container-capability-warning {
    margin-bottom: 10px;
    border-radius: 11px;
}

#container-section .container-status-grid-v2 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

#container-section .container-status-grid-v2 .container-status-card {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--container-border);
    border-radius: 11px;
    background: var(--card-bg, #fff);
    box-shadow: 4px 4px 11px rgba(15, 23, 42, .035);
}

#container-section .container-status-grid-v2 .container-status-card > i {
    display: grid;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 9px;
    background: var(--container-accent-soft);
    color: var(--container-accent);
    font-size: 11px;
}

#container-section .container-status-grid-v2 .container-status-card > span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

#container-section .container-status-grid-v2 .container-status-card small,
#container-section .container-status-grid-v2 .container-status-card strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#container-section .container-status-grid-v2 .container-status-card small {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    text-transform: uppercase;
}

#container-section .container-status-grid-v2 .container-status-card strong {
    margin: 0;
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
}

#container-section .container-list-card-v2 {
    min-width: 0;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--container-border);
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 0 10px 25px rgba(15, 23, 42, .045);
}

#container-section .container-list-head-v2 {
    min-height: 55px;
    padding: 9px 13px;
    border-bottom: 1px solid var(--container-border);
}

#container-section .container-list-head-v2 > span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 9px;
    border-radius: 8px;
    background: var(--container-accent-soft);
    color: var(--container-accent);
    font-weight: 800;
}

#container-section .container-list-columns-v2,
#container-section .container-row-v2 {
    display: grid;
    grid-template-columns:
        minmax(165px, .9fr)
        minmax(190px, 1fr)
        minmax(230px, 1.15fr)
        minmax(185px, .9fr)
        126px;
    gap: 8px;
    align-items: center;
}

#container-section .container-list-columns-v2 {
    padding: 7px 13px;
    border-bottom: 1px solid var(--container-border);
    background: rgba(248, 250, 252, .72);
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#container-section .container-list-columns-v2 span:last-child {
    text-align: center;
}

#container-section .container-list-body-v2 {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

#container-section .container-row-v2 {
    min-width: 0;
    min-height: 82px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--container-border);
    border-left: 3px solid #94a3b8;
    background: transparent;
    transition: background .15s ease;
}

#container-section .container-row-v2:last-child {
    border-bottom: 0;
}

#container-section .container-row-v2:hover {
    background: rgba(79, 70, 229, .03);
}

#container-section .container-row-v2.is-running {
    border-left-color: #22c55e;
}

#container-section .container-row-v2.is-error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, .018);
}

#container-section .container-row-v2.is-pending {
    border-left-color: #f59e0b;
}

#container-section .container-row-v2 > section {
    min-width: 0;
}

#container-section .container-row-identity-v2 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

#container-section .container-row-icon-v2 {
    position: relative;
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--container-accent-soft);
    color: var(--container-accent);
}

#container-section .container-row-dot-v2 {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--card-bg, #fff);
    border-radius: 50%;
    background: #94a3b8;
}

#container-section .container-row-v2.is-running .container-row-dot-v2 {
    background: #22c55e;
}

#container-section .container-row-v2.is-error .container-row-dot-v2 {
    background: #ef4444;
}

#container-section .container-row-v2.is-pending .container-row-dot-v2 {
    background: #f59e0b;
}

#container-section .container-row-v2 .container-name-cell {
    flex: 1;
}

#container-section .container-row-v2 .container-name-cell strong {
    font-size: 10.5px;
}

#container-section .container-row-v2 .container-name-cell small {
    font-size: 7.5px;
}

#container-section .container-row-v2 .container-image-code {
    margin-top: 4px;
    color: var(--container-accent);
    font-size: 7.8px;
}

#container-section .container-row-network-v2 {
    display: grid;
    gap: 6px;
}

#container-section .container-row-network-v2 :is(.container-network-line, .container-root-code) {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    font-size: 8.5px;
}

#container-section .container-row-network-v2 i {
    flex: 0 0 11px;
    color: var(--container-accent);
}

#container-section .container-row-resources-v2 {
    display: grid;
    gap: 6px;
}

#container-section .container-resource-primary-v2,
#container-section .container-resource-meta-v2 {
    min-width: 0;
}

#container-section .container-resource-primary-v2 {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 5px;
}

#container-section .container-resource-metric-v3 {
    display: grid;
    min-width: 0;
    align-items: center;
    gap: 1px;
    padding: 4px 6px;
    border: 1px solid rgba(99, 102, 241, .1);
    border-radius: 7px;
    background: rgba(99, 102, 241, .045);
}

#container-section .container-resource-metric-v3 small {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    color: var(--text-muted);
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.15;
    text-transform: uppercase;
}

#container-section .container-resource-metric-v3 small em {
    overflow: hidden;
    color: #d97706;
    font-size: 7px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

#container-section .container-resource-metric-v3 > strong {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
    overflow: hidden;
    color: var(--text-main);
    font-size: 9.5px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#container-section .container-resource-metric-v3 > strong em {
    color: var(--container-accent);
    font-size: 8px;
    font-style: normal;
    font-weight: 850;
}

#container-section .container-memory-track-v2 {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
}

#container-section .container-memory-track-v2 > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #22c55e);
}

#container-section .container-memory-track-v2.is-unknown {
    background: repeating-linear-gradient(135deg, rgba(148, 163, 184, .13) 0 5px, rgba(148, 163, 184, .04) 5px 10px);
}

#container-section .container-row-resources-v2.is-memory-warning .container-memory-track-v2 > i {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

#container-section .container-row-resources-v2.is-memory-critical .container-memory-track-v2 > i {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

#container-section .container-resource-meta-v2 {
    display: grid;
    grid-template-columns: 64px 54px minmax(0, 1fr);
    gap: 5px;
}

#container-section .container-resource-meta-v2 span {
    display: grid;
    min-width: 0;
    gap: 1px;
    padding: 2px 4px;
    overflow: hidden;
    border-radius: 5px;
    background: rgba(148, 163, 184, .07);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#container-section .container-resource-meta-v2 small {
    color: var(--text-muted);
    font-size: 7px;
    font-weight: 750;
    line-height: 1.1;
}

#container-section .container-resource-meta-v2 strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 8px;
    line-height: 1.2;
    text-overflow: ellipsis;
}

#container-section .container-row-state-v2 {
    display: flex;
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
}

#container-section .container-row-state-v2 .container-state {
    align-self: flex-start;
    min-height: 24px;
    padding-inline: 8px;
    font-size: 8.5px;
}

#container-section .container-row-state-v2 .container-state.is-pending {
    background: rgba(245, 158, 11, .12);
    color: #b45309;
}

#container-section .container-row-state-v2 .container-service-check {
    display: flex;
    min-width: 0;
    min-height: 23px;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin: 0;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(148, 163, 184, .07);
    font-size: 8px;
    line-height: 1.25;
}

#container-section .container-row-state-v2 .container-service-check i {
    flex: 0 0 auto;
}

#container-section .container-row-state-v2 .container-service-check span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#container-section .container-service-check.is-warning {
    color: #b45309;
}

#container-section .container-service-check.is-pending {
    color: #2563eb;
}

#container-section .container-service-check.is-neutral {
    color: var(--text-muted);
}

#container-section .container-row-state-v2 .container-boot-toggle {
    width: 100%;
    min-height: 23px;
    justify-content: space-between;
    padding-inline: 6px;
    font-size: 8px;
}

#container-section .container-row-state-v2 .container-boot-toggle > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#container-section .container-row-state-v2 .container-boot-toggle > strong {
    min-width: 28px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .13);
    color: var(--text-muted);
    font-size: 7.5px;
    text-align: center;
}

#container-section .container-row-state-v2 .container-boot-toggle.is-on > strong {
    background: rgba(34, 197, 94, .13);
    color: #15803d;
}

#container-section .container-actions-v2 {
    display: grid;
    grid-template-columns: repeat(3, 28px);
    justify-content: center;
    gap: 4px;
}

#container-section .container-actions-v2 button,
#container-section .container-actions-v2 a {
    width: 28px;
    height: 28px;
}

#container-section .container-empty-state-v2 {
    display: grid;
    min-height: 170px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
}

#container-section .container-empty-state-v2 > i {
    color: #a5b4fc;
    font-size: 27px;
}

#container-section .container-empty-state-v2 strong {
    color: var(--text-main);
    font-size: 12px;
}

#container-section .container-empty-state-v2 span {
    font-size: 9px;
}

#container-section .container-create-shell-v2 {
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--container-border);
    border-radius: 14px;
    background: var(--card-bg, #fff);
}

#container-section .container-create-shell-v2 > summary,
#container-section .container-guide-card-v2 > summary {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 13px;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
}

#container-section .container-create-shell-v2 > summary::-webkit-details-marker,
#container-section .container-guide-card-v2 > summary::-webkit-details-marker {
    display: none;
}

#container-section .container-create-shell-v2 > summary > span,
#container-section .container-guide-card-v2 > summary > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

#container-section .container-create-shell-v2 > summary > span > i,
#container-section .container-guide-card-v2 > summary > span > i {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    background: var(--container-accent-soft);
    color: var(--container-accent);
}

#container-section .container-create-shell-v2 > summary strong,
#container-section .container-create-shell-v2 > summary small,
#container-section .container-guide-card-v2 > summary strong,
#container-section .container-guide-card-v2 > summary small {
    display: block;
}

#container-section .container-create-shell-v2 > summary strong,
#container-section .container-guide-card-v2 > summary strong {
    font-size: 11px;
}

#container-section .container-create-shell-v2 > summary small,
#container-section .container-guide-card-v2 > summary small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 8.5px;
}

#container-section .container-create-shell-v2 > summary > i,
#container-section .container-guide-card-v2 > summary > i {
    color: #94a3b8;
    transition: transform .18s ease;
}

#container-section .container-create-shell-v2[open] > summary > i,
#container-section .container-guide-card-v2[open] > summary > i {
    transform: rotate(180deg);
}

#container-section .container-create-content-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(230px, .65fr);
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--container-border);
}

#container-section .container-create-content-v2 .container-create-card {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
}

#container-section .container-form-section-v2 {
    padding: 10px;
    border: 1px solid var(--container-border);
    border-radius: 10px;
    background: rgba(248, 250, 252, .62);
}

#container-section .container-form-section-head-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

#container-section .container-form-section-head-v2 > span {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    background: var(--container-accent-soft);
    color: var(--container-accent);
    font-size: 9px;
    font-weight: 900;
}

#container-section .container-form-section-head-v2 strong,
#container-section .container-form-section-head-v2 small {
    display: block;
}

#container-section .container-form-section-head-v2 strong {
    color: var(--text-main);
    font-size: 10px;
}

#container-section .container-form-section-head-v2 small {
    margin-top: 1px;
    color: var(--text-muted);
    font-size: 8px;
}

#container-section .container-resource-form-v2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#container-section .container-form-options {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--container-border);
    border-radius: 10px;
}

#container-section .container-create-button {
    justify-self: start;
    min-height: 36px;
    border-radius: 9px;
}

#container-section .container-guide-card-v2 {
    align-self: start;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--container-border);
    border-radius: 10px;
    background: rgba(248, 250, 252, .62);
}

#container-section .container-guide-body-v2 {
    padding: 0 11px 11px;
    border-top: 1px solid var(--container-border);
}

#container-section .container-guide-body-v2 ul {
    margin: 9px 0 0;
    padding-left: 17px;
    color: var(--text-muted);
    font-size: 8.5px;
    line-height: 1.55;
}

#container-section .container-guide-body-v2 .container-runtime-info {
    margin-top: 9px;
    padding-top: 9px;
}

#container-section :is(.container-static-field[hidden], .container-storage-consent[hidden], .container-capability-warning[hidden]) {
    display: none !important;
}

body.dark-mode #container-section :is(.container-page-header-v2, .container-status-card, .container-list-card-v2, .container-create-shell-v2) {
    background: rgba(17, 24, 39, .96);
    box-shadow: 7px 7px 18px rgba(0, 0, 0, .17);
}

body.dark-mode #container-section :is(.container-list-columns-v2, .container-form-section-v2, .container-guide-card-v2) {
    background: rgba(15, 23, 42, .66);
}

@media (min-width: 981px) {
    #container-section {
        max-width: calc(100vw - 340px);
    }
}

@container container-workspace (max-width: 1000px) {
    #container-section .container-status-grid-v2 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #container-section .container-list-columns-v2 {
        display: none;
    }

    #container-section .container-row-v2 {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        gap: 8px 12px;
        padding: 10px;
    }

    #container-section .container-row-identity-v2 { grid-column: 1; grid-row: 1; }
    #container-section .container-row-state-v2 { grid-column: 2; grid-row: 1; }
    #container-section .container-row-network-v2 { grid-column: 1; grid-row: 2; }
    #container-section .container-row-resources-v2 { grid-column: 2; grid-row: 2; }
    #container-section .container-actions-v2 { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; }

    #container-section .container-create-content-v2 {
        grid-template-columns: 1fr;
    }
}

@container container-workspace (max-width: 650px) {
    #container-section .container-page-header-v2,
    #container-section .container-header-actions-v2 {
        align-items: stretch;
        flex-direction: column;
    }

    #container-section .container-header-actions-v2 > * {
        width: 100%;
        justify-content: center;
    }

    #container-section .container-status-grid-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #container-section .container-row-v2 {
        grid-template-columns: 1fr;
    }

    #container-section .container-row-v2 > section {
        grid-column: 1;
        grid-row: auto;
    }

    #container-section .container-actions-v2 {
        justify-content: flex-start;
    }

    #container-section .container-form-grid,
    #container-section .container-resource-form-v2 {
        grid-template-columns: 1fr;
    }
}

/* Keep the tablet header inside the viewport between desktop and mobile layouts. */
@media (min-width: 992px) and (max-width: 1399px) {
    .top-bar-actions {
        min-width: 0 !important;
        gap: 8px !important;
    }

    .top-bar-actions .server-info-hint {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .header-stats {
        display: none !important;
    }

    #mikrotikConnectBtn {
        width: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
    }

    #mikrotikConnectBtn span {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .header-stats {
        display: none !important;
    }

    .top-bar-actions {
        min-width: 0 !important;
        max-width: calc(100% - 58px) !important;
    }

    .top-bar-actions .router-selector-wrap {
        min-width: 0 !important;
    }

    #mikrotikConnectBtn span,
    .top-bar-actions .btn span {
        display: none !important;
    }
}

/* ===== PROXY OPERATIONS WORKSPACE 2026-08-14 ===== */
#proxies {
    --proxy-ink: #172033;
    --proxy-muted: #667085;
    --proxy-line: #e6eaf0;
    --proxy-surface: #ffffff;
    --proxy-soft: #f7f9fc;
}

#proxies .proxy-page-header {
    align-items: center;
    margin-bottom: 16px;
}

#proxies .proxy-page-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

#proxies .proxy-page-heading h2 {
    margin: 0;
    color: var(--proxy-ink);
    font-size: 24px;
    font-weight: 850;
    letter-spacing: -0.03em;
}

#proxies .proxy-page-heading .section-subtitle {
    margin: 4px 0 0;
    color: var(--proxy-muted);
    font-size: 12px;
    font-weight: 550;
}

#proxies .proxy-page-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(145deg, #2563eb, #4f46e5);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

#proxies .proxy-live-indicator {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 999px;
    color: #047857;
    background: rgba(236, 253, 245, 0.82);
    font-size: 11px;
    font-weight: 800;
}

#proxies .proxy-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

#proxies .proxy-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

#proxies .proxy-overview-card {
    min-width: 0;
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--proxy-line);
    border-radius: 14px;
    background: var(--proxy-surface);
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.045);
}

#proxies .proxy-overview-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: #2563eb;
    background: #eef4ff;
}

#proxies .proxy-overview-card.online .proxy-overview-icon {
    color: #059669;
    background: #ecfdf5;
}

#proxies .proxy-overview-card.converted .proxy-overview-icon {
    color: #7c3aed;
    background: #f5f3ff;
}

#proxies .proxy-overview-card.assigned .proxy-overview-icon {
    color: #d97706;
    background: #fffbeb;
}

#proxies .proxy-overview-card div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#proxies .proxy-overview-card strong {
    color: var(--proxy-ink);
    font-size: 22px;
    font-weight: 850;
    line-height: 1;
}

#proxies .proxy-overview-card div span {
    margin-top: 5px;
    color: var(--proxy-muted);
    font-size: 11px;
    font-weight: 700;
}

#proxies .proxy-control-bar.compact-toolbar {
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    padding: 9px !important;
    border: 1px solid var(--proxy-line) !important;
    border-radius: 14px !important;
    background: var(--proxy-surface) !important;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.04) !important;
}

#proxies .proxy-control-bar .proxy-tool-group {
    gap: 6px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

#proxies .proxy-control-bar .selected-actions {
    padding-left: 9px !important;
    border-left: 1px solid var(--proxy-line) !important;
}

#proxies .proxy-control-bar .tool-group-label {
    gap: 6px;
    padding: 0 8px !important;
    color: var(--proxy-muted) !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    letter-spacing: 0.02em;
}

#proxies .proxy-control-bar .tool-group-label b {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 999px;
    color: #2563eb;
    background: #eef4ff;
    font-size: 10px;
}

#proxies .proxy-control-bar .btn-action,
#proxies .proxy-control-bar .proxy-dropdown-trigger,
#proxies .proxy-control-bar .proxy-more-dropdown > summary {
    min-height: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
}

#proxies .table-area.glass {
    border: 1px solid var(--proxy-line) !important;
    border-radius: 16px !important;
    background: var(--proxy-soft) !important;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.055) !important;
}

#proxies .proxy-list-header {
    min-height: 62px !important;
    padding: 12px 16px !important;
    background: var(--proxy-surface) !important;
}

#proxies .proxy-list-title {
    display: grid !important;
    grid-template-columns: 32px auto;
    column-gap: 10px !important;
    align-items: center;
}

#proxies .proxy-list-title i {
    grid-row: 1 / 3;
}

#proxies .proxy-list-title span {
    line-height: 1.15;
}

#proxies .proxy-list-title small {
    color: var(--proxy-muted);
    font-size: 10px;
    font-weight: 600;
}

#proxies .table-container {
    max-height: calc(100vh - 340px) !important;
    padding: 10px !important;
    overflow: auto !important;
    background: var(--proxy-soft) !important;
}

#proxies .proxies-table,
#proxies .proxies-table tbody {
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
}

#proxies .proxies-table thead {
    display: none !important;
}

#proxies .proxies-table tbody tr[data-proxy-id] {
    width: 100%;
    box-sizing: border-box;
    min-height: 112px;
    display: grid !important;
    grid-template-columns: 28px 54px 110px minmax(155px, 1.1fr) minmax(155px, 1fr) minmax(180px, 1.15fr) 138px;
    grid-template-rows: repeat(3, minmax(26px, auto));
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--proxy-line);
    border-radius: 13px;
    background: var(--proxy-surface) !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease !important;
}

#proxies .proxies-table tbody tr[data-proxy-id]:last-child {
    margin-bottom: 0;
}

#proxies .proxies-table tbody tr[data-proxy-id]:hover {
    transform: translateY(-1px);
    border-color: #cbd8ef;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07) !important;
}

#proxies .proxies-table tbody tr[data-proxy-id].active {
    border-color: rgba(37, 99, 235, 0.35);
    background: linear-gradient(90deg, rgba(239, 246, 255, 0.9), #ffffff 34%) !important;
}

#proxies .proxies-table tbody tr[data-proxy-id] > td {
    min-width: 0;
    width: auto !important;
    height: auto !important;
    display: flex;
    align-items: center;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
}

#proxies .proxies-table tbody tr[data-proxy-id] > td:nth-child(1) { grid-column: 1; grid-row: 1 / 4; justify-content: center; }
#proxies .proxies-table tbody tr[data-proxy-id] > td:nth-child(2) { grid-column: 2; grid-row: 1; justify-content: center; }
#proxies .proxies-table tbody tr[data-proxy-id] > td:nth-child(3) { grid-column: 2; grid-row: 2 / 4; justify-content: center; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-status { grid-column: 3; grid-row: 1; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-fingerprint { grid-column: 3; grid-row: 2; justify-content: flex-start; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-auth { grid-column: 3; grid-row: 3; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-ip-port { grid-column: 4; grid-row: 1 / 3; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-webrtc { grid-column: 4; grid-row: 3; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-host-ip { grid-column: 5; grid-row: 1; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-converted-ip-port { grid-column: 5; grid-row: 2 / 4; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-device-ip { grid-column: 6; grid-row: 1 / 4; }
#proxies .proxies-table tbody tr[data-proxy-id] > .col-action { grid-column: 7; grid-row: 1 / 4; justify-content: flex-end; }

#proxies .col-ip-port,
#proxies .col-host-ip,
#proxies .col-converted-ip-port,
#proxies .col-device-ip {
    position: relative;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: center;
    gap: 4px;
}

#proxies .col-ip-port::before,
#proxies .col-host-ip::before,
#proxies .col-converted-ip-port::before,
#proxies .col-device-ip::before {
    display: block;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.07em;
    line-height: 1;
}

#proxies .col-ip-port::before { content: "IP PUBLIC"; }
#proxies .col-host-ip::before { content: "KẾT NỐI GỐC"; }
#proxies .col-converted-ip-port::before { content: "PORT CONVERT"; }
#proxies .col-device-ip::before { content: "THIẾT BỊ ĐƯỢC GÁN"; }

#proxies .status-badge.compact {
    min-width: 0 !important;
    width: auto !important;
    height: 27px !important;
    padding: 0 9px !important;
}

#proxies .status-badge.compact .status-info span {
    max-width: 82px !important;
    white-space: nowrap !important;
}

#proxies .col-ip-port > div > div:first-child {
    min-height: 27px !important;
    padding: 0 8px !important;
}

#proxies .col-device-ip .ip-input-wrapper {
    width: 100%;
    min-width: 0 !important;
}

#proxies .row-actions.compact {
    width: 103px;
    display: grid !important;
    grid-template-columns: repeat(3, 31px);
    gap: 5px !important;
}

#proxies .col-auth > div {
    width: 100%;
    flex-direction: row !important;
    align-items: center;
    gap: 5px !important;
    overflow: hidden;
}

#proxies .col-auth .user-text {
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode #proxies {
    --proxy-ink: #f1f5f9;
    --proxy-muted: #94a3b8;
    --proxy-line: rgba(148, 163, 184, 0.17);
    --proxy-surface: #0f172a;
    --proxy-soft: #0b1220;
}

body.dark-mode #proxies .proxy-overview-card,
body.dark-mode #proxies .proxy-control-bar.compact-toolbar,
body.dark-mode #proxies .proxy-list-header,
body.dark-mode #proxies .proxies-table tbody tr[data-proxy-id] {
    background: var(--proxy-surface) !important;
}

body.dark-mode #proxies .proxy-live-indicator {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.09);
}

@media (max-width: 1180px) {
    #proxies .proxy-control-bar.compact-toolbar .main-actions,
    #proxies .proxy-control-bar.compact-toolbar .selected-actions {
        flex-basis: 100%;
    }

    #proxies .proxy-control-bar .selected-actions {
        padding: 8px 0 0 !important;
        border-left: 0 !important;
        border-top: 1px solid var(--proxy-line) !important;
    }

    #proxies .proxies-table tbody tr[data-proxy-id] {
        grid-template-columns: 28px 58px minmax(120px, .75fr) minmax(165px, 1fr) minmax(180px, 1.05fr) 74px;
    }

    #proxies .proxies-table tbody tr[data-proxy-id] > .col-auth { display: none; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-status { grid-column: 3; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-fingerprint { grid-column: 3; grid-row: 2 / 4; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-ip-port,
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-webrtc { grid-column: 4; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-host-ip,
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-converted-ip-port { grid-column: 5; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-device-ip { display: none; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-action { grid-column: 6; }
}

@media (max-width: 768px) {
    #proxies .proxy-page-header {
        align-items: flex-start;
        gap: 12px;
    }

    #proxies .proxy-page-heading h2 { font-size: 20px; }
    #proxies .proxy-page-heading .section-subtitle { max-width: 280px; }
    #proxies .proxy-live-indicator { min-height: 30px; }

    #proxies .proxy-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #proxies .proxy-overview-card {
        min-height: 66px;
        padding: 10px;
    }

    #proxies .proxy-overview-card strong { font-size: 19px; }

    #proxies .proxy-control-bar.compact-toolbar .proxy-tool-group {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    #proxies .proxy-control-bar .tool-group-label {
        justify-content: flex-start !important;
    }

    #proxies .proxy-list-header {
        align-items: flex-start !important;
        gap: 10px;
    }

    #proxies .table-container {
        max-height: none !important;
        padding: 8px !important;
    }

    #proxies .proxies-table tbody tr[data-proxy-id] {
        grid-template-columns: 28px 62px minmax(0, 1fr) 80px;
        grid-template-rows: repeat(7, auto);
        gap: 7px 8px;
        padding: 11px;
    }

    #proxies .proxies-table tbody tr[data-proxy-id] > td:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
    #proxies .proxies-table tbody tr[data-proxy-id] > td:nth-child(2) { grid-column: 2; grid-row: 1; }
    #proxies .proxies-table tbody tr[data-proxy-id] > td:nth-child(3) { grid-column: 2; grid-row: 2; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-status { grid-column: 3; grid-row: 1; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-fingerprint { grid-column: 4; grid-row: 1 / 3; display: flex; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-auth { display: none; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-ip-port { grid-column: 1 / 3; grid-row: 3 / 5; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-webrtc { grid-column: 3 / 5; grid-row: 3 / 5; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-host-ip { grid-column: 1 / 3; grid-row: 5; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-converted-ip-port { grid-column: 3 / 5; grid-row: 5; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-device-ip { grid-column: 1 / 5; grid-row: 6; display: flex; }
    #proxies .proxies-table tbody tr[data-proxy-id] > .col-action { grid-column: 1 / 5; grid-row: 7; justify-content: flex-start; }

    #proxies .row-actions.compact {
        width: auto;
        grid-template-columns: repeat(5, 34px);
    }
}

/* Compact provider cascade (must remain last). */
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header { min-height:46px !important; margin-bottom:7px !important; padding:6px 9px !important; }
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header h2 { font-size:16px !important; }
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header :is(p,.section-subtitle) { font-size:9px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-page-grid { gap:7px !important; margin-bottom:7px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.shoplike-card,.shoplike-list-card), #suiproxy-section :is(.suiproxy-account-card,.suiproxy-list-card) { border-radius:10px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-key-card, #suiproxy-section .suiproxy-account-card { padding:9px 10px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-form-grid { gap:5px 7px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(input,select,.form-control) { min-height:29px !important; height:29px !important; padding:0 8px !important; font-size:10px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-form-actions, #suiproxy-section .suiproxy-account-actions { margin-top:7px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.shoplike-list-head,.kiotproxy-list-head,.nestproxy-list-head), #suiproxy-section .suiproxy-list-head { min-height:42px !important; padding:6px 8px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.shoplike-list-actions,.shoplike-bulk-actions,.nestproxy-bulk-actions), #suiproxy-section .suiproxy-list-tools { gap:4px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.bulk-webrtc-control,.nestproxy-bulk-dns), #suiproxy-section :is(.bulk-webrtc-control,.suiproxy-bulk-dns) { min-height:28px !important; padding:2px 4px 2px 6px !important; border-radius:7px !important; }
:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) :is(.bulk-webrtc-control,.nestproxy-bulk-dns) :is(select,button), #suiproxy-section :is(.bulk-webrtc-control,.suiproxy-bulk-dns) :is(select,button) { min-height:23px !important; height:23px !important; font-size:9px !important; }
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section) :is(.shoplike-summary-strip,.nestproxy-summary-strip,.kiotproxy-summary-strip) { gap:5px !important; padding:5px 7px !important; }
:is(#shoplike-section, #nestproxy-section, #kiotproxy-section) :is(.shoplike-summary-strip,.nestproxy-summary-strip,.kiotproxy-summary-strip) > div { min-height:44px !important; padding:5px 7px !important; border-radius:8px !important; }
#kiotproxy-section .kiotproxy-commandbar { gap:5px !important; padding:6px 8px !important; }
#kiotproxy-section .kiotproxy-commandbar .btn, #kiotproxy-section .nestproxy-auto-select { min-height:28px !important; height:28px !important; }
:is(#shoplike-section,#nestproxy-section,#kiotproxy-section,#suiproxy-section) :is(.shoplike-key-card-v2,.nestproxy-key-card,.kiotproxy-key-card,.suiproxy-proxy-card) { margin:0 5px 5px !important; }
:is(#shoplike-section,#nestproxy-section,#kiotproxy-section,#suiproxy-section) :is(.shoplike-key-card-v2 > section,.nestproxy-key-card > section,.kiotproxy-key-card > section,.suiproxy-proxy-card > section) { padding:7px 8px !important; }
:is(#shoplike-section,#nestproxy-section,#kiotproxy-section,#suiproxy-section) :is(.shoplike-action-btn,.nestproxy-action-btn,.suiproxy-action-btn) { min-height:27px !important; height:27px !important; padding:0 7px !important; font-size:9px !important; }
@media (max-width:720px) { :is(#shoplike-section,#kiotproxy-section,#tmproxy-section,#nestproxy-section) .shoplike-page-grid { grid-template-columns:1fr !important; } :is(#shoplike-section,#kiotproxy-section,#tmproxy-section,#nestproxy-section) .shoplike-note-card { display:none !important; } }

/* SuiProxy overlap guard: use intrinsic grid rows and non-stretching actions. */
#suiproxy-section .suiproxy-account-body {
    grid-template-columns: minmax(220px, .9fr) minmax(300px, 1.45fr) auto !important;
    gap: 8px !important;
    align-items: center !important;
    margin-top: 8px !important;
}
#suiproxy-section .suiproxy-account-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
}
#suiproxy-section .suiproxy-account-actions .btn {
    width: auto !important;
    min-width: 104px !important;
    height: 29px !important;
    min-height: 29px !important;
    padding: 0 9px !important;
}
#suiproxy-section .suiproxy-account-meta {
    min-width: 0 !important;
    min-height: 0 !important;
}
#suiproxy-section .suiproxy-proxy-card {
    grid-template-columns: minmax(190px, 1.05fr) minmax(240px, 1.25fr) minmax(185px, 1.05fr) minmax(200px, .9fr) !important;
    grid-auto-rows: minmax(0, auto) !important;
    align-items: stretch !important;
    height: auto !important;
    min-height: 0 !important;
}
#suiproxy-section .suiproxy-card-zone {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
#suiproxy-section .suiproxy-info,
#suiproxy-section .suiproxy-connection-zone,
#suiproxy-section .suiproxy-actions-zone { min-width: 0 !important; }
#suiproxy-section .suiproxy-action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
#suiproxy-section .suiproxy-action-button { min-width: 0 !important; overflow: hidden !important; }
@media (max-width: 1100px) {
    #suiproxy-section .suiproxy-account-body { grid-template-columns: minmax(210px, 1fr) minmax(280px, 1.35fr) !important; }
    #suiproxy-section .suiproxy-account-actions { grid-column: 1 / -1 !important; justify-content: flex-start !important; }
    #suiproxy-section .suiproxy-proxy-card { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #suiproxy-section .suiproxy-card-zone:nth-child(3), #suiproxy-section .suiproxy-card-zone:nth-child(4) { border-top: 1px solid var(--sui-border) !important; }
}
@media (max-width: 720px) {
    #suiproxy-section .suiproxy-account-body, #suiproxy-section .suiproxy-proxy-card { grid-template-columns: 1fr !important; }
    #suiproxy-section .suiproxy-account-actions { grid-column: auto !important; }
    #suiproxy-section .suiproxy-account-actions .btn { flex: 1 1 140px; }
}

/* Deterministic SuiProxy card placement: four zones use unique grid cells. */
#suiproxy-section .suiproxy-proxy-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) !important;
    grid-template-rows: auto auto !important;
    grid-auto-flow: row !important;
    align-items: stretch !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone { grid-column: 1 !important; grid-row: 1 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-connection-zone { grid-column: 2 !important; grid-row: 1 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-devices-zone { grid-column: 1 !important; grid-row: 2 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-actions-zone { grid-column: 2 !important; grid-row: 2 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    position: relative !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 96px !important;
    height: auto !important;
    padding: 8px 9px !important;
    border-left: 1px solid var(--sui-border) !important;
    border-top: 1px solid var(--sui-border) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone,
#suiproxy-section .suiproxy-proxy-card > .suiproxy-connection-zone { border-top: 0 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone,
#suiproxy-section .suiproxy-proxy-card > .suiproxy-devices-zone { border-left: 0 !important; }
#suiproxy-section .suiproxy-device-details,
#suiproxy-section .suiproxy-connection-zone,
#suiproxy-section .suiproxy-actions-zone { align-self: stretch !important; }
@media (max-width: 720px) {
    #suiproxy-section .suiproxy-proxy-card { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone { grid-column: 1 !important; min-height: 0 !important; border-left: 0 !important; border-top: 1px solid var(--sui-border) !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone { grid-row: 1 !important; border-top: 0 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-connection-zone { grid-row: 2 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-devices-zone { grid-row: 3 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-actions-zone { grid-row: 4 !important; }
}

/* SuiProxy final polish cascade (intentionally last). */
#suiproxy-section .suiproxy-page-header { min-height:58px !important; margin-bottom:10px !important; padding:10px 14px !important; border:1px solid var(--proxy-polish-border) !important; border-radius:14px !important; box-shadow:var(--proxy-polish-shadow) !important; }
#suiproxy-section .suiproxy-heading { gap:10px !important; }
#suiproxy-section .suiproxy-heading-icon { width:38px !important; height:38px !important; flex-basis:38px !important; border-radius:11px !important; }
#suiproxy-section .suiproxy-heading h2 { font-size:18px !important; }
#suiproxy-section .suiproxy-heading p { margin-top:2px !important; font-size:10px !important; line-height:1.3 !important; }
#suiproxy-section .suiproxy-account-card { margin-bottom:9px !important; padding:11px 14px !important; border-radius:12px !important; box-shadow:0 3px 12px rgba(15,23,42,.045) !important; }
#suiproxy-section .suiproxy-card-heading > span, #suiproxy-section .suiproxy-card-heading-icon { width:34px !important; height:34px !important; border-radius:10px !important; }
#suiproxy-section .suiproxy-card-heading h3, #suiproxy-section .suiproxy-list-title h3 { font-size:14px !important; }
#suiproxy-section .suiproxy-account-body { gap:8px !important; margin-top:9px !important; }
#suiproxy-section .suiproxy-key-input input { height:36px !important; min-height:36px !important; }
#suiproxy-section .suiproxy-list-card { border-radius:12px !important; box-shadow:0 3px 12px rgba(15,23,42,.045) !important; }
#suiproxy-section .suiproxy-list-head { min-height:56px !important; gap:9px !important; padding:9px 13px !important; }
#suiproxy-section .suiproxy-list-tools { gap:5px !important; }
#suiproxy-section :is(.suiproxy-bulk-dns,.bulk-webrtc-control) { min-height:30px !important; gap:5px !important; padding:2px 4px 2px 7px !important; border-radius:8px !important; box-shadow:none !important; }
#suiproxy-section :is(.suiproxy-bulk-dns,.bulk-webrtc-control) :is(select,button) { min-height:25px !important; height:25px !important; padding:0 7px !important; border-radius:6px !important; font-size:9.5px !important; }
#suiproxy-section .suiproxy-card-list { max-height:clamp(430px,62vh,720px) !important; overflow-y:auto !important; overflow-x:hidden !important; scrollbar-gutter:stable; overscroll-behavior:contain; }
#suiproxy-section .suiproxy-card-zone { padding:9px 10px !important; }
#suiproxy-section .suiproxy-card-zone:first-child { padding-left:13px !important; }
#suiproxy-section .suiproxy-action-button { min-height:29px !important; height:29px !important; border-radius:7px !important; }
#suiproxy-section .suiproxy-proxy-card { min-height:112px !important; height:auto !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone { min-height:112px !important; }
@media (max-width:980px) { #suiproxy-section .suiproxy-card-list { max-height:none !important; overflow-y:visible !important; } }


/* PPPoE rows: remove the full-height green status rail. */
#pppoe-section .pppoe-list-row-v3,
#pppoe-section .pppoe-list-row-v3:hover,
#pppoe-section .pppoe-list-row-v3.no-proxy,
#pppoe-section .pppoe-list-row-v3.no-proxy:hover,
#pppoe-section .pppoe-list-row-v3.is-selected,
#pppoe-section .pppoe-list-row-v3.is-selected:hover,
#pppoe-section .pppoe-proxy-card-v2 {
    border-left: 0 !important;
}

/* The green status dot is the single online indicator for PPPoE rows. */
#pppoe-section .pppoe-state-badge-v2.is-online,
#pppoe-section .pppoe-port-number-v2 {
    display: none !important;
}

/* ===== PPPoE compact workspace v4 =====
   One calm row per interface: name/status, IP, connection details,
   assigned-device control and icon actions. */
#pppoe-section .pppoe-card-list-v2 {
    padding: 4px 10px 10px;
}

#pppoe-section .pppoe-list-row-v3 {
    grid-template-columns:
        minmax(190px, 1.15fr)
        minmax(170px, .95fr)
        minmax(150px, .9fr)
        minmax(160px, .95fr)
        auto;
    gap: 8px;
    min-height: 68px;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(148, 163, 184, .2);
    border-left: 0 !important;
}

#pppoe-section .pppoe-list-row-v3:hover,
#pppoe-section .pppoe-list-row-v3.is-selected,
#pppoe-section .pppoe-list-row-v3.is-selected:hover {
    border-left: 0 !important;
    background: rgba(37, 99, 235, .035);
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-head-v2 {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: auto 8px minmax(0, 1fr);
    gap: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-select-v2 > span {
    min-width: 22px;
    height: 22px;
    border-radius: 7px;
    font-size: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 {
    min-width: 0;
    gap: 2px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 > strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-title-v2 .pppoe-state-badges-v2 {
    min-height: 0;
    gap: 4px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
    display: contents;
}

#pppoe-section .pppoe-list-row-v3 :is(.pppoe-card-network-v2, .pppoe-card-config-v2) {
    min-width: 0;
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-network-v2 {
    grid-column: 2;
    grid-row: 1;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-config-v2 {
    grid-column: 3;
    grid-row: 1;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-label-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-endpoint-v2 {
    display: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 > span:first-child,
#pppoe-section .pppoe-list-row-v3 .pppoe-config-row-v2 > span:first-child {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-public-ip-v2 .pppoe-ip-stack {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 {
    gap: 4px;
    margin-top: 5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-live-metrics-v2 > div {
    min-height: 21px;
    gap: 4px;
    padding: 0 5px;
    border: 0;
    border-radius: 5px;
    background: rgba(248, 250, 252, .86);
    font-size: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-auth-state-v2 {
    min-height: 24px;
    margin: 0;
    padding: 2px 5px;
    border: 0;
    border-radius: 6px;
    background: rgba(248, 250, 252, .86);
}

#pppoe-section .pppoe-list-row-v3 .pppoe-auth-state-v2 small {
    display: none;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-config-details-v3 {
    margin-top: 3px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-config-details-v3 > summary {
    min-height: 20px;
    font-size: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2 {
    grid-column: 4;
    grid-row: 1;
    min-width: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-device-dropdown-nest-style > summary {
    min-height: 34px;
    padding-inline: 9px;
    border-radius: 8px;
    font-size: 10px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-device-dropdown-nest-style .pppoe-device-summary-main {
    gap: 5px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-device-dropdown-nest-style .pppoe-device-panel-v2 {
    padding: 8px;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
    display: grid;
    grid-column: 5;
    grid-row: 1;
    grid-template-columns: repeat(2, 30px);
    min-width: 65px;
    gap: 5px;
    align-content: center;
    justify-content: end;
    margin: 0;
    padding: 0;
    border: 0;
}

#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.primary,
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2.create {
    width: 30px;
    max-width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
}

/* Compact action buttons: labels remain available through title/tooltips,
   while the fixed icon cells prevent text from colliding at narrow widths. */
#pppoe-section .pppoe-list-row-v3 .pppoe-card-action-v2 span {
    display: none !important;
}

@container pppoe-workspace (min-width: 1040px) {
    #pppoe-section .pppoe-list-row-v3 {
        min-height: 68px;
        padding: 8px 6px;
    }
}

@container pppoe-workspace (min-width: 860px) and (max-width: 1039px) {
    #pppoe-section .pppoe-list-row-v3 {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 0;
        padding: 10px 8px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-network-v2,
    #pppoe-section .pppoe-list-row-v3 .pppoe-card-config-v2 {
        grid-column: auto;
        grid-row: auto;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2 {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
        grid-column: 2;
        grid-row: 1;
    }
}

@container pppoe-workspace (max-width: 859px) {
    #pppoe-section .pppoe-list-row-v3 {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 9px;
        padding: 9px 6px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-grid-v2 {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: 1fr;
        gap: 3px;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-network-v2,
    #pppoe-section .pppoe-list-row-v3 .pppoe-card-config-v2 {
        grid-column: auto;
        grid-row: auto;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-devices-v2 {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    #pppoe-section .pppoe-list-row-v3 .pppoe-card-actions-v2 {
        grid-column: 2;
        grid-row: 1;
    }
}

/* Provider toolbar stability — controls wrap as complete groups, never clip. */
:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section)
    :is(.shoplike-list-head, .suiproxy-list-head, .kiotproxy-list-head) {
    flex-wrap: wrap !important;
    overflow: visible !important;
}

:is(#shoplike-section, #tmproxy-section) .shoplike-list-actions,
#suiproxy-section .suiproxy-list-tools,
#kiotproxy-section :is(.kiotproxy-commandbar, .kiotproxy-command-group) {
    display: flex !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 7px !important;
    overflow: visible !important;
}

:is(#shoplike-section, #tmproxy-section) .shoplike-list-actions,
#suiproxy-section .suiproxy-list-tools {
    flex: 1 1 720px !important;
    justify-content: flex-end !important;
}

:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section)
    :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) {
    display: grid !important;
    grid-template-columns: 22px minmax(138px, 1fr) minmax(84px, auto) auto !important;
    flex: 1 1 300px !important;
    width: auto !important;
    max-width: 520px !important;
    min-width: min(300px, 100%) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section)
    :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) > span {
    width: auto !important;
    min-width: 84px !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
}

:is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section)
    :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) select {
    width: 100% !important;
    min-width: 0 !important;
}

#suiproxy-section .suiproxy-search {
    flex: 1 1 190px !important;
    min-width: 170px !important;
    max-width: 300px !important;
}

#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
}

#suiproxy-section .suiproxy-proxy-card.is-expired,
#kiotproxy-section .kiotproxy-key-card.is-expired {
    border-color: rgba(245, 158, 11, .42) !important;
    background: rgba(255, 251, 235, .72) !important;
}

#kiotproxy-section .converted-port-badge.is-stored-only {
    opacity: .72;
    border-style: dashed !important;
}

#kiotproxy-section .kiotproxy-stored-port-note {
    display: block;
    margin-top: 4px;
    color: #b45309;
    font-size: 9px;
    font-weight: 700;
}

body.dark-mode :is(#suiproxy-section .suiproxy-proxy-card.is-expired, #kiotproxy-section .kiotproxy-key-card.is-expired) {
    background: rgba(120, 53, 15, .18) !important;
}

@media (max-width: 760px) {
    :is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section)
        :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) {
        grid-template-columns: 22px minmax(0, 1fr) auto !important;
        max-width: none !important;
    }
    :is(#shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section)
        :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) > span {
        grid-column: 2 / 4 !important;
        grid-row: 2 !important;
        white-space: normal !important;
    }
}

/* SuiProxy overlap guard (2026-08-30) */
#suiproxy-section .suiproxy-proxy-card {
    min-height: 132px !important;
    height: auto !important;
    grid-auto-rows: minmax(132px, auto) !important;
    align-items: stretch !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    min-height: 132px !important;
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
@media (max-width: 1400px) {
    #suiproxy-section .suiproxy-proxy-card { grid-auto-rows: minmax(124px, auto) !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone { min-height: 124px !important; }
}
@media (max-width: 820px) {
    #suiproxy-section .suiproxy-proxy-card { grid-auto-rows: auto !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone { min-height: 0 !important; overflow: visible !important; }
}

/* SuiProxy overlap guard (2026-08-30)
   The compact restore rules constrained each record to 112px while the
   connection/actions columns need a little more room.  Let the grid row size
   itself from its content and keep the card zones visible so controls cannot
   be clipped into the next record. */
#suiproxy-section .suiproxy-proxy-card {
    min-height: 132px !important;
    height: auto !important;
    grid-auto-rows: minmax(132px, auto) !important;
    align-items: stretch !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    min-height: 132px !important;
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
@media (max-width: 1400px) {
    #suiproxy-section .suiproxy-proxy-card {
        grid-auto-rows: minmax(124px, auto) !important;
    }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
        min-height: 124px !important;
    }
}
@media (max-width: 820px) {
    #suiproxy-section .suiproxy-proxy-card {
        grid-auto-rows: auto !important;
    }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
        min-height: 0 !important;
        overflow: visible !important;
    }
}

/* Last cascade: keep SuiProxy content fully visible after every legacy reset. */
#suiproxy-section .suiproxy-proxy-card {
    min-height: 132px !important;
    height: auto !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    min-height: 112px !important;
    height: auto !important;
}

/* SuiProxy polish must follow its stability reset; grid definitions untouched. */
#suiproxy-section .suiproxy-page-header {
    min-height: 58px !important;
    margin-bottom: 10px !important;
    padding: 10px 14px !important;
    border: 1px solid var(--proxy-polish-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--proxy-polish-shadow) !important;
}
#suiproxy-section .suiproxy-heading { gap: 10px !important; }
#suiproxy-section .suiproxy-heading-icon { width: 38px !important; height: 38px !important; flex-basis: 38px !important; border-radius: 11px !important; }
#suiproxy-section .suiproxy-heading h2 { font-size: 18px !important; }
#suiproxy-section .suiproxy-heading p { margin-top: 2px !important; font-size: 10px !important; line-height: 1.3 !important; }
#suiproxy-section .suiproxy-account-card { margin-bottom: 9px !important; padding: 11px 14px !important; border-radius: 12px !important; box-shadow: 0 3px 12px rgba(15,23,42,.045) !important; }
#suiproxy-section .suiproxy-account-head { gap: 10px !important; }
#suiproxy-section .suiproxy-card-heading { gap: 9px !important; }
#suiproxy-section .suiproxy-card-heading > span,
#suiproxy-section .suiproxy-card-heading-icon { width: 34px !important; height: 34px !important; border-radius: 10px !important; }
#suiproxy-section .suiproxy-card-heading h3,
#suiproxy-section .suiproxy-list-title h3 { font-size: 14px !important; }
#suiproxy-section .suiproxy-card-heading p,
#suiproxy-section .suiproxy-list-title p { margin-top: 2px !important; font-size: 10px !important; }
#suiproxy-section .suiproxy-account-body { gap: 8px !important; margin-top: 9px !important; }
#suiproxy-section .suiproxy-key-input input { height: 36px !important; min-height: 36px !important; }
#suiproxy-section .suiproxy-account-actions .btn { min-height: 31px !important; border-radius: 8px !important; }
#suiproxy-section .suiproxy-list-card { border-radius: 12px !important; box-shadow: 0 3px 12px rgba(15,23,42,.045) !important; }
#suiproxy-section .suiproxy-list-head { min-height: 56px !important; gap: 9px !important; padding: 9px 13px !important; }
#suiproxy-section .suiproxy-list-tools { gap: 5px !important; }
#suiproxy-section :is(.suiproxy-bulk-dns, .bulk-webrtc-control) { min-height: 30px !important; gap: 5px !important; padding: 2px 4px 2px 7px !important; border-radius: 8px !important; box-shadow: none !important; }
#suiproxy-section :is(.suiproxy-bulk-dns, .bulk-webrtc-control) :is(select, button) { min-height: 25px !important; height: 25px !important; padding: 0 7px !important; border-radius: 6px !important; font-size: 9.5px !important; }
#suiproxy-section .suiproxy-card-list { max-height: clamp(430px, 62vh, 720px) !important; overflow-y: auto !important; overflow-x: hidden !important; scrollbar-gutter: stable; overscroll-behavior: contain; }
#suiproxy-section .suiproxy-card-zone { padding: 9px 10px !important; }
#suiproxy-section .suiproxy-card-zone:first-child { padding-left: 13px !important; }
#suiproxy-section .suiproxy-action-button { min-height: 29px !important; height: 29px !important; border-radius: 7px !important; }
@media (max-width: 980px) {
    #suiproxy-section .suiproxy-card-list { max-height: none !important; overflow-y: visible !important; }
}

/* ========================================================================== */
/* PPPoE Workspace V5 — isolated visual system.                                */
/* Existing PPPoE class names remain only as behavior hooks in JavaScript;     */
/* every visible component below uses rp5-* so older themes cannot collide.    */
/* ========================================================================== */
#pppoe-section.pppoe-v5 {
    --rp5-primary: #2563eb;
    --rp5-primary-dark: #1d4ed8;
    --rp5-primary-soft: #eff6ff;
    --rp5-success: #059669;
    --rp5-success-soft: #ecfdf5;
    --rp5-warning: #d97706;
    --rp5-warning-soft: #fffbeb;
    --rp5-danger: #dc2626;
    --rp5-danger-soft: #fef2f2;
    --rp5-violet: #7c3aed;
    --rp5-violet-soft: #f5f3ff;
    --rp5-ink: #0f172a;
    --rp5-text: #334155;
    --rp5-muted: #64748b;
    --rp5-subtle: #94a3b8;
    --rp5-line: #dbe4f0;
    --rp5-line-strong: #cbd5e1;
    --rp5-surface: #ffffff;
    --rp5-surface-soft: #f8fafc;
    --rp5-shadow: 0 14px 36px rgba(15, 23, 42, .075);
    width: 100%;
    min-width: 0;
    max-width: none;
    overflow: visible;
    color: var(--rp5-text);
}

#pppoe-section.pppoe-v5,
#pppoe-section.pppoe-v5 * {
    box-sizing: border-box;
}

#pppoe-section.pppoe-v5 button,
#pppoe-section.pppoe-v5 input,
#pppoe-section.pppoe-v5 select,
#pppoe-section.pppoe-v5 summary {
    font: inherit;
}

#pppoe-section.pppoe-v5 .rp5-page-header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 20px 22px;
    overflow: visible;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 0%, rgba(59, 130, 246, .13), transparent 38%),
        var(--rp5-surface);
    box-shadow: var(--rp5-shadow);
}

#pppoe-section.pppoe-v5 .rp5-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

#pppoe-section.pppoe-v5 .rp5-heading-icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
    font-size: 20px;
}

#pppoe-section.pppoe-v5 .rp5-heading > div {
    min-width: 0;
}

#pppoe-section.pppoe-v5 .rp5-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--rp5-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .13em;
}

#pppoe-section.pppoe-v5 .rp5-heading h2 {
    margin: 0;
    color: var(--rp5-ink);
    font-size: clamp(23px, 2vw, 28px);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.15;
}

#pppoe-section.pppoe-v5 .rp5-heading p {
    margin: 5px 0 0;
    color: var(--rp5-muted);
    font-size: 13px;
    line-height: 1.45;
}

#pppoe-section.pppoe-v5 .rp5-header-actions,
#pppoe-section.pppoe-v5 .rp5-command-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

#pppoe-section.pppoe-v5 .rp5-sync-status {
    display: inline-flex;
    min-height: 40px;
    max-width: 260px;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    overflow: hidden;
    border: 1px solid rgba(5, 150, 105, .22);
    border-radius: 11px;
    background: var(--rp5-success-soft);
    color: #047857;
    font-size: 12px;
    font-weight: 750;
}

#pppoe-section.pppoe-v5 .rp5-sync-status > i {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
    animation: rp5-pulse 1.8s ease-in-out infinite;
}

#pppoe-section.pppoe-v5 .rp5-sync-status > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes rp5-pulse {
    50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}

#pppoe-section.pppoe-v5 .rp5-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

#pppoe-section.pppoe-v5 .rp5-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

#pppoe-section.pppoe-v5 .rp5-button-secondary {
    border-color: var(--rp5-line-strong);
    background: var(--rp5-surface);
    color: var(--rp5-text);
}

#pppoe-section.pppoe-v5 .rp5-button-secondary:hover {
    border-color: #93c5fd;
    background: var(--rp5-primary-soft);
    color: var(--rp5-primary-dark);
}

#pppoe-section.pppoe-v5 .rp5-button-primary {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .18);
}

#pppoe-section.pppoe-v5 .rp5-button-success {
    border-color: rgba(5, 150, 105, .24);
    background: var(--rp5-success-soft);
    color: #047857;
}

#pppoe-section.pppoe-v5 .rp5-button-warning {
    border-color: rgba(217, 119, 6, .24);
    background: var(--rp5-warning-soft);
    color: #b45309;
}

#pppoe-section.pppoe-v5 .rp5-workspace {
    container-name: rp5-workspace;
    container-type: inline-size;
    min-width: 0;
    overflow: visible;
    border: 1px solid var(--rp5-line);
    border-radius: 18px;
    background: var(--rp5-surface);
    box-shadow: var(--rp5-shadow);
}

#pppoe-section.pppoe-v5 .rp5-commandbar {
    position: sticky;
    top: 10px;
    z-index: 24;
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(340px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rp5-line);
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .045);
    backdrop-filter: blur(14px);
}

#pppoe-section.pppoe-v5 .rp5-search-filter {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(210px, 1fr) minmax(175px, 220px);
    gap: 8px;
}

#pppoe-section.pppoe-v5 :is(.rp5-search, .rp5-filter) {
    display: flex;
    min-width: 0;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 11px;
    background: var(--rp5-surface);
    color: var(--rp5-subtle);
    transition: border-color .16s ease, box-shadow .16s ease;
}

#pppoe-section.pppoe-v5 :is(.rp5-search, .rp5-filter):focus-within {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

#pppoe-section.pppoe-v5 .rp5-search input,
#pppoe-section.pppoe-v5 .rp5-filter select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--rp5-ink);
    font-size: 12px;
}

#pppoe-section.pppoe-v5 .rp5-search input::placeholder {
    color: var(--rp5-subtle);
}

#pppoe-section.pppoe-v5 .rp5-search button {
    display: grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--rp5-subtle);
    cursor: pointer;
}

#pppoe-section.pppoe-v5 .rp5-search button:hover {
    background: #f1f5f9;
    color: var(--rp5-text);
}

#pppoe-section.pppoe-v5 :is(.rp5-more-actions, .rp5-row-menu) {
    position: relative;
    min-width: 0;
}

#pppoe-section.pppoe-v5 :is(.rp5-more-actions, .rp5-row-menu) > summary {
    list-style: none;
}

#pppoe-section.pppoe-v5 :is(.rp5-more-actions, .rp5-row-menu) > summary::-webkit-details-marker {
    display: none;
}

#pppoe-section.pppoe-v5 .rp5-more-actions > summary {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 11px;
    background: var(--rp5-surface);
    color: var(--rp5-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-more-actions > summary i:last-child {
    color: var(--rp5-subtle);
    font-size: 10px;
    transition: transform .16s ease;
}

#pppoe-section.pppoe-v5 .rp5-more-actions[open] > summary i:last-child {
    transform: rotate(180deg);
}

#pppoe-section.pppoe-v5 .rp5-more-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    display: grid;
    width: 260px;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--rp5-line);
    border-radius: 13px;
    background: var(--rp5-surface);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .17);
}

#pppoe-section.pppoe-v5 .rp5-menu-action,
#pppoe-section.pppoe-v5 .rp5-row-menu button {
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--rp5-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

#pppoe-section.pppoe-v5 :is(.rp5-menu-action, .rp5-row-menu button):hover {
    background: var(--rp5-primary-soft);
    color: var(--rp5-primary-dark);
}

#pppoe-section.pppoe-v5 :is(.rp5-menu-action, .rp5-row-menu button).is-danger {
    color: var(--rp5-danger);
}

#pppoe-section.pppoe-v5 :is(.rp5-menu-action, .rp5-row-menu button).is-danger:hover {
    background: var(--rp5-danger-soft);
}

#pppoe-section.pppoe-v5 .rp5-summary {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(125px, 1fr)) minmax(155px, auto);
    gap: 9px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rp5-line);
}

#pppoe-section.pppoe-v5 :is(.rp5-stat, .rp5-select-page) {
    display: flex;
    min-width: 0;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border: 1px solid var(--rp5-line);
    border-radius: 12px;
    background: var(--rp5-surface-soft);
}

#pppoe-section.pppoe-v5 .rp5-stat-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    font-size: 13px;
}

#pppoe-section.pppoe-v5 .rp5-stat-icon.is-green { background: var(--rp5-success-soft); color: var(--rp5-success); }
#pppoe-section.pppoe-v5 .rp5-stat-icon.is-blue { background: var(--rp5-primary-soft); color: var(--rp5-primary); }
#pppoe-section.pppoe-v5 .rp5-stat-icon.is-amber { background: var(--rp5-warning-soft); color: var(--rp5-warning); }
#pppoe-section.pppoe-v5 .rp5-stat-icon.is-violet { background: var(--rp5-violet-soft); color: var(--rp5-violet); }

#pppoe-section.pppoe-v5 .rp5-stat > span:last-child {
    display: grid;
    min-width: 0;
    gap: 1px;
}

#pppoe-section.pppoe-v5 .rp5-stat small,
#pppoe-section.pppoe-v5 .rp5-select-page > span {
    overflow: hidden;
    color: var(--rp5-muted);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-stat strong {
    color: var(--rp5-ink);
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 19px;
    line-height: 1;
}

#pppoe-section.pppoe-v5 .rp5-select-page {
    justify-content: center;
    cursor: pointer;
}

#pppoe-section.pppoe-v5 .rp5-select-page input,
#pppoe-section.pppoe-v5 .pppoe-checkbox {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    accent-color: var(--rp5-primary);
}

#pppoe-section.pppoe-v5 .rp5-select-page strong {
    color: var(--rp5-primary-dark);
    font-size: 11px;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-list-head,
#pppoe-section.pppoe-v5 .rp5-row {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr))
        minmax(190px, .58fr);
    gap: 12px;
}

#pppoe-section.pppoe-v5 .rp5-list-head {
    align-items: center;
    padding: 10px 24px;
    border-bottom: 1px solid var(--rp5-line);
    background: #f8fafc;
    color: var(--rp5-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

#pppoe-section.pppoe-v5 .rp5-list-head span:last-child {
    text-align: center;
}

#pppoe-section.pppoe-v5 .rp5-list-wrap,
#pppoe-section.pppoe-v5 .rp5-list {
    min-width: 0;
}

#pppoe-section.pppoe-v5 .rp5-list {
    display: flex;
    flex-direction: column;
    padding: 0 14px;
}

#pppoe-section.pppoe-v5 .rp5-row {
    position: relative;
    min-width: 0;
    min-height: 96px;
    align-items: center;
    padding: 13px 10px;
    border-bottom: 1px solid var(--rp5-line);
    background: var(--rp5-surface);
    transition: background .16s ease, box-shadow .16s ease;
}

#pppoe-section.pppoe-v5 .rp5-row:first-child {
    border-top: 0;
}

#pppoe-section.pppoe-v5 .rp5-row:hover {
    background: #fbfdff;
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, .22);
}

#pppoe-section.pppoe-v5 .rp5-row.is-selected {
    background: #f4f8ff;
    box-shadow: inset 3px 0 0 var(--rp5-primary);
}

#pppoe-section.pppoe-v5 .rp5-row > * {
    min-width: 0;
}

#pppoe-section.pppoe-v5 .rp5-identity {
    display: grid;
    min-width: 0;
    grid-template-columns: auto 9px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

#pppoe-section.pppoe-v5 .rp5-row-select {
    display: grid;
    grid-template-columns: auto 27px;
    gap: 7px;
    align-items: center;
    cursor: pointer;
}

#pppoe-section.pppoe-v5 .rp5-row-select > span {
    display: grid;
    height: 27px;
    place-items: center;
    border-radius: 8px;
    background: var(--rp5-primary-soft);
    color: var(--rp5-primary-dark);
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 800;
}

#pppoe-section.pppoe-v5 .rp5-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

#pppoe-section.pppoe-v5 .rp5-identity-copy {
    display: grid;
    min-width: 0;
    gap: 6px;
}

#pppoe-section.pppoe-v5 .rp5-identity-copy > strong {
    overflow: hidden;
    color: var(--rp5-ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-badges {
    display: flex;
    min-width: 0;
    min-height: 22px;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

#pppoe-section.pppoe-v5 .rp5-badges:empty {
    display: none;
}

#pppoe-section.pppoe-v5 .rp5-badge {
    display: inline-flex;
    min-height: 21px;
    align-items: center;
    gap: 5px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 9.5px;
    font-weight: 800;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-badge.is-amber { border-color: #fde68a; background: var(--rp5-warning-soft); color: #b45309; }
#pppoe-section.pppoe-v5 .rp5-badge.is-violet { border-color: #ddd6fe; background: var(--rp5-violet-soft); color: #6d28d9; }

#pppoe-section.pppoe-v5 :is(.rp5-network, .rp5-proxy-config, .rp5-devices) {
    min-width: 0;
}

#pppoe-section.pppoe-v5 .rp5-mobile-label {
    display: none;
    margin-bottom: 6px;
    color: var(--rp5-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

#pppoe-section.pppoe-v5 .rp5-public-ip {
    display: grid;
    min-width: 0;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

#pppoe-section.pppoe-v5 .rp5-public-ip > small {
    color: var(--rp5-muted);
    font-size: 10px;
    font-weight: 800;
}

#pppoe-section.pppoe-v5 .rp5-public-ip .pppoe-ip-stack {
    display: grid;
    min-width: 0;
    gap: 2px;
    overflow: hidden;
    color: #047857;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 14px;
    font-weight: 800;
}

#pppoe-section.pppoe-v5 .rp5-public-ip .pppoe-ipv4,
#pppoe-section.pppoe-v5 .rp5-public-ip .pppoe-ipv6 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-public-ip .pppoe-ipv6 {
    color: var(--rp5-muted);
    font-size: 10px;
    font-weight: 600;
}

#pppoe-section.pppoe-v5 .rp5-metrics {
    display: flex;
    min-width: 0;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

#pppoe-section.pppoe-v5 .rp5-metrics > span {
    display: inline-flex;
    min-width: 0;
    min-height: 26px;
    align-items: center;
    gap: 5px;
    padding: 0 7px;
    border: 1px solid var(--rp5-line);
    border-radius: 7px;
    background: var(--rp5-surface-soft);
    color: var(--rp5-muted);
    font-size: 10px;
}

#pppoe-section.pppoe-v5 .rp5-metrics i {
    color: var(--rp5-primary);
}

#pppoe-section.pppoe-v5 .rp5-metrics b {
    min-width: 0;
    overflow: hidden;
    color: var(--rp5-text);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-endpoint {
    display: flex;
    min-width: 0;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 5px 0 10px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: var(--rp5-primary-soft);
    color: var(--rp5-primary-dark);
}

#pppoe-section.pppoe-v5 .rp5-endpoint > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

#pppoe-section.pppoe-v5 .rp5-endpoint code {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-endpoint button {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--rp5-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .11);
}

#pppoe-section.pppoe-v5 .rp5-endpoint.is-pending {
    border-color: #fde68a;
    background: var(--rp5-warning-soft);
    color: #b45309;
    font-size: 11px;
}

#pppoe-section.pppoe-v5 .rp5-config-details {
    margin-top: 6px;
}

#pppoe-section.pppoe-v5 .rp5-config-details > summary {
    display: flex;
    min-height: 28px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--rp5-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
    list-style: none;
}

#pppoe-section.pppoe-v5 .rp5-config-details > summary::-webkit-details-marker { display: none; }
#pppoe-section.pppoe-v5 .rp5-config-details > summary span { display: flex; align-items: center; gap: 6px; }
#pppoe-section.pppoe-v5 .rp5-config-details > summary span i { color: var(--rp5-primary); }
#pppoe-section.pppoe-v5 .rp5-config-details > summary > i { transition: transform .16s ease; }
#pppoe-section.pppoe-v5 .rp5-config-details[open] > summary > i { transform: rotate(180deg); }

#pppoe-section.pppoe-v5 .rp5-config-panel {
    display: grid;
    gap: 7px;
    padding-top: 6px;
}

#pppoe-section.pppoe-v5 .rp5-config-panel > label {
    display: grid;
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
}

#pppoe-section.pppoe-v5 .rp5-config-panel > label > small {
    color: var(--rp5-muted);
    font-size: 10px;
    font-weight: 750;
}

#pppoe-section.pppoe-v5 .pppoe-dns-cell {
    display: grid;
    min-width: 0;
    gap: 5px;
}

#pppoe-section.pppoe-v5 :is(.pppoe-dns-select, .pppoe-dns-custom) {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 8px;
    outline: 0;
    background: var(--rp5-surface);
    color: var(--rp5-ink);
    font-size: 11px;
}

#pppoe-section.pppoe-v5 .rp5-auth {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border: 1px solid var(--rp5-line);
    border-radius: 9px;
    background: var(--rp5-surface-soft);
    color: var(--rp5-muted);
}

#pppoe-section.pppoe-v5 .rp5-auth > span {
    display: grid;
    min-width: 0;
    gap: 1px;
}

#pppoe-section.pppoe-v5 .rp5-auth :is(strong, small) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pppoe-section.pppoe-v5 .rp5-auth strong { color: var(--rp5-text); font-size: 10.5px; }
#pppoe-section.pppoe-v5 .rp5-auth small { font-size: 9.5px; }
#pppoe-section.pppoe-v5 .rp5-auth.is-ready { border-color: #bbf7d0; background: var(--rp5-success-soft); color: #047857; }
#pppoe-section.pppoe-v5 .rp5-auth.is-ready strong { color: #047857; }

#pppoe-section.pppoe-v5 .rp5-device-dropdown {
    min-width: 0;
}

#pppoe-section.pppoe-v5 .rp5-device-dropdown > summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #3730a3;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    list-style: none;
}

#pppoe-section.pppoe-v5 .rp5-device-dropdown > summary::-webkit-details-marker { display: none; }
#pppoe-section.pppoe-v5 .rp5-device-dropdown > summary span { display: flex; min-width: 0; align-items: center; gap: 7px; }
#pppoe-section.pppoe-v5 .rp5-device-dropdown > summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pppoe-section.pppoe-v5 .rp5-device-dropdown > summary > i { flex: 0 0 auto; color: #6366f1; transition: transform .16s ease; }
#pppoe-section.pppoe-v5 .rp5-device-dropdown[open] > summary { border-color: #818cf8; background: #e0e7ff; }
#pppoe-section.pppoe-v5 .rp5-device-dropdown[open] > summary > i { transform: rotate(180deg); }

#pppoe-section.pppoe-v5 .rp5-device-panel {
    display: grid;
    min-width: 0;
    gap: 8px;
    margin-top: 7px;
    padding: 8px;
    border: 1px solid var(--rp5-line);
    border-radius: 10px;
    background: var(--rp5-surface);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

#pppoe-section.pppoe-v5 .rp5-device-list {
    display: grid;
    min-width: 0;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

#pppoe-section.pppoe-v5 .rp5-device-chip {
    display: flex;
    min-width: 0;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 4px 4px 4px 8px;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    background: var(--rp5-success-soft);
    color: #047857;
}

#pppoe-section.pppoe-v5 .rp5-device-chip code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: inherit;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
}

#pppoe-section.pppoe-v5 .rp5-device-chip button {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(220, 38, 38, .18);
    border-radius: 7px;
    background: var(--rp5-danger-soft);
    color: var(--rp5-danger);
    cursor: pointer;
}

#pppoe-section.pppoe-v5 .rp5-device-empty {
    padding: 8px;
    border-radius: 8px;
    background: var(--rp5-surface-soft);
    color: var(--rp5-muted);
    font-size: 10.5px;
    text-align: center;
}

#pppoe-section.pppoe-v5 .rp5-device-add {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(115px, 1fr) 34px 34px;
    gap: 6px;
}

#pppoe-section.pppoe-v5 .rp5-device-add input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 8px;
    outline: 0;
    font-size: 10.5px;
}

#pppoe-section.pppoe-v5 .rp5-icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 8px;
    background: var(--rp5-surface);
    color: var(--rp5-text);
    cursor: pointer;
}

#pppoe-section.pppoe-v5 .rp5-icon-button.is-primary { border-color: var(--rp5-primary); background: var(--rp5-primary); color: #fff; }

#pppoe-section.pppoe-v5 .rp5-row-actions {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(82px, 1fr) 38px;
    gap: 7px;
    align-items: center;
}

#pppoe-section.pppoe-v5 :is(.rp5-rotate-button, .rp5-create-button) {
    display: inline-flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--rp5-primary);
    border-radius: 10px;
    background: var(--rp5-primary);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

#pppoe-section.pppoe-v5 :is(.rp5-rotate-button, .rp5-create-button):hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, .2);
}

#pppoe-section.pppoe-v5 .rp5-create-button {
    grid-column: 1 / -1;
    border-color: var(--rp5-success);
    background: var(--rp5-success);
}

#pppoe-section.pppoe-v5 .rp5-rotate-button:disabled {
    cursor: wait;
    opacity: .78;
}

#pppoe-section.pppoe-v5 .rp5-rotate-button.is-loading i {
    animation: rp5-spin .8s linear infinite;
}

@keyframes rp5-spin { to { transform: rotate(360deg); } }

#pppoe-section.pppoe-v5 .rp5-row-menu > summary {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 10px;
    background: var(--rp5-surface);
    color: var(--rp5-text);
    cursor: pointer;
}

#pppoe-section.pppoe-v5 .rp5-row-menu > div {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 55;
    display: grid;
    width: 190px;
    gap: 3px;
    padding: 7px;
    border: 1px solid var(--rp5-line);
    border-radius: 11px;
    background: var(--rp5-surface);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
}

#pppoe-section.pppoe-v5 .rp5-empty {
    display: grid;
    min-height: 190px;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--rp5-muted);
    text-align: center;
}

#pppoe-section.pppoe-v5 .rp5-empty > i { color: #60a5fa; font-size: 28px; }
#pppoe-section.pppoe-v5 .rp5-empty strong { color: var(--rp5-ink); font-size: 14px; }
#pppoe-section.pppoe-v5 .rp5-empty span { font-size: 11px; }

#pppoe-section.pppoe-v5 .rp5-pagination {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-top: 1px solid var(--rp5-line);
    border-radius: 0 0 18px 18px;
    background: var(--rp5-surface);
    box-shadow: none;
    color: var(--rp5-muted);
    font-size: 12px;
}

#pppoe-section.pppoe-v5 .rp5-pagination .pagination-controls,
#pppoe-section.pppoe-v5 .rp5-pagination :is(.page-size-selector, .page-nav) {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

#pppoe-section.pppoe-v5 .rp5-pagination select {
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--rp5-line-strong);
    border-radius: 8px;
    background: var(--rp5-surface);
    color: var(--rp5-ink);
}

#pppoe-section.pppoe-v5 :is(button, input, select, summary):focus-visible {
    outline: 3px solid rgba(37, 99, 235, .25);
    outline-offset: 2px;
}

body.dark-mode #pppoe-section.pppoe-v5 {
    --rp5-ink: #f8fafc;
    --rp5-text: #cbd5e1;
    --rp5-muted: #94a3b8;
    --rp5-subtle: #64748b;
    --rp5-line: #334155;
    --rp5-line-strong: #475569;
    --rp5-surface: #111827;
    --rp5-surface-soft: #0f172a;
    --rp5-primary-soft: rgba(37, 99, 235, .16);
    --rp5-success-soft: rgba(5, 150, 105, .14);
    --rp5-warning-soft: rgba(217, 119, 6, .14);
    --rp5-danger-soft: rgba(220, 38, 38, .14);
    --rp5-violet-soft: rgba(124, 58, 237, .15);
}

body.dark-mode #pppoe-section.pppoe-v5 :is(.rp5-page-header, .rp5-workspace, .rp5-row, .rp5-pagination) {
    background-color: var(--rp5-surface);
}

body.dark-mode #pppoe-section.pppoe-v5 .rp5-commandbar {
    background: rgba(17, 24, 39, .95);
}

body.dark-mode #pppoe-section.pppoe-v5 .rp5-list-head { background: #0f172a; }
body.dark-mode #pppoe-section.pppoe-v5 .rp5-row:hover { background: #131d2e; }
body.dark-mode #pppoe-section.pppoe-v5 .rp5-row.is-selected { background: rgba(37, 99, 235, .12); }
body.dark-mode #pppoe-section.pppoe-v5 .rp5-endpoint button { background: #172554; color: #bfdbfe; }
body.dark-mode #pppoe-section.pppoe-v5 .rp5-device-dropdown > summary { border-color: #4338ca; background: rgba(79, 70, 229, .16); color: #c7d2fe; }

@container rp5-workspace (max-width: 1120px) {
    #pppoe-section.pppoe-v5 .rp5-list-head { display: none; }
    #pppoe-section.pppoe-v5 .rp5-row {
        grid-template-columns: minmax(0, 1fr) minmax(210px, .72fr);
        gap: 12px;
        align-items: start;
        padding: 16px;
        border: 1px solid var(--rp5-line);
        border-radius: 14px;
        box-shadow: 0 5px 14px rgba(15, 23, 42, .04);
    }
    #pppoe-section.pppoe-v5 .rp5-list { gap: 10px; padding: 12px; }
    #pppoe-section.pppoe-v5 .rp5-network { grid-column: 1; grid-row: 2; }
    #pppoe-section.pppoe-v5 .rp5-proxy-config { grid-column: 2; grid-row: 2; }
    #pppoe-section.pppoe-v5 .rp5-devices { grid-column: 1 / -1; grid-row: 3; }
    #pppoe-section.pppoe-v5 .rp5-row-actions { grid-column: 2; grid-row: 1; justify-self: end; width: min(180px, 100%); }
    #pppoe-section.pppoe-v5 .rp5-mobile-label { display: block; }
}

@container rp5-workspace (max-width: 820px) {
    #pppoe-section.pppoe-v5 .rp5-commandbar { position: static; grid-template-columns: 1fr; }
    #pppoe-section.pppoe-v5 .rp5-command-actions { justify-content: flex-start; }
    #pppoe-section.pppoe-v5 .rp5-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #pppoe-section.pppoe-v5 .rp5-select-page { grid-column: 1 / -1; }
}

@container rp5-workspace (max-width: 620px) {
    #pppoe-section.pppoe-v5 .rp5-search-filter { grid-template-columns: 1fr; }
    #pppoe-section.pppoe-v5 .rp5-command-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #pppoe-section.pppoe-v5 .rp5-command-actions > .rp5-button { width: 100%; }
    #pppoe-section.pppoe-v5 .rp5-more-actions { grid-column: 1 / -1; }
    #pppoe-section.pppoe-v5 .rp5-more-actions > summary { width: 100%; justify-content: center; }
    #pppoe-section.pppoe-v5 .rp5-more-panel { position: static; width: 100%; margin-top: 7px; box-shadow: none; }
    #pppoe-section.pppoe-v5 .rp5-row { grid-template-columns: 1fr; }
    #pppoe-section.pppoe-v5 :is(.rp5-identity, .rp5-network, .rp5-proxy-config, .rp5-devices, .rp5-row-actions) {
        grid-column: 1;
        grid-row: auto;
    }
    #pppoe-section.pppoe-v5 .rp5-row-actions { width: 100%; justify-self: stretch; }
    #pppoe-section.pppoe-v5 .rp5-row-menu > div { right: auto; left: 0; }
}

@media (max-width: 720px) {
    #pppoe-section.pppoe-v5 .rp5-page-header { align-items: stretch; flex-direction: column; padding: 16px; }
    #pppoe-section.pppoe-v5 .rp5-heading-icon { flex-basis: 44px; width: 44px; height: 44px; border-radius: 13px; font-size: 17px; }
    #pppoe-section.pppoe-v5 .rp5-heading h2 { font-size: 22px; }
    #pppoe-section.pppoe-v5 .rp5-heading p { font-size: 11px; }
    #pppoe-section.pppoe-v5 .rp5-header-actions { justify-content: stretch; }
    #pppoe-section.pppoe-v5 .rp5-header-actions > * { flex: 1 1 auto; justify-content: center; }
    #pppoe-section.pppoe-v5 .rp5-pagination,
    #pppoe-section.pppoe-v5 .rp5-pagination .pagination-controls { align-items: stretch; flex-direction: column; }
    #pppoe-section.pppoe-v5 .rp5-pagination :is(.page-size-selector, .page-nav) { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
    #pppoe-section.pppoe-v5 *,
    #pppoe-section.pppoe-v5 *::before,
    #pppoe-section.pppoe-v5 *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ShopLike + NestProxy stable restore — isolate both from compact overrides. */
:is(#shoplike-section, #nestproxy-section) {
    gap: 0 !important;
    padding-bottom: 0 !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-page-header, .nestproxy-page-header) {
    min-height: 0 !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 18px !important;
    margin-bottom: 14px !important;
    padding: 16px 18px !important;
    border-radius: 16px !important;
}
#shoplike-section .shoplike-heading-v2,
#nestproxy-section .nestproxy-heading { gap: 13px !important; }
#shoplike-section .shoplike-heading-icon-v2,
#nestproxy-section .nestproxy-heading-icon {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
    border-radius: 14px !important;
    font-size: 18px !important;
}
#shoplike-section .shoplike-heading-v2 h2,
#nestproxy-section .nestproxy-heading h2 { font-size: 22px !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-heading-v2, .nestproxy-heading) .section-subtitle {
    max-width: none !important;
    margin: 3px 0 0 !important;
    overflow: visible !important;
    font-size: 11px !important;
    line-height: normal !important;
    text-overflow: clip !important;
    white-space: normal !important;
}
#shoplike-section .shoplike-page-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(275px, .65fr) !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}
#nestproxy-section .nestproxy-setup-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr) !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-card, .nestproxy-mcp-panel) {
    border-radius: 14px !important;
}
#shoplike-section .shoplike-setup-card-v2,
#nestproxy-section .nestproxy-setup-card { padding: 16px !important; }
#shoplike-section .shoplike-note-card-v2,
#nestproxy-section .nestproxy-note-card { padding: 18px !important; }
:is(#shoplike-section, #nestproxy-section) .shoplike-card-title {
    gap: 12px !important;
    margin-bottom: 16px !important;
}
:is(#shoplike-section, #nestproxy-section) .shoplike-card-title h3 { font-size: 18px !important; }
:is(#shoplike-section, #nestproxy-section) .shoplike-card-title p {
    margin-top: 4px !important;
    font-size: 13px !important;
    line-height: normal !important;
}
:is(#shoplike-section, #nestproxy-section) .shoplike-card-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    font-size: inherit !important;
}
#shoplike-section .shoplike-form-grid {
    grid-template-columns: minmax(115px, .62fr) minmax(200px, 1.35fr) minmax(125px, .78fr) minmax(125px, .78fr) !important;
    gap: 10px !important;
}
#nestproxy-section .nestproxy-key-form-grid {
    grid-template-columns: minmax(130px, .58fr) minmax(220px, 1.15fr) minmax(190px, 1fr) !important;
    gap: 12px !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-form-grid, .nestproxy-key-form-grid) :is(input, select) {
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 12px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
}
:is(#shoplike-section, #nestproxy-section) .shoplike-form-actions {
    gap: 10px !important;
    margin-top: 14px !important;
}
#shoplike-section .shoplike-list-head,
#nestproxy-section .nestproxy-list-head {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr) !important;
    gap: 14px !important;
    padding: 14px 16px !important;
}
#nestproxy-section .nestproxy-list-head { grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr) !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-list-head, .nestproxy-list-head) h3 { font-size: 18px !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-list-head, .nestproxy-list-head) p {
    margin-top: 3px !important;
    font-size: 11px !important;
}
#shoplike-section .shoplike-bulk-actions,
#nestproxy-section .nestproxy-bulk-actions { gap: 7px !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-bulk-dns, .nestproxy-bulk-dns) {
    min-height: 34px !important;
    gap: 7px !important;
    padding: 3px 4px 3px 10px !important;
    border-radius: 10px !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-bulk-dns, .nestproxy-bulk-dns) :is(select, button) {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}
:is(#shoplike-section, #nestproxy-section) .bulk-webrtc-control {
    min-height: 32px !important;
    gap: 5px !important;
    padding: 2px 3px 2px 8px !important;
    border-radius: 9px !important;
}
:is(#shoplike-section, #nestproxy-section) .bulk-webrtc-control :is(select, button) {
    min-height: 26px !important;
    height: 26px !important;
    font-size: 10px !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) {
    grid-template-columns: repeat(4, minmax(110px, 1fr)) !important;
    gap: 8px !important;
    padding: 10px 14px 0 !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) > div {
    min-height: 0 !important;
    gap: 10px !important;
    padding: 9px 11px !important;
    border-radius: 11px !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) strong { font-size: 15px !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) small,
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) span { font-size: 10px !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-device-overview, .nestproxy-device-overview) { margin: 10px 14px !important; }
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-key-list-v2, .nestproxy-key-list) {
    max-height: none !important;
    gap: 9px !important;
    padding: 4px 14px 14px !important;
    overflow: visible !important;
    scrollbar-gutter: auto !important;
}
#shoplike-section .shoplike-key-card-v2 {
    grid-template-columns: minmax(145px, .72fr) minmax(280px, 1.32fr) minmax(210px, 1fr) minmax(190px, .84fr) !important;
    gap: 12px !important;
    padding: 12px !important;
    margin: 0 !important;
    border-radius: 14px !important;
}
#nestproxy-section .nestproxy-key-card {
    grid-template-columns: 30px minmax(145px, .72fr) minmax(280px, 1.36fr) minmax(210px, 1fr) minmax(180px, .82fr) !important;
    gap: 12px !important;
    padding: 12px !important;
    margin: 0 !important;
    border-radius: 14px !important;
}
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-key-card-v2, .nestproxy-key-card) > section {
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
}
#shoplike-section .shoplike-key-card-v2 > :is(.shoplike-card-network-v2, .shoplike-card-devices-v2, .shoplike-card-health-v2),
#nestproxy-section .nestproxy-key-card > :is(.nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) {
    padding-left: 12px !important;
    border-left: 1px solid var(--shop-border) !important;
}
#nestproxy-section .nestproxy-key-card > :is(.nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) { border-left-color: var(--nest-border) !important; }
:is(#shoplike-section, #nestproxy-section) .provider-webrtc-control {
    min-height: 27px !important;
    padding: 2px 7px !important;
    border-radius: 8px !important;
}
:is(#shoplike-section, #nestproxy-section) .provider-webrtc-control select {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    font-size: 10px !important;
}
@media (max-width: 1120px) {
    #shoplike-section .shoplike-page-grid { grid-template-columns: 1fr !important; }
    #shoplike-section .shoplike-key-card-v2 { grid-template-columns: minmax(205px, .8fr) minmax(300px, 1.2fr) !important; }
    #shoplike-section .shoplike-card-devices-v2 { grid-column: 1 !important; padding: 10px 0 0 !important; border-top: 1px solid var(--shop-border) !important; border-left: 0 !important; }
    #shoplike-section .shoplike-card-health-v2 { grid-column: 2 !important; padding-top: 10px !important; border-top: 1px solid var(--shop-border) !important; }
}
@media (max-width: 1050px) {
    #nestproxy-section .nestproxy-key-card { grid-template-columns: 30px minmax(200px, .8fr) minmax(300px, 1.2fr) !important; }
    #nestproxy-section .nestproxy-card-select { grid-row: 1 / span 2 !important; }
    #nestproxy-section .nestproxy-card-devices { grid-column: 2 !important; padding: 10px 0 0 !important; border-top: 1px solid var(--nest-border) !important; border-left: 0 !important; }
    #nestproxy-section .nestproxy-card-health { grid-column: 3 !important; padding-top: 10px !important; border-top: 1px solid var(--nest-border) !important; }
}
@media (max-width: 980px) {
    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-page-header, .nestproxy-page-header) { align-items: stretch !important; flex-direction: column !important; }
    #shoplike-section .shoplike-page-grid,
    #nestproxy-section .nestproxy-setup-grid,
    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-list-head, .nestproxy-list-head) { grid-template-columns: 1fr !important; }
    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-form-grid, .nestproxy-key-form-grid) { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 760px) {
    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #shoplike-section .shoplike-key-card-v2 { grid-template-columns: minmax(0, 1fr) !important; }
    #shoplike-section .shoplike-key-card-v2 > section { grid-column: 1 !important; padding: 10px 0 0 !important; border-top: 1px solid var(--shop-border) !important; border-left: 0 !important; }
    #shoplike-section .shoplike-key-card-v2 > .shoplike-card-identity-v2 { padding-top: 0 !important; border-top: 0 !important; }
    #nestproxy-section .nestproxy-key-card { grid-template-columns: 28px minmax(0, 1fr) !important; }
    #nestproxy-section .nestproxy-card-select { grid-row: 1 / span 4 !important; }
    #nestproxy-section .nestproxy-key-card > section { grid-column: 2 !important; padding: 10px 0 0 !important; border-top: 1px solid var(--nest-border) !important; border-left: 0 !important; }
    #nestproxy-section .nestproxy-key-card > .nestproxy-card-identity { padding-top: 0 !important; border-top: 0 !important; }
}
@media (max-width: 560px) {
    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-form-grid, .nestproxy-key-form-grid) { grid-template-columns: 1fr !important; }
}

/* ========================================================================== */
/* Proxy workspace polish 2026-08-29 — spacing only, provider grids preserved */
/* ========================================================================== */
:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) {
    --proxy-polish-border: rgba(148, 163, 184, .22);
    --proxy-polish-shadow: 0 5px 16px rgba(15, 23, 42, .055);
    --proxy-polish-soft: rgba(248, 250, 252, .88);
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.section-header, .proxy-page-header, .shoplike-page-header, .suiproxy-page-header, .nestproxy-page-header) {
    min-height: 58px !important;
    margin-bottom: 10px !important;
    padding: 10px 14px !important;
    border: 1px solid var(--proxy-polish-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--proxy-polish-shadow) !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-heading-icon-v2, .nestproxy-heading-icon),
#proxies .proxy-page-icon,
#suiproxy-section .suiproxy-heading-icon {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
    border-radius: 11px !important;
    font-size: 15px !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .section-header h2,
#shoplike-section .shoplike-heading-v2 h2,
#nestproxy-section .nestproxy-heading h2,
#suiproxy-section .suiproxy-heading h2 {
    font-size: 18px !important;
    line-height: 1.15 !important;
}

:is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.section-subtitle, .shoplike-heading-v2 p, .nestproxy-heading p, .suiproxy-heading p) {
    margin-top: 2px !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-page-grid,
#nestproxy-section .nestproxy-setup-grid {
    gap: 9px !important;
    margin-bottom: 9px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section)
    :is(.shoplike-key-card, .shoplike-note-card, .shoplike-setup-card-v2, .nestproxy-setup-card) {
    padding: 12px 14px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card,
#suiproxy-section :is(.suiproxy-account-card, .suiproxy-list-card) {
    border-radius: 12px !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .045) !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-title {
    gap: 9px !important;
    margin-bottom: 10px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-title h3,
#suiproxy-section :is(.suiproxy-card-heading h3, .suiproxy-list-title h3) {
    font-size: 14px !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-title p,
#suiproxy-section :is(.suiproxy-card-heading p, .suiproxy-list-title p) {
    margin-top: 2px !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
}

:is(#shoplike-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) .shoplike-card-icon,
#suiproxy-section :is(.suiproxy-card-heading > span, .suiproxy-card-heading-icon) {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
}

#shoplike-section .shoplike-form-grid,
#nestproxy-section .nestproxy-key-form-grid {
    gap: 7px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-form-grid, .nestproxy-key-form-grid) :is(input, select) {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

:is(#shoplike-section, #nestproxy-section) .shoplike-form-actions {
    gap: 7px !important;
    margin-top: 9px !important;
}

#suiproxy-section .suiproxy-account-card {
    margin-bottom: 9px !important;
    padding: 11px 14px !important;
}

#suiproxy-section .suiproxy-account-body {
    gap: 8px !important;
    margin-top: 9px !important;
}

#suiproxy-section .suiproxy-key-input input {
    height: 36px !important;
    min-height: 36px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-list-head, .nestproxy-list-head),
#suiproxy-section .suiproxy-list-head,
#kiotproxy-section .kiotproxy-list-head,
#tmproxy-section .shoplike-list-head {
    min-height: 56px !important;
    gap: 9px !important;
    padding: 9px 13px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-bulk-actions, .nestproxy-bulk-actions),
#suiproxy-section .suiproxy-list-tools,
#kiotproxy-section .kiotproxy-commandbar {
    gap: 5px !important;
}

:is(#shoplike-section, #nestproxy-section, #suiproxy-section, #kiotproxy-section)
    :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) {
    min-height: 30px !important;
    gap: 5px !important;
    padding: 2px 4px 2px 7px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

:is(#shoplike-section, #nestproxy-section, #suiproxy-section, #kiotproxy-section)
    :is(.shoplike-bulk-dns, .nestproxy-bulk-dns, .suiproxy-bulk-dns, .bulk-webrtc-control) :is(select, button) {
    min-height: 25px !important;
    height: 25px !important;
    padding: 0 7px !important;
    border-radius: 6px !important;
    font-size: 9.5px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip),
#kiotproxy-section .kiotproxy-summary-strip {
    gap: 5px !important;
    padding: 7px 10px 0 !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-summary-strip, .nestproxy-summary-strip) > div,
#kiotproxy-section .kiotproxy-summary-strip > div {
    min-height: 38px !important;
    padding: 6px 9px !important;
    border-radius: 8px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-device-overview, .nestproxy-device-overview) {
    margin: 7px 10px !important;
    border-radius: 9px !important;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-device-overview-head, .nestproxy-device-overview-head) {
    min-height: 36px !important;
    padding: 6px 9px !important;
}

/* Long provider catalogs stay inside a predictable workspace. */
:is(#shoplike-section, #nestproxy-section) :is(.shoplike-key-list-v2, .nestproxy-key-list),
#suiproxy-section .suiproxy-card-list,
#kiotproxy-section .kiotproxy-card-list {
    max-height: clamp(430px, 62vh, 720px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

:is(#shoplike-section, #nestproxy-section) :is(.shoplike-key-list-v2, .nestproxy-key-list),
#kiotproxy-section .kiotproxy-card-list {
    gap: 6px !important;
    padding: 3px 10px 10px !important;
}

#shoplike-section .shoplike-key-card-v2,
#nestproxy-section .nestproxy-key-card,
#kiotproxy-section .kiotproxy-key-card {
    gap: 9px !important;
    padding: 9px !important;
    border-radius: 11px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04) !important;
}

#shoplike-section .shoplike-key-card-v2 > :is(.shoplike-card-network-v2, .shoplike-card-devices-v2, .shoplike-card-health-v2),
#nestproxy-section .nestproxy-key-card > :is(.nestproxy-card-network, .nestproxy-card-devices, .nestproxy-card-health) {
    padding-left: 9px !important;
}

#suiproxy-section .suiproxy-proxy-card {
    min-height: 0 !important;
}

#suiproxy-section .suiproxy-card-zone {
    padding: 9px 10px !important;
}

#suiproxy-section .suiproxy-card-zone:first-child {
    padding-left: 13px !important;
}

:is(#shoplike-section, #nestproxy-section, #kiotproxy-section, #suiproxy-section)
    :is(.shoplike-action-btn, .suiproxy-action-button) {
    min-height: 29px !important;
    height: 29px !important;
    border-radius: 7px !important;
}

#proxies .proxy-overview-grid { gap: 8px !important; margin-bottom: 9px !important; }
#proxies .proxy-overview-card { min-height: 62px !important; padding: 9px 12px !important; border-radius: 11px !important; }
#proxies .proxy-overview-card strong { font-size: 19px !important; }
#proxies .proxy-control-bar.compact-toolbar { gap: 6px !important; margin-bottom: 9px !important; padding: 8px 10px !important; border-radius: 11px !important; }
#proxies .proxy-control-bar.compact-toolbar :is(.btn, button, select) { min-height: 30px !important; height: 30px !important; font-size: 10px !important; }
#proxies .proxy-list-header { min-height: 54px !important; padding: 9px 13px !important; }
#proxies .table-container { max-height: clamp(430px, 66vh, 760px) !important; padding: 7px !important; }
#proxies .proxies-table tbody tr[data-proxy-id] { min-height: 100px !important; margin-bottom: 6px !important; padding: 8px 10px !important; border-radius: 10px !important; }

#tmproxy-section .shoplike-table-wrap {
    max-height: clamp(340px, 58vh, 680px) !important;
    overflow: auto !important;
}

#tmproxy-section .shoplike-table :is(th, td) {
    padding: 8px 10px !important;
    font-size: 10px !important;
}

:is(#shoplike-section, #nestproxy-section, #suiproxy-section, #kiotproxy-section, #proxies) :is(.shoplike-key-list-v2, .nestproxy-key-list, .suiproxy-card-list, .kiotproxy-card-list, .table-container)::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

:is(#shoplike-section, #nestproxy-section, #suiproxy-section, #kiotproxy-section, #proxies) :is(.shoplike-key-list-v2, .nestproxy-key-list, .suiproxy-card-list, .kiotproxy-card-list, .table-container)::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
    background-clip: padding-box;
}

body.dark-mode :is(#proxies, #shoplike-section, #suiproxy-section, #kiotproxy-section, #tmproxy-section, #nestproxy-section) {
    --proxy-polish-border: rgba(100, 116, 139, .28);
    --proxy-polish-shadow: 0 5px 18px rgba(0, 0, 0, .18);
    --proxy-polish-soft: rgba(15, 23, 42, .76);
}

@media (max-width: 980px) {
    :is(#shoplike-section, #nestproxy-section) :is(.shoplike-key-list-v2, .nestproxy-key-list),
    #suiproxy-section .suiproxy-card-list,
    #kiotproxy-section .kiotproxy-card-list,
    #proxies .table-container {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* Regular proxy list — stable desktop command center and card sizing. */
@media (min-width: 769px) {
    #proxies .proxy-control-bar.compact-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: start !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-width: 0 !important;
        align-items: center !important;
        gap: 6px !important;
        overflow: visible !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions > .tool-group-label {
        grid-column: span 2 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions > .btn-action,
    #proxies .proxy-control-bar.compact-toolbar .main-actions > .proxy-action-dropdown {
        grid-column: span 2 !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions > .regular-bulk-webrtc {
        grid-column: span 4 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions > .regular-bulk-webrtc {
        display: grid !important;
        grid-template-columns: 18px minmax(0, 1fr) minmax(45px, auto) auto !important;
        gap: 5px !important;
        padding: 2px 4px 2px 7px !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions > .regular-bulk-webrtc :is(select, button) {
        min-width: 0 !important;
        max-width: none !important;
        min-height: 26px !important;
        height: 26px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .main-actions > .regular-bulk-webrtc > span {
        min-width: 0 !important;
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .selected-actions {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 7px 0 0 !important;
        border-left: 0 !important;
        border-top: 1px solid var(--proxy-line) !important;
        gap: 6px !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .selected-actions > .tool-group-label {
        grid-column: span 2 !important;
        min-width: 0 !important;
    }

    #proxies .proxy-control-bar.compact-toolbar .selected-actions > .btn-action {
        grid-column: span 2 !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    #proxies .proxy-control-bar.compact-toolbar > .danger-actions {
        align-self: end !important;
        margin-bottom: 0 !important;
    }

    #proxies .proxies-table tbody tr[data-proxy-id] {
        grid-template-columns: 30px 54px 116px minmax(170px, 1.1fr) minmax(170px, 1fr) minmax(190px, 1.15fr) 138px !important;
    }

    #proxies .proxies-table tbody tr[data-proxy-id] > td {
        overflow: hidden !important;
    }

    #proxies .col-webrtc > div {
        min-width: 0 !important;
        width: 100% !important;
        gap: 2px !important;
    }

    #proxies .col-webrtc select {
        min-height: 24px !important;
        height: 24px !important;
        padding: 0 4px !important;
        max-width: 100% !important;
        font-size: 10px !important;
    }

    #proxies .col-webrtc label {
        max-width: 100% !important;
        padding: 2px 5px !important;
    }
}

/* Regular proxy tunnel control — make the live state unmistakable. */
#proxies .row-actions.compact > .btn-icon:first-child {
    position: relative !important;
    isolation: isolate;
    transition: background .18s ease, border-color .18s ease, color .18s ease,
        box-shadow .18s ease, transform .18s ease !important;
}

#proxies .row-actions.compact > .btn-icon:first-child.btn-success {
    color: #047857 !important;
    background: linear-gradient(145deg, #ecfdf5, #d1fae5) !important;
    border-color: rgba(16, 185, 129, .34) !important;
}

#proxies .row-actions.compact > .btn-icon:first-child.btn-success:hover:not(:disabled) {
    color: #065f46 !important;
    background: linear-gradient(145deg, #d1fae5, #a7f3d0) !important;
    border-color: rgba(5, 150, 105, .52) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .10), 0 7px 15px rgba(5, 150, 105, .16) !important;
    transform: translateY(-1px);
}

#proxies .row-actions.compact > .btn-icon:first-child.btn-secondary {
    color: #ffffff !important;
    background: linear-gradient(145deg, #059669, #10b981) !important;
    border-color: rgba(5, 150, 105, .72) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .13), 0 7px 16px rgba(5, 150, 105, .24) !important;
}

#proxies .row-actions.compact > .btn-icon:first-child.btn-secondary::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1fae5;
    box-shadow: 0 0 0 3px rgba(209, 250, 229, .18);
    animation: proxy-tunnel-live 1.8s ease-in-out infinite;
    pointer-events: none;
}

#proxies .row-actions.compact > .btn-icon:first-child.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(145deg, #047857, #059669) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .16), 0 9px 18px rgba(5, 150, 105, .30) !important;
    transform: translateY(-1px);
}

#proxies .row-actions.compact > .btn-icon:first-child.btn-loading {
    color: #ffffff !important;
    background: linear-gradient(145deg, #2563eb, #4f46e5) !important;
    border-color: rgba(37, 99, 235, .60) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), 0 7px 16px rgba(37, 99, 235, .22) !important;
    opacity: 1 !important;
}

@keyframes proxy-tunnel-live {
    0%, 100% { opacity: .55; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    #proxies .row-actions.compact > .btn-icon:first-child.btn-secondary::after {
        animation: none;
    }
}

/* SuiProxy stable restore — isolated from the compact provider theme. */
#suiproxy-section {
    gap: 0 !important;
    padding-bottom: 0 !important;
}
#suiproxy-section .suiproxy-page-header {
    min-height: 0 !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
#suiproxy-section .suiproxy-heading { gap: 12px !important; }
#suiproxy-section .suiproxy-heading-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    font-size: inherit !important;
}
#suiproxy-section .suiproxy-heading h2 { font-size: 22px !important; }
#suiproxy-section .suiproxy-heading p {
    max-width: none !important;
    margin-top: 0 !important;
    overflow: visible !important;
    font-size: 11px !important;
    line-height: normal !important;
    text-overflow: clip !important;
    white-space: normal !important;
}
#suiproxy-section .suiproxy-account-card,
#suiproxy-section .suiproxy-list-card {
    border-radius: 16px !important;
    box-shadow: none !important;
}
#suiproxy-section .suiproxy-account-card {
    margin-bottom: 14px !important;
    padding: 16px 18px !important;
}
#suiproxy-section .suiproxy-account-head,
#suiproxy-section .suiproxy-list-head {
    min-height: 0 !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 16px !important;
}
#suiproxy-section .suiproxy-card-heading,
#suiproxy-section .suiproxy-list-title { gap: 12px !important; }
#suiproxy-section .suiproxy-card-heading > span,
#suiproxy-section .suiproxy-card-heading-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    font-size: inherit !important;
}
#suiproxy-section .suiproxy-card-heading h3,
#suiproxy-section .suiproxy-list-title h3 { font-size: 15px !important; }
#suiproxy-section .suiproxy-card-heading p,
#suiproxy-section .suiproxy-list-title p {
    margin-top: 3px !important;
    font-size: 11px !important;
    line-height: normal !important;
}
#suiproxy-section .suiproxy-account-body {
    grid-template-columns: minmax(250px, 1fr) minmax(360px, 1.65fr) 156px !important;
    gap: 12px !important;
    align-items: stretch !important;
    margin-top: 14px !important;
}
#suiproxy-section .suiproxy-account-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    align-items: stretch !important;
    gap: 7px !important;
    margin-top: 0 !important;
}
#suiproxy-section .suiproxy-account-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
}
#suiproxy-section .suiproxy-key-input input {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 42px 0 13px !important;
    border-radius: 11px !important;
    font-size: inherit !important;
}
#suiproxy-section .suiproxy-auto-control select,
#suiproxy-section .suiproxy-dns-select {
    height: 28px !important;
    min-height: 28px !important;
    font-size: 10px !important;
}
#suiproxy-section .suiproxy-list-head { padding: 14px 17px !important; }
#suiproxy-section .suiproxy-list-tools { gap: 8px !important; }
#suiproxy-section .suiproxy-bulk-dns {
    grid-template-columns: 28px minmax(142px, 1fr) auto auto !important;
    min-height: 40px !important;
    width: min(520px, 100%) !important;
    gap: 6px !important;
    padding: 4px !important;
    border-radius: 12px !important;
}
#suiproxy-section .suiproxy-bulk-dns select,
#suiproxy-section .suiproxy-bulk-dns button {
    height: 30px !important;
    min-height: 30px !important;
    font-size: 11px !important;
}
#suiproxy-section .bulk-webrtc-control {
    min-height: 32px !important;
    padding: 2px 3px 2px 8px !important;
    gap: 5px !important;
    border-radius: 9px !important;
}
#suiproxy-section .bulk-webrtc-control :is(select, button) {
    height: 26px !important;
    min-height: 26px !important;
    font-size: 10px !important;
}
#suiproxy-section .suiproxy-card-list {
    max-height: none !important;
    overflow: visible !important;
    scrollbar-gutter: auto !important;
}
#suiproxy-section .suiproxy-column-guide,
#suiproxy-section .suiproxy-proxy-card {
    display: grid !important;
    grid-template-columns: minmax(180px, 1.05fr) minmax(230px, 1.25fr) minmax(200px, 1.05fr) minmax(190px, .9fr) !important;
}
#suiproxy-section .suiproxy-proxy-card {
    grid-template-rows: auto !important;
    grid-auto-flow: row !important;
    height: auto !important;
    min-height: 112px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone { grid-column: 1 !important; grid-row: 1 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-connection-zone { grid-column: 2 !important; grid-row: 1 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-devices-zone { grid-column: 3 !important; grid-row: 1 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-actions-zone { grid-column: 4 !important; grid-row: 1 !important; }
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    width: auto !important;
    min-width: 0 !important;
    min-height: 112px !important;
    height: auto !important;
    padding: 13px 12px !important;
    border-top: 0 !important;
    border-left: 1px solid var(--sui-border) !important;
    overflow: hidden !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone {
    padding-left: 17px !important;
    border-left: 0 !important;
}
#suiproxy-section .suiproxy-action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 5px !important; }
#suiproxy-section .suiproxy-action-button {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 3px !important;
    border-radius: 8px !important;
    font-size: 7px !important;
}
#suiproxy-section .provider-webrtc-control {
    min-height: 32px !important;
    padding: 4px 7px !important;
    border-radius: 9px !important;
}
#suiproxy-section .provider-webrtc-control select {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
}
#suiproxy-section .suiproxy-device-editor input,
#suiproxy-section .suiproxy-device-editor .btn {
    height: 30px !important;
    min-height: 30px !important;
}
@media (max-width: 1400px) {
    #suiproxy-section .suiproxy-account-body { grid-template-columns: minmax(230px, 1fr) minmax(320px, 1.5fr) !important; }
    #suiproxy-section .suiproxy-account-actions {
        grid-column: 1 / -1 !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 38px !important;
    }
    #suiproxy-section .suiproxy-column-guide { display: none !important; }
    #suiproxy-section .suiproxy-proxy-card { grid-template-columns: 1fr 1.15fr !important; grid-template-rows: auto auto !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone { grid-column: 1 !important; grid-row: 1 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-connection-zone { grid-column: 2 !important; grid-row: 1 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-devices-zone { grid-column: 1 !important; grid-row: 2 !important; border-left: 0 !important; border-top: 1px solid var(--sui-border) !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-actions-zone { grid-column: 2 !important; grid-row: 2 !important; border-top: 1px solid var(--sui-border) !important; }
}
@media (max-width: 820px) {
    #suiproxy-section .suiproxy-page-header,
    #suiproxy-section .suiproxy-account-head,
    #suiproxy-section .suiproxy-list-head { align-items: flex-start !important; flex-direction: column !important; }
    #suiproxy-section .suiproxy-account-body,
    #suiproxy-section .suiproxy-proxy-card { grid-template-columns: 1fr !important; grid-template-rows: auto !important; }
    #suiproxy-section .suiproxy-account-actions { grid-column: auto !important; grid-template-columns: 1fr 1fr !important; grid-template-rows: 38px !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone { grid-column: 1 !important; border-left: 0 !important; border-top: 1px solid var(--sui-border) !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-identity-zone { grid-row: 1 !important; border-top: 0 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-connection-zone { grid-row: 2 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-devices-zone { grid-row: 3 !important; }
    #suiproxy-section .suiproxy-proxy-card > .suiproxy-actions-zone { grid-row: 4 !important; }
}

/* SuiProxy post-restore polish — keep this block at EOF. */
#suiproxy-section .suiproxy-page-header { min-height:58px !important; margin-bottom:10px !important; padding:10px 14px !important; border:1px solid var(--proxy-polish-border) !important; border-radius:14px !important; box-shadow:var(--proxy-polish-shadow) !important; }
#suiproxy-section .suiproxy-heading { gap:10px !important; }
#suiproxy-section .suiproxy-heading-icon { width:38px !important; height:38px !important; flex-basis:38px !important; border-radius:11px !important; }
#suiproxy-section .suiproxy-heading h2 { font-size:18px !important; }
#suiproxy-section .suiproxy-heading p { margin-top:2px !important; font-size:10px !important; line-height:1.3 !important; }
#suiproxy-section .suiproxy-account-card { margin-bottom:9px !important; padding:11px 14px !important; border-radius:12px !important; box-shadow:0 3px 12px rgba(15,23,42,.045) !important; }
#suiproxy-section .suiproxy-card-heading > span, #suiproxy-section .suiproxy-card-heading-icon { width:34px !important; height:34px !important; border-radius:10px !important; }
#suiproxy-section .suiproxy-card-heading h3, #suiproxy-section .suiproxy-list-title h3 { font-size:14px !important; }
#suiproxy-section .suiproxy-account-body { gap:8px !important; margin-top:9px !important; }
#suiproxy-section .suiproxy-key-input input { height:36px !important; min-height:36px !important; }
#suiproxy-section .suiproxy-list-card { border-radius:12px !important; box-shadow:0 3px 12px rgba(15,23,42,.045) !important; }
#suiproxy-section .suiproxy-list-head { min-height:56px !important; gap:9px !important; padding:9px 13px !important; }
#suiproxy-section .suiproxy-list-tools { gap:5px !important; }
#suiproxy-section :is(.suiproxy-bulk-dns,.bulk-webrtc-control) { min-height:30px !important; gap:5px !important; padding:2px 4px 2px 7px !important; border-radius:8px !important; box-shadow:none !important; }
#suiproxy-section :is(.suiproxy-bulk-dns,.bulk-webrtc-control) :is(select,button) { min-height:25px !important; height:25px !important; padding:0 7px !important; border-radius:6px !important; font-size:9.5px !important; }
#suiproxy-section .suiproxy-card-list { max-height:clamp(430px,62vh,720px) !important; overflow-y:auto !important; overflow-x:hidden !important; scrollbar-gutter:stable; overscroll-behavior:contain; }
#suiproxy-section .suiproxy-card-zone {
    padding: 9px 10px !important;
    min-height: 132px !important;
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
#suiproxy-section .suiproxy-proxy-card {
    min-height: 132px !important;
    height: auto !important;
    grid-template-rows: auto !important;
}
#suiproxy-section .suiproxy-proxy-card > .suiproxy-card-zone {
    min-height: 132px !important;
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
#suiproxy-section .suiproxy-card-zone:first-child { padding-left:13px !important; }
#suiproxy-section .suiproxy-action-button { min-height:29px !important; height:29px !important; border-radius:7px !important; }
@media (max-width:980px) { #suiproxy-section .suiproxy-card-list { max-height:none !important; overflow-y:visible !important; } }

/* PPPoE / SUI compact: shared visual rhythm, isolated behavior hooks. */
body.dark-mode #pppoe-section[data-layout="sui-v6"] { --rp5-violet: #c4b5fd; --rp5-primary-dark: #93c5fd; color-scheme: dark; }
body.dark-mode #pppoe-section[data-layout="sui-v6"] .rp5-public-ip .pppoe-ipv4 { color: #6ee7b7; }
body.dark-mode #pppoe-section[data-layout="sui-v6"] .rp5-endpoint { color: #93c5fd; }
#pppoe-section[data-layout="sui-v6"] .rp5-page-header {
    min-height: 58px; padding: 10px 14px; margin-bottom: 10px;
    gap: 12px; border: 1px solid var(--rp5-line); border-radius: 14px;
    background: var(--rp5-surface); box-shadow: 0 3px 12px rgba(15,23,42,.045);
}
#pppoe-section[data-layout="sui-v6"] .rp5-heading { gap: 10px; }
#pppoe-section[data-layout="sui-v6"] .rp5-heading-icon {
    width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px;
    background: var(--rp5-violet-soft); color: var(--rp5-violet); box-shadow: none; font-size: 17px;
}
#pppoe-section[data-layout="sui-v6"] .rp5-heading h2 { font-size: 18px; }
#pppoe-section[data-layout="sui-v6"] .rp5-heading p { font-size: 11px; margin-top: 3px; }
#pppoe-section[data-layout="sui-v6"] .rp5-workspace { border-radius: 12px; box-shadow: 0 3px 12px rgba(15,23,42,.045); }
#pppoe-section[data-layout="sui-v6"] .rp6-list-title {
    display: flex; align-items: center; gap: 10px; padding: 10px 13px;
    border-bottom: 0;
}
#pppoe-section[data-layout="sui-v6"] .rp6-list-title > span {
    display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 10px; color: var(--rp5-violet); background: var(--rp5-violet-soft);
}
#pppoe-section[data-layout="sui-v6"] .rp6-list-title h3 { margin: 0; font-size: 14px; color: var(--rp5-ink); }
#pppoe-section[data-layout="sui-v6"] .rp6-list-title p { margin: 3px 0 0; font-size: 11px; color: var(--rp5-muted); }
#pppoe-section[data-layout="sui-v6"] .rp7-toolbar { display: grid; grid-template-columns: 205px minmax(0,1fr); align-items: center; border-bottom: 1px solid var(--rp5-line); }
#pppoe-section[data-layout="sui-v6"] .rp5-commandbar { position: static; padding: 9px 13px; gap: 6px; grid-template-columns: minmax(0,1fr); border-bottom: 0; }
#pppoe-section[data-layout="sui-v6"] .rp5-command-actions { justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
#pppoe-section[data-layout="sui-v6"] :is(.rp5-search,.rp5-filter) { min-height: 32px; height: 32px; border-radius: 8px; }
#pppoe-section[data-layout="sui-v6"] :is(.rp5-search input,.rp5-filter select) { min-height: 30px; height: 30px; font-size: 11px; }
#pppoe-section[data-layout="sui-v6"] .rp5-button { min-height: 32px; padding: 7px 10px; border-radius: 8px; font-size: 11px; box-shadow: none; }
#pppoe-section[data-layout="sui-v6"] .rp5-summary { display: flex; flex-wrap: wrap; align-items: center; padding: 7px 13px; gap: 6px 16px; background: var(--rp5-surface); }
#pppoe-section[data-layout="sui-v6"] .rp5-stat { min-height: 25px; padding: 0; gap: 6px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#pppoe-section[data-layout="sui-v6"] .rp5-stat > span:last-child { display: flex; gap: 6px; align-items: center; }
#pppoe-section[data-layout="sui-v6"] .rp5-stat-icon { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
#pppoe-section[data-layout="sui-v6"] .rp5-stat strong { font-size: 12px; }
#pppoe-section[data-layout="sui-v6"] .rp5-stat small { font-size: 10px; }
#pppoe-section[data-layout="sui-v6"] .rp5-select-page { margin-left: auto; min-height: 25px; padding: 0; border: 0; gap: 6px; background: transparent; font-size: 10px; }
#pppoe-section[data-layout="sui-v6"] .rp5-list-head,
#pppoe-section[data-layout="sui-v6"] .rp5-row {
    display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1.25fr) minmax(0,1.05fr) minmax(0,.9fr);
    gap: 0; align-items: stretch; padding: 0;
}
#pppoe-section[data-layout="sui-v6"] .rp5-list-head > span { padding: 10px 13px; text-align: left; }
#pppoe-section[data-layout="sui-v6"] .rp5-list { padding: 0; gap: 0; }
#pppoe-section[data-layout="sui-v6"] .rp5-list-wrap {
    max-height: clamp(430px,62vh,720px); overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain;
}
#pppoe-section[data-layout="sui-v6"] .rp5-row {
    min-height: 112px; border-radius: 0; border: 0; border-bottom: 1px solid var(--rp5-line);
    box-shadow: none;
}
#pppoe-section[data-layout="sui-v6"] .rp5-row > * {
    grid-column: auto; grid-row: auto; min-width: 0; padding: 10px 12px;
    border-left: 1px solid var(--rp5-line); align-self: stretch;
}
#pppoe-section[data-layout="sui-v6"] .rp5-row > :first-child { border-left: 0; }
#pppoe-section[data-layout="sui-v6"] .rp5-identity { gap: 7px; }
#pppoe-section[data-layout="sui-v6"] .rp5-row-select { grid-template-columns: auto auto; gap: 5px; }
#pppoe-section[data-layout="sui-v6"] .rp5-identity-copy > strong { font-size: 12px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
#pppoe-section[data-layout="sui-v6"] .rp5-row-select > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: var(--rp5-violet-soft); color: var(--rp5-violet); }
#pppoe-section[data-layout="sui-v6"] .rp5-network { margin-top: 10px; }
#pppoe-section[data-layout="sui-v6"] .rp5-network > .rp5-mobile-label { display: none; }
#pppoe-section[data-layout="sui-v6"] .rp5-public-ip { grid-template-columns: 56px minmax(0,1fr); gap: 6px; text-align: left; align-items: start; }
#pppoe-section[data-layout="sui-v6"] .rp5-public-ip > small { font-size: 9px; padding-top: 2px; }
#pppoe-section[data-layout="sui-v6"] .rp5-public-ip .pppoe-ip-stack { font-size: 12px; text-align: left; }
#pppoe-section[data-layout="sui-v6"] .rp5-public-ip :is(.pppoe-ipv4,.pppoe-ipv6) { text-align: left; }
#pppoe-section[data-layout="sui-v6"] .rp5-list-head > span:last-child { text-align: left; }
#pppoe-section[data-layout="sui-v6"] .rp5-metrics { gap: 4px; margin-top: 9px; }
#pppoe-section[data-layout="sui-v6"] .rp5-metrics > span { min-height: 23px; font-size: 10px; padding: 0 5px; }
#pppoe-section[data-layout="sui-v6"] .rp5-endpoint { min-height: 29px; margin: 5px 0; padding-left: 0; border: 0; background: transparent; }
#pppoe-section[data-layout="sui-v6"] .rp5-endpoint code { font-size: 11px; }
#pppoe-section[data-layout="sui-v6"] .rp5-device-dropdown > summary { min-height: 32px; border-radius: 8px; }
#pppoe-section[data-layout="sui-v6"] .rp5-row-actions { display: flex; flex-direction: column; gap: 9px; justify-content: center; width: auto; justify-self: stretch; }
#pppoe-section[data-layout="sui-v6"] .rp5-row-actions > * { width: 100%; }
#pppoe-section[data-layout="sui-v6"] .rp7-action-label { font-size: 9px; letter-spacing: .04em; color: var(--rp5-muted); font-weight: 700; }
#pppoe-section[data-layout="sui-v6"] .rp7-action-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; align-items: start; }
#pppoe-section[data-layout="sui-v6"] .rp7-action-grid :is(.rp5-rotate-button,.rp7-action,.rp5-create-button,.rp5-row-menu > summary) {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    width: 100%; min-width: 0; min-height: 37px; padding: 4px 2px; border-radius: 7px;
    border: 1px solid var(--rp5-line); background: var(--rp5-surface-soft); color: var(--rp5-text);
    font-size: 9px; font-weight: 700; cursor: pointer; white-space: normal; text-align: center; box-shadow: none;
}
#pppoe-section[data-layout="sui-v6"] .rp5-row-actions .rp7-action-grid .rp5-rotate-button { background: var(--rp5-violet-soft); border-color: #ddd6fe; color: var(--rp5-violet); }
#pppoe-section[data-layout="sui-v6"] .rp7-action-grid .rp5-row-menu { min-width: 0; }
#pppoe-section[data-layout="sui-v6"] .rp7-action-grid .rp5-row-menu[open] { grid-column: 1 / -1; }
#pppoe-section[data-layout="sui-v6"] .rp7-action-grid .rp5-row-menu[open] > summary { flex-direction: row; min-height: 28px; }
#pppoe-section[data-layout="sui-v6"] .rp5-row-menu > div { position: static; width: 100%; min-width: 0; margin-top: 6px; box-shadow: none; }
#pppoe-section[data-layout="sui-v6"] .rp5-row-menu button { white-space: normal; overflow-wrap: anywhere; }
#pppoe-section[data-layout="sui-v6"] .rp5-pagination { padding: 12px 14px; }
#pppoe-section[data-layout="sui-v6"] .rp5-auth { margin-top: 6px; padding: 0; border: 0; background: transparent; gap: 5px; }
#pppoe-section[data-layout="sui-v6"] .rp5-auth small { display: none; }
#pppoe-section[data-layout="sui-v6"] .rp7-dns { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 4px; }
#pppoe-section[data-layout="sui-v6"] .rp7-dns > span { color: var(--rp5-muted); font-size: 10px; }
#pppoe-section[data-layout="sui-v6"] .rp7-dns :is(.pppoe-dns-select,.pppoe-dns-custom) { height: 28px; padding: 0 6px; font-size: 10px; border-radius: 7px; }
#pppoe-section[data-layout="sui-v6"] .rp5-mobile-label { display: none; }
@container rp5-workspace (max-width: 900px) {
    #pppoe-section[data-layout="sui-v6"] .rp7-toolbar { grid-template-columns: 1fr; }
    #pppoe-section[data-layout="sui-v6"] .rp6-list-title { padding-bottom: 0; }
    #pppoe-section[data-layout="sui-v6"] .rp5-list-head { display: none; }
    #pppoe-section[data-layout="sui-v6"] .rp5-row { grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); }
    #pppoe-section[data-layout="sui-v6"] .rp5-row > :nth-child(3) { border-left: 0; }
    #pppoe-section[data-layout="sui-v6"] .rp5-row > :nth-child(n+3) { border-top: 1px solid var(--rp5-line); }
    #pppoe-section[data-layout="sui-v6"] .rp5-mobile-label { display: block; }
    #pppoe-section[data-layout="sui-v6"] .rp5-row { margin-bottom: 10px; border-bottom-width: 3px; }
}
@container rp5-workspace (max-width: 620px) {
    #pppoe-section[data-layout="sui-v6"] .rp5-row { grid-template-columns: minmax(0,1fr); }
    #pppoe-section[data-layout="sui-v6"] .rp5-row > * { grid-column: 1; grid-row: auto; border-left: 0; border-top: 1px solid var(--rp5-line); }
    #pppoe-section[data-layout="sui-v6"] .rp5-row > :first-child { border-top: 0; }
    #pppoe-section[data-layout="sui-v6"] .rp5-list-wrap { max-height: none; overflow: visible; }
}
