/* ===== Console Clarity — Google Search Console Style ===== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gsc-blue: #1a73e8;
    --gsc-blue-hover: #1765cc;
    --gsc-blue-light: #e8f0fe;
    --gsc-bg: #f8f9fa;
    --gsc-surface: #ffffff;
    --gsc-text: #202124;
    --gsc-text-secondary: #5f6368;
    --gsc-text-muted: #80868b;
    --gsc-border: #dadce0;
    --gsc-border-light: #e8eaed;
    --gsc-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --gsc-shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
    --gsc-clicks: #4285f4;
    --gsc-impressions: #9334e6;
    --gsc-ctr: #059669;
    --gsc-position: #e37400;
    --gsc-success: #1e8e3e;
    --gsc-error: #d93025;
    --gsc-warning: #e37400;
    --gsc-skeleton: #e8eaed;
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --font-google: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
    --gsc-bg: #111317;
    --gsc-surface: #1e2028;
    --gsc-text: #e8eaed;
    --gsc-text-secondary: #9aa0a6;
    --gsc-text-muted: #6b7280;
    --gsc-border: #3c4043;
    --gsc-border-light: #2d2f36;
    --gsc-blue-light: #1c2a4a;
    --gsc-skeleton: #2c2f37;
    --gsc-shadow: 0 1px 3px rgba(0,0,0,0.5);
    --gsc-shadow-sm: 0 1px 4px rgba(0,0,0,0.6);
}

html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--gsc-bg);
    color: var(--gsc-text);
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--gsc-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--gsc-blue); color: #fff; }

/* ==================== TOP BAR ==================== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--gsc-surface);
    border-bottom: 1px solid var(--gsc-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 200;
    gap: 16px;
}
.topbar-hamburger {
    width: 40px; height: 40px;
    border: none; background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--gsc-text-secondary);
    flex-shrink: 0;
}
.topbar-hamburger:hover { background: var(--gsc-bg); }
.topbar-hamburger svg { width: 24px; height: 24px; }

.topbar-brand {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-google);
    font-size: 18px;
    color: var(--gsc-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.topbar-brand img, .topbar-brand svg { height: 24px; width: auto; }
.topbar-brand span { font-weight: 400; }
.topbar-brand b { font-weight: 500; color: var(--gsc-text); }
.topbar-brand .cc-mark { width: 28px; height: 28px; }

/* Console Clarity mark (the "Lens"): inline so it follows the theme. favicon.svg is the tile version. */
.cc-mark { --cc-lens: var(--gsc-blue); flex: none; }
[data-theme="dark"] .cc-mark { --cc-lens: #8ab4f8; }
.cc-mark .cc-lens { fill: none; stroke: var(--cc-lens); stroke-width: 5.5; stroke-linecap: round; }
.cc-mark .cc-line { fill: none; stroke: var(--gsc-text); stroke-width: 3.6; stroke-linejoin: round; stroke-linecap: round; }
.cc-mark .cc-dot { fill: var(--cc-lens); }

.topbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}
.topbar-search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--gsc-border);
    border-radius: 24px;
    background: var(--gsc-bg);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--gsc-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.topbar-search input:focus {
    border-color: var(--gsc-blue);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
    background: var(--gsc-surface);
}
.topbar-search input::placeholder { color: var(--gsc-text-muted); }
.topbar-search { position: relative; }
.topbar-search .search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; color: var(--gsc-text-secondary); pointer-events: none;
}

.topbar-actions {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.topbar-icon-btn {
    width: 40px; height: 40px;
    border: none; background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--gsc-text-secondary);
    transition: background 0.15s;
}
.topbar-icon-btn:hover { background: var(--gsc-bg); }
.topbar-icon-btn svg { width: 20px; height: 20px; }

.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gsc-blue);
    color: #fff;
    font-family: var(--font-google);
    font-size: 14px;
    font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--gsc-surface);
    border-right: 1px solid var(--gsc-border);
    overflow-y: auto;
    z-index: 100;
    padding: 8px 0;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-content { margin-left: 0; }

/* Property switcher */
.property-switcher {
    margin: 4px 12px 12px;
    padding: 8px 12px;
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    position: relative;
}
.property-switcher:hover { background: var(--gsc-bg); }
.property-icon {
    width: 24px; height: 24px;
    border-radius: 4px;
    background: var(--gsc-error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.property-switcher .prop-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gsc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.property-switcher .chevron {
    width: 18px; height: 18px;
    color: var(--gsc-text-muted);
    flex-shrink: 0;
}

/* Property dropdown */
.property-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    margin-top: 4px;
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    box-shadow: var(--gsc-shadow-sm);
    z-index: 300;
    max-height: 360px;
    overflow-y: auto;
}
.property-dropdown.open { display: block; }
.property-dropdown input {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--gsc-border-light);
    background: transparent;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--gsc-text);
    outline: none;
}
.property-dropdown-item {
    padding: 8px 12px;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gsc-text);
    transition: background 0.1s;
}
.property-dropdown-item:hover { background: var(--gsc-bg); }
.property-dropdown-item.active { background: var(--gsc-blue-light); color: var(--gsc-blue); }
.property-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.property-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.property-kind { font-size: 11px; color: var(--gsc-text-muted); }
.property-favicon { width: 20px; height: 20px; border-radius: 3px; flex-shrink: 0; background: var(--gsc-bg); }

/* Nav items */
.nav-section { padding: 4px 0; }
.nav-section-header {
    padding: 6px 24px;
    font-size: 11px;
    font-weight: 500;
    color: var(--gsc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-section-header .collapse-icon {
    width: 18px; height: 18px;
    transition: transform 0.2s;
}
.nav-section-header.collapsed .collapse-icon { transform: rotate(-90deg); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    height: 40px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gsc-text);
    border-radius: 0 24px 24px 0;
    margin-right: 12px;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.nav-item:hover { background: var(--gsc-bg); text-decoration: none; }
/* "Soon" tag on a menu item whose feature isn't switched on yet. */
.nav-soon { margin-left: auto; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; background: rgba(227,116,0,.12); color: var(--gsc-warning); }
.nav-item.active {
    background: var(--gsc-blue-light);
    color: var(--gsc-blue);
}
.nav-item svg, .nav-item .nav-icon {
    width: 20px; height: 20px;
    color: var(--gsc-text-secondary);
    flex-shrink: 0;
}
.nav-item.active svg, .nav-item.active .nav-icon { color: var(--gsc-blue); }

.nav-item-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    height: 40px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gsc-text);
    border-radius: 0 24px 24px 0;
    margin-right: 12px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.nav-item-parent:hover { background: var(--gsc-bg); }
.nav-item-parent.active { color: var(--gsc-blue); }
.nav-item-parent.active svg { color: var(--gsc-blue); }
.nav-item-parent svg {
    width: 20px; height: 20px;
    color: var(--gsc-text-secondary);
    flex-shrink: 0;
}
.nav-item-parent .nav-chevron {
    width: 16px; height: 16px;
    margin-left: auto;
    transition: transform 0.2s;
}
.nav-item-parent.expanded .nav-chevron { transform: rotate(180deg); }

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4,0,0.2,1);
}
.nav-submenu.open { max-height: 480px; }   /* 11 items at 34px; 300px cut the last few off */

/* Section heading between groups of pages, as in Search Console's own sidebar */
.nav-label {
    padding: 16px 24px 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gsc-text-muted);
    user-select: none;
}
.nav-submenu .nav-item {
    height: 34px;
    padding-left: 56px;
    font-size: 12px;
    font-weight: 400;
}

.nav-divider {
    height: 1px;
    background: var(--gsc-border-light);
    margin: 8px 0;
}
.data-card { margin-top: 24px; padding: 0 24px 20px; }
.data-card p { font-size: 14px; line-height: 1.6; color: var(--gsc-text-secondary); margin: 0 0 16px; }
.data-card .gsc-card-header { padding-left: 0; padding-right: 0; }
.nav-legal { display: flex; gap: 16px; padding: 12px 24px 20px; font-size: 12px; }
.nav-legal a { color: var(--gsc-text-muted); }
.nav-legal a:hover { color: var(--gsc-text); }

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px 32px 48px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1);
}
.main-content > * {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

.page-title {
    font-family: var(--font-google);
    font-size: 22px;
    font-weight: 400;
    color: var(--gsc-text);
    margin-bottom: 24px;
}

/* The sentence or two under a page title. Lines are capped for reading, and the left margin keeps
   the text on the same edge as the centred 1440px column the title and cards sit in. */
.main-content > .page-intro {
    color: var(--gsc-text-secondary);
    font-size: 14px;
    line-height: 1.5;
    max-width: 760px;
    margin: 0 0 24px max(0px, calc((100% - 1440px) / 2));
}
/* Sit 8px under the title, as on pages whose title shares a row with controls (.page-head) */
.main-content > .page-title + .page-intro { margin-top: -16px; }

/* ==================== GSC CARDS ==================== */
.gsc-card {
    background: var(--gsc-surface);
    border-radius: 8px;
    border: 1px solid var(--gsc-border);
    margin-bottom: 24px;
    overflow: hidden;
}
.gsc-card-header {
    padding: 20px 24px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.gsc-card-title {
    font-family: var(--font-google);
    font-size: 16px;
    font-weight: 400;
    color: var(--gsc-text);
}
.gsc-card-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--gsc-blue);
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
    cursor: pointer;
}
.gsc-card-link:hover { text-decoration: none; background: var(--gsc-blue-light); padding: 4px 8px; margin: -4px -8px; border-radius: 4px; }
.gsc-card-link svg { width: 18px; height: 18px; }
.gsc-card-body { padding: 0 24px 20px; }
.gsc-card-metric {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px;
    color: var(--gsc-text-secondary);
    margin-bottom: 12px;
}
.gsc-card-metric .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gsc-card-chart { width: 100%; height: 200px; }

/* ==================== PERFORMANCE METRIC TOGGLES ==================== */
.metric-toggles {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gsc-border-light);
}
.metric-toggle {
    flex: 1;
    padding: 16px 20px;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    border-bottom: 3px solid transparent;
    transition: background 0.15s;
    font-family: var(--font-body);
    position: relative;
}
.metric-toggle:hover { background: var(--gsc-bg); }
.metric-toggle.active { border-bottom-color: var(--metric-color); }
.metric-toggle .metric-label {
    font-size: 12px;
    color: var(--gsc-text-secondary);
    margin-bottom: 4px;
}
.metric-toggle .metric-value {
    font-family: var(--font-google);
    font-size: 28px;
    font-weight: 400;
    color: var(--metric-color);
    line-height: 1.2;
}
.metric-toggle .metric-value.inactive { color: var(--gsc-text-muted); }
.metric-toggle:not(.active) .metric-value { color: var(--gsc-text-muted); }

/* ==================== DATA TABLES (GSC style) ==================== */
.gsc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.gsc-table thead th {
    padding: 8px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--gsc-text-secondary);
    border-bottom: 1px solid var(--gsc-border);
    background: var(--gsc-surface);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.gsc-table thead th:hover { color: var(--gsc-text); }
.gsc-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gsc-border-light);
    color: var(--gsc-text);
}
.gsc-table tbody tr:hover td { background: var(--gsc-bg); }
.gsc-table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.gsc-table .col-rank { width: 36px; text-align: center; color: var(--gsc-text-muted); font-size: 12px; }
.gsc-table .col-check { width: 40px; text-align: center; }
.gsc-table tbody tr.selected td { background: var(--gsc-blue-light); }

/* ==================== TAB BAR (GSC style) ==================== */
.gsc-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gsc-border);
    padding: 0 24px;
    overflow-x: auto;
}
.gsc-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gsc-text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    font-family: var(--font-body);
    transition: color 0.15s;
}
.gsc-tab:hover { color: var(--gsc-text); }
.gsc-tab.active { color: var(--gsc-blue); border-bottom-color: var(--gsc-blue); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==================== STAT BADGES ==================== */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 500;
}
.badge-owner { background: #e6f4ea; color: var(--gsc-success); }
.badge-full { background: #e8f0fe; color: var(--gsc-blue); }
.badge-restricted { background: #fef7e0; color: var(--gsc-warning); }
.badge-ok { background: #e6f4ea; color: var(--gsc-success); }
.badge-error { background: #fce8e6; color: var(--gsc-error); }
.badge-pending { background: #fef7e0; color: var(--gsc-warning); }
.badge-index { background: #e8eaf6; color: #3f51b5; }

/* ==================== CHANGE INDICATORS ==================== */
.change-up { color: var(--gsc-success); }
.change-down { color: var(--gsc-error); }
.change-flat { color: var(--gsc-text-muted); }
.stat-change { font-size: 12px; font-weight: 500; }

/* ==================== ALERTS ==================== */
.gsc-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px;
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--gsc-text-secondary);
}
.gsc-banner-icon { color: var(--gsc-warning); margin-right: 12px; }
.gsc-banner-link { color: var(--gsc-blue); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.alert-error { background: #fce8e6; color: var(--gsc-error); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }

/* ==================== OVERVIEW GRID ==================== */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* ==================== PROPERTY URL ==================== */
.prop-url { color: var(--gsc-blue); word-break: break-all; font-weight: 500; }
.prop-url:hover { text-decoration: underline; }
.prop-kind { font-size: 12px; color: var(--gsc-text-muted); margin-top: 2px; }

/* ==================== EMPTY & LOADING ==================== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--gsc-text-muted); font-size: 14px; }
.empty-tab { padding: 24px; text-align: center; color: var(--gsc-text-muted); font-size: 13px; }
.loading-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--gsc-border);
    border-top-color: var(--gsc-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeletons: flat grey blocks in the shape of the content on its way (App.js `skeleton`).
   They sit inside the real components, so only the fill is defined here. */
.sk-wrap { pointer-events: none; user-select: none; }
.sk-wrap .gsc-table tbody tr:hover td { background: none; }
/* These two are buttons in the real UI, which do not inherit the body line height. */
.sk-wrap .metric-toggle, .sk-wrap .gsc-tab { line-height: normal; }
.sk {
    background: var(--gsc-skeleton);
    border-radius: 4px;
    animation: sk-pulse 1.6s ease-in-out infinite;
}
.sk-bar { display: inline-block; height: .8em; max-width: 100%; vertical-align: middle; }
.sk-block { display: block; width: 100%; border-radius: 8px; }
.sk-table { table-layout: fixed; }
/* In a grid (the update impact tiles) the skeleton spans it and lays its tiles out the same way */
.impact-summary > .sk-wrap { grid-column: 1 / -1; display: grid; grid-template-columns: inherit; gap: inherit; }
.sk-table .pf-spark { width: 110px; height: 30px; border-radius: 4px; }
.sk-caption { font-size: 12px; color: var(--gsc-text-muted); margin-bottom: 16px; }
.gsc-card .sk-wrap > .sk-caption { padding: 16px 24px 0; margin-bottom: 0; }
.sk-note { font-size: 12px; color: var(--gsc-text-muted); text-align: right; max-width: 60%; }
.sk-under { position: absolute; inset: 0; }
.update-icon.sk { border-radius: 50%; }
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==================== CHECKBOX ==================== */
.checkbox { width: 18px; height: 18px; accent-color: var(--gsc-blue); cursor: pointer; }

/* ==================== DATE RANGE PICKER ==================== */
.date-picker {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--gsc-border);
    border-radius: 4px;
    overflow: hidden;
    font-size: 13px;
}
.date-picker button {
    padding: 6px 14px;
    border: none;
    background: var(--gsc-surface);
    color: var(--gsc-text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-right: 1px solid var(--gsc-border);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.date-picker button:last-child { border-right: none; }
.date-picker button:hover { background: var(--gsc-bg); color: var(--gsc-text); }
.date-picker button.active { background: var(--gsc-blue-light); color: var(--gsc-blue); }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: none; border-radius: 4px;
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary { background: var(--gsc-blue); color: #fff; }
.btn-primary:hover { background: var(--gsc-blue-hover); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.btn-secondary {
    background: transparent; color: var(--gsc-blue);
    border: 1px solid var(--gsc-border);
}
.btn-secondary:hover { background: var(--gsc-blue-light); }
.btn-danger { color: var(--gsc-error); }
.btn-danger:hover { background: rgba(217,48,37,.08); }
.btn-text { background: none; color: var(--gsc-blue); padding: 8px 12px; }
.btn-text:hover { background: var(--gsc-blue-light); border-radius: 4px; }

/* ==================== SPARKLINE ==================== */
.sparkline-cell { width: 120px; }
.sparkline-canvas { width: 110px; height: 32px; }

/* ==================== URL INSPECT ==================== */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.result-item { padding: 12px 24px; border-bottom: 1px solid var(--gsc-border-light); }
.result-label { font-size: 11px; font-weight: 500; color: var(--gsc-text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.result-value { font-size: 14px; color: var(--gsc-text); word-break: break-all; }
.result-value.mono { font-family: 'Roboto Mono', monospace; font-size: 12px; }
.ref-urls { list-style: none; }
.ref-urls li { font-family: 'Roboto Mono', monospace; font-size: 12px; color: var(--gsc-blue); padding: 2px 0; word-break: break-all; }
.issue-list { list-style: none; }
.issue-item { padding: 8px 12px; margin: 4px 0; border-radius: 4px; font-size: 13px; }
.issue-error { background: #fce8e6; color: var(--gsc-error); }
.issue-warning { background: #fef7e0; color: var(--gsc-warning); }

/* ==================== CHART HEIGHT CONSTRAINTS ==================== */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap-sm { height: 160px; }
.chart-wrap-md { height: 220px; }
.chart-wrap-lg { height: 300px; }
.chart-wrap-xl { height: 380px; }
.chart-wrap canvas { position: absolute; inset: 0; }
.gsc-card-chart { height: 160px !important; }
.mini-chart canvas { height: 80px !important; }

/* ==================== GRIDS ==================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.mini-chart canvas { height: 100px; width: 100%; }
.sitemap-url { font-family: 'Roboto Mono', monospace; font-size: 12px; word-break: break-all; color: var(--gsc-blue); }
.sitemap-meta { font-size: 12px; color: var(--gsc-text-muted); }

/* ==================== DARK MODE TOGGLE ==================== */
.theme-toggle { color: var(--gsc-text-secondary); }

/* ==================== LOGIN ==================== */
.login-wrapper {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 24px;
    background: var(--gsc-bg);
}
.login-card {
    background: var(--gsc-surface);
    border-radius: 8px;
    border: 1px solid var(--gsc-border);
    padding: 48px 44px;
    text-align: center;
    max-width: 440px; width: 100%;
    box-shadow: var(--gsc-shadow);
}
.login-card h1 { font-family: var(--font-google); font-size: 24px; font-weight: 400; margin-bottom: 4px; }
.login-card .subtitle { color: var(--gsc-text-secondary); margin-bottom: 28px; font-size: 14px; line-height: 1.6; }
.login-card .logo-mark {
    width: 48px; height: 48px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
}
.login-card .logo-mark img, .login-card .logo-mark svg { width: 48px; height: 48px; }
.btn-google {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 24px;
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 14px; font-weight: 500;
    color: var(--gsc-text);
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s;
}
.btn-google:hover { box-shadow: var(--gsc-shadow); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
.login-card .features { text-align: left; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gsc-border-light); }
.login-card .feature-item { display: flex; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--gsc-text-secondary); }
.login-card .feature-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--gsc-blue); }

/* ==================== RESPONSIVE ==================== */
/* The phone and tablet layout lives in the MOBILE section at the end of this file, so it
   can override component rules defined further down. */

/* ==================== GOOGLE UPDATES ==================== */
.update-list { list-style: none; }
.update-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--gsc-border-light);
    transition: background 0.15s;
    cursor: pointer;
}
.update-item:last-child { border-bottom: none; }
.update-item:hover { background: var(--gsc-bg); }

.update-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 2px;
}
.update-icon.core { background: #e8f0fe; color: #1a73e8; }
.update-icon.spam { background: #fce8e6; color: #d93025; }
.update-icon.discover { background: #e6f4ea; color: #1e8e3e; }
.update-icon.other { background: #f1f3f4; color: #5f6368; }
.update-icon.reviews { background: #fef7e0; color: #e37400; }
.update-icon.helpful-content { background: #e8f0fe; color: #1a73e8; }
.update-icon.link { background: #f3e8fd; color: #9334e6; }

.update-info { flex: 1; min-width: 0; }
.update-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gsc-text);
    margin-bottom: 2px;
}
.update-dates {
    font-size: 12px;
    color: var(--gsc-text-muted);
}
.update-badge-ongoing {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #fef7e0;
    color: #e37400;
    margin-left: 6px;
}

.update-impact {
    text-align: right;
    flex-shrink: 0;
    min-width: 100px;
}
.update-impact-value {
    font-family: var(--font-google);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
}
.update-impact-label {
    font-size: 11px;
    color: var(--gsc-text-muted);
}
.impact-negative .update-impact-value { color: #d93025; }
.impact-positive .update-impact-value { color: #1e8e3e; }
.impact-neutral .update-impact-value { color: var(--gsc-text-muted); }

.update-impact-loading {
    color: var(--gsc-text-muted);
    font-size: 12px;
    text-align: right;
}

/* Update detail page */
.update-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.update-header-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.update-header-info { flex: 1; }
.update-header-info h1 {
    font-family: var(--font-google);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 4px;
}
.update-header-info .update-meta {
    font-size: 13px;
    color: var(--gsc-text-secondary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.update-header-info .update-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.update-description {
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--gsc-text);
}
#descInner {
    transition: max-height 0.35s ease;
    position: relative;
}
#descInner.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--gsc-surface));
    pointer-events: none;
}
.desc-toggle {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-top: 1px solid var(--gsc-border-light);
    background: transparent;
    color: var(--gsc-blue);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}
.desc-toggle:hover { background: var(--gsc-bg); }
.update-description h3 {
    font-family: var(--font-google);
    font-size: 14px;
    font-weight: 500;
    color: var(--gsc-text-secondary);
    margin-bottom: 6px;
    margin-top: 16px;
}
.update-description h3:first-child { margin-top: 0; }
.update-description ul {
    margin: 6px 0 0 20px;
    font-size: 13px;
}
.update-description li { margin-bottom: 4px; }
.update-description .expert-quote {
    border-left: 3px solid var(--gsc-blue);
    padding: 8px 16px;
    margin: 12px 0;
    font-style: italic;
    color: var(--gsc-text-secondary);
    font-size: 13px;
}
.update-description .expert-name {
    font-style: normal;
    font-weight: 500;
    color: var(--gsc-text);
}

.impact-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.impact-stat {
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
}
.impact-stat-label { font-size: 11px; color: var(--gsc-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.impact-stat-value { font-family: var(--font-google); font-size: 24px; font-weight: 400; }
.impact-stat-sub { font-size: 12px; color: var(--gsc-text-muted); margin-top: 2px; }

.change-table .gained { color: #1e8e3e; }
.change-table .lost { color: #d93025; }
.change-table .bar {
    height: 6px;
    border-radius: 3px;
    display: inline-block;
    min-width: 4px;
    vertical-align: middle;
    margin-left: 6px;
}
.change-table .bar-gained { background: #1e8e3e; }
.change-table .bar-lost { background: #d93025; }

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

/* Overview ongoing badge */
.ongoing-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #fef7e0;
    color: #e37400;
    margin-top: 6px;
}
.ongoing-badge .pulse-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #e37400;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== SPEED / CORE WEB VITALS ==================== */
.score-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-google);
    font-size: 28px; font-weight: 500;
    margin: 0 auto 8px;
    border: 4px solid;
}
.score-good { border-color: #0cce6b; color: #0cce6b; }
.score-average { border-color: #ffa400; color: #ffa400; }
.score-poor { border-color: #ff4e42; color: #ff4e42; }

.cwv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.cwv-item {
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.cwv-label { font-size: 11px; color: var(--gsc-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.cwv-value { font-family: var(--font-google); font-size: 24px; font-weight: 400; }
.cwv-rating { font-size: 11px; font-weight: 500; margin-top: 4px; }
.cwv-good { color: #0cce6b; }
.cwv-needs-improvement { color: #ffa400; }
.cwv-poor { color: #ff4e42; }

.audit-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gsc-border-light);
    font-size: 13px;
}
.audit-item:last-child { border-bottom: none; }
.audit-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.audit-pass { color: #0cce6b; }
.audit-fail { color: #ff4e42; }
.audit-warn { color: #ffa400; }
.audit-info { color: var(--gsc-text-muted); }
.audit-savings { font-size: 11px; color: var(--gsc-text-muted); margin-top: 2px; }

/* ==================== INSIGHTS PAGE ==================== */
.insight-card {
    background: var(--gsc-surface);
    border: 1px solid var(--gsc-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.insight-priority {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
    flex-shrink: 0;
}
.insight-high { background: #fce8e6; color: #d93025; }
.insight-medium { background: #fef7e0; color: #e37400; }
.insight-low { background: #e6f4ea; color: #1e8e3e; }
.insight-content { flex: 1; min-width: 0; }
.insight-title { font-size: 14px; font-weight: 500; color: var(--gsc-text); margin-bottom: 2px; }
.insight-desc { font-size: 12px; color: var(--gsc-text-secondary); line-height: 1.5; }
.insight-meta { font-size: 11px; color: var(--gsc-text-muted); margin-top: 4px; }

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

/* ==================== ANNOTATION MODAL ==================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--gsc-surface);
    border-radius: 12px;
    border: 1px solid var(--gsc-border);
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    width: 100%; max-width: 460px;
    padding: 24px;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal h3 { font-family: var(--font-google); font-size: 18px; font-weight: 400; margin-bottom: 16px; }
.modal label { display: block; font-size: 12px; font-weight: 500; color: var(--gsc-text-secondary); margin-bottom: 4px; margin-top: 12px; }
.modal input, .modal textarea, .modal select {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--gsc-border); border-radius: 4px;
    background: var(--gsc-surface); font-family: var(--font-body);
    font-size: 13px; color: var(--gsc-text); outline: none;
}
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--gsc-blue); }
.modal textarea { resize: vertical; min-height: 60px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.color-options { display: flex; gap: 6px; margin-top: 6px; }
.color-dot {
    width: 24px; height: 24px; border-radius: 50%;
    cursor: pointer; border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.selected { border-color: var(--gsc-text); }

/* Annotation list items */
.annotation-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gsc-border-light);
    font-size: 13px;
}
.annotation-item:last-child { border-bottom: none; }
.annotation-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.annotation-item .ann-title { font-weight: 500; color: var(--gsc-text); }
.annotation-item .ann-date { font-size: 11px; color: var(--gsc-text-muted); }
.annotation-item .ann-desc { font-size: 12px; color: var(--gsc-text-secondary); margin-top: 2px; }
.annotation-delete {
    margin-left: auto; padding: 2px 6px;
    background: none; border: none; color: var(--gsc-text-muted);
    cursor: pointer; font-size: 14px; border-radius: 4px;
    flex-shrink: 0;
}
.annotation-delete:hover { background: var(--gsc-error); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gsc-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gsc-text-muted); }

/* ==================== PORTFOLIO OVERVIEW ==================== */
.pf-meta { font-size: 12px; color: var(--gsc-text-muted); margin-bottom: 16px; }

.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.pf-stat { background: var(--gsc-surface); border: 1px solid var(--gsc-border-light); border-radius: 8px; padding: 16px 20px; box-shadow: var(--gsc-shadow); }
.pf-stat-label { font-size: 11px; color: var(--gsc-text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.pf-stat-value { font-family: var(--font-google); font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pf-stat-sub { margin-top: 6px; font-size: 12px; color: var(--gsc-text-muted); }

/* Country names with flags, devices with icons (App.js countryHtml / deviceHtml) */
.cc-country, .cc-device { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; vertical-align: middle; }
.cc-flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); background: var(--gsc-bg); }
.cc-flag-none { background: var(--gsc-bg); box-shadow: 0 0 0 1px var(--gsc-border-light); }
[data-theme="dark"] .cc-flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.cc-device svg { width: 18px; height: 18px; fill: var(--gsc-text-secondary); flex-shrink: 0; }
.pf-stat-value .cc-flag { width: 28px; height: 21px; }

.pf-scroll { overflow-x: auto; }
.pf-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.pf-matrix thead th { text-align: center; font-size: 11px; font-weight: 500; color: var(--gsc-text-secondary); padding: 10px 12px; border-bottom: 1px solid var(--gsc-border); white-space: nowrap; }
.pf-matrix thead th.pf-site-col, .pf-matrix tbody td.pf-site-col { text-align: left; position: sticky; left: 0; background: var(--gsc-surface); z-index: 1; }
.pf-matrix tbody td { padding: 9px 12px; border-bottom: 1px solid var(--gsc-border-light); text-align: center; font-variant-numeric: tabular-nums; }
.pf-matrix tbody tr:hover td { background: var(--gsc-bg); }
.pf-matrix tbody tr:hover td.pf-site-col { background: var(--gsc-bg); }
.pf-update-head { display: block; font-weight: 500; color: var(--gsc-text); }
.pf-update-date { display: block; font-size: 10px; color: var(--gsc-text-muted); margin-top: 2px; }

.pf-chip { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; text-decoration: none; }
a.pf-chip:hover { text-decoration: none; filter: brightness(0.94); }
.pf-hit { background: rgba(217,48,37,.13); color: #d93025; }
.pf-ctrshift { background: rgba(227,116,0,.15); color: #e37400; }
.pf-gain { background: rgba(30,142,62,.13); color: #1e8e3e; }
.pf-flat { color: var(--gsc-text-secondary); }
.pf-na { color: var(--gsc-text-muted); }

.pf-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--gsc-text-secondary); padding: 14px 24px 20px; }
.pf-legend span.pf-chip { margin-right: 6px; }

.pf-spark { width: 110px; height: 30px; position: relative; }
.pf-spark canvas { width: 110px !important; height: 30px !important; }
.pf-name { display: flex; align-items: center; gap: 8px; }
.pf-name img { border-radius: 2px; flex-shrink: 0; }
.pf-sortable { cursor: pointer; user-select: none; }
.pf-sortable:hover { color: var(--gsc-text); }
.pf-note { font-size: 12px; color: var(--gsc-text-muted); padding: 0 24px 18px; line-height: 1.6; }

/* Portfolio: metric toggle, event legend, freshness markers */
.pf-toggle { display: inline-flex; border: 1px solid var(--gsc-border); border-radius: 6px; overflow: hidden; }
.pf-toggle-btn { background: var(--gsc-surface); color: var(--gsc-text-secondary); border: 0; border-right: 1px solid var(--gsc-border); padding: 5px 12px; font-size: 12px; font-family: inherit; cursor: pointer; }
.pf-toggle-btn:last-child { border-right: 0; }
.pf-toggle-btn:hover { background: var(--gsc-bg); color: var(--gsc-text); }
.pf-toggle-btn.active { background: var(--gsc-blue); color: #fff; }

.pf-events { display: flex; flex-direction: column; gap: 8px; padding: 0 24px 18px; }
.pf-events-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-events-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gsc-text-muted); }
.pf-event { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gsc-text-secondary); cursor: default; }
.pf-swatch { width: 18px; height: 8px; border-radius: 2px; display: inline-block; }
.pf-marker { width: 8px; height: 8px; transform: rotate(45deg); display: inline-block; }

.pf-lag { color: var(--gsc-warning); font-size: 12px; cursor: help; }
.pf-ctr-mark { font-style: normal; margin-left: 3px; opacity: .75; }

/* Portfolio: recovery bars, brand split, health, depth selector */
.pf-bar { position: relative; height: 18px; background: var(--gsc-border-light); border-radius: 9px; overflow: hidden; min-width: 120px; }
.pf-bar-fill { height: 100%; border-radius: 9px; transition: width .2s; }
.pf-bar-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--gsc-text); }

.pf-split { height: 12px; background: var(--gsc-border); border-radius: 6px; overflow: hidden; min-width: 120px; }
.pf-split-branded { height: 100%; background: var(--gsc-blue); }

.pf-brand-term { cursor: pointer; border-bottom: 1px dashed var(--gsc-border); font-size: 12px; }
.pf-brand-term:hover { color: var(--gsc-blue); border-bottom-color: var(--gsc-blue); }

.pf-depth { background: var(--gsc-surface); color: var(--gsc-text); border: 1px solid var(--gsc-border); border-radius: 4px; padding: 3px 6px; font-size: 12px; font-family: inherit; }

/* Sign-in page: shown when an expired grant sent the user back */
.login-notice { text-align: left; font-size: 13px; line-height: 1.55; color: var(--gsc-text); background: rgba(227,116,0,.10); border: 1px solid rgba(227,116,0,.35); border-radius: 8px; padding: 12px 14px; margin: -12px 0 20px; }
.login-notice strong { display: block; margin-bottom: 2px; color: var(--gsc-warning); }
.pf-auto { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--gsc-text-muted); border: 1px solid var(--gsc-border); border-radius: 3px; padding: 0 4px; }
.pi-page { font-size: 10px; font-weight: 600; color: var(--gsc-text-muted); border: 1px solid var(--gsc-border); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.pi-page-1 { color: var(--gsc-success); border-color: rgba(30,142,62,.4); }

/* Properties table: one line per cell, change beside its value */
.pf-props th, .pf-props td { padding-left: 10px; padding-right: 10px; }
.pf-props td { white-space: nowrap; padding-top: 11px; padding-bottom: 11px; }
.pf-props .pf-row { cursor: pointer; }
.pf-delta { display: inline-block; min-width: 44px; text-align: right; font-size: 11px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.pf-d-up { color: var(--gsc-success); }
.pf-d-down { color: var(--gsc-error); }
.pf-d-flat { color: var(--gsc-text-muted); }
.pf-hit-text { color: var(--gsc-error); }
.pf-ctrshift-text { color: var(--gsc-warning); }
.pf-gain-text { color: var(--gsc-success); }
.pf-flat-text { color: var(--gsc-text-secondary); }
.pf-latest { font-size: 12px; }
.pf-latest strong { font-weight: 600; }
.pf-health { font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-trend-col { width: 120px; }

.pf-props td.pf-error-cell { white-space: normal; color: var(--gsc-text-muted); font-size: 12px; }

/* Explanations: an (i) on the card title opens the method as an inset panel */
.pf-info { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 8px; vertical-align: 2px; border-radius: 50%; border: 1px solid var(--gsc-border); background: transparent; color: var(--gsc-text-muted); font: italic 600 11px/1 Georgia, 'Times New Roman', serif; cursor: pointer; padding: 0; }
.pf-info:hover, .pf-info[aria-expanded="true"] { color: var(--gsc-blue); border-color: var(--gsc-blue); background: var(--gsc-blue-light); }
.pf-info:focus-visible { outline: 2px solid var(--gsc-blue); outline-offset: 2px; }
.pf-explain { margin: 0 24px 14px; padding: 10px 14px; background: var(--gsc-bg); border-left: 3px solid var(--gsc-blue); border-radius: 6px; font-size: 13px; line-height: 1.55; color: var(--gsc-text-secondary); max-width: 860px; }
.pf-explain[hidden] { display: none; }
.pf-explain p { margin: 0; }
.pf-explain p + p { margin-top: 8px; }

/* Update rows open per-property detail - make that obvious, not just a faint hover */
.update-item[onclick] { position: relative; padding-right: 48px; }
.update-item[onclick]::after { content: "\203A"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 22px; line-height: 1; color: var(--gsc-text-muted); transition: color .15s, transform .15s; }
.update-item[onclick]:hover::after { color: var(--gsc-blue); transform: translate(3px, -50%); }
.update-item[onclick]:hover .update-title { color: var(--gsc-blue); }
.update-item[onclick] .update-info::after { content: "See its impact on this property & recovery advice \2192"; display: block; height: 0; overflow: hidden; margin-top: 0; font-size: 12px; color: var(--gsc-blue); transition: height .15s, margin-top .15s; }
.update-item[onclick]:hover .update-info::after { height: 1.5em; margin-top: 4px; }
.update-list-hint { font-size: 12px; color: var(--gsc-text-muted); margin-top: 2px; }

/* Needs attention */
.pf-attn-row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; padding: 12px 24px; border-top: 1px solid var(--gsc-border-light); }
.pf-attn-issue { display: flex; align-items: center; gap: 8px; color: var(--gsc-text); font-size: 13px; line-height: 1.5; padding: 2px 0; text-decoration: none; }
.pf-attn-issue + .pf-attn-issue { margin-top: 4px; }
.pf-attn-issue:hover { color: var(--gsc-blue); text-decoration: none; }
.pf-attn-go { margin-left: auto; color: var(--gsc-text-muted); font-size: 18px; line-height: 1; }
.pf-attn-issue:hover .pf-attn-go { color: var(--gsc-blue); }
.pf-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pf-dot-bad { background: var(--gsc-error); }
.pf-dot-warn { background: var(--gsc-warning); }
.pf-footnote { padding: 10px 24px 0; font-size: 12px; color: var(--gsc-text-muted); }
.pf-brand-cell .pf-brand-term { cursor: pointer; border-bottom: none; font-size: inherit; }
.pf-brand-cell .pf-brand-term:hover { color: var(--gsc-blue); }

/* Evidence */
.pf-conf-weak { opacity: .5; outline: 1px dashed currentColor; outline-offset: -1px; }
.pf-conf-medium { opacity: .8; }
.update-conf { font-weight: 600; }
.update-conf-high { color: var(--gsc-text); }
.update-conf-low, .update-conf-unverified { color: var(--gsc-text-muted); }
.ev-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; }
.ev-badge-high { background: rgba(30,142,62,.13); color: var(--gsc-success); }
.ev-badge-medium { background: rgba(227,116,0,.14); color: var(--gsc-warning); }
.ev-badge-low, .ev-badge-unverified { background: var(--gsc-bg); color: var(--gsc-text-muted); }
.ev-summary { padding: 0 24px 14px; font-size: 14px; color: var(--gsc-text-secondary); max-width: 900px; }
.ev-none { padding-bottom: 20px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; padding: 0 24px 20px; }
.ev-check { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--gsc-border-light); border-radius: 8px; }
.ev-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.ev-pass .ev-icon { background: rgba(30,142,62,.13); color: var(--gsc-success); }
.ev-fail .ev-icon { background: rgba(217,48,37,.12); color: var(--gsc-error); }
.ev-na .ev-icon { background: var(--gsc-bg); color: var(--gsc-text-muted); }
.ev-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gsc-text-muted); }
.ev-headline { font-size: 15px; font-weight: 500; margin: 2px 0 4px; color: var(--gsc-text); }
.ev-na .ev-headline { color: var(--gsc-text-muted); }
.ev-detail { font-size: 12px; color: var(--gsc-text-secondary); line-height: 1.5; }

/* Query coverage */
.pi-coverage { margin: -4px 24px 12px; font-size: 12px; color: var(--gsc-text-muted); cursor: help; }
.pi-coverage-low { color: var(--gsc-warning); }

/* Since your last visit */
.pf-since-card .pf-since-item { padding: 6px 24px; }
.pf-since-card .pf-since-item:last-of-type { padding-bottom: 16px; }
.pf-since-quiet { font-size: 13px; color: var(--gsc-text-muted); margin: -4px 0 16px; }
.pf-dot-good { background: var(--gsc-success); }
.pf-dot-info { background: var(--gsc-blue); }

/* Query shift */
.qs-table .qs-family td { background: var(--gsc-bg); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gsc-text-muted); padding-top: 8px; padding-bottom: 8px; }
.qs-table .qs-name { padding-left: 24px; }
.qs-stats { display: flex; gap: 40px; padding: 0 24px 12px; flex-wrap: wrap; }
.qs-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gsc-text-muted); }
.qs-stat-value { font-size: 20px; font-family: var(--font-google); margin-top: 2px; }
.qs-stat-sub { font-size: 12px; color: var(--gsc-text-muted); }
.qs-reading { margin: 0 24px 8px; padding: 10px 14px; background: var(--gsc-bg); border-radius: 6px; font-size: 13px; color: var(--gsc-text-secondary); max-width: 900px; }

/* AI exposure import */
.ai-import { padding: 0 24px 16px; font-size: 13px; color: var(--gsc-text-secondary); }
.ai-import p { margin: 0 0 12px; max-width: 900px; line-height: 1.55; }
.ai-drop { display: flex; align-items: center; justify-content: center; height: 72px; border: 2px dashed var(--gsc-border); border-radius: 8px; cursor: pointer; color: var(--gsc-text-muted); }
.ai-drop:hover, .ai-drop-over { border-color: var(--gsc-blue); color: var(--gsc-blue); background: var(--gsc-blue-light); }
.ai-summary { margin: 14px 0 8px; font-size: 13px; color: var(--gsc-text); }

/* Measured changes */
.ann-effect { font-size: 12px; margin-top: 4px; line-height: 1.5; }
.ann-effect:empty { display: none; }
.ann-confound { color: var(--gsc-warning); margin-top: 2px; cursor: help; }

/* Export */
.gsc-card-header { gap: 12px; }
.pf-export { margin-left: auto; flex-shrink: 0; font: 600 11px/1 var(--font-body); letter-spacing: .04em; padding: 5px 9px; border-radius: 4px; border: 1px solid var(--gsc-border); background: var(--gsc-surface); color: var(--gsc-text-secondary); cursor: pointer; }
.gsc-card-header > span + .pf-export, .gsc-card-header > a + .pf-export { margin-left: 0; }
.pf-export:hover { color: var(--gsc-blue); border-color: var(--gsc-blue); }
.pf-pack-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.pf-pack-bar:empty { display: none; }

/* Research pack sits at the right of the update heading */
.update-header .pf-pack-bar { margin: 0 0 0 auto; align-self: center; }

/* Grids for the keyword summary, PageSpeed scores and screenshot pair */
.kw-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Search intent on Keywords (Intent.js): filter chips above the table, a tag per keyword */
.kw-intent-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 4px; font-size: 13px; }
.kw-intent-label { color: var(--gsc-text-secondary); margin-right: 4px; }
.kw-intent-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--gsc-border); border-radius: 14px; background: var(--gsc-surface); color: var(--gsc-text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
.kw-intent-chip b { font-weight: 500; color: var(--gsc-text); }
.kw-intent-chip:hover { border-color: var(--gsc-text-muted); }
.kw-intent-chip.active { background: var(--gsc-blue-light); border-color: var(--gsc-blue); color: var(--gsc-blue); }
.kw-intent-by { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--gsc-text-secondary); }
.kw-intent-note { padding: 4px 16px 0; font-size: 12px; color: var(--gsc-text-muted); }
.kw-intent-dot { width: 8px; height: 8px; border-radius: 50%; }
.kw-intent { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.kw-intent-dot.kw-intent-informational { background: #1a73e8; }
.kw-intent-dot.kw-intent-commercial { background: #e8710a; }
.kw-intent-dot.kw-intent-transactional { background: #188038; }
.kw-intent-dot.kw-intent-navigational { background: #9334e6; }
span.kw-intent.kw-intent-informational { background: rgba(26, 115, 232, 0.12); color: #1a73e8; }
span.kw-intent.kw-intent-commercial { background: rgba(232, 113, 10, 0.14); color: #b45309; }
span.kw-intent.kw-intent-transactional { background: rgba(24, 128, 56, 0.12); color: #188038; }
span.kw-intent.kw-intent-navigational { background: rgba(147, 52, 230, 0.12); color: #9334e6; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.shot-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }

/* ==================== MOBILE ==================== */
/* Below 900px the sidebar becomes an off-canvas drawer (App.js toggleSidebar); below 640px
   the content tightens up for phones. Coarse pointers get 44px touch targets at any width. */

html { -webkit-text-size-adjust: 100%; }
a, button, .nav-item, .nav-item-parent, .property-switcher, .property-dropdown-item,
.pf-row, .update-item, .gsc-tab, .metric-toggle, .date-picker button { -webkit-tap-highlight-color: transparent; }

.sidebar-scrim { display: none; }
.topbar-search-btn { display: none; }

/* Tables scroll inside their card rather than pushing the page sideways (App.js wraps any
   table that is not already in a scroller). */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* A title tooltip opened by tapping, since touch screens have no hover. */
.tap-tip {
    position: absolute; z-index: 400;
    max-width: min(320px, calc(100vw - 24px));
    padding: 8px 12px; border-radius: 4px;
    background: #3c4043; color: #fff;
    font-size: 12px; line-height: 1.5; white-space: pre-line;
    box-shadow: var(--gsc-shadow-sm);
    animation: fadeIn .12s ease-out;
}
[data-theme="dark"] .tap-tip { background: #e8eaed; color: #202124; }

@media (max-width: 900px) {
    .main-content { margin-left: 0; }
    .sidebar-collapsed .main-content { margin-left: 0; }

    .sidebar {
        transform: translateX(-100%);
        width: min(var(--sidebar-width), 85vw);
        z-index: 190;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        visibility: hidden;
        transition: transform .25s cubic-bezier(0.4,0,0.2,1), visibility 0s linear .25s;
    }
    .sidebar-open .sidebar {
        transform: none;
        visibility: visible;
        box-shadow: var(--gsc-shadow-sm);
        transition: transform .25s cubic-bezier(0.4,0,0.2,1), visibility 0s;
    }
    .sidebar-open .sidebar-scrim {
        display: block;
        position: fixed; left: 0; right: 0; bottom: 0; top: var(--topbar-height);
        background: rgba(32,33,36,.45);
        z-index: 180;
        animation: fadeIn .2s ease-out;
    }
    body.sidebar-open { overflow: hidden; }

    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: 1fr; }

    /* Wide tables keep their row label in view while the figures scroll */
    .table-scroll > .gsc-table td:first-child:not(.col-rank):not(.col-check),
    .table-scroll > .gsc-table th:first-child:not(.col-rank):not(.col-check),
    .pf-scroll > .gsc-table td:first-child, .pf-scroll > .gsc-table th:first-child {
        position: sticky; left: 0; z-index: 1;
        background: var(--gsc-surface);
    }
    .table-scroll > .gsc-table tbody tr:hover td:first-child,
    .pf-scroll > .gsc-table tbody tr:hover td:first-child { background: var(--gsc-bg); }
    .table-scroll > .gsc-table tbody tr.selected td:first-child { background: var(--gsc-blue-light); }
}

@media (max-width: 760px) {
    .topbar {
        gap: 4px;
        padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    }
    .topbar-brand { font-size: 17px; min-width: 0; overflow: hidden; }
    .topbar-search-btn { display: flex; }
    .topbar-actions { margin-left: auto; }
    .topbar-search { display: none; }
    .search-open .topbar-search {
        display: block;
        position: absolute; top: 100%; left: 0; right: 0;
        max-width: none; margin: 0;
        padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
        background: var(--gsc-surface);
        border-bottom: 1px solid var(--gsc-border);
        box-shadow: var(--gsc-shadow);
    }
    .search-open .topbar-search .search-icon { left: calc(max(12px, env(safe-area-inset-left)) + 14px); }
    .search-open .topbar-search-btn { background: var(--gsc-blue-light); color: var(--gsc-blue); }
}

@media (max-width: 640px) {
    .main-content {
        padding: 16px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }
    .page-title { font-size: 20px; margin-bottom: 16px; }
    .main-content > .page-intro { font-size: 13px; margin-bottom: 16px; }
    .main-content > .page-title + .page-intro { margin-top: -8px; }

    /* A page heading with a date picker beside it: the picker takes its own row */
    .page-head { flex-wrap: wrap; gap: 12px; margin-bottom: 16px !important; }
    .page-head > .page-title { margin-bottom: 0; }
    .page-head > div:last-child { max-width: 100%; }
    .date-picker { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .date-picker::-webkit-scrollbar { display: none; }
    .date-picker button { flex: 1 0 auto; padding: 6px 12px; }

    .gsc-card { margin-bottom: 16px; }
    .gsc-card-header { padding: 16px 16px 10px; flex-wrap: wrap; }
    .gsc-card-body { padding: 0 16px 16px; }
    .gsc-tabs { padding: 0 8px; scrollbar-width: none; }
    .gsc-tabs::-webkit-scrollbar { display: none; }
    .gsc-tab { flex-shrink: 0; padding: 12px; }
    .gsc-table thead th { padding: 8px 10px; }
    .gsc-table tbody td { padding: 10px; }

    /* Stat tiles and metric toggles two-up */
    .pf-stats { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
    .pf-stat { padding: 12px 14px; min-width: 0; }
    .pf-stat-value { font-size: 22px; }
    .pf-stat-sub { overflow-wrap: anywhere; }
    .metric-toggles { flex-wrap: wrap; }
    .metric-toggle { flex: 1 1 50%; min-width: 50%; padding: 12px 16px; }
    .metric-toggle .metric-value { font-size: 24px; }
    .impact-summary { grid-template-columns: 1fr 1fr; gap: 12px; }
    .impact-stat { padding: 12px; min-width: 0; }
    .impact-stat-value { font-size: 20px; }
    .cwv-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Charts: shorter, so a chart and what it explains fit on one screen */
    .chart-wrap { max-height: 240px; }

    /* Dashboard */
    .pf-toggle { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .pf-toggle::-webkit-scrollbar { display: none; }
    .pf-toggle-btn { flex-shrink: 0; white-space: nowrap; }
    .pf-events, .pf-note, .pf-legend { padding-left: 16px; padding-right: 16px; }
    .pf-attn-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 16px; }
    .pf-meta { overflow-wrap: anywhere; }

    /* Update lists and the update detail heading */
    .update-item { padding: 12px 16px; gap: 10px; }
    .update-impact { min-width: 76px; }
    .update-header { flex-wrap: wrap; }
    .update-header .pf-pack-bar { margin: 0; flex-basis: 100%; justify-content: flex-start; }
    .update-header-info h1 { font-size: 20px; overflow-wrap: anywhere; }
    .update-header-info .update-meta { flex-wrap: wrap; gap: 4px 16px; }
    .qs-stats { gap: 16px 24px; padding: 0 16px 12px; }
    .qs-reading { margin: 0 16px 8px; }

    .modal { width: calc(100vw - 32px); max-width: none; padding: 20px; }
}

/* Touch: 44px targets, and inputs at 16px so iOS does not zoom the page on focus */
@media (pointer: coarse) {
    .topbar-hamburger, .topbar-icon-btn { width: 44px; height: 44px; }
    .nav-item, .nav-item-parent, .nav-submenu .nav-item { height: 44px; }
    .nav-submenu.open { max-height: 600px; }
    .property-switcher { min-height: 44px; }
    .property-dropdown-item { min-height: 44px; }
    .property-dropdown input { height: 44px; }
    .date-picker button, .pf-toggle-btn, .btn, .gsc-tab, .pf-export { min-height: 44px; }
    .pf-export { min-width: 44px; }
    .annotation-delete { min-width: 44px; min-height: 44px; }
    .pf-info, .pf-chip { position: relative; }
    .pf-chip::after { content: ''; position: absolute; inset: -10px -4px; }
    .pf-info::after { content: ''; position: absolute; inset: -13px; }
    .checkbox { width: 22px; height: 22px; }

    input[type="text"], input[type="url"], input[type="search"], input[type="email"], input:not([type]),
    select, textarea { font-size: 16px !important; }
}

@media (max-width: 640px) {
    /* The CSV button stays top-right instead of wrapping onto a line of its own */
    .gsc-card-header { position: relative; }
    .gsc-card-header:has(> .pf-export) { padding-right: 72px; }
    .gsc-card-header > .pf-export { position: absolute; top: 12px; right: 12px; margin: 0; }
    .pf-props .pf-name > span { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .update-header-info { min-width: 0; }
}

@media (max-width: 640px) {
    /* Performance filter: the operator and value share a row, the buttons take the next */
    .perf-filter { flex-wrap: wrap; padding: 8px 12px !important; }
    .perf-filter select { flex: 0 0 auto; }
    .perf-filter input { flex: 1 1 140px !important; min-width: 0; }
    .perf-filter .btn { flex: 0 0 auto; justify-content: center; min-width: 72px; }

    /* Text columns keep a readable width and the table scrolls, rather than squeezing a
       query down to a word per line */
    .table-scroll > .gsc-table td:not(.col-num):not(.col-rank):not(.col-check) { min-width: 9.5em; }
}

@media (max-width: 640px) {
    .kw-stats-grid { grid-template-columns: 1fr 1fr; }
    .kw-stats-grid > .gsc-card { margin-bottom: 0; padding: 12px 14px !important; min-width: 0; }
    .score-grid { gap: 8px; margin-bottom: 16px; }
    .score-grid > .gsc-card { padding: 12px 4px !important; margin-bottom: 0; }
    .shot-grid { grid-template-columns: 1fr; }
}

/* Opportunities > Cannibalisation: pages competing by meaning (Overlap.js) */
.ov-progress, .ov-start { display: flex; align-items: center; gap: 14px; padding: 20px 24px; font-size: 13px; color: var(--gsc-text-secondary); }
.ov-progress .loading-spinner { margin: 0; flex-shrink: 0; }
.ov-pair { padding: 14px 24px; border-bottom: 1px solid var(--gsc-border-light); }
.ov-pages { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.ov-pages .pi-url { font-weight: 500; word-break: break-all; }
.ov-vs { color: var(--gsc-text-muted); }
.ov-meta { margin-left: auto; font-size: 12px; color: var(--gsc-text-muted); }
