/* =====================================================================
   SEMapper UI — Enterprise Clay-Glassmorphism Design System
   Shared by .app (workspace) and .admin (control plane)
   Burnt Terracotta #D94E28 · Deep Slate #0F172A · Canvas #F3F6FC
   ===================================================================== */

:root {
    --canvas: #F3F6FC;
    --surface: rgba(255, 255, 255, 0.74);
    --surface-solid: #FFFFFF;
    --surface-sunken: rgba(226, 232, 240, 0.5);

    --slate-950: #0B1120;
    --slate-900: #0F172A;
    --slate-800: #1E293B;
    --slate-700: #334155;
    --ink: #0F172A;
    --ink-2: #334155;
    --muted: #475569;
    --soft: #64748B;
    --faint: #94A3B8;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.14);

    --terra: #D94E28;
    --terra-hi: #FF6B3D;
    --terra-deep: #B83D1C;
    --terra-tint: rgba(217, 78, 40, 0.09);
    --terra-ring: rgba(217, 78, 40, 0.18);

    --sky: #0284C7;
    --emerald: #059669;
    --amber: #D97706;
    --crimson: #E11D48;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --r-xl: 22px;
    --r-lg: 18px;
    --r-md: 13px;
    --r-sm: 10px;

    --glass-blur: blur(22px) saturate(165%);
    --shadow-card: inset 0 2px 3px rgba(255, 255, 255, 0.95), inset 0 -6px 16px rgba(148, 163, 184, 0.1), 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px rgba(15, 23, 42, 0.055);
    --shadow-pop: 0 2px 6px rgba(15, 23, 42, 0.06), 0 24px 60px rgba(15, 23, 42, 0.18);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --sidebar-w: 268px;
    --topbar-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body.ui-body {
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 85% -10%, rgba(2, 132, 199, 0.07), transparent 60%),
        radial-gradient(800px 500px at 20% 0%, rgba(217, 78, 40, 0.06), transparent 60%),
        linear-gradient(180deg, #F7F9FE 0%, #EFF4FB 50%, #F7F4F1 100%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--terra); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Shell ---------- */
.ui-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Sidebar (Deep Slate) ---------- */
.ui-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(217, 78, 40, 0.16), transparent 70%),
        linear-gradient(180deg, var(--slate-900) 0%, var(--slate-950) 100%);
    color: #CBD5E1;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 40;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 22px 20px 18px;
    color: #FFFFFF;
    text-decoration: none;
}
.sb-brand:hover { text-decoration: none; }

.sb-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--terra-hi), var(--terra));
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45), 0 8px 18px rgba(217, 78, 40, 0.35);
    color: #FFFFFF;
    flex-shrink: 0;
}

.sb-brand-text { display: grid; line-height: 1.15; }
.sb-brand-name { font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; }
.sb-brand-sub { font-size: 0.75rem; color: #94A3B8; font-weight: 600; }

/* Workspace switcher */
.sb-switcher { position: relative; padding: 0 14px 14px; }
.sb-switch-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #F1F5F9;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.sb-switch-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); }
.sb-site-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    color: #FFFFFF;
    background: linear-gradient(145deg, #334155, #1E293B);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
}
.sb-switch-text { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.sb-switch-text strong { font-size: 0.8125rem; font-weight: 700; }
.sb-switch-text span { font-size: 0.75rem; color: #94A3B8; }
.sb-chevron { color: #64748B; flex-shrink: 0; }

.sb-switch-menu {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% - 8px);
    padding: 6px;
    border-radius: 14px;
    background: var(--slate-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    z-index: 60;
    max-height: 320px;
    overflow-y: auto;
}
.sb-switch-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: #E2E8F0;
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    text-align: left;
}
.sb-switch-item:hover { background: rgba(255, 255, 255, 0.07); }
.sb-switch-item.is-current { background: rgba(217, 78, 40, 0.16); color: #FFFFFF; }
.sb-switch-item .sb-site-badge { width: 26px; height: 26px; font-size: 0.75rem; border-radius: 8px; }
.sb-switch-divider { height: 1px; margin: 6px 4px; background: rgba(255, 255, 255, 0.08); }
.sb-switch-add { color: #FDBA9F; font-weight: 700; }

/* Navigation */
.sb-nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 16px;
}
.sb-group { margin-top: 14px; }
.sb-group:first-child { margin-top: 4px; }
.sb-group-label {
    margin: 0 0 6px;
    padding: 0 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
}
.sb-link {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    margin-bottom: 2px;
    border-radius: 11px;
    border: 0;
    background: transparent;
    color: #CBD5E1;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.sb-link svg { flex-shrink: 0; color: #64748B; transition: color 150ms var(--ease); }
.sb-link:hover { background: rgba(255, 255, 255, 0.05); color: #FFFFFF; }
.sb-link:hover svg { color: #CBD5E1; }
.sb-link.is-active {
    background: linear-gradient(90deg, rgba(217, 78, 40, 0.2), rgba(217, 78, 40, 0.05));
    color: #FFFFFF;
}
.sb-link.is-active svg { color: var(--terra-hi); }
.sb-link.is-active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--terra-hi);
}
.sb-badge {
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(217, 78, 40, 0.22);
    color: #FDBA9F;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.sb-footer { padding: 12px 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.sb-status-card {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.sb-status-row { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 700; color: #F1F5F9; }
.sb-status-sub { margin: 4px 0 0; font-size: 0.75rem; color: #94A3B8; line-height: 1.45; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--faint); }
.dot-ok { background: #34D399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.dot-warn { background: #FBBF24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.dot-bad { background: #FB7185; box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18); }

/* ---------- Main + Topbar ---------- */
.ui-main { min-width: 0; display: flex; flex-direction: column; }

.ui-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    background: rgba(247, 249, 254, 0.78);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--line);
}
.tb-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line-strong);
    background: var(--surface-solid);
    color: var(--ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.tb-heading { min-width: 0; flex: 1; }
.tb-crumb { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--soft); }
.tb-crumb .sep { color: var(--faint); }
.tb-title { margin: 1px 0 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }

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

.tb-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 250px;
}
.tb-search svg { position: absolute; left: 12px; color: var(--soft); pointer-events: none; }
.tb-search input {
    width: 100%;
    height: 38px;
    padding: 0 38px 0 36px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.85);
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--ink);
    outline: none;
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.tb-search input:focus { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-ring); background: #FFFFFF; }
.tb-search kbd {
    position: absolute;
    right: 9px;
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    background: #F8FAFC;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--soft);
}
.tb-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    padding: 6px;
    border-radius: 14px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
    z-index: 70;
}
.tb-search-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    text-align: left;
    cursor: pointer;
}
.tb-search-item:hover, .tb-search-item.is-focus { background: var(--terra-tint); color: var(--terra-deep); }

/* Profile menu */
.tb-profile { position: relative; }
.tb-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.85);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.tb-profile-btn:hover, .tb-profile-btn[aria-expanded="true"] { border-color: rgba(217, 78, 40, 0.4); box-shadow: 0 0 0 3px var(--terra-ring); }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: contain;
    background: linear-gradient(145deg, #FFFFFF, #EEF2F8);
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; }
.avatar-xl { width: 92px; height: 92px; border-radius: 24px; border: 2px solid var(--terra-ring); }
.tb-profile-meta { display: grid; text-align: left; line-height: 1.2; max-width: 150px; }
.tb-profile-meta strong { font-size: 0.8125rem; color: var(--ink); }
.tb-profile-meta span { font-size: 0.75rem; color: var(--soft); }

.pop-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 270px;
    padding: 6px;
    border-radius: 16px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
    z-index: 80;
    animation: popIn 160ms var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.pop-head { display: flex; align-items: center; gap: 12px; padding: 10px; }
.pop-head-meta { min-width: 0; display: grid; line-height: 1.3; }
.pop-head-meta strong { font-size: 0.875rem; }
.pop-head-meta span { font-size: 0.75rem; color: var(--soft); }
.pop-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.pop-item svg { color: var(--soft); flex-shrink: 0; }
.pop-item:hover { background: #F4F6FA; color: var(--ink); text-decoration: none; }
.pop-item.is-danger { color: var(--crimson); }
.pop-item.is-danger svg { color: var(--crimson); }
.pop-item.is-danger:hover { background: rgba(225, 29, 72, 0.07); }
.pop-divider { height: 1px; margin: 4px 6px; background: var(--line); }

/* ---------- Content ---------- */
.ui-content { padding: 26px 28px 64px; max-width: 1480px; width: 100%; }
.view-intro { margin: 0 0 20px; max-width: 70ch; color: var(--muted); font-size: 0.875rem; }

.banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 28px 0;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.banner-warn { background: rgba(217, 119, 6, 0.09); border: 1px solid rgba(217, 119, 6, 0.25); color: #92400E; }

/* Cards */
.card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-card);
    padding: 22px;
    min-width: 0;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.card-flush .card-head { padding: 20px 22px 0; }
.card-title { margin: 0; font-size: 0.9375rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.card-sub { margin: 3px 0 0; font-size: 0.8125rem; color: var(--soft); }
.card-dark {
    background:
        radial-gradient(380px 220px at 100% 0%, rgba(217, 78, 40, 0.28), transparent 70%),
        linear-gradient(160deg, var(--slate-800), var(--slate-900));
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #E2E8F0;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}
.card-dark .card-title { color: #FFFFFF; }
.card-dark .card-sub { color: #94A3B8; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }
.mt { margin-top: 18px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi {
    position: relative;
    padding: 18px 20px;
    overflow: hidden;
}
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.kpi-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--terra-tint);
    color: var(--terra);
}
.kpi-icon.is-sky { background: rgba(2, 132, 199, 0.1); color: var(--sky); }
.kpi-icon.is-emerald { background: rgba(5, 150, 105, 0.1); color: var(--emerald); }
.kpi-icon.is-amber { background: rgba(217, 119, 6, 0.1); color: var(--amber); }
.kpi-value { margin: 10px 0 2px; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-sub { margin: 0; font-size: 0.75rem; color: var(--soft); }
.kpi-spark { display: block; width: 100%; height: 34px; margin-top: 10px; }

/* Health ring */
.health-wrap { display: flex; align-items: center; gap: 22px; }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center strong { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; color: #FFFFFF; line-height: 1; }
.ring-center span { font-size: 0.75rem; color: #94A3B8; margin-top: 3px; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; flex: 1; }
.mini-stat-label { font-size: 0.75rem; color: #94A3B8; }
.mini-stat-val { font-size: 1.125rem; font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }

/* Charts */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; max-height: 360px; overflow: visible; }
.chart-axis { font-family: var(--font-mono); font-size: 10px; fill: var(--faint); }
.chart-grid { stroke: rgba(15, 23, 42, 0.06); stroke-width: 1; }
.chart-tip {
    position: absolute;
    pointer-events: none;
    padding: 8px 11px;
    border-radius: 10px;
    background: var(--slate-900);
    color: #FFFFFF;
    font-size: 0.75rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
    white-space: nowrap;
    transform: translate(-50%, -110%);
}
.chart-tip strong { display: block; font-size: 0.875rem; }
.chart-empty {
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    color: var(--soft);
    border-radius: 16px;
    border: 1.5px dashed var(--line-strong);
    background: rgba(255, 255, 255, 0.4);
}
.chart-empty strong { color: var(--ink-2); }

/* Segmented control */
.segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 12px;
    background: var(--surface-sunken);
    border: 1px solid rgba(255, 255, 255, 0.85);
}
.segmented button {
    border: 0;
    background: transparent;
    padding: 6px 13px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--soft);
    cursor: pointer;
    transition: background-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.segmented button.is-active { background: #FFFFFF; color: var(--ink); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(145deg, var(--terra-hi), var(--terra));
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 8px 20px rgba(217, 78, 40, 0.26);
}
.btn-primary:hover:not(:disabled) { box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45), 0 12px 26px rgba(217, 78, 40, 0.34); }
.btn-secondary { background: rgba(255, 255, 255, 0.88); color: var(--ink); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.btn-secondary:hover:not(:disabled) { background: #FFFFFF; border-color: rgba(15, 23, 42, 0.22); }
.btn-dark { background: var(--slate-900); color: #FFFFFF; }
.btn-dark:hover:not(:disabled) { background: var(--slate-800); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: rgba(15, 23, 42, 0.05); color: var(--ink); }
.btn-danger { background: rgba(225, 29, 72, 0.08); color: var(--crimson); border-color: rgba(225, 29, 72, 0.22); }
.btn-danger:hover:not(:disabled) { background: rgba(225, 29, 72, 0.13); }
.btn-danger-solid { background: var(--crimson); color: #FFFFFF; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 0.75rem; border-radius: 10px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 10px; }
.btn-block { width: 100%; }
.card-dark .btn-secondary { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: #FFFFFF; }

/* Forms */
.field { display: grid; gap: 6px; }
.field-label { font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 0.75rem; color: var(--soft); }
.input, .select, .textarea {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.92);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--ink);
    outline: none;
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.textarea { height: auto; min-height: 200px; padding: 12px 13px; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-ring); background: #FFFFFF; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.card-dark .select, .card-dark .input { background-color: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
.card-dark .select option { color: var(--ink); }
.card-dark .field-label { color: #CBD5E1; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 200px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.875rem; color: var(--ink-2); }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--terra); }

/* Switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: 0.875rem; }
.switch-row span { font-size: 0.8125rem; color: var(--soft); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #CBD5E1; cursor: pointer; transition: background-color 160ms var(--ease); }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); transition: transform 160ms var(--ease); }
.switch input:checked + .switch-track { background: var(--terra); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.table th {
    text-align: left;
    padding: 11px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--soft);
    background: rgba(241, 245, 249, 0.7);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.table tbody tr { transition: background-color 120ms var(--ease); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.65); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 34px 16px !important; text-align: center; color: var(--soft); }
.cell-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-user-meta { display: grid; line-height: 1.3; min-width: 0; }
.cell-user-meta strong { color: var(--ink); font-size: 0.8125rem; }
.cell-user-meta span { color: var(--soft); font-size: 0.75rem; }
.url-cell { max-width: 420px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }

/* Status pills (semantic data states only) */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: rgba(5, 150, 105, 0.1); color: #047857; }
.pill-warn { background: rgba(217, 119, 6, 0.1); color: #B45309; }
.pill-bad { background: rgba(225, 29, 72, 0.09); color: #BE123C; }
.pill-info { background: rgba(2, 132, 199, 0.09); color: #0369A1; }
.pill-neutral { background: rgba(100, 116, 139, 0.12); color: #475569; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--terra-hi), var(--terra)); transition: width 400ms var(--ease); }

/* Alerts */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 13px; font-size: 0.8125rem; font-weight: 600; line-height: 1.5; }
.alert-info { background: rgba(2, 132, 199, 0.07); border: 1px solid rgba(2, 132, 199, 0.2); color: #075985; }
.alert-ok { background: rgba(5, 150, 105, 0.08); border: 1px solid rgba(5, 150, 105, 0.22); color: #065F46; }
.alert-warn { background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.24); color: #92400E; }
.alert-bad { background: rgba(225, 29, 72, 0.07); border: 1px solid rgba(225, 29, 72, 0.22); color: #9F1239; }

/* List rows */
.list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); min-width: 0; max-width: 100%; }
.list-row > :first-child { min-width: 0; flex: 1; }
.list-row > .pill { flex-shrink: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row-title { margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.list-row-sub { margin: 2px 0 0; font-size: 0.75rem; color: var(--soft); }

/* Timeline */
.timeline { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-left: 22px; min-width: 0; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.tl-item { position: relative; min-width: 0; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--terra); }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-tag { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--terra); }
.tl-title { font-weight: 700; font-size: 0.875rem; color: var(--ink); }
.tl-date { margin-left: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--soft); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.kanban-col { padding: 14px; border-radius: var(--r-lg); background: rgba(226, 232, 240, 0.4); border: 1px solid rgba(255, 255, 255, 0.85); display: grid; gap: 10px; align-content: start; min-height: 240px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.kanban-head strong { font-size: 0.8125rem; color: var(--ink); }
.kanban-count { padding: 1px 8px; border-radius: 999px; background: #FFFFFF; font-size: 0.75rem; font-weight: 700; color: var(--soft); }
.task-card { padding: 13px; border-radius: 14px; background: #FFFFFF; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04); }
.task-title { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.75rem; color: var(--soft); }

/* Diff */
.diff-box { margin: 0; padding: 16px 0; border-radius: 16px; background: var(--slate-900); color: #CBD5E1; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.7; max-height: 520px; overflow: auto; }
.diff-line { display: block; padding: 0 18px; white-space: pre-wrap; word-break: break-all; }
.diff-add { background: rgba(16, 185, 129, 0.16); color: #A7F3D0; box-shadow: inset 3px 0 0 #10B981; }
.diff-rem { background: rgba(244, 63, 94, 0.16); color: #FECDD3; box-shadow: inset 3px 0 0 #F43F5E; }
.diff-eq { color: #64748B; }
.diff-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 0.75rem; color: var(--soft); }
.diff-meta b { color: var(--ink); }

/* Empty state */
.empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 56px 24px;
    text-align: center;
}
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--terra-tint); color: var(--terra); }
.empty h2 { margin: 6px 0 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.empty p { margin: 0 0 8px; max-width: 46ch; color: var(--muted); }

/* Drawer + Modal */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0.42); backdrop-filter: blur(4px); animation: fadeIn 160ms var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    width: min(520px, 100vw);
    display: flex;
    flex-direction: column;
    background: #F8FAFD;
    box-shadow: -24px 0 60px rgba(15, 23, 42, 0.2);
    animation: slideIn 220ms var(--ease);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: #FFFFFF; }
.drawer-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; display: grid; gap: 20px; align-content: start; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: #FFFFFF; }
.modal-wrap { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 460px; background: #FFFFFF; border-radius: 22px; box-shadow: var(--shadow-pop); padding: 26px; animation: popIn 180ms var(--ease); }
.modal h2 { margin: 0 0 6px; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.avatar-opt {
    padding: 5px;
    border-radius: 14px;
    border: 1.5px solid var(--line);
    background: #FFFFFF;
    cursor: pointer;
    transition: transform 140ms var(--ease), border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.avatar-opt img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.avatar-opt:hover { transform: translateY(-2px); border-color: rgba(217, 78, 40, 0.45); }
.avatar-opt.is-selected { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-ring); }

/* Icon-button kebab menu (row actions) */
.row-menu { position: relative; display: inline-block; }
.row-menu .pop-menu { width: 210px; }

/* Toast */
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--slate-900);
    color: #FFFFFF;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
    animation: popIn 180ms var(--ease);
}
.toast.is-error { background: #881337; }

/* Skeleton */
.skeleton { border-radius: 10px; background: linear-gradient(90deg, rgba(226, 232, 240, 0.6), rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.6)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .grid-main-side { grid-template-columns: 1fr; }
    .tb-search { width: 200px; }
}
@media (max-width: 1024px) {
    .ui-shell { grid-template-columns: 1fr; }
    .ui-sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform 220ms var(--ease); }
    .ui-sidebar.is-open { transform: translateX(0); box-shadow: 24px 0 60px rgba(0, 0, 0, 0.35); }
    .tb-menu-btn { display: inline-flex; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .tb-search { display: none; }
}
@media (max-width: 640px) {
    .ui-topbar { padding: 0 16px; gap: 10px; }
    .ui-content { padding: 18px 16px 48px; }
    .tb-profile-meta, .tb-hide-sm { display: none !important; }
    .health-wrap { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Advanced GSC Studio Scorecard Toggles & Intelligence ---------- */
.gsc-scorecards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.gsc-card-btn {
    appearance: none;
    text-align: left;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.65);
    border: 1.5px solid var(--line);
    cursor: pointer;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    transition: transform 140ms var(--ease), border-color 140ms var(--ease), background-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.gsc-card-btn:hover { transform: translateY(-1px); background: #FFFFFF; }
.gsc-card-btn.is-on {
    background: #FFFFFF;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}
.gsc-card-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; right: 0;
    height: 4px;
    background: var(--sc-color, var(--terra));
    opacity: 0.25;
    transition: opacity 140ms var(--ease);
}
.gsc-card-btn.is-on::before { opacity: 1; }
.gsc-card-btn[data-m="clicks"] { --sc-color: #0284C7; }
.gsc-card-btn[data-m="impressions"] { --sc-color: #6366F1; }
.gsc-card-btn[data-m="ctr"] { --sc-color: #059669; }
.gsc-card-btn[data-m="position"] { --sc-color: #D94E28; }
.gsc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.gsc-card-val { margin: 8px 0 2px; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.gsc-delta { font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gsc-delta.is-up { color: var(--emerald); }
.gsc-delta.is-down { color: var(--crimson); }

.bar-meter { height: 7px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; min-width: 80px; }
.bar-meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--terra-hi), var(--terra)); }

.intent-tag { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: capitalize; }
.intent-informational { background: rgba(2, 132, 199, 0.1); color: #0369A1; }
.intent-commercial { background: rgba(99, 102, 241, 0.1); color: #4338CA; }
.intent-transactional { background: rgba(5, 150, 105, 0.12); color: #047857; }
.intent-navigational { background: rgba(217, 78, 40, 0.1); color: #B83D1C; }

@media (max-width: 960px) {
    .gsc-scorecards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .gsc-scorecards { grid-template-columns: 1fr; }
}

/* ---------- Animated Smooth Bezier Curves & Domain Favicons ---------- */
@keyframes drawSpline {
    from { stroke-dashoffset: 2400; }
    to { stroke-dashoffset: 0; }
}
.chart-spline-anim {
    stroke-dasharray: 2400;
    stroke-dashoffset: 0;
    animation: drawSpline 850ms var(--ease) forwards;
}
.chart-area-anim {
    animation: fadeIn 650ms var(--ease) forwards;
}
.sb-site-fav {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.94); border: 1px solid rgba(255, 255, 255, 0.25);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.75rem; color: #0F172A; overflow: hidden;
}
.sb-site-fav img { width: 20px; height: 20px; object-fit: contain; display: block; }
.chart-legend {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-top: 10px; font-size: 0.75rem; font-weight: 600; color: var(--muted);
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.site-pick-card {
    appearance: none; text-align: left; padding: 12px 14px; border-radius: 14px;
    background: #FFFFFF; border: 1.5px solid var(--line-strong); cursor: pointer; font-family: inherit;
    display: flex; align-items: center; gap: 11px;
    transition: transform 140ms var(--ease), border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.site-pick-card:hover { transform: translateY(-1px); border-color: rgba(217, 78, 40, 0.45); }
.site-pick-card.is-selected { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-ring); }

/* ---------- Semrush-Grade Domain Overview Visualizations ---------- */
.serp-bar {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-sunken);
    gap: 2px;
    margin: 14px 0 16px;
}
.serp-seg {
    height: 100%;
    transition: width 550ms var(--ease);
    min-width: 4px;
}
.serp-seg-1 { background: #059669; }
.serp-seg-2 { background: #0284C7; }
.serp-seg-3 { background: #6366F1; }
.serp-seg-4 { background: #F59E0B; }
.serp-seg-5 { background: #94A3B8; }

.serp-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.serp-stat {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 140ms var(--ease), border-color 140ms var(--ease);
}
.serp-stat:hover { transform: translateY(-1px); border-color: rgba(15, 23, 42, 0.2); }
.serp-stat-head { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.serp-stat-val { margin-top: 4px; font-size: 1.25rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.serp-stat-pct { font-size: 0.72rem; color: var(--soft); font-family: var(--font-mono); }

.intent-rows { display: grid; gap: 10px; }
.intent-row { display: grid; grid-template-columns: 112px 1fr 78px; align-items: center; gap: 12px; }
.intent-track { height: 9px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.intent-fill { height: 100%; border-radius: 999px; transition: width 550ms var(--ease); }

@media (max-width: 820px) {
    .serp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Modal Scanner Animation & Interactive Bar Charts ---------- */
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes riseBar { from { transform: scaleY(0); opacity: 0.4; } to { transform: scaleY(1); opacity: 1; } }
.scan-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 18px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(239, 244, 251, 0.85));
    border: 1.5px solid var(--line);
    text-align: center;
}
.scan-ring {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(217, 78, 40, 0.16);
    border-top-color: var(--terra);
    animation: spinSlow 0.8s linear infinite;
}
.chart-bar-anim {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: riseBar 480ms var(--ease) both;
}
.page-pick-list {
    display: grid;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 14px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
}
.page-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    cursor: pointer;
    font-size: 0.8125rem;
}
.page-pick-row:hover { border-color: rgba(217, 78, 40, 0.4); }
.metric-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Modular Add-Ons, Locked Nav, Clickable URLs & 2-Worker Site Audit ---------- */
.sb-link { justify-content: flex-start; }
.sb-lock {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #94A3B8;
}
.sb-link.is-locked { opacity: 0.76; }
.sb-link.is-locked:hover { opacity: 1; }

.url-link {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--sky);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.url-link:hover { color: var(--terra); text-decoration: underline; }

.audit-worker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.audit-worker-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
}
.audit-worker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.audit-worker-status { font-size: 0.84rem; color: var(--muted); }

.audit-issue-stack { display: grid; gap: 12px; }
.audit-issue-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
}
.audit-issue-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.audit-issue-meta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    display: grid;
    gap: 4px;
    font-size: 0.8125rem;
}

.sev-critical { background: rgba(225, 29, 72, 0.14); color: #BE123C; }
.sev-high { background: rgba(217, 78, 40, 0.14); color: #C2410C; }
.sev-medium { background: rgba(217, 119, 6, 0.14); color: #B45309; }
.sev-low { background: rgba(2, 132, 199, 0.12); color: #0369A1; }

.checks-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}
.checks-cat-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
}
.checks-cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 0.82rem; }
.checks-ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks-ul li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.8rem; line-height: 1.35; }
.checks-ul li .pill { flex-shrink: 0; font-size: 0.66rem; padding: 1px 6px; }

.addons-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}
.addon-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 18px rgba(15, 23, 42, 0.04);
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.addon-card:hover { border-color: var(--line-strong); }
.addon-card.is-installed { border-color: rgba(5, 150, 105, 0.38); background: #FFFFFF; box-shadow: inset 0 1px 0 #FFFFFF, 0 10px 26px rgba(15, 23, 42, 0.06); }
.addon-card.is-upcoming { opacity: 0.78; background: rgba(248, 250, 252, 0.72); }
.addon-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.addon-card-ident { display: flex; align-items: flex-start; gap: 14px; min-width: 0; flex: 1; }
.addon-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85), 0 4px 10px rgba(15, 23, 42, 0.06);
}
.addon-icon-badge.is-terra { background: linear-gradient(145deg, rgba(255, 107, 61, 0.16), rgba(217, 78, 40, 0.08)); color: var(--terra); border-color: rgba(217, 78, 40, 0.22); }
.addon-icon-badge.is-sky { background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(2, 132, 199, 0.08)); color: var(--sky); border-color: rgba(2, 132, 199, 0.22); }
.addon-icon-badge.is-emerald { background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.08)); color: var(--emerald); border-color: rgba(5, 150, 105, 0.22); }
.addon-icon-badge.is-amber { background: linear-gradient(145deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.08)); color: var(--amber); border-color: rgba(217, 119, 6, 0.22); }
.addon-icon-badge.is-slate { background: linear-gradient(145deg, rgba(100, 116, 139, 0.15), rgba(71, 85, 105, 0.07)); color: #334155; border-color: rgba(71, 85, 105, 0.2); }
.addon-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.addon-state-lbl { font-size: 0.78rem; font-weight: 700; letter-spacing: -0.005em; }
.addon-state-lbl.is-active { color: var(--emerald); }
.addon-state-lbl.is-locked { color: var(--amber); }
.addon-state-lbl.is-upcoming { color: var(--soft); }
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-sunken);
    border: 1px solid var(--line-strong);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}
.addon-perms-box {
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
}
.addon-role-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.addon-chk-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid var(--line-strong);
    font-size: 0.78rem;
    cursor: pointer;
}
.addon-member-list { display: grid; gap: 6px; margin-top: 6px; }
.addon-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    font-size: 0.8rem;
}
/* ---------- Progress Tracker & Stepper UI ---------- */
.progress-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.progress-pct-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 14px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
}
.progress-pct-badge .mono { font-size: 1.4rem; font-weight: 800; color: var(--terra); }
.progress-bar-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    overflow: hidden;
    margin: 14px 0;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--terra-hi), var(--emerald));
    transition: width 420ms var(--ease);
}
.progress-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.progress-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    font-size: 0.78rem;
}
.progress-task-list { display: grid; gap: 14px; }
.progress-task-card {
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid var(--line);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(15, 23, 42, 0.04);
    display: grid;
    gap: 14px;
}
.progress-task-card.is-complete {
    border-color: rgba(5, 150, 105, 0.28);
    background: rgba(255, 255, 255, 0.88);
}
.progress-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.progress-task-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); }
.progress-note-box {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(2, 132, 199, 0.07);
    border: 1px solid rgba(2, 132, 199, 0.16);
    font-size: 0.82rem;
    color: var(--ink);
}
.step-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.step-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--muted);
}
.step-dot {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #FFFFFF; border: 1.5px solid var(--line-strong); font-size: 0.72rem; font-weight: 800;
}
.step-node.is-current {
    background: rgba(217, 78, 40, 0.1);
    border-color: rgba(217, 78, 40, 0.35);
    color: var(--terra);
}
.step-node.is-current .step-dot { background: var(--terra); border-color: var(--terra); color: #FFFFFF; }
.step-node.is-done {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.28);
    color: #047857;
}
.step-node.is-done .step-dot { background: var(--emerald); border-color: var(--emerald); color: #FFFFFF; }
.progress-task-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}
@media (max-width: 780px) {
    .audit-worker-grid { grid-template-columns: 1fr; }
    .addons-store-grid { grid-template-columns: 1fr; }
    .audit-issue-top { flex-direction: column; }
    .progress-hero-top, .progress-task-head, .progress-task-foot { flex-direction: column; align-items: flex-start; }
    .step-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Semrush / Ahrefs-Grade Site Audit Studio ---------- */
.audit-main-card { padding: 24px 26px; }
.audit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.audit-heading {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.audit-live-strip {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(2, 132, 199, 0.06);
    border: 1px solid rgba(2, 132, 199, 0.18);
}
.audit-live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}
.audit-live-nums { font-size: 0.8125rem; color: var(--sky); }
.audit-live-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(2, 132, 199, 0.14);
    overflow: hidden;
}
.audit-live-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sky), var(--terra));
    transition: width 360ms var(--ease);
}

.audit-overview-grid {
    display: grid;
    grid-template-columns: minmax(290px, 0.92fr) minmax(360px, 1.35fr);
    gap: 28px;
    margin-top: 22px;
    align-items: start;
}
.audit-health-col {
    padding-right: 26px;
    border-right: 1px solid var(--line);
}
.audit-gauge-row {
    display: flex;
    align-items: center;
    gap: 18px;
}
.audit-gauge-wrap { flex-shrink: 0; }
.audit-gauge-arc { transition: stroke-dashoffset 520ms var(--ease), stroke 260ms var(--ease); }
.audit-gauge-label {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.015em;
}
.audit-gauge-note {
    margin: 4px 0 6px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted);
}
.audit-gauge-foot { font-size: 0.78rem; color: var(--soft); }

.audit-divider {
    height: 1px;
    background: var(--line);
    margin: 18px 0;
}
.audit-sub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}
.audit-dist-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-sunken);
    gap: 2px;
}
.dist-seg { height: 100%; transition: width 420ms var(--ease); }
.dist-healthy { background: var(--emerald); }
.dist-issues { background: var(--amber); }
.dist-redirects { background: var(--sky); }
.dist-broken { background: var(--crimson); }
.dist-empty { background: rgba(148, 163, 184, 0.25); }

.audit-dist-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin-top: 12px;
}
.audit-dist-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
}
.audit-dist-item strong { margin-left: auto; color: var(--ink); }

.audit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.audit-tier-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.audit-tier-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-right: 1px solid var(--line);
    padding: 6px 16px 8px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: grid;
    gap: 2px;
    border-radius: 10px;
    transition: background-color 160ms var(--ease);
}
.audit-tier-btn:first-child { padding-left: 6px; }
.audit-tier-btn:last-child { border-right: none; }
.audit-tier-btn:hover { background: rgba(15, 23, 42, 0.035); }
.audit-tier-top {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ink);
}
.audit-tier-val {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.audit-tier-hint { font-size: 0.78rem; color: var(--soft); }

.audit-thematic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
}
.audit-theme-row {
    appearance: none;
    background: transparent;
    border: none;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: grid;
    gap: 5px;
    transition: background-color 160ms var(--ease);
}
.audit-theme-row:hover { background: rgba(15, 23, 42, 0.035); }
.audit-theme-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8125rem;
}
.audit-theme-name { font-weight: 600; color: var(--ink); }
.audit-theme-pct { font-size: 0.8125rem; font-weight: 700; }
.audit-theme-track {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-sunken);
    overflow: hidden;
}
.audit-theme-track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 420ms var(--ease);
}

.audit-explorer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.audit-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.55);
    flex-wrap: wrap;
}

.audit-page-row {
    cursor: pointer;
    transition: background-color 140ms var(--ease);
}
.audit-page-row:hover { background: rgba(217, 78, 40, 0.035); }
.audit-page-row.is-expanded { background: rgba(217, 78, 40, 0.055); }
.audit-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 440px;
}
.audit-chevron {
    display: inline-block;
    color: var(--soft);
    font-size: 0.8rem;
    transition: transform 180ms var(--ease);
    flex-shrink: 0;
}
.audit-chevron.is-open { transform: rotate(90deg); color: var(--terra); }
.audit-http {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}
.audit-http.status-ok { color: var(--emerald); }
.audit-http.status-warn { color: var(--amber); }
.audit-http.status-bad { color: var(--crimson); }

.audit-mini-health {
    display: flex;
    align-items: center;
    gap: 8px;
}
.audit-mini-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-sunken);
    overflow: hidden;
    min-width: 56px;
}
.audit-mini-track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.audit-detail-td {
    padding: 0 !important;
    background: rgba(243, 246, 252, 0.82);
    white-space: normal !important;
}
.audit-page-sheet {
    padding: 18px 24px 20px 40px;
    border-bottom: 1px solid var(--line);
    min-width: 0;
    max-width: 100%;
}
.audit-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.audit-sheet-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.audit-sheet-item {
    padding: 16px 0 16px 14px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}
.audit-sheet-item.is-error { border-left-color: rgba(225, 29, 72, 0.65); }
.audit-sheet-item.is-warning { border-left-color: rgba(217, 119, 6, 0.65); }
.audit-sheet-item.is-notice { border-left-color: rgba(2, 132, 199, 0.55); }
.audit-sheet-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}
.audit-sheet-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    margin-bottom: 3px;
}
.audit-meta-sep { color: var(--faint); }
.audit-sheet-title { font-size: 0.9375rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.audit-sheet-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    font-size: 0.875rem;
    color: var(--ink);
    line-height: 1.5;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.audit-sheet-body > div,
.audit-sheet-body .mono {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.audit-fix-inline {
    font-size: 0.875rem;
    color: var(--muted);
    max-width: 72ch;
    line-height: 1.5;
}
.audit-fix-lbl {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.8125rem;
}
.audit-live-feedback {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.audit-live-feedback.is-pass {
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
}
.audit-live-feedback.is-fail {
    background: rgba(217, 119, 6, 0.12);
    color: #B45309;
}
.audit-clean-msg {
    padding: 14px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--emerald);
}
.audit-fixed-strip {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.8125rem;
}
.audit-fixed-item { color: #047857; font-weight: 600; }

/* Admin-Only Hidden Rules Recovery Strip */
.audit-suppressed-bar {
    padding: 11px 22px;
    background: rgba(248, 250, 252, 0.92);
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.audit-sup-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.audit-sup-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--muted);
}
.audit-sup-summary svg { color: var(--soft); flex-shrink: 0; }
.audit-sup-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border-top: 1px solid var(--line);
}
.audit-sup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.audit-sup-item:last-child { border-bottom: none; padding-bottom: 2px; }
.audit-sup-title { font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.audit-sup-meta { font-size: 0.78rem; color: var(--soft); margin-top: 2px; }

/* Architectural Grouped Issues Explorer */
.audit-grouped-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.audit-ledger-head {
    display: grid;
    grid-template-columns: 20px 88px minmax(0, 1fr) 156px 128px;
    align-items: center;
    gap: 14px;
    padding: 10px 24px 10px 21px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--soft);
}
.audit-group-row {
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    min-width: 0;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.audit-group-row.is-error:hover,
.audit-group-row.is-error.is-open { border-left-color: #E11D48; }
.audit-group-row.is-warning:hover,
.audit-group-row.is-warning.is-open { border-left-color: #D97706; }
.audit-group-row.is-notice:hover,
.audit-group-row.is-notice.is-open { border-left-color: #0284C7; }
.audit-group-row.is-open { background: rgba(255, 255, 255, 0.92); }
.audit-group-head {
    width: 100%;
    appearance: none;
    background: transparent;
    border: none;
    padding: 15px 24px 15px 18px;
    display: grid;
    grid-template-columns: 20px 88px minmax(0, 1fr) 156px 128px;
    align-items: center;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--ink);
    transition: background-color 150ms var(--ease);
}
.audit-group-head:hover { background: rgba(15, 23, 42, 0.025); }
.audit-group-head .audit-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--soft);
    transition: transform 170ms var(--ease), color 150ms var(--ease);
}
.audit-group-head:hover .audit-chevron,
.audit-group-head .audit-chevron.is-open { color: var(--ink); }
.audit-group-head .audit-chevron.is-open { transform: rotate(90deg); }
.audit-sev-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.audit-group-tier { font-weight: 700; font-size: 0.8125rem; }
.audit-group-title {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}
.audit-group-cat { font-size: 0.8125rem; color: var(--muted); }
.audit-impact-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}
.audit-group-cnt { font-size: 0.8125rem; font-weight: 700; color: var(--ink); }
.audit-impact-bar {
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: block;
}
.audit-impact-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
}
.audit-group-body {
    padding: 18px 24px 20px 52px;
    background: linear-gradient(180deg, rgba(243, 246, 252, 0.84) 0%, rgba(248, 250, 252, 0.62) 100%);
    border-top: 1px solid var(--line);
    min-width: 0;
    overflow: hidden;
}
.audit-group-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
}
.audit-group-fix {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.52;
    max-width: 68ch;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.audit-group-fix p { margin: 2px 0 0; color: var(--muted); }
.audit-fix-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    color: var(--terra);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.btn-suppress-rule {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 150ms var(--ease), color 150ms var(--ease), background-color 150ms var(--ease);
}
.btn-suppress-rule:hover {
    border-color: rgba(15, 23, 42, 0.3);
    color: var(--ink);
    background: #FFFFFF;
}
.audit-affected-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.audit-affected-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--line);
    min-width: 0;
}
.audit-affected-info {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
}
.audit-affected-actions { flex-shrink: 0; padding-top: 2px; }
.audit-url-line { min-width: 0; }
.audit-ext-arrow { font-size: 0.74rem; opacity: 0.55; margin-left: 3px; }
.audit-wrap-url {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.42;
}
.audit-evidence-block {
    margin-top: 5px;
    padding: 7px 12px;
    border-left: 2px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 0 8px 8px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    min-width: 0;
}
.audit-evidence-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--soft);
}
.audit-found-live {
    font-size: 0.78rem;
    color: var(--ink-2);
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .audit-overview-grid { grid-template-columns: 1fr; }
    .audit-health-col { padding-right: 0; border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
}
@media (max-width: 780px) {
    .audit-header, .audit-sheet-item-top, .audit-affected-row, .audit-group-toolbar { flex-direction: column; align-items: flex-start; }
    .audit-tier-strip { grid-template-columns: 1fr; }
    .audit-tier-btn { border-right: none; border-bottom: 1px solid var(--line); padding: 10px 6px; }
    .audit-thematic-grid { grid-template-columns: 1fr; }
    .audit-ledger-head { display: none; }
    .audit-group-head { grid-template-columns: 18px 74px minmax(0, 1fr) 82px; padding: 13px 16px 13px 14px; gap: 10px; }
    .audit-group-cat { display: none; }
    .audit-group-body { padding: 14px 16px 16px 18px; }
    .audit-page-sheet { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .audit-live-fill, .audit-gauge-arc, .dist-seg, .audit-theme-track > span, .audit-chevron, .audit-group-row, .addon-card { transition: none !important; }
}

/* ---------- Core Logo Dock (GSC & GA4), Provenance, Duplicate Peers, Plans & Profile Cards ---------- */
.sb-tool-dock {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 6px;
}
.sb-tool-dock.is-single { grid-template-columns: 1fr; }
.tm-tool-toggles {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tm-tool-chip {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface-sunken);
    color: var(--soft);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0.58;
    transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), opacity 150ms var(--ease);
}
.tm-tool-chip:hover { opacity: 0.92; border-color: rgba(217, 78, 40, 0.4); }
.tm-tool-chip.is-on {
    opacity: 1;
    background: #FFFFFF;
    border-color: rgba(5, 150, 105, 0.42);
    color: var(--ink);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.sb-logo-tile {
    position: relative;
    justify-content: center !important;
    padding: 10px !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}
.sb-logo-tile:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}
.sb-logo-tile.is-active {
    background: rgba(217, 78, 40, 0.2) !important;
    border-color: rgba(255, 107, 61, 0.55) !important;
}
.sb-logo-glyph { display: inline-flex; align-items: center; justify-content: center; }
.sb-dock-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748B;
}
.sb-dock-dot.is-on { background: #10B981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25); }
.sb-dock-dot.is-off { background: #F59E0B; }

.audit-plan-schedule {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--sky);
    font-weight: 600;
}
.audit-canon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 10px;
    background: var(--surface-sunken);
    border: 1px solid var(--line-strong);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.audit-found-sub {
    font-size: 0.74rem;
    color: var(--soft);
    margin-top: 2px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.audit-related-box {
    margin-top: 8px;
    padding: 9px 12px;
    border-left: 2px solid rgba(2, 132, 199, 0.35);
    border-radius: 0 10px 10px 0;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}
.audit-related-heading {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink-2);
}
.audit-related-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; }
.audit-related-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
    padding: 5px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.audit-related-row:first-child { border-top: none; padding-top: 2px; }
.audit-related-note {
    font-size: 0.74rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* Premium Profile Menu & Bottom Action Cards */
.pop-menu-premium {
    width: 312px;
    padding: 8px;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}
.pop-menu-premium .pop-head { padding: 6px 8px 6px; gap: 10px; }
.pop-menu-premium .avatar-lg { width: 42px; height: 42px; border-radius: 12px; }
.pop-menu-premium .pop-item { padding: 6px 8px; }
.pop-menu-premium .pop-divider { margin: 4px 4px; }
.pm-plan-tag {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(217, 78, 40, 0.12);
    color: var(--terra);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.pop-ico {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--surface-sunken);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    flex-shrink: 0;
}
.pop-item:hover .pop-ico { color: var(--terra); background: rgba(217, 78, 40, 0.1); }
.pop-item.is-danger .pop-ico { color: var(--crimson); background: rgba(225, 29, 72, 0.08); }
.pop-cards-stack { display: grid; gap: 8px; padding: 4px 2px 2px; }
.pop-action-card {
    appearance: none;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.92);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 160ms var(--ease);
}
.pop-action-card:hover {
    transform: translateY(-1px);
    background: #FFFFFF;
}
.pop-action-card.is-addon-req { border-color: rgba(217, 78, 40, 0.25); background: rgba(217, 78, 40, 0.045); }
.pop-action-card.is-addon-req:hover { border-color: var(--terra); }
.pop-action-card.is-feedback { border-color: rgba(2, 132, 199, 0.25); background: rgba(2, 132, 199, 0.045); }
.pop-action-card.is-feedback:hover { border-color: var(--sky); }
.pop-card-ico {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.pop-action-card.is-addon-req .pop-card-ico { background: rgba(217, 78, 40, 0.14); color: var(--terra); }
.pop-action-card.is-feedback .pop-card-ico { background: rgba(2, 132, 199, 0.14); color: var(--sky); }
.pop-card-text { display: grid; gap: 2px; min-width: 0; }
.pop-card-text strong { font-size: 0.8125rem; font-weight: 700; color: var(--ink); line-height: 1.25; }
.pop-card-text span { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

/* GA4 Property Discovery & Plans Grid */
.ga4-props-grid { display: grid; gap: 10px; }
.ga4-prop-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
}
.ga4-prop-card.is-match { border-color: rgba(5, 150, 105, 0.45); background: #FFFFFF; }
.ga4-prop-card.is-mismatch { opacity: 0.72; background: var(--surface-sunken); }
.ga4-other-wrap { margin-top: 12px; display: grid; gap: 8px; }
.ga4-guidance-box {
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(217, 119, 6, 0.06);
    border: 1px solid rgba(217, 119, 6, 0.24);
    display: grid;
    gap: 8px;
}
.ga4-guidance-box strong { font-size: 0.95rem; color: var(--ink); }
.ga4-guidance-box p { margin: 0; font-size: 0.875rem; color: var(--muted); line-height: 1.5; }
.ga4-guidance-list {
    margin: 4px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 0.84rem;
    color: var(--ink);
    line-height: 1.45;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.plan-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.plan-card.is-current {
    border-color: var(--terra);
    background: #FFFFFF;
    box-shadow: 0 12px 28px rgba(217, 78, 40, 0.08);
}
.plan-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-name { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.plan-price { text-align: right; white-space: nowrap; }
.plan-price strong { font-size: 1.7rem; font-weight: 800; color: var(--ink); }
.plan-speed-line {
    font-size: 0.76rem;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--surface-sunken);
    color: var(--sky);
    font-weight: 600;
}
.plan-feat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--muted);
    flex: 1;
}
@media (max-width: 960px) {
    .plans-grid { grid-template-columns: 1fr; }
    .ga4-prop-card { flex-direction: column; align-items: flex-start; }
}
