.evo-v3-grid,
.evo-v3-grid * {
    box-sizing: border-box;
}

.evo-v3-grid {
    --evo-panel: #0a171d;
    --evo-cyan: #19dcf5;
    --evo-orange: #ff8a1f;
    --evo-green: #38e77d;
    --evo-red: #ff5364;
    --evo-blue: #45b8ff;
    --evo-white: #f5fbff;
    --evo-muted: #a9bac3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    width: 100%;
    margin: 0 auto;
}

.evo-v3-card {
    min-width: 0;
    overflow: hidden;
    color: var(--evo-white);
    background:
        radial-gradient(circle at top right, rgba(25, 220, 245, 0.09), transparent 36%),
        linear-gradient(145deg, #08151b 0%, var(--evo-panel) 100%);
    border: 2px solid var(--evo-cyan);
    border-radius: 18px;
    box-shadow:
        inset 0 0 0 1px rgba(25, 220, 245, 0.15),
        0 12px 28px rgba(0, 0, 0, 0.30),
        0 0 18px rgba(25, 220, 245, 0.09);
}

.evo-v3-summary {
    display: block;
    padding: 12px 14px 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.evo-v3-summary::-webkit-details-marker {
    display: none;
}

.evo-v3-summary::marker {
    content: "";
}

.evo-v3-summary-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.evo-v3-server-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
}

.evo-v3-title,
.evo-v3-state {
    margin: 0;
    font: inherit;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: nowrap;
}

.evo-v3-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--evo-orange);
    text-overflow: ellipsis;
}

.evo-v3-state {
    flex: 0 0 auto;
    margin-left: 8px;
}

.evo-v3-state-online,
.evo-v3-power-online {
    color: var(--evo-green);
}

.evo-v3-state-offline,
.evo-v3-power-offline {
    color: var(--evo-red);
}

.evo-v3-power {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-right: 7px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #3b3b3b 0%, #111 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.14),
        inset 0 -4px 8px rgba(0, 0, 0, 0.45),
        0 0 12px currentColor;
}

.evo-v3-power::before {
    position: absolute;
    inset: 4px;
    content: "";
    border: 2px solid currentColor;
    border-radius: 50%;
}

.evo-v3-power > span {
    position: relative;
    display: block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    transform: translateY(2px);
}

.evo-v3-power > span::before {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 4px;
    height: 13px;
    content: "";
    background: currentColor;
    border-radius: 4px;
    transform: translateX(-50%);
}

.evo-v3-scan-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--evo-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.evo-v3-clock {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border: 2px solid var(--evo-muted);
    border-radius: 50%;
}

.evo-v3-clock::before,
.evo-v3-clock::after {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 2px;
    content: "";
    background: var(--evo-muted);
    border-radius: 2px;
    transform-origin: 50% 100%;
}

.evo-v3-clock::before {
    height: 4px;
    transform: translateX(-50%);
}

.evo-v3-clock::after {
    height: 5px;
    transform: translateX(-50%) rotate(120deg);
}

.evo-v3-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 9px;
    padding-top: 8px;
    color: var(--evo-cyan);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: center;
}

.evo-v3-toggle-arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--evo-cyan);
    border-bottom: 2px solid var(--evo-cyan);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.evo-v3-collapsible[open] .evo-v3-summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.evo-v3-collapsible[open] .evo-v3-toggle-open {
    display: none;
}

.evo-v3-toggle-close {
    width: 100%;
    margin: 0;
    padding: 11px 10px 13px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.evo-v3-toggle-close .evo-v3-toggle-arrow {
    transform: translateY(2px) rotate(225deg);
}

.evo-v3-channel-list-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: calc(100% - 24px);
    margin: 12px auto 0;
    padding: 12px 14px;
    color: var(--evo-white);
    background: linear-gradient(180deg, rgba(255, 138, 31, 0.18), rgba(255, 138, 31, 0.08));
    border: 1px solid var(--evo-orange);
    border-radius: 11px;
    box-shadow: 0 0 12px rgba(255, 138, 31, 0.12);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.035em;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.evo-v3-channel-list-button:hover,
.evo-v3-channel-list-button:focus-visible {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(255, 138, 31, 0.32), rgba(255, 138, 31, 0.14));
    box-shadow: 0 0 18px rgba(255, 138, 31, 0.25);
    outline: none;
}

.evo-v3-channel-list-icon {
    color: var(--evo-cyan);
    font-size: 18px;
    line-height: 1;
}

.evo-v3-modal {
    --evo-panel: #0a171d;
    --evo-cyan: #19dcf5;
    --evo-orange: #ff8a1f;
    --evo-white: #f5fbff;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.evo-v3-modal[hidden] {
    display: none !important;
}

.evo-v3-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.evo-v3-modal-dialog {
    position: relative;
    display: flex;
    width: min(1180px, calc(100vw - 48px));
    height: min(88vh, 900px);
    max-height: 900px;
    flex-direction: column;
    overflow: hidden;
    color: var(--evo-white);
    background: #071116;
    border: 2px solid var(--evo-cyan);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 28px rgba(25, 220, 245, 0.18);
}

.evo-v3-modal-head {
    display: flex;
    min-height: 54px;
    padding: 10px 14px 10px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(180deg, #0b1b22, #081419);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.evo-v3-modal-title {
    color: var(--evo-orange);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.025em;
}

.evo-v3-modal-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--evo-white);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.evo-v3-modal-close:hover,
.evo-v3-modal-close:focus-visible {
    color: #ffffff;
    background: rgba(255, 83, 100, 0.22);
    border-color: #ff5364;
    outline: none;
}

.evo-v3-modal-body {
    min-height: 0;
    flex: 1 1 auto;
    background: #050505;
}

.evo-v3-modal-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #050505;
}

html.evo-v3-modal-lock,
body.evo-v3-modal-lock {
    overflow: hidden !important;
}

.evo-v3-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.evo-v3-metric {
    display: flex;
    min-width: 0;
    min-height: 88px;
    padding: 13px 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.evo-v3-metric + .evo-v3-metric {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.evo-v3-metric strong {
    display: block;
    color: var(--evo-blue);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(19px, 1.45vw, 27px);
    font-weight: 900;
    line-height: 1.05;
    white-space: nowrap;
}

.evo-v3-metric span,
.evo-v3-metric small {
    display: block;
    margin-top: 8px;
    color: var(--evo-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.035em;
}

.evo-v3-metric small {
    margin-top: 4px;
    color: var(--evo-muted);
    font-size: 10px;
    font-weight: 800;
}

.evo-v3-channel-metric {
    grid-column: 1 / -1;
    min-height: 70px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 0 !important;
}

.evo-v3-channel-metric strong {
    color: var(--evo-white);
    font-size: 20px;
    white-space: normal;
}

.evo-v3-channel-metric strong em {
    color: var(--evo-orange);
    font-style: normal;
}

.evo-v3-channel-metric span {
    font-size: 12px;
}

.evo-v3-catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evo-v3-catalog-item {
    display: flex;
    min-width: 0;
    min-height: 78px;
    padding: 12px 6px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.evo-v3-catalog-item + .evo-v3-catalog-item {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.evo-v3-catalog-item strong {
    color: var(--evo-blue);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.05;
    white-space: nowrap;
}

.evo-v3-catalog-item span {
    margin-top: 7px;
    color: var(--evo-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.035em;
}

.evo-v3-card-error {
    min-height: 112px;
    padding: 15px;
}

.evo-v3-error-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--evo-red);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 900;
}

.evo-v3-error-text,
.evo-v3-empty {
    padding-top: 12px;
    color: #ffd7dc;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 1180px) {
    .evo-v3-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }
}

@media (max-width: 600px) {
    .evo-v3-card {
        border-radius: 15px;
    }

    .evo-v3-summary {
        padding: 10px 10px 8px;
    }

    .evo-v3-summary-line {
        gap: 6px;
    }

    .evo-v3-server-identity {
        font-size: 13px;
    }

    .evo-v3-power {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .evo-v3-power::before {
        inset: 4px;
    }

    .evo-v3-scan-inline {
        font-size: 12px;
        letter-spacing: -0.02em;
    }

    .evo-v3-scan-inline .evo-v3-clock {
        width: 12px;
        height: 12px;
        margin-right: 3px;
        border-width: 1px;
    }

    .evo-v3-toggle {
        margin-top: 7px;
        padding-top: 7px;
        font-size: 11px;
    }

    .evo-v3-metric {
        min-height: 78px;
        padding: 11px 5px;
    }

    .evo-v3-metric strong {
        font-size: 20px;
    }

    .evo-v3-metric span {
        font-size: 11px;
    }

    .evo-v3-metric small {
        font-size: 9px;
    }

    .evo-v3-channel-metric {
        min-height: 62px;
    }

    .evo-v3-channel-metric strong {
        font-size: 17px;
    }

    .evo-v3-channel-metric span {
        font-size: 12px;
    }

    .evo-v3-catalog-item {
        min-height: 68px;
        padding: 10px 3px;
    }

    .evo-v3-catalog-item strong {
        font-size: 18px;
    }

    .evo-v3-catalog-item span {
        margin-top: 6px;
        font-size: 10px;
    }

    .evo-v3-channel-list-button {
        width: calc(100% - 18px);
        margin-top: 9px;
        padding: 11px 8px;
        font-size: 11px;
    }

    .evo-v3-modal {
        padding: 0;
    }

    .evo-v3-modal-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .evo-v3-modal-head {
        min-height: 50px;
        padding: 8px 10px 8px 13px;
    }

    .evo-v3-modal-title {
        font-size: 14px;
    }

    .evo-v3-modal-close {
        width: 34px;
        height: 34px;
    }
}
