:root {
    --surface-raised: #1a2234;
    --accent: #7b72ff;
}

body {
    background-image: radial-gradient(ellipse at 8% 0, #574bd91a, transparent 48%);
}

.global-search {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 1;
    width: min(340px, 38%);
    margin-right: auto;
    margin-left: 22px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.global-search input {
    padding: 3px;
    font-size: 10px;
    border: 0;
    background: transparent;
    min-width: 0;
    width: 100%;
}

.global-search>span {
    color: var(--accent);
    font-size: 22px;
}

.global-search kbd {
    padding: 1px 5px;
    font: 11px monospace;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.top-actions {
    order: 2;
}

.command-banner {
    position: relative;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
    background-image: radial-gradient(circle at 5% 25%, #7d6dff22, transparent 45%), linear-gradient(125deg, #25203c22, var(--surface));
    padding: 32px 34px;
}

.command-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.17;
    background-image: radial-gradient(var(--muted) 0.6px, transparent 0.6px);
    background-size: 16px 16px;
    mask-image: linear-gradient(to right, #000, transparent 50%);
}

.command-banner h2 {
    font-size: 28px;
    letter-spacing: -0.7px;
}

.command-banner p {
    font-size: 12px;
    max-width: 610px;
    line-height: 2.2;
}

.banner-art {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 150px;
    height: 145px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 28px;
    background: linear-gradient(150deg, #ffffff07, #ffffff01);
    box-shadow: inset 0 1px #ffffff09, 0 15px 60px #00000015;
    transform: rotate(-6deg);
    flex-shrink: 0;
}

.banner-art>span {
    position: absolute;
    top: -20px;
    left: -15px;
    background: var(--surface-raised);
    color: #b7acff;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 1px 13px;
    font-size: 32px;
    transform: rotate(18deg);
}

.banner-art b {
    color: var(--accent);
    font: 48px/1.1 Arial, sans-serif;
    margin-top: 22px;
    letter-spacing: -2px;
}

.banner-art small {
    color: var(--muted);
    font-size: 10px;
    align-self: start;
}

.control-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}

.metric-tile {
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border);
    padding: 18px;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--text);
}

.metric-tile:hover {
    border-color: var(--accent);
}

.metric-tile>span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 42px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font-size: 24px;
}

.metric-tile.enabled>span {
    background: #34d3990d;
    color: #34d399;
}

.metric-tile.disabled>span {
    background: #fb71850d;
    color: #fb7185;
}

.metric-tile strong {
    display: block;
    margin-top: 3px;
    font-size: 24px;
}

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

.metric-tile>b {
    margin-right: auto;
    font-size: 13px;
    color: var(--muted);
}

.toolbar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
}

.toolbar-bottom form {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 10px;
}

.view-switch {
    display: flex;
    gap: 5px;
}

.view-switch .active {
    color: var(--accent);
    border-color: var(--accent);
}

.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    background: color-mix(in srgb, var(--accent) 6%, var(--bg));
    border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
    border-radius: 11px;
    padding: 13px 15px;
    margin-top: 17px;
    font-size: 11px;
    flex-wrap: wrap;
}

.bulk-toolbar select {
    margin-right: auto;
    padding: 7px 10px;
    font-size: 10px;
}

.bulk-toolbar button {
    min-height: 35px;
    font-size: 11px;
    padding: 7px 15px;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 10px;
}

.select-all input,
.item-check input {
    appearance: auto;
    width: 15px;
    height: 15px;
    margin: 0;
    display: inline-block;
    accent-color: var(--accent);
}

#selected-count {
    color: var(--muted);
    font-size: 10px;
}

.item-check {
    display: inline-flex;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg);
}

.editor-card:has(.item-check input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.button-disabled .mini-telegram {
    opacity: 0.6;
}

.button-state-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px;
}

.state-pill {
    display: inline-block;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 10px;
    border: 1px solid var(--border);
}

.state-pill.on {
    color: #4bd9a3;
    background: #34d3990d;
    border-color: #34d39925;
}

.state-pill.off {
    color: #ff8b9f;
    background: #fb71850d;
    border-color: #fb718525;
}

.text-button {
    border: 0;
    background: transparent;
    padding: 4px 9px;
    color: var(--muted);
    font-size: 10px;
    min-height: 30px;
}

.availability-box {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--accent) 4%, var(--bg));
    border-radius: 12px;
    padding: 18px;
    margin: 0 0 24px;
}

.availability-box strong {
    font-size: 12px;
}

.availability-box small {
    display: block;
    font-size: 9px;
    line-height: 1.9;
    margin-top: 4px;
}

.edit-surface .availability-box select {
    margin: 0;
    width: auto;
    font-size: 10px;
    min-width: 135px;
}

.telegram-button.preview-disabled {
    opacity: 0.45;
    filter: saturate(0.25);
}

.product-monogram {
    display: grid;
    place-items: center;
    width: 44px;
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    border-radius: 13px;
    font: bold 24px Arial, sans-serif;
}

.product-card h3 {
    font-size: 17px;
    margin: 20px 0 3px;
}

.product-price {
    font-size: 21px;
    margin: 20px 0;
}

.product-price small {
    font-size: 10px;
    font-weight: 400;
}

.product-control-link {
    display: block;
    text-align: center;
    background: color-mix(in srgb, var(--accent) 12%, var(--bg));
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 23%, transparent);
    font-size: 12px;
}

.price-details {
    margin-top: 18px;
    font-size: 11px;
    max-width: none;
}

.price-details summary {
    color: var(--muted);
    text-align: center;
}

.price-details form {
    padding-top: 20px;
}

.product-offline {
    border-color: #fb718525;
}

.product-control-stage {
    max-width: 900px;
    margin: 0 auto;
    padding: 35px;
    background: radial-gradient(ellipse at 50% 0, #7b72ff0a, transparent 60%), var(--surface);
}

.product-control-intro {
    text-align: center;
}

.control-orbit {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 24px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font: bold 45px Arial, sans-serif;
    margin: 25px auto;
    transform: rotate(-7deg);
}

.product-control-intro p {
    font-size: 12px;
    color: var(--muted);
}

.availability-console {
    padding: 25px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-top: 32px;
}

.full-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-radius: 13px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 18px;
}

.full-state.is-on {
    color: #54dba7;
    background: #34d3990a;
    border-color: #34d39930;
}

.full-state.is-off {
    color: #ff92a4;
    background: #fb71850a;
    border-color: #fb718530;
}

.full-state>span {
    font-size: 30px;
}

.full-state div {
    margin-left: auto;
}

.full-state small {
    display: block;
    font-size: 10px;
    color: inherit;
    opacity: 0.75;
}

.full-state strong {
    font-size: 19px;
    display: block;
    margin-top: 5px;
}

.full-state>b {
    font: 28px Arial, sans-serif;
    letter-spacing: 2px;
    opacity: 0.55;
}

.power-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.power-actions button {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.power-actions span {
    font-size: 29px;
    margin-bottom: 10px;
}

.power-actions strong {
    font-size: 16px;
}

.power-actions small {
    font-size: 10px;
    color: inherit;
    opacity: 0.7;
    margin-top: 8px;
}

.power-actions .power-on {
    color: #4bd9a3;
    border-color: #34d39930;
    background: #34d39908;
}

.power-actions .power-off {
    color: #ff8b9f;
    border-color: #fb718530;
    background: #fb718508;
}

.full-back {
    width: 100%;
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
}

.editor-grid.list-view {
    grid-template-columns: 1fr;
}

.editor-grid.list-view .editor-card {
    display: grid;
    grid-template-columns: 180px 1fr 180px 220px;
    align-items: center;
    gap: 25px;
    padding: 18px 20px;
}

.editor-grid.list-view .mini-telegram {
    margin: 0;
    padding: 10px;
}

.editor-grid.list-view .mini-chat-bubble {
    display: none;
}

.editor-grid.list-view .button-state-row {
    padding: 0;
}

.editor-grid.list-view .editor-card-footer {
    border: 0;
    padding: 0;
    margin: 0;
    flex-direction: column;
    align-items: flex-end;
}

body.light .state-pill.on,
body.light .power-on,
body.light .full-state.is-on {
    color: #107b50;
}

body.light .state-pill.off,
body.light .power-off,
body.light .full-state.is-off {
    color: #b92f4b;
}

@media (max-width: 1300px) {
    .editor-grid.list-view .editor-card {
        grid-template-columns: 140px 1fr 130px;
        gap: 15px;
    }

    .editor-grid.list-view .editor-card-footer {
        grid-column: 1 / -1;
        flex-direction: row;
    }

    .metric-tile {
        padding: 15px 12px;
        gap: 10px;
    }

    .metric-tile>b {
        display: none;
    }
}

@media (max-width: 1000px) {
    .global-search {
        display: none;
    }

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

    .metric-tile {
        padding: 17px;
    }

    .availability-box {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .edit-surface .availability-box select {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .command-banner {
        padding: 25px;
    }

    .command-banner h2 {
        font-size: 24px;
    }

    .banner-art {
        display: none;
    }

    .editor-grid.list-view .editor-card {
        display: flex;
    }

    .editor-grid.list-view .editor-card-footer {
        flex-direction: row;
        width: 100%;
    }

    .editor-grid.list-view .editor-card-head {
        width: 100%;
    }

    .editor-grid.list-view .mini-telegram {
        width: 100%;
    }

    .editor-grid.list-view .button-state-row {
        width: 100%;
    }

    .bulk-toolbar {
        gap: 12px;
    }

    .bulk-toolbar select {
        width: 100%;
        margin: 0;
    }

    .bulk-toolbar button {
        width: 100%;
    }

    .product-control-stage {
        padding: 22px 18px;
    }

    .availability-console {
        padding: 15px;
    }

    .full-state {
        padding: 19px 15px;
        gap: 10px;
    }

    .full-state strong {
        font-size: 15px;
    }

    .full-state>b {
        font-size: 19px;
    }

    .full-state>span {
        font-size: 23px;
    }

    .power-actions {
        gap: 12px;
    }

    .power-actions button {
        padding: 19px 10px;
    }

    .power-actions strong {
        font-size: 14px;
    }

    .toolbar-bottom form {
        flex-wrap: wrap;
        gap: 8px;
    }
}
