/**
 * WP Site Performance Detection - Frontend Styles v2.0.0
 * Two-column layout: content (left) + sticky sidebar (right)
 */
 */

.wp-spd-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    color: #1e1e1e;
    line-height: 1.6;
}

/* ==================== Search Form ==================== */
.wp-spd-search-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wp-spd-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.wp-spd-url-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.wp-spd-url-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.12);
}

.wp-spd-submit-btn {
    padding: 14px 32px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    min-width: 140px;
}

.wp-spd-submit-btn:hover { background: #135e96; }
.wp-spd-submit-btn:disabled { background: #a7aaad; cursor: not-allowed; }

.wp-spd-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wp-spd-spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes wp-spd-spin { to { transform: rotate(360deg); } }

.wp-spd-advanced-row {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.wp-spd-adv-label {
    font-size: 13px;
    color: #3c434a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wp-spd-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.wp-spd-checkbox-label {
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #3c434a;
}

/* ==================== Ad Spots ==================== */
.wp-spd-ads {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.wp-spd-ad-spot {
    min-height: 60px;
    border: 1px dashed #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}

.wp-spd-ad-spot > * {
    max-width: 100%;
}

@media (max-width: 768px) {
    .wp-spd-ads { grid-template-columns: 1fr; }
}

/* ==================== Messages ==================== */
.wp-spd-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.wp-spd-not-wp {
    background: #fcf9e8;
    border: 1px solid #f0c33c;
    color: #bd8600;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-spd-not-wp-icon { font-size: 18px; flex-shrink: 0; }

/* ==================== Loading ==================== */
.wp-spd-loading-overlay {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.wp-spd-loading-spinner {
    width: 44px; height: 44px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wp-spd-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.wp-spd-loading-content p { color: #646970; font-size: 15px; margin: 0; }

/* ==================== Results Wrapper ==================== */
.wp-spd-results-wrapper {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

/* ==================== Content (Left) ==================== */
.wp-spd-content {
    flex: 1;
    min-width: 0;
}

.wp-spd-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    scroll-margin-top: 20px;
}

.wp-spd-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 18px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #1e1e1e;
}

/* ==================== Score Overview ==================== */
.wp-spd-score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.wp-spd-score-card {
    text-align: center;
    padding: 20px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: box-shadow 0.2s;
}

.wp-spd-score-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.wp-spd-score-card.perf { border-left: 4px solid #2271b1; }
.wp-spd-score-card.seo { border-left: 4px solid #00a32a; }
.wp-spd-score-card.wp { border-left: 4px solid #dba617; }
.wp-spd-score-card.requests { border-left: 4px solid #8c6a9e; }
.wp-spd-score-card.size { border-left: 4px solid #d63638; }

.wp-spd-score-circle {
    position: relative;
    width: 100px; height: 100px;
    margin: 0 auto 8px;
}

.wp-spd-score-circle svg { transform: rotate(-90deg); }

.wp-spd-score-circle-sm {
    position: relative;
    width: 80px; height: 80px;
    margin: 0 auto 8px;
}

.wp-spd-score-circle-sm svg { transform: rotate(-90deg); }

.wp-spd-score-bg { fill: none; stroke: #e0e0e0; stroke-width: 8; }

.wp-spd-score-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease, stroke 0.3s;
}

.wp-spd-score-text {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px; font-weight: 700;
}

.wp-spd-score-text-sm {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px; font-weight: 700;
}

.wp-spd-score-value-lg {
    font-size: 36px; font-weight: 700;
    color: #1e1e1e;
    margin-bottom: 4px;
}

.wp-spd-score-label {
    font-size: 13px;
    color: #646970;
    font-weight: 500;
}

/* ==================== Cards (Overview) ==================== */
.wp-spd-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.wp-spd-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.wp-spd-card-title {
    margin: 0;
    padding: 12px 16px;
    background: #f6f7f7;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    color: #3c434a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wp-spd-card-body { padding: 16px; }

.wp-spd-theme-info { display: flex; gap: 14px; align-items: flex-start; }
.wp-spd-theme-screenshot { width: 80px; height: 60px; border-radius: 4px; object-fit: cover; border: 1px solid #e0e0e0; }
.wp-spd-theme-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.wp-spd-theme-meta { font-size: 13px; color: #646970; }
.wp-spd-theme-meta span + span::before { content: " \00b7 "; }
.wp-spd-theme-parent { font-size: 13px; color: #2271b1; margin-top: 4px; }

.wp-spd-info-grid { display: flex; flex-direction: column; gap: 8px; }
.wp-spd-info-item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.wp-spd-info-label { color: #646970; }
.wp-spd-info-value { font-weight: 600; }

.wp-spd-cache-list { display: flex; flex-direction: column; gap: 6px; }
.wp-spd-cache-item { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid #f6f7f7; font-size: 13px; }
.wp-spd-cache-item:last-child { border-bottom: none; }
.wp-spd-cache-layer { color: #3c434a; }
.wp-spd-cache-status { font-weight: 600; }
.wp-spd-cache-status.detected { color: #00a32a; }
.wp-spd-cache-status.not-detected { color: #d63638; }

.wp-spd-security-list { display: flex; flex-direction: column; gap: 6px; }
.wp-spd-security-item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.wp-spd-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.wp-spd-badge.enabled { background: #edfaef; color: #00a32a; }
.wp-spd-badge.disabled { background: #fcf0f1; color: #d63638; }

/* ==================== Performance Metrics ==================== */
.wp-spd-perf-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.wp-spd-perf-metric {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.wp-spd-perf-metric:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.wp-spd-perf-metric-value { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.wp-spd-perf-metric-value.excellent { color: #00a32a; }
.wp-spd-perf-metric-value.good { color: #dba617; }
.wp-spd-perf-metric-value.poor { color: #d63638; }
.wp-spd-perf-metric-label { font-size: 11px; color: #646970; text-transform: uppercase; letter-spacing: 0.5px; }

/* ==================== Opportunities ==================== */
.wp-spd-opportunities-list { display: flex; flex-direction: column; gap: 10px; }

.wp-spd-opportunity-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.wp-spd-opportunity-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.wp-spd-opp-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 12px; }
.wp-spd-opp-title { font-weight: 600; font-size: 14px; flex: 1; }
.wp-spd-opp-savings { font-size: 13px; font-weight: 700; color: #d63638; background: #fcf0f1; padding: 2px 10px; border-radius: 10px; white-space: nowrap; }
.wp-spd-opp-savings.neutral { color: #646970; background: #f6f7f7; }
.wp-spd-opp-desc { font-size: 13px; color: #646970; margin-bottom: 8px; }
.wp-spd-opp-items { display: flex; flex-direction: column; gap: 3px; }
.wp-spd-opp-item { padding: 3px 10px; background: #f6f7f7; border-radius: 4px; font-size: 12px; font-family: monospace; color: #646970; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== Resources ==================== */
.wp-spd-resources-overview { display: flex; flex-direction: column; gap: 16px; }
.wp-spd-res-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.wp-spd-res-stat { border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px; text-align: center; }
.wp-spd-res-stat-value { font-size: 20px; font-weight: 700; }
.wp-spd-res-stat-label { font-size: 11px; color: #646970; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.wp-spd-res-bars { display: flex; flex-direction: column; gap: 8px; }
.wp-spd-res-bar-row { display: flex; align-items: center; gap: 10px; }
.wp-spd-res-bar-label { width: 70px; font-size: 12px; font-weight: 600; flex-shrink: 0; color: #3c434a; }
.wp-spd-res-bar-track { flex: 1; height: 18px; background: #f0f0f0; border-radius: 9px; overflow: hidden; }
.wp-spd-res-bar-fill { height: 100%; border-radius: 9px; transition: width 0.5s ease; min-width: 2px; }
.wp-spd-res-bar-fill.css { background: #2271b1; }
.wp-spd-res-bar-fill.js { background: #dba617; }
.wp-spd-res-bar-fill.image { background: #00a32a; }
.wp-spd-res-bar-fill.font { background: #d63638; }
.wp-spd-res-bar-fill.media { background: #8c6a9e; }
.wp-spd-res-bar-fill.other { background: #a7aaad; }
.wp-spd-res-bar-value { width: 60px; font-size: 11px; color: #646970; text-align: right; flex-shrink: 0; }
.wp-spd-res-bar-count { width: 30px; font-size: 11px; color: #a7aaad; text-align: right; flex-shrink: 0; }

.wp-spd-third-parties { border: 1px solid #f0c33c; background: #fcf9e8; border-radius: 8px; padding: 12px 14px; }
.wp-spd-third-parties-title { font-size: 13px; font-weight: 600; color: #bd8600; margin-bottom: 6px; }
.wp-spd-third-parties-list { display: flex; flex-wrap: wrap; gap: 4px; }
.wp-spd-third-party-tag { background: #fff; border: 1px solid #f0c33c; color: #bd8600; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

.wp-spd-compression-badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.wp-spd-compression-badge.enabled { background: #edfaef; color: #00a32a; }
.wp-spd-compression-badge.disabled { background: #fcf0f1; color: #d63638; }

/* ==================== Timing ==================== */
.wp-spd-timing-diagram { display: flex; flex-direction: column; gap: 16px; }
.wp-spd-timing-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.wp-spd-timing-stat { border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px; text-align: center; }
.wp-spd-timing-stat-value { font-size: 18px; font-weight: 700; }
.wp-spd-timing-stat-label { font-size: 11px; color: #646970; margin-top: 2px; }

.wp-spd-timing-bar { border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; }
.wp-spd-timing-bar-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.wp-spd-timing-phases { display: flex; flex-direction: column; gap: 5px; }
.wp-spd-timing-phase { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.wp-spd-timing-phase-label { width: 120px; flex-shrink: 0; color: #3c434a; }
.wp-spd-timing-phase-bar { flex: 1; height: 14px; border-radius: 4px; min-width: 2px; transition: width 0.5s ease; }
.wp-spd-timing-phase-bar.dns { background: #8c6a9e; }
.wp-spd-timing-phase-bar.tcp { background: #72aee6; }
.wp-spd-timing-phase-bar.ssl { background: #2271b1; }
.wp-spd-timing-phase-bar.request { background: #dba617; }
.wp-spd-timing-phase-bar.response { background: #00a32a; }
.wp-spd-timing-phase-bar.dom { background: #d63638; }
.wp-spd-timing-phase-time { width: 70px; text-align: right; color: #646970; flex-shrink: 0; }

/* ==================== SEO Checklist ==================== */
.wp-spd-seo-checklist { display: flex; flex-direction: column; gap: 8px; }
.wp-spd-seo-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border: 1px solid #e0e0e0;
    border-radius: 8px; font-size: 13px;
}

.wp-spd-seo-status {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
}

.wp-spd-seo-status.pass { background: #edfaef; color: #00a32a; }
.wp-spd-seo-status.warning { background: #fcf9e8; color: #dba617; }
.wp-spd-seo-status.fail { background: #fcf0f1; color: #d63638; }

.wp-spd-seo-info { flex: 1; }
.wp-spd-seo-item-label { font-weight: 600; }
.wp-spd-seo-item-detail { font-size: 12px; color: #646970; margin-top: 2px; }

.wp-spd-seo-severity { font-size: 10px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; font-weight: 600; }
.wp-spd-seo-severity.critical { background: #fcf0f1; color: #d63638; }
.wp-spd-seo-severity.high { background: #fcf9e8; color: #dba617; }
.wp-spd-seo-severity.medium { background: #f0f6fc; color: #2271b1; }
.wp-spd-seo-severity.low { background: #f6f7f7; color: #646970; }

/* ==================== Plugins ==================== */
.wp-spd-plugins-count { font-size: 14px; color: #646970; margin-bottom: 14px; }
.wp-spd-plugins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.wp-spd-plugin-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px; transition: box-shadow 0.2s; }
.wp-spd-plugin-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.wp-spd-plugin-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.wp-spd-plugin-meta { display: flex; gap: 10px; font-size: 12px; color: #646970; flex-wrap: wrap; align-items: center; }
.wp-spd-plugin-category { background: #f0f6fc; color: #2271b1; padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.wp-spd-plugin-confidence { display: flex; align-items: center; gap: 4px; }
.wp-spd-confidence-bar { width: 45px; height: 4px; background: #e0e0e0; border-radius: 2px; overflow: hidden; }
.wp-spd-confidence-fill { height: 100%; border-radius: 2px; }
.wp-spd-confidence-fill.high { background: #00a32a; }
.wp-spd-confidence-fill.medium { background: #dba617; }
.wp-spd-confidence-fill.low { background: #d63638; }

/* ==================== WP Audit ==================== */
.wp-spd-wp-audit { display: flex; flex-direction: column; gap: 12px; }
.wp-spd-wp-score { text-align: center; padding: 16px; border: 1px solid #e0e0e0; border-radius: 8px; }
.wp-spd-wp-score-value { font-size: 32px; font-weight: 700; }
.wp-spd-wp-score-value.good { color: #00a32a; }
.wp-spd-wp-score-value.ok { color: #dba617; }
.wp-spd-wp-score-value.bad { color: #d63638; }
.wp-spd-wp-score-label { font-size: 13px; color: #646970; margin-top: 4px; }

.wp-spd-wp-items { display: flex; flex-direction: column; gap: 6px; }
.wp-spd-wp-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 13px; }
.wp-spd-wp-item-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; font-weight: 700; }
.wp-spd-wp-item-icon.fail { background: #fcf0f1; color: #d63638; }
.wp-spd-wp-item-icon.warning { background: #fcf9e8; color: #dba617; }
.wp-spd-wp-item-icon.info { background: #f0f6fc; color: #2271b1; }
.wp-spd-wp-item-content { flex: 1; }
.wp-spd-wp-item-label { font-weight: 600; margin-bottom: 2px; }
.wp-spd-wp-item-message { font-size: 12px; color: #646970; }

/* ==================== Sidebar (Right) ==================== */
.wp-spd-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    align-self: flex-start;
}

.wp-spd-sidebar-inner {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
}

/* ==================== CSV Download Button ==================== */
.wp-spd-csv-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 14px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wp-spd-csv-btn:hover { background: #135e96; }
.wp-spd-csv-btn:disabled { background: #a7aaad; cursor: not-allowed; }

.wp-spd-toc-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e1e1e;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.wp-spd-toc { display: flex; flex-direction: column; gap: 2px; }

.wp-spd-toc-link {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    color: #646970;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.wp-spd-toc-link:hover {
    color: #2271b1;
    background: #f0f6fc;
}

.wp-spd-toc-link.active {
    color: #2271b1;
    background: #f0f6fc;
    border-left-color: #2271b1;
    font-weight: 600;
}

/* ==================== Share ==================== */
.wp-spd-share {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.wp-spd-share-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 10px 0;
}

.wp-spd-share-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wp-spd-share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #f6f7f7;
    color: #3c434a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: left;
}

.wp-spd-share-btn:hover { background: #e8e8e8; }
.wp-spd-share-btn.twitter:hover { background: #1da1f2; color: #fff; }
.wp-spd-share-btn.facebook:hover { background: #1877f2; color: #fff; }
.wp-spd-share-btn.linkedin:hover { background: #0a66c2; color: #fff; }
.wp-spd-share-btn.reddit:hover { background: #ff4500; color: #fff; }
.wp-spd-share-btn.copy:hover { background: #2271b1; color: #fff; }

.wp-spd-copy-toast {
    display: none;
    font-size: 12px;
    color: #00a32a;
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
}

.wp-spd-copy-toast.show { display: block; }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .wp-spd-results-wrapper { flex-direction: column; }
    .wp-spd-sidebar { width: 100%; }
    .wp-spd-sidebar-inner { position: static; }
    .wp-spd-toc { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .wp-spd-toc-link { border-left: none; border-bottom: 2px solid transparent; font-size: 12px; padding: 4px 8px; }
    .wp-spd-toc-link.active { border-bottom-color: #2271b1; }
    .wp-spd-share-buttons { flex-direction: row; flex-wrap: wrap; }
    .wp-spd-share-btn { width: auto; flex: 1; min-width: 80px; justify-content: center; }
    .wp-spd-share-btn span { display: none; }
}

@media (max-width: 768px) {
    .wp-spd-input-group { flex-direction: column; }
    .wp-spd-submit-btn { width: 100%; }
    .wp-spd-advanced-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .wp-spd-score-cards { grid-template-columns: repeat(2, 1fr); }
    .wp-spd-cards { grid-template-columns: 1fr; }
    .wp-spd-perf-metrics { grid-template-columns: repeat(2, 1fr); }
    .wp-spd-plugins-grid { grid-template-columns: 1fr; }
    .wp-spd-res-summary { grid-template-columns: repeat(2, 1fr); }
    .wp-spd-timing-stats { grid-template-columns: repeat(2, 1fr); }
    .wp-spd-section { padding: 16px; }
}

/* ==================== Waterfall ==================== */
.wp-spd-wf-summary { display: flex; gap: 20px; font-size: 13px; color: #646970; margin-bottom: 12px; }
.wp-spd-wf-table { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; font-size: 12px; }
.wp-spd-wf-header { display: flex; background: #f6f7f7; padding: 8px 12px; font-weight: 600; border-bottom: 1px solid #e0e0e0; }
.wp-spd-wf-row { display: flex; padding: 6px 12px; border-bottom: 1px solid #f0f0f0; align-items: center; }
.wp-spd-wf-row:last-child { border-bottom: none; }
.wf-col-url { flex: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-col-type { flex: 0.8; }
.wf-col-status { flex: 0.6; text-align: center; font-weight: 600; }
.wf-col-status.ok { color: #00a32a; }
.wf-col-status.warn { color: #dba617; }
.wf-col-status.na { color: #a7aaad; }
.wf-col-size { flex: 0.8; text-align: right; color: #646970; }
.wf-col-timeline { flex: 2; padding-left: 10px; }
.wf-type-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; color: #fff; font-size: 10px; font-weight: 600; }
.wf-bar { display: block; height: 6px; border-radius: 3px; min-width: 2px; }

/* ==================== Trends ==================== */
.wp-spd-trends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.wp-spd-trend-chart { border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; }
.wp-spd-trend-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: #3c434a; }
.wp-spd-mini-bars { display: flex; gap: 8px; align-items: flex-end; height: 120px; }
.wp-spd-mini-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.wp-spd-mini-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.wp-spd-mini-bar-fill { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; transition: height 0.5s ease; }
.wp-spd-mini-bar-fill.excellent { background: #00a32a; }
.wp-spd-mini-bar-fill.good { background: #dba617; }
.wp-spd-mini-bar-fill.poor { background: #d63638; }
.wp-spd-mini-bar-label { font-size: 10px; color: #a7aaad; margin-top: 4px; }
.wp-spd-mini-bar-val { font-size: 11px; font-weight: 600; color: #3c434a; }

/* ==================== Comparison ==================== */
.wp-spd-compare-table { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.wp-spd-compare-header { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; background: #f6f7f7; padding: 10px 14px; font-weight: 600; font-size: 13px; border-bottom: 1px solid #e0e0e0; }
.wp-spd-compare-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; padding: 10px 14px; border-bottom: 1px solid #f0f0f0; font-size: 13px; align-items: center; }
.wp-spd-compare-row:last-child { border-bottom: none; }
.cmp-label { font-weight: 600; }
.cmp-val { text-align: center; font-weight: 600; }
.cmp-val.excellent { color: #00a32a; }
.cmp-val.good { color: #dba617; }
.cmp-val.poor { color: #d63638; }
.cmp-diff { text-align: center; font-weight: 700; }
.cmp-diff.better { color: #00a32a; }
.cmp-diff.worse { color: #d63638; }

/* ==================== PWA ==================== */
.wp-spd-pwa { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 480px) {
    .wp-spd-score-cards { grid-template-columns: 1fr; }
    .wp-spd-perf-metrics { grid-template-columns: 1fr; }
    .wp-spd-res-summary { grid-template-columns: 1fr; }
    .wp-spd-timing-stats { grid-template-columns: 1fr; }
    .wp-spd-trends-grid { grid-template-columns: 1fr; }
    .wp-spd-compare-header, .wp-spd-compare-row { grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr; font-size: 11px; padding: 8px 10px; }
    .wp-spd-wf-row { flex-wrap: wrap; }
    .wf-col-timeline { display: none; }
}
