:root {
    --scripts-line: rgba(255,255,255,.075);
    --scripts-soft: rgba(255,255,255,.035);
}

.scripts-main {
    padding-top: 0;
}

.scripts-intro {
    min-height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding: 72px 0 34px;
    border-bottom: 1px solid var(--scripts-line);
}

.kicker {
    margin-bottom: 13px;
    color: #8575d8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .17em;
}

.scripts-intro h1 {
    margin: 0;
    font-size: clamp(46px, 6vw, 68px);
    line-height: .95;
    letter-spacing: -.055em;
}

.scripts-intro p {
    margin: 15px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.sync-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 5px;
    color: #778193;
    font-size: 11px;
    font-weight: 650;
}

.sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(62,230,155,.08);
}

.overview-strip {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 72px;
    border-bottom: 1px solid var(--scripts-line);
}

.overview-strip div {
    min-width: 125px;
    padding-right: 30px;
}

.overview-strip div + div {
    padding-left: 30px;
    border-left: 1px solid var(--scripts-line);
}

.overview-strip span,
.overview-strip strong {
    display: block;
}

.overview-strip span {
    color: #667081;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.overview-strip strong {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.scripts-controls {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.script-search {
    width: min(320px, 100%);
    height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid var(--scripts-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
}

.script-search:focus-within {
    border-color: rgba(121,91,255,.48);
    box-shadow: 0 0 0 3px rgba(121,91,255,.06);
}

.script-search svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #657083;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.script-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.script-search input::placeholder {
    color: #5c6677;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.filter-button {
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #727c8e;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.filter-button:hover {
    color: #c5cad3;
    background: rgba(255,255,255,.035);
}

.filter-button.active {
    color: #eceef2;
    background: rgba(121,91,255,.13);
}

.script-table-shell {
    border: 1px solid var(--scripts-line);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(9,13,20,.54);
}

.script-table-head,
.script-row {
    display: grid;
    grid-template-columns: minmax(250px, 2.2fr) minmax(120px, 1fr) 90px 80px 110px 90px 38px;
    align-items: center;
    column-gap: 20px;
}

.script-table-head {
    min-height: 38px;
    padding: 0 18px;
    border-bottom: 1px solid var(--scripts-line);
    color: #596475;
    background: rgba(255,255,255,.018);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.script-row {
    min-height: 82px;
    padding: 13px 18px;
    transition: background 120ms ease;
}

.script-row + .script-row {
    border-top: 1px solid var(--scripts-line);
}

.script-row:hover {
    background: rgba(255,255,255,.023);
}

.script-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.script-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.07);
    object-fit: cover;
    background: #121721;
}

.script-icon.fallback {
    display: grid;
    place-items: center;
    color: #d9d5ff;
    background: #171328;
    font-size: 16px;
    font-weight: 800;
}

.script-name {
    min-width: 0;
}

.script-name strong {
    display: block;
    overflow: hidden;
    color: #eef0f4;
    font-size: 13px;
    font-weight: 720;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.script-name span {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #687284;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-cell {
    min-width: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

.status-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.undetected { color: #83dcb5; }
.status-badge.undetected i { background: #3ee69b; }
.status-badge.detected { color: #ed7f8b; }
.status-badge.detected i { background: #ff5f72; }
.status-badge.outdated { color: #d6b870; }
.status-badge.outdated i { background: #e3b955; }
.status-badge.disabled { color: #8a93a1; }
.status-badge.disabled i { background: #697382; }
.status-badge.checking { color: #aaa4d5; }
.status-badge.checking i { background: #8d7ce0; }

.status-note {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #5f6978;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric {
    color: #c9ced7;
    font-size: 11px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.metric.subtle {
    color: #818b9a;
    font-weight: 550;
}

.row-action {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #717b8c;
}

.row-action:hover {
    color: #e1e4e9;
    border-color: var(--scripts-line);
    background: rgba(255,255,255,.035);
}

.row-action svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.loading-row {
    min-height: 82px;
}

.row-skeleton {
    width: 70%;
    height: 9px;
    border-radius: 5px;
    background: rgba(255,255,255,.055);
    animation: rowPulse 1.25s ease-in-out infinite alternate;
}

.row-skeleton.wide {
    width: 55%;
    height: 18px;
}

@keyframes rowPulse {
    to { opacity: .38; }
}

.empty-state {
    margin-top: 14px;
    padding: 42px 20px;
    text-align: center;
    border: 1px solid var(--scripts-line);
    border-radius: 10px;
    color: #737d8c;
}

.empty-state strong,
.empty-state span { display: block; }
.empty-state strong { color: #d9dde4; font-size: 13px; }
.empty-state span { margin-top: 5px; font-size: 11px; }

@media (max-width: 980px) {
    .script-table-head { display: none; }
    .script-table-shell { border: 0; background: transparent; overflow: visible; }
    .script-list { display: grid; gap: 8px; }
    .script-row {
        grid-template-columns: minmax(0, 1.7fr) minmax(120px, 1fr) 90px 90px;
        grid-template-areas:
            "identity status executions action"
            "identity rate checks updated";
        row-gap: 8px;
        min-height: 96px;
        border: 1px solid var(--scripts-line);
        border-radius: 10px;
        background: rgba(9,13,20,.54);
    }
    .script-row + .script-row { border-top: 1px solid var(--scripts-line); }
    .script-identity { grid-area: identity; }
    .status-cell { grid-area: status; }
    .metric-rate { grid-area: rate; }
    .metric-checks { grid-area: checks; }
    .metric-executions { grid-area: executions; }
    .metric-updated { grid-area: updated; }
    .row-action { grid-area: action; justify-self: end; }
}

@media (max-width: 700px) {
    .scripts-intro {
        min-height: 210px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
        padding-top: 88px;
    }
    .overview-strip {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 12px 0;
    }
    .overview-strip div,
    .overview-strip div + div {
        min-width: 0;
        padding: 10px 14px 10px 0;
        border-left: 0;
    }
    .scripts-controls { align-items: stretch; flex-direction: column; padding: 17px 0; }
    .script-search { width: 100%; }
    .filter-row { overflow-x: auto; padding-bottom: 2px; }
    .filter-button { flex: 0 0 auto; }
    .script-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "identity action"
            "status status"
            "rate executions"
            "checks updated";
        padding: 15px;
    }
    .metric { position: relative; padding-top: 14px; }
    .metric::before {
        position: absolute;
        top: 0;
        left: 0;
        color: #596475;
        font-size: 8px;
        font-weight: 750;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .metric-rate::before { content: "Ban rate"; }
    .metric-checks::before { content: "Checks"; }
    .metric-executions::before { content: "Executions"; }
    .metric-updated::before { content: "Updated"; }
}
