:root {
    --wps-border-color: #2271b1;
    --wps-tabs-bg-selected: #2271b1;
    --wps-tabs-text-selected: #ffffff;
    --wps-main-dark: #135e96;
    --wps-main-light: #f6f7f7;
    --wps-header-text: #ffffff;
    --wps-bg-primary: #f0f2f5;
    --wps-bg-white: #ffffff;
    --wps-text-primary: #1d2327;
    --wps-text-secondary: #2c3338;
    --wps-accent: #2271b1;
    --wps-shadow-light: 0 1px 2px rgb(16 24 40 / 6%);
    --wps-shadow-medium: 0 6px 20px rgb(16 24 40 / 8%);
    --wps-radius-sm: 8px;
    --wps-radius-md: 12px;
    --wps-transition: 220ms ease;
    --wps-btn-neutral-text: #1d2327;
    --wps-btn-neutral-border: #b7c1cb;
    --wps-btn-neutral-bg: #f3f6fa;
    --wps-btn-neutral-shadow: 0 2px 8px rgb(16 24 40 / 8%);
    --wps-btn-info-text: #ffffff;
    --wps-btn-info-border: #135e96;
    --wps-btn-info-bg: #2271b1;
    --wps-btn-info-shadow: 0 6px 14px rgb(19 94 150 / 24%);
    --wps-btn-info-bg-hover: #1c67a4;
    --wps-btn-info-border-hover: #0f5a90;
    --wps-btn-info-shadow-hover: 0 8px 16px rgb(19 94 150 / 28%);
    --wps-btn-success-text: #ffffff;
    --wps-btn-success-border: #166534;
    --wps-btn-success-bg: #16a34a;
    --wps-btn-success-shadow: 0 6px 14px rgb(21 128 61 / 28%);
    --wps-btn-warning-text: #ffffff;
    --wps-btn-warning-border: #a44a07;
    --wps-btn-warning-bg: #d97706;
    --wps-btn-warning-shadow: 0 6px 14px rgb(194 65 12 / 26%);
    --wps-btn-danger-text: #ffffff;
    --wps-btn-danger-border: #7a2f1f;
    --wps-btn-danger-bg: #b54d33;
    --wps-btn-danger-shadow: 0 6px 14px rgb(140 55 36 / 30%);
    --wpopt-info-1: #eaf4ff;
    --wpopt-info-2: #dcecff;
    --wpopt-info-border: #8eb9da;
    --wpopt-info-text: #0f4c81;
}

.wps-wrap a:hover,
.wps-wrap a:focus {
    color: var(--wps-border-color);
}

/* Keep anchor-buttons colored like buttons on hover/focus (not like generic links). */
.wps-wrap a.wpopt-btn:hover,
.wps-wrap a.wpopt-btn:focus {
    color: var(--wpopt-btn-text, #ffffff);
}

.wps-wrap.wps-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    padding: 8px 0 0;
}

.wps-wrap.wps-home > .wps,
.wps-wrap.wps-home > aside.wps {
    min-width: 0;
    max-width: 100%;
}

.wps-wrap.wps-home > .wps {
    display: grid;
    /* gap: 16px; */
}

.wpopt-shell,
.wpopt-main,
.wpopt-sidebar {
    position: relative;
    z-index: 1;
}

.wpopt-hero {
    overflow: hidden;
}

.wpopt-hero-subtitle {
    margin: 0 0 14px;
    color: #2c3338;
    font-size: 0.96rem;
    max-width: 74ch;
}

.wpopt-actions,
.wpopt-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wpopt-muted {
    margin: 0 0 12px;
    color: #3c434a;
}

.wpopt-scroll-x {
    overflow-x: auto;
    padding-bottom: 6px;
    margin: 0 -2px;
    scrollbar-width: thin;
}

.wpopt-scroll-x::-webkit-scrollbar {
    height: 8px;
}

.wpopt-scroll-x::-webkit-scrollbar-thumb {
    background: #b8c6d8;
    border-radius: 999px;
}

.wpopt-scroll-x::-webkit-scrollbar-track {
    background: #edf1f4;
    border-radius: 999px;
}

.wpopt-kpi-grid {
    display: flex;
    gap: 10px;
    min-width: max-content;
    padding: 0 2px;
}

.wpopt-kpi-card {
    width: 185px;
    flex: 0 0 185px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wpopt-kpi-label {
    color: #50575e;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wpopt-kpi-value {
    margin-top: 4px;
    color: #1d2327;
    font-size: 1.1rem;
}

.wpopt-chip-grid {
    margin-top: 4px;
}

.wpopt-notice-card {
    border-left: 4px solid #2271b1 !important;
}

.wpopt-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.wpopt-metric-item {
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    padding: 12px 14px;
    background: #f6f7f7;
}

.wpopt-metric-item span {
    display: block;
    color: #50575e;
    font-size: 0.82rem;
}

.wpopt-metric-item strong {
    display: block;
    margin-top: 4px;
    color: #1d2327;
    font-size: 1rem;
}

.wpopt-actions-form {
    margin-top: 8px;
}

.wps-wrap .wpopt-settings-setup {
    margin-top: 12px;
    padding: 10px 12px 6px;
    border: 1px solid #d5dde6;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f2f5f8 100%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
}

.wps-wrap .wpopt-settings-actions {
    margin: 4px 0 10px;
    gap: 10px;
}

.wps-wrap .wpopt-settings-import {
    margin: 0 0 6px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.wps-wrap .wpopt-settings-import::after {
    content: none;
}

.wps-wrap .wpopt-settings-import #conf_data,
.wps-wrap .wpopt-settings-import .wpopt-import-field {
    width: 100%;
    min-height: 96px;
    border-radius: 10px;
    border-color: #b9c5d2;
    background: #ffffff;
}

.wps-wrap .wpopt-settings-import .wpopt-btn {
    min-width: 170px;
    white-space: nowrap;
}

#wpopt-toast-host {
    position: fixed;
    top: 42px;
    right: 24px;
    display: grid;
    gap: 8px;
    z-index: 99999;
}

.wpopt-toast {
    min-width: 220px;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    background: #ffffff;
    color: #1d2327;
    box-shadow: 0 8px 24px rgb(16 24 40 / 14%);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.wpopt-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.wpopt-toast.is-success {
    border-color: #cfe8cf;
    background: #eff9ef;
    color: #1f6f43;
}

.wpopt-toast.is-error {
    border-color: #ebc6c1;
    background: #fff1ef;
    color: #b32d2e;
}

.wps-ar-tabcontent.wpopt-tab-animate[aria-hidden="false"] {
    animation: wpopt-tab-enter 220ms ease both;
}

@keyframes wpopt-tab-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.wps-option-info.is-entering {
    animation: wpopt-info-reveal 360ms cubic-bezier(0.2, 0.68, 0.22, 1) both;
}

@keyframes wpopt-info-reveal {
    0% {
        opacity: 0;
        transform: translateY(-6px) scale(0.99);
        filter: blur(1px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.wps-wrap .wpopt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border-width: 1px;
    border-style: solid;
    font-weight: 600;
    color: var(--wpopt-btn-text, #ffffff);
    border-color: var(--wpopt-btn-border, #c3c4c7);
    background: var(--wpopt-btn-bg, #f3f6fa);
    box-shadow: var(--wpopt-btn-shadow, 0 6px 14px rgb(16 24 40 / 16%));
    text-decoration: none;
    transition: box-shadow 170ms ease, border-color 170ms ease, background-color 170ms ease, color 170ms ease;
}

.wps-wrap .wpopt-btn:hover,
.wps-wrap .wpopt-btn:focus {
    color: var(--wpopt-btn-text, #ffffff);
    text-decoration: none;
    box-shadow: var(--wpopt-btn-shadow-hover, 0 5px 10px rgb(16 24 40 / 14%));
}

.wps-wrap .wpopt-btn:active {
    color: var(--wpopt-btn-text, #ffffff);
    text-decoration: none;
    box-shadow: var(--wpopt-btn-shadow-active, 0 2px 5px rgb(16 24 40 / 12%));
}

.wps-wrap .wpopt-btn.is-success,
.wps-wrap .wpopt-btn-success {
    --wpopt-btn-text: var(--wps-btn-success-text);
    --wpopt-btn-border: var(--wps-btn-success-border);
    --wpopt-btn-bg: var(--wps-btn-success-bg);
    --wpopt-btn-shadow: var(--wps-btn-success-shadow);
    --wpopt-btn-shadow-hover: 0 5px 10px rgb(21 128 61 / 25%);
    --wpopt-btn-shadow-active: 0 2px 5px rgb(21 128 61 / 20%);
}

.wps-wrap .wpopt-btn.is-warning,
.wps-wrap .wpopt-btn-warning {
    --wpopt-btn-text: var(--wps-btn-warning-text);
    --wpopt-btn-border: var(--wps-btn-warning-border);
    --wpopt-btn-bg: var(--wps-btn-warning-bg);
    --wpopt-btn-shadow: var(--wps-btn-warning-shadow);
    --wpopt-btn-shadow-hover: 0 5px 10px rgb(194 65 12 / 23%);
    --wpopt-btn-shadow-active: 0 2px 5px rgb(194 65 12 / 19%);
}

.wps-wrap .wpopt-btn.is-info,
.wps-wrap .wpopt-btn-info {
    --wpopt-btn-text: var(--wps-btn-info-text);
    --wpopt-btn-border: var(--wps-btn-info-border);
    --wpopt-btn-bg: var(--wps-btn-info-bg);
    --wpopt-btn-shadow: var(--wps-btn-info-shadow);
    --wpopt-btn-shadow-hover: var(--wps-btn-info-shadow-hover);
    --wpopt-btn-shadow-active: 0 2px 6px rgb(19 94 150 / 22%);
}

.wps-wrap .wpopt-btn.is-neutral {
    --wpopt-btn-text: var(--wps-btn-neutral-text);
    --wpopt-btn-border: var(--wps-btn-neutral-border);
    --wpopt-btn-bg: var(--wps-btn-neutral-bg);
    --wpopt-btn-shadow: var(--wps-btn-neutral-shadow);
    --wpopt-btn-shadow-hover: 0 6px 14px rgb(16 24 40 / 12%);
    --wpopt-btn-shadow-active: 0 2px 6px rgb(16 24 40 / 10%);
}

.wps-wrap .wpopt-btn.is-danger,
.wps-wrap .wpopt-btn-danger {
    --wpopt-btn-text: var(--wps-btn-danger-text);
    --wpopt-btn-border: var(--wps-btn-danger-border);
    --wpopt-btn-bg: var(--wps-btn-danger-bg);
    --wpopt-btn-shadow: var(--wps-btn-danger-shadow);
    --wpopt-btn-shadow-hover: 0 5px 10px rgb(140 55 36 / 26%);
    --wpopt-btn-shadow-active: 0 2px 5px rgb(140 55 36 / 21%);
}

.wpopt-actions .wps-button:not(.wpopt-btn),
.wpopt-inline-actions .wps-button:not(.wpopt-btn) {
    min-height: 38px;
    border: 1px solid #b7c1cb;
    border-radius: 10px;
    background: #f1f5f8;
    color: #1d2327;
    font-weight: 600;
    box-shadow: 0 2px 8px rgb(16 24 40 / 8%);
}

.wpopt-actions .wps-button:not(.wpopt-btn):hover,
.wpopt-actions .wps-button:not(.wpopt-btn):focus,
.wpopt-inline-actions .wps-button:not(.wpopt-btn):hover,
.wpopt-inline-actions .wps-button:not(.wpopt-btn):focus {
    border-color: #8da0b3;
    background: #eaf1f7;
    color: #1d2327;
    box-shadow: 0 6px 14px rgb(16 24 40 / 12%);
}

.wps-wrap .wpopt-db-button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.wps-wrap .wpopt-db-button-row .wpopt-btn {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 140px;
    max-width: 100%;
    white-space: nowrap;
}

.wpopt-mail-message-cell {
    min-width: 220px;
}

.wpopt-mail-message-preview {
    color: #1d2327;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

.wpopt-mail-message-more {
    display: inline-block;
    margin-top: 8px;
    font-weight: 600;
    text-decoration: none;
}

.wpopt-mail-message-modal-text {
    max-height: 60vh;
    overflow: auto;
    color: #1d2327;
    line-height: 1.6;
    word-break: break-word;
}

.wpopt-mail-message-modal-text p {
    margin: 0 0 1em;
}

.wpopt-mail-message-modal-text p:last-child {
    margin-bottom: 0;
}

.wpopt-sidebar .wps-box:last-child {
    margin-bottom: 0;
}

.wpopt-sidebar .wps-box {
    border-radius: 14px;
    border: 1px solid #c7d0da;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    box-shadow: 0 8px 22px rgb(15 23 42 / 8%);
}

.wpopt-sidebar .wps-box h3 {
    margin: 0 0 10px;
    color: #0f2942;
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}

.wpopt-sidebar .wps-donation-wrap {
    background: linear-gradient(160deg, #0f172a, #1e293b);
    border: 1px solid #334155;
    box-shadow: 0 10px 26px rgb(15 23 42 / 36%);
    color: #f8fafc;
}

.wpopt-sidebar .wps-donation-title {
    color: #f8fafc;
}

.wpopt-sidebar .wpopt-muted {
    color: #cbd5e1;
}

.wpopt-sidebar .wps-donation-hr {
    background: #475569;
}

.wpopt-sidebar .dn-btc {
    background: #111827;
    border-color: #475569;
}

.wpopt-sidebar .wps-donation-name {
    color: #93c5fd;
}

.wpopt-sidebar .wps-donation-value {
    color: #f8fafc;
}

.wpopt-sidebar .wpopt-support-cta {
    margin-top: 12px;
}

.wpopt-sidebar .wpopt-support-cta .wpopt-btn {
    flex: 1 1 100%;
}

.wpopt-link-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 8px;
}

.wpopt-link-list li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpopt-link-list a {
    position: relative;
    display: block;
    padding: 11px 36px 11px 12px;
    border-radius: 11px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #9aaec5;
    text-decoration: none;
    color: #102a43;
    font-weight: 600;
    box-shadow: 0 2px 8px rgb(16 24 40 / 7%);
    transition: background var(--wps-transition), border-color var(--wps-transition), box-shadow var(--wps-transition), color var(--wps-transition);
}

.wpopt-link-list a::after {
    content: ">";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #2563a5;
    opacity: 0.85;
}

.wpopt-link-list a:hover,
.wpopt-link-list a:focus {
    background: linear-gradient(180deg, #eef6ff 0%, #e2eefb 100%);
    border-color: #5b84ad;
    color: #0b2238;
    box-shadow: 0 10px 18px rgb(19 94 150 / 14%);
}

.wpopt-link-list a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(34 113 177 / 20%), 0 10px 18px rgb(19 94 150 / 14%);
}

.dn-btc {
    padding: 10px 12px;
    border-radius: var(--wps-radius-sm);
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
}

.wps-donation-value {
    word-break: break-all;
    font-family: "Consolas", "Monaco", monospace;
    color: #1f2933;
}

@media (max-width: 1080px) {
    .wps-wrap.wps-home {
        grid-template-columns: minmax(0, 1fr);
    }

    .wpopt-kpi-grid {
        min-width: max-content;
    }

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

@media (max-width: 782px) {
    .wpopt-kpi-grid,
    .wpopt-metrics-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wps-wrap .wpopt-settings-import {
        grid-template-columns: minmax(0, 1fr);
    }

    .wps-wrap .wpopt-settings-import .wpopt-btn {
        width: 100%;
        min-width: 0;
    }

    .wps-wrap .wpopt-db-button-row .wpopt-btn {
        width: 100% !important;
        min-width: 0;
    }

    .wpopt-mail-message-cell {
        min-width: 0;
    }
}

/* Performance Monitor */
.wpopt-perf-shell,
.wpopt-perf-slow-shell,
.wpopt-perf-cache-grid,
.wpopt-perf-component-shell {
    --wpopt-perf-ink: #0f172a;
    --wpopt-perf-muted: #64748b;
    --wpopt-perf-copy: #475569;
    --wpopt-perf-copy-strong: #334155;
    --wpopt-perf-line: rgba(15, 23, 42, 0.08);
    --wpopt-perf-line-strong: rgba(148, 163, 184, 0.34);
    --wpopt-perf-line-soft: rgba(148, 163, 184, 0.28);
    --wpopt-perf-track: rgba(148, 163, 184, 0.18);
    --wpopt-perf-surface: #fff;
    --wpopt-perf-panel: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --wpopt-perf-radius-sm: 12px;
    --wpopt-perf-radius-md: 14px;
    --wpopt-perf-radius-lg: 18px;
    --wpopt-perf-radius-xl: 22px;
    --wpopt-perf-radius-pill: 999px;
    --wpopt-perf-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.04);
    --wpopt-perf-shadow-card: 0 10px 22px rgba(15, 23, 42, 0.05);
    --wpopt-perf-shadow-panel: 0 16px 36px rgba(15, 23, 42, 0.07);
    --wpopt-perf-shadow-button: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.wpopt-perf-shell,
.wpopt-perf-kpis,
.wpopt-perf-type-grid,
.wpopt-perf-slow-chart-list,
.wpopt-perf-slow-meta,
.wpopt-perf-cache-layer-grid,
.wpopt-perf-component-shell,
.wpopt-perf-component-list,
.wpopt-perf-component-meta,
.wpopt-perf-component-facts,
.wpopt-perf-component-workload,
.wpopt-perf-type-stats,
.wpopt-perf-slow-metrics,
.wpopt-perf-component-metrics,
.wpopt-perf-component-section-head,
.wpopt-perf-component-fact {
    display: grid;
}

.wpopt-perf-toolbar,
.wpopt-perf-actions,
.wpopt-perf-legend,
.wpopt-perf-component-controls,
.wpopt-perf-slow-bar-stats,
.wpopt-perf-component-chips {
    display: flex;
    flex-wrap: wrap;
}

.wpopt-perf-shell {
    gap: 20px;
}

.wpopt-perf-toolbar {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.wpopt-perf-actions {
    gap: 10px;
    align-items: center;
}

.wpopt-perf-chart,
.wpopt-perf-cache-layer {
    border: 1px solid var(--wpopt-perf-line);
    border-radius: 16px;
    background: var(--wpopt-perf-panel);
}

.wpopt-perf-chart,
.wpopt-perf-table {
    overflow: auto;
}

.wpopt-perf-chart {
    padding: 16px;
}

.wpopt-perf-chart h3,
.wpopt-perf-table h3 {
    margin-top: 0;
}

.wpopt-perf-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--wpopt-perf-radius-sm);
    color: var(--wpopt-perf-muted);
    background: #f8fafc;
}

.wpopt-perf-legend {
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--wpopt-perf-copy);
}

.wpopt-perf-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpopt-perf-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: var(--wpopt-perf-radius-pill);
}

/* Overview */
.wpopt-perf-kpis {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.wpopt-perf-kpi,
.wpopt-perf-type-card {
    border: 1px solid var(--wpopt-perf-line);
    border-radius: var(--wpopt-perf-radius-md);
    background: var(--wpopt-perf-surface);
}

.wpopt-perf-kpi {
    padding: 16px;
}

.wpopt-perf-kpi span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--wpopt-perf-muted);
}

.wpopt-perf-kpi strong {
    font-size: 24px;
    color: var(--wpopt-perf-ink);
}

.wpopt-perf-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 18px;
}

.wpopt-perf-type-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.wpopt-perf-type-card {
    padding: 14px;
}

.wpopt-perf-type-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.wpopt-perf-type-top strong,
.wpopt-perf-slow-bar-title,
.wpopt-perf-slow-section strong,
.wpopt-perf-cache-layer-head strong,
.wpopt-perf-component-title,
.wpopt-perf-component-fact strong,
.wpopt-perf-component-section-head strong {
    display: block;
    color: var(--wpopt-perf-ink);
}

.wpopt-perf-type-top span {
    font-size: 12px;
    color: var(--wpopt-perf-muted);
}

.wpopt-perf-type-accent {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
}

.wpopt-perf-type-stats,
.wpopt-perf-cache-layer-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wpopt-perf-type-stats {
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
}

.wpopt-perf-type-stats b {
    display: block;
    color: var(--wpopt-perf-ink);
    font-size: 14px;
}

/* Slow queries */
.wpopt-perf-slow-shell {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
    gap: 18px;
    align-items: start;
}

.wpopt-perf-slow-chart-list,
.wpopt-perf-slow-meta {
    gap: 12px;
}

.wpopt-perf-slow-bar,
.wpopt-perf-component-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--wpopt-perf-line-strong);
    border-radius: 20px;
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    transition: box-shadow .18s ease, border-color .18s ease;
}

.wpopt-perf-slow-bar {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    background: linear-gradient(135deg, #fcfffe 0%, #f3fbfb 100%);
}

.wpopt-perf-slow-bar:hover {
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.10);
}

.wpopt-perf-slow-bar[data-active="1"] {
    border-color: #0f766e;
    box-shadow: 0 18px 34px rgba(15, 118, 110, 0.16);
    background: linear-gradient(135deg, #f4fffe 0%, #ecfdf5 100%);
}

.wpopt-perf-slow-rank,
.wpopt-perf-component-rank {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 0 8px;
    border-radius: var(--wpopt-perf-radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wpopt-perf-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}

.wpopt-perf-slow-rank {
    min-width: 30px;
    height: 30px;
    z-index: 2;
}

.wpopt-perf-component-rank {
    min-width: 32px;
    height: 32px;
}

.wpopt-perf-slow-bar[data-active="1"] .wpopt-perf-slow-rank,
.wpopt-perf-component-card[data-active="1"] .wpopt-perf-component-rank {
    background: #0f766e;
}

.wpopt-perf-slow-bar-copy,
.wpopt-perf-component-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
}

.wpopt-perf-slow-bar-copy {
    padding-right: 42px;
}

.wpopt-perf-component-copy {
    padding-right: 46px;
}

.wpopt-perf-slow-bar-head,
.wpopt-perf-cache-layer-head,
.wpopt-perf-component-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.wpopt-perf-slow-bar-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.wpopt-perf-slow-bar-context,
.wpopt-perf-slow-bar-peak small,
.wpopt-perf-slow-detail-kicker,
.wpopt-perf-cache-badge,
.wpopt-perf-cache-mini span,
.wpopt-perf-cache-layer-stats span,
.wpopt-perf-component-kicker,
.wpopt-perf-component-main small,
.wpopt-perf-component-metrics span,
.wpopt-perf-component-section-head span,
.wpopt-perf-component-fact span,
.wpopt-perf-component-link span,
.wpopt-perf-component-description span,
.wpopt-perf-component-workload-item span {
    color: var(--wpopt-perf-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.wpopt-perf-slow-detail-kicker,
.wpopt-perf-cache-badge,
.wpopt-perf-component-section-head span,
.wpopt-perf-component-fact span,
.wpopt-perf-component-link span,
.wpopt-perf-component-description span,
.wpopt-perf-component-workload-item span {
    font-weight: 700;
}

.wpopt-perf-slow-bar-context {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wpopt-perf-copy);
}

.wpopt-perf-slow-bar-peak,
.wpopt-perf-component-main {
    display: grid;
    justify-items: end;
    gap: 2px;
    color: var(--wpopt-perf-ink);
    white-space: nowrap;
}

.wpopt-perf-slow-bar-peak strong {
    font-size: 16px;
    line-height: 1;
}

.wpopt-perf-slow-meter,
.wpopt-perf-component-meter {
    position: relative;
    width: 100%;
    border-radius: var(--wpopt-perf-radius-pill);
    background: var(--wpopt-perf-track);
    overflow: hidden;
}

.wpopt-perf-slow-meter {
    display: block;
    height: 8px;
}

.wpopt-perf-component-meter {
    height: 10px;
}

.wpopt-perf-slow-meter span,
.wpopt-perf-component-meter span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: var(--wpopt-perf-radius-pill);
}

.wpopt-perf-slow-meter span {
    background: linear-gradient(90deg, #38bdf8 0%, #0f766e 100%);
    box-shadow: 0 0 18px rgba(15, 118, 110, 0.24);
}

.wpopt-perf-slow-bar-stats,
.wpopt-perf-component-chips {
    gap: 8px;
}

.wpopt-perf-slow-chip,
.wpopt-perf-component-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--wpopt-perf-radius-pill);
    background: #fff;
    border: 1px solid var(--wpopt-perf-line-soft);
    color: var(--wpopt-perf-copy-strong);
    font-size: 11px;
}

.wpopt-perf-slow-chip b,
.wpopt-perf-component-chip b {
    color: var(--wpopt-perf-ink);
    font-size: 12px;
}

.wpopt-perf-slow-details,
.wpopt-perf-component-detail {
    position: sticky;
    top: 16px;
    border: 1px solid var(--wpopt-perf-line);
    border-radius: var(--wpopt-perf-radius-xl);
    padding: 18px;
    box-shadow: var(--wpopt-perf-shadow-panel);
}

.wpopt-perf-slow-details {
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.10), transparent 34%), var(--wpopt-perf-panel);
}

.wpopt-perf-component-detail {
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 34%), var(--wpopt-perf-panel);
}

.wpopt-perf-slow-detail-head,
.wpopt-perf-component-detail-head {
    margin-bottom: 16px;
}

.wpopt-perf-slow-detail-head h4,
.wpopt-perf-component-detail-head h4 {
    font-size: 18px;
    line-height: 1.35;
    color: var(--wpopt-perf-ink);
}

.wpopt-perf-slow-detail-head h4 {
    margin: 6px 0 8px;
}

.wpopt-perf-component-detail-head h4 {
    margin: 0 0 8px;
}

.wpopt-perf-slow-detail-head p,
.wpopt-perf-component-detail-head p,
.wpopt-perf-cache-summary p {
    margin: 0;
    color: var(--wpopt-perf-copy);
}

.wpopt-perf-slow-detail-kicker,
.wpopt-perf-cache-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--wpopt-perf-radius-pill);
}

.wpopt-perf-slow-detail-kicker {
    background: #ecfeff;
    color: #0f766e;
}

.wpopt-perf-slow-metrics,
.wpopt-perf-component-metrics {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.wpopt-perf-slow-metrics div,
.wpopt-perf-component-metrics div {
    border: 1px solid var(--wpopt-perf-line);
    border-radius: var(--wpopt-perf-radius-md);
    background: #fff;
    padding: 12px;
    box-shadow: var(--wpopt-perf-shadow-soft);
}

.wpopt-perf-slow-metrics span,
.wpopt-perf-component-metrics span {
    display: block;
    margin-bottom: 6px;
}

.wpopt-perf-slow-metrics strong,
.wpopt-perf-component-metrics strong {
    display: block;
    color: var(--wpopt-perf-ink);
    font-size: 16px;
}

.wpopt-perf-slow-section {
    border: 1px solid var(--wpopt-perf-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    padding: 14px;
}

.wpopt-perf-slow-meta p,
.wpopt-perf-component-description p {
    color: var(--wpopt-perf-copy-strong);
}

.wpopt-perf-slow-meta p {
    margin: .45em 0 0;
}

.wpopt-perf-slow-meta pre {
    margin: 8px 0 0;
    padding: 12px;
    border-radius: var(--wpopt-perf-radius-md);
    background: #0f172a;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

.wpopt-perf-slow-meta code {
    font-family: Consolas, Monaco, monospace;
}

/* Cache */
.wpopt-perf-cache-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
    gap: 18px;
    align-items: stretch;
}

.wpopt-perf-cache-summary {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--wpopt-perf-line);
    border-radius: var(--wpopt-perf-radius-xl);
    padding: 20px;
    background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 42%), var(--wpopt-perf-panel);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
}

.wpopt-perf-meta-note {
    margin-top: 10px;
}

.wpopt-perf-cache-badge {
    background: #ecfeff;
    color: #0f766e;
}

.wpopt-perf-cache-ring-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0;
    flex-wrap: wrap;
}

.wpopt-perf-cache-ring-box {
    position: relative;
    width: 168px;
    height: 168px;
}

.wpopt-perf-cache-ring {
    --wpopt-ratio: 0;
    display: grid;
    place-items: center;
    width: 168px;
    height: 168px;
    border-radius: var(--wpopt-perf-radius-pill);
    background: conic-gradient(#0f766e 0 calc(var(--wpopt-ratio) * 1%), #f59e0b calc(var(--wpopt-ratio) * 1%) 100%);
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.10);
}

.wpopt-perf-cache-ring::before {
    content: "";
    width: 118px;
    height: 118px;
    border-radius: var(--wpopt-perf-radius-pill);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

.wpopt-perf-cache-ring-copy {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
}

.wpopt-perf-cache-ring-copy strong {
    display: block;
    font-size: 34px;
    line-height: 1;
    color: var(--wpopt-perf-ink);
}

.wpopt-perf-cache-ring-copy span {
    display: block;
    margin-top: 6px;
    color: var(--wpopt-perf-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.wpopt-perf-cache-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    flex: 1 1 220px;
}

.wpopt-perf-cache-mini {
    border: 1px solid var(--wpopt-perf-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.wpopt-perf-cache-mini span {
    display: block;
    margin-bottom: 6px;
}

.wpopt-perf-cache-mini strong,
.wpopt-perf-cache-layer-ratio {
    display: block;
    color: var(--wpopt-perf-ink);
}

.wpopt-perf-cache-mini strong {
    font-size: 20px;
}

.wpopt-perf-cache-layer-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.wpopt-perf-cache-layer {
    border-radius: var(--wpopt-perf-radius-lg);
    padding: 16px;
    box-shadow: var(--wpopt-perf-shadow-card);
}

.wpopt-perf-cache-layer-head {
    margin-bottom: 12px;
}

.wpopt-perf-cache-layer-head strong {
    font-size: 16px;
}

.wpopt-perf-cache-layer-head span {
    display: block;
    color: var(--wpopt-perf-muted);
    font-size: 12px;
}

.wpopt-perf-cache-layer-ratio {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
}

.wpopt-perf-cache-meter {
    display: flex;
    width: 100%;
    height: 12px;
    margin-bottom: 12px;
    border-radius: var(--wpopt-perf-radius-pill);
    background: #e2e8f0;
    overflow: hidden;
}

.wpopt-perf-cache-meter span {
    display: block;
    height: 100%;
}

.wpopt-perf-cache-meter .is-hit {
    background: linear-gradient(90deg, #2dd4bf 0%, #0f766e 100%);
}

.wpopt-perf-cache-meter .is-miss {
    background: linear-gradient(90deg, #fbbf24 0%, #ea580c 100%);
}

.wpopt-perf-cache-layer-stats {
    gap: 10px;
}

.wpopt-perf-cache-layer-stats span {
    display: block;
    margin-bottom: 5px;
}

.wpopt-perf-cache-layer-stats b {
    display: block;
    color: var(--wpopt-perf-ink);
    font-size: 15px;
}

/* Components */
.wpopt-perf-component-shell {
    gap: 18px;
}

.wpopt-perf-component-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
    gap: 18px;
    align-items: start;
}

.wpopt-perf-component-controls {
    gap: 8px;
}

.wpopt-perf-component-sort {
    appearance: none;
    border: 1px solid var(--wpopt-perf-line-strong);
    border-radius: var(--wpopt-perf-radius-pill);
    background: #fff;
    padding: 8px 12px;
    color: var(--wpopt-perf-copy-strong);
    font-size: 12px;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.wpopt-perf-component-sort:hover {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.wpopt-perf-component-sort.is-active {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #0f766e;
    box-shadow: 0 12px 22px rgba(15, 118, 110, 0.12);
}

.wpopt-perf-component-list {
    gap: 12px;
}

.wpopt-perf-component-card {
    box-shadow: var(--wpopt-perf-shadow-button);
    background: linear-gradient(135deg, #fcfffe 0%, #f8fbff 100%);
}

.wpopt-perf-component-card:hover {
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.10);
}

.wpopt-perf-component-card[data-active="1"] {
    border-color: #0f766e;
    box-shadow: 0 18px 34px rgba(15, 118, 110, 0.14);
    background: linear-gradient(135deg, #f7fffd 0%, #ecfdf5 100%);
}

.wpopt-perf-component-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wpopt-perf-component-kicker b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: var(--wpopt-perf-radius-pill);
    background: #e2e8f0;
    color: var(--wpopt-perf-ink);
    font-size: 10px;
}

.wpopt-perf-component-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.wpopt-perf-component-sub {
    display: block;
    color: var(--wpopt-perf-muted);
    font-size: 12px;
}

.wpopt-perf-component-main strong {
    font-size: 18px;
    line-height: 1;
}

.wpopt-perf-component-meter span {
    background: linear-gradient(90deg, #0ea5e9 0%, #0f766e 100%);
    box-shadow: 0 0 18px rgba(14, 165, 233, 0.22);
}

.wpopt-perf-component-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.wpopt-perf-component-section {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--wpopt-perf-line);
    border-radius: var(--wpopt-perf-radius-lg);
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.wpopt-perf-component-section::before,
.wpopt-perf-component-workload-item::after {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
}

.wpopt-perf-component-section::before {
    height: 1px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.55), rgba(15, 118, 110, 0.22));
}

.wpopt-perf-component-section-workload {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 38%), linear-gradient(180deg, #fbfffd 0%, #f3fbf7 100%);
}

.wpopt-perf-component-section-head {
    gap: 4px;
    margin-bottom: 14px;
}

.wpopt-perf-component-section-head strong {
    font-size: 16px;
    line-height: 1.25;
}

.wpopt-perf-component-section-workload .wpopt-perf-component-section-head span {
    color: #0f766e;
}

.wpopt-perf-component-facts,
.wpopt-perf-component-workload {
    gap: 10px;
}

.wpopt-perf-component-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wpopt-perf-component-workload {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wpopt-perf-component-fact,
.wpopt-perf-component-link,
.wpopt-perf-component-description,
.wpopt-perf-component-workload-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--wpopt-perf-radius-md);
    background: rgba(255, 255, 255, 0.92);
    padding: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.wpopt-perf-component-fact {
    gap: 6px;
}

.wpopt-perf-component-fact strong {
    font-size: 15px;
    line-height: 1.35;
    word-break: break-word;
}

.wpopt-perf-component-link {
    gap: 6px;
    text-decoration: none;
    color: var(--wpopt-perf-ink);
    transition: box-shadow .18s ease, border-color .18s ease;
}

.wpopt-perf-component-link strong {
    display: block;
    color: #1d4ed8;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.wpopt-perf-component-link:hover {
    border-color: rgba(29, 78, 216, 0.3);
    box-shadow: 0 12px 22px rgba(29, 78, 216, 0.10);
}

.wpopt-perf-component-link:hover strong {
    color: #1e40af;
}

.wpopt-perf-component-description {
    grid-column: 1 / -1;
}

.wpopt-perf-component-description p {
    margin: 8px 0 0;
    line-height: 1.55;
}

.wpopt-perf-component-workload-item {
    position: relative;
    overflow: hidden;
}

.wpopt-perf-component-workload-item::after {
    inset: auto auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.9), rgba(15, 118, 110, 0.9));
    opacity: .75;
}

.wpopt-perf-component-workload-item strong {
    display: block;
    margin-top: 8px;
    color: var(--wpopt-perf-ink);
    font-size: 18px;
    line-height: 1.2;
}

/* Performance Monitor: responsive */
@media (max-width: 980px) {
    .wpopt-perf-grid,
    .wpopt-perf-slow-shell,
    .wpopt-perf-cache-grid,
    .wpopt-perf-component-grid {
        grid-template-columns: 1fr;
    }

    .wpopt-perf-slow-details,
    .wpopt-perf-component-detail {
        position: static;
    }

    .wpopt-perf-component-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .wpopt-perf-component-facts,
    .wpopt-perf-component-workload {
        grid-template-columns: 1fr;
    }
}
