/* ========================================================
   Site Analyzer - Google Material Design 3 (M3) System
   Professional, grounded, accessible developer tooling
   Zero AI neon/gradient clichés — authentic Material Design
   ======================================================== */

:root {
    color-scheme: light;
    /* M3 Clean Light Surface Palette (Professional Google Style) */
    --md-sys-color-surface: #f8f9fc;
    --md-sys-color-surface-dim: #edeef3;
    --md-sys-color-surface-bright: #ffffff;
    --md-sys-color-surface-container-lowest: #ffffff;
    --md-sys-color-surface-container-low: #f3f4f8;
    --md-sys-color-surface-container: #ffffff;
    --md-sys-color-surface-container-high: #eaeef6;
    --md-sys-color-surface-container-highest: #dfe3ec;

    --md-sys-color-on-surface: #191c20;
    --md-sys-color-on-surface-variant: #43474e;
    --md-sys-color-outline: #73777f;
    --md-sys-color-outline-variant: #d6d9e2;

    /* Primary Accent: Google M3 Technical Blue */
    --md-sys-color-primary: #0b57d0;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d3e3fd;
    --md-sys-color-on-primary-container: #041e49;

    /* Secondary: Slate / Indigo */
    --md-sys-color-secondary: #535f70;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #d7e3f7;
    --md-sys-color-on-secondary-container: #101c2b;

    /* Semantic Tonal Statuses (Clean, Readable on Light) */
    --md-sys-color-success: #137333;
    --md-sys-color-on-success: #ffffff;
    --md-sys-color-success-container: #e6f4ea;
    --md-sys-color-on-success-container: #0d652d;

    --md-sys-color-warning: #b06000;
    --md-sys-color-on-warning: #ffffff;
    --md-sys-color-warning-container: #fef7e0;
    --md-sys-color-on-warning-container: #804600;

    --md-sys-color-error: #c5221f;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-error-container: #fce8e6;
    --md-sys-color-on-error-container: #a50e0e;

    --md-sys-color-info: #1a73e8;
    --md-sys-color-info-container: #e8f0fe;
    --md-sys-color-on-info-container: #174ea6;

    /* Subtle Material Elevations */
    --md-elevation-1: 0 1px 3px 0 rgba(60,64,67,0.12), 0 1px 2px 0 rgba(60,64,67,0.24);
    --md-elevation-2: 0 2px 6px 2px rgba(60,64,67,0.15), 0 1px 2px 0 rgba(60,64,67,0.3);
    --md-elevation-3: 0 4px 8px 3px rgba(60,64,67,0.15), 0 1px 3px 0 rgba(60,64,67,0.3);

    /* Shape Radii */
    --md-shape-xs: 4px;
    --md-shape-sm: 8px;
    --md-shape-md: 12px;
    --md-shape-lg: 16px;
    --md-shape-xl: 24px;
    --md-shape-full: 9999px;

    /* Typography */
    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Legacy compatibility mappings */
    --bg-primary: var(--md-sys-color-surface);
    --bg-card: var(--md-sys-color-surface-container);
    --bg-card-hover: var(--md-sys-color-surface-container-high);
    --border: var(--md-sys-color-outline-variant);
    --text-primary: var(--md-sys-color-on-surface);
    --text-secondary: var(--md-sys-color-on-surface-variant);
    --text-muted: var(--md-sys-color-outline);
    --accent: var(--md-sys-color-primary);
    --success: var(--md-sys-color-success);
    --warning: var(--md-sys-color-warning);
    --danger: var(--md-sys-color-error);
    --info: var(--md-sys-color-info);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    line-height: 1.5;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

/* Material Symbols Glyph Utility */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

/* ─── Hero Header ────────────────────────────── */
.hero {
    text-align: center;
    padding: 48px 16px 28px;
}

.hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-logo-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--md-shape-md);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--md-elevation-1);
}

.hero-logo-badge .material-symbols-outlined {
    font-size: 26px;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--md-sys-color-on-surface);
}

.hero p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 16px;
    max-width: 660px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── Search Bar (M3 Dock / Search Container) ─── */
.m3-search-dock,
.search-box {
    margin: 24px auto 36px;
    max-width: 820px;
    padding: 0 4px;
}

.m3-search-bar {
    background: #ffffff;
    border: 1.5px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-full);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 10px 8px 24px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 1px 4px 0 rgba(60,64,67,0.12), 0 1px 2px 0 rgba(60,64,67,0.2);
}

.m3-search-bar:focus-within {
    border-color: var(--md-sys-color-primary);
    background: #ffffff;
    box-shadow: 0 2px 8px 2px rgba(11,87,208,0.18), 0 1px 2px 0 rgba(60,64,67,0.3);
}

.m3-search-bar.shake-error {
    animation: shakeError 0.45s ease-in-out;
    border-color: var(--md-sys-color-error);
    box-shadow: 0 2px 8px 2px rgba(197,34,31,0.2);
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    15%, 55%, 85% { transform: translateX(-7px); }
    35%, 70% { transform: translateX(7px); }
}

.m3-search-bar .search-icon,
.m3-search-icon {
    color: var(--md-sys-color-primary);
    font-size: 22px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.m3-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
    min-width: 0;
    padding: 10px 8px;
    height: 100%;
}

.m3-search-bar input::placeholder {
    color: var(--md-sys-color-outline);
}

/* Fix browser autofill styling so no clashing background/border appears */
.m3-search-bar input:-webkit-autofill,
.m3-search-bar input:-webkit-autofill:hover, 
.m3-search-bar input:-webkit-autofill:focus, 
.m3-search-bar input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: var(--md-sys-color-on-surface) !important;
    caret-color: var(--md-sys-color-on-surface);
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
    border-radius: var(--md-shape-full);
}

.m3-btn-search {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-shape-full);
    padding: 12px 28px;
    font-size: 14.5px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 14px;
}

.m3-btn-search:hover {
    filter: brightness(1.08);
    box-shadow: var(--md-elevation-1);
}

.m3-btn-search:active {
    filter: brightness(0.95);
}

.m3-btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Error Message ──────────────────────────── */
.error-msg {
    display: none;
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    border-radius: var(--md-shape-md);
    padding: 14px 20px;
    margin: 0 auto 20px;
    max-width: 760px;
    font-size: 14px;
    align-items: center;
    gap: 12px;
    box-shadow: var(--md-elevation-1);
}
.error-msg.active { display: flex; }

/* ─── Step-by-Step Progress Card ─────────────── */
.progress-card {
    display: none;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--md-elevation-2);
}
.progress-card.active { display: block; }

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-percentage {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

.m3-progress-track {
    height: 6px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-shape-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.m3-progress-indicator {
    height: 100%;
    width: 0%;
    background: var(--md-sys-color-primary);
    border-radius: var(--md-shape-full);
    transition: width 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.progress-status-text {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.m3-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--md-sys-color-outline-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: m3-spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Checklist Steps */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding-top: 16px;
}

.step-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--md-shape-md);
    background: var(--md-sys-color-surface-container-low);
    transition: all 0.2s ease;
}

.step-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-indicator {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-outline);
}

.step-item.running .step-indicator {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.step-item.done .step-indicator {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.step-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.step-detail {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

/* ─── Results Section ────────────────────────── */
.results {
    display: none;
    margin-top: 16px;
}
.results.active {
    display: block;
}

/* ─── Material Design 3 Navigation Tabs ──────── */
.m3-tabs-container {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-xl);
    padding: 4px;
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.m3-tabs-container::-webkit-scrollbar { display: none; }

.m3-tab {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--md-shape-full);
    color: var(--md-sys-color-on-surface-variant);
    font-family: var(--font-family);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    white-space: nowrap;
}

.m3-tab:hover {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
}

.m3-tab.active {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 600;
    box-shadow: var(--md-elevation-1);
}

.m3-tab .material-symbols-outlined {
    font-size: 18px;
}

/* ─── Tab Content Panes ──────────────────────── */
.tab-pane {
    display: none;
    animation: m3-tab-fade 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.tab-pane.active {
    display: block;
}

@keyframes m3-tab-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Cooldown & Cache Banner ────────────────── */
.cached-banner {
    background: #ffffff;
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-left: 4px solid var(--md-sys-color-primary);
    border-radius: var(--md-shape-lg);
    padding: 18px 22px;
    margin-top: 20px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--md-elevation-1);
}

.cached-banner-text {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--md-sys-color-on-surface);
}

.cached-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── Standalone Report CTA Banner ────────────── */
.report-cta-card {
    background: #ffffff;
    border: 1.5px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-xl);
    padding: 28px 32px;
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: var(--md-elevation-1);
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.report-cta-card:hover {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--md-elevation-2);
}

.report-cta-text h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-cta-text p {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    max-width: 650px;
    line-height: 1.5;
}

/* ─── Action Toolbar ─────────────────────────── */
.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.result-actions-left,
.result-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── M3 Buttons ─────────────────────────────── */
.btn {
    font-family: var(--font-family);
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--md-shape-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.btn-outline {
    background: transparent;
    border-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
}
.btn-outline:hover {
    background: var(--md-sys-color-surface-container-high);
}

.btn-green {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}
.btn-green:hover { filter: brightness(1.1); }

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

/* ─── Top Clickable Metric Cards ─────────────── */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.m3-score-card {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: var(--md-elevation-1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.m3-score-card:hover {
    background: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline);
    transform: translateY(-2px);
    box-shadow: var(--md-elevation-2);
}

.m3-score-card .jump-icon {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 16px;
    color: var(--md-sys-color-outline);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.m3-score-card:hover .jump-icon {
    opacity: 1;
    color: var(--md-sys-color-primary);
    transform: translate(2px, -2px);
}

.m3-score-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    border: 3.5px solid;
    background: var(--md-sys-color-surface-container-low);
}

.m3-score-card h3 {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.m3-score-sublabel {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

/* ─── M3 Cards & Surface Containers ──────────── */
.card {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--md-elevation-1);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.card.highlight-pulse {
    border-color: var(--md-sys-color-primary) !important;
    animation: highlight-pulse-anim 1.5s ease-in-out;
}

@keyframes highlight-pulse-anim {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 199, 250, 0.7); }
    40% { transform: scale(1.008); box-shadow: 0 0 0 8px rgba(168, 199, 250, 0.25); }
    100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(168, 199, 250, 0.3); }
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 .material-symbols-outlined {
    font-size: 22px;
    color: var(--md-sys-color-primary);
}

/* ─── Material Badges & Chips ────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--md-shape-sm);
    font-size: 12px;
    font-weight: 500;
}

.badge-green {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
}

.badge-yellow {
    background: var(--md-sys-color-warning-container);
    color: var(--md-sys-color-on-warning-container);
}

.badge-red {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.badge-blue {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.badge-gray {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
}

/* Filter Chips (DNS / Categories) */
.m3-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.m3-chip {
    padding: 6px 14px;
    border-radius: var(--md-shape-sm);
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.m3-chip:hover {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
}

.m3-chip.active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: transparent;
    font-weight: 600;
}

/* Tag (Technologies) */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--md-shape-sm);
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    font-size: 13px;
    margin: 3px;
}

/* ─── Tables ─────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    font-size: 14px;
}

th {
    color: var(--md-sys-color-outline);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }

/* ─── Opportunities & Recommendation Items ───── */
.opportunity-item {
    background: var(--md-sys-color-surface-container-low);
    border-left: 4px solid var(--md-sys-color-warning);
    border-radius: 0 var(--md-shape-md) var(--md-shape-md) 0;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.opportunity-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 2px;
}

.opportunity-savings {
    font-size: 13px;
    font-weight: 700;
    color: var(--md-sys-color-warning);
    background: var(--md-sys-color-warning-container);
    padding: 3px 8px;
    border-radius: var(--md-shape-xs);
    white-space: nowrap;
}

.pass {
    background: rgba(109, 213, 140, 0.08);
    border-left: 4px solid var(--md-sys-color-success);
    border-radius: 0 var(--md-shape-sm) var(--md-shape-sm) 0;
    padding: 10px 14px;
    margin: 6px 0;
    font-size: 13.5px;
    color: var(--md-sys-color-on-surface);
}

.issue {
    background: rgba(255, 186, 40, 0.08);
    border-left: 4px solid var(--md-sys-color-warning);
    border-radius: 0 var(--md-shape-sm) var(--md-shape-sm) 0;
    padding: 10px 14px;
    margin: 6px 0;
    font-size: 13.5px;
    color: var(--md-sys-color-on-surface);
}

/* ─── PageSpeed Strategy Switcher (Mobile vs Desktop) ─── */
.strategy-switcher {
    display: inline-flex;
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-shape-full);
    padding: 4px;
    gap: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.strategy-btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--md-shape-full);
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.strategy-btn:hover {
    color: var(--md-sys-color-on-surface);
}

.strategy-btn.active {
    background: #ffffff;
    color: var(--md-sys-color-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(60,64,67,0.18);
}

.strategy-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ─── Actionable Security Header Implementation Snippets ─── */
.security-snippet-container {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-lg);
    padding: 22px;
    margin-top: 24px;
}

.security-snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.snippet-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.snippet-tab {
    padding: 6px 14px;
    border-radius: var(--md-shape-sm);
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.snippet-tab:hover {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
}

.snippet-tab.active {
    background: var(--md-sys-color-primary);
    color: #ffffff;
    border-color: var(--md-sys-color-primary);
    font-weight: 600;
}

.snippet-pre {
    background: #1e2024;
    color: #f1f3f8;
    padding: 16px 18px;
    border-radius: var(--md-shape-sm);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
    border: 1px solid #2d3036;
}

.btn-copy-snippet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--md-shape-full);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-copy-snippet:hover {
    filter: brightness(1.08);
}

/* ─── Grid Helpers ───────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

/* ─── Landing Features (M3 Tiles) ────────────── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 32px 0 48px;
}

.feature {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-lg);
    padding: 24px;
    transition: all 0.2s ease;
    box-shadow: var(--md-elevation-1);
}

.feature:hover {
    background: var(--md-sys-color-surface-container-high);
    transform: translateY(-2px);
    box-shadow: var(--md-elevation-2);
}

.feature-icon-container {
    width: 44px;
    height: 44px;
    border-radius: var(--md-shape-md);
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 6px;
}

.feature p {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}

/* ─── Email Modal ────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-xl);
    padding: 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: var(--md-elevation-3);
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
}

.modal input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--md-shape-sm);
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    font-size: 15px;
    margin-bottom: 20px;
    outline: none;
}
.modal input:focus {
    border-color: var(--md-sys-color-primary);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-sm);
    padding: 12px 20px;
    font-size: 14px;
    box-shadow: var(--md-elevation-3);
    z-index: 2000;
    display: none;
}
.toast.show { display: block; }
.toast-success { border-left: 4px solid var(--md-sys-color-success); }
.toast-error { border-left: 4px solid var(--md-sys-color-error); }

/* Footer */
.footer {
    text-align: center;
    padding: 32px 16px;
    color: var(--md-sys-color-outline);
    font-size: 13px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin-top: 48px;
}
