/* Design tokens taken from the Insights Dashboard design. Light mode only. */
:root {
    --navy: #091540;
    --blue: #1B2CC1;
    --blue-soft: #7692FF;
    --blue-light: #ABD2FA;
    --canvas: #F6F7FB;
    --surface: #FFFFFF;
    --surface-muted: #FBFCFE;
    --border: #E6E8F2;
    --border-strong: #E0E3F0;
    --border-soft: #EEF0F7;
    --row-border: #F4F5FA;
    --text: #091540;
    --text-secondary: #3D4460;
    --text-muted: #5B627D;
    --text-subtle: #8A90A6;
    --text-faint: #A7ADC0;
    --text-ghost: #B9BFD1;
    --active-bg: #F0F3FF;
    --positive: #147D64;
    --positive-bg: #E7F5F0;
    --negative: #A4363B;
    --negative-bg: #FBECEC;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

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

html, body { margin: 0; padding: 0; }

body {
    background: var(--canvas);
    font-family: 'Instrument Sans', system-ui, sans-serif;
    color: var(--text);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
input, button { font-family: inherit; }
::selection { background: var(--blue-light); color: var(--navy); }

/* Layout */
.shell { display: flex; min-height: 100vh; background: var(--canvas); }

.sidebar {
    width: 264px;
    flex: 0 0 264px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}

.sidebar__brand { padding: 22px 22px 18px; display: flex; align-items: center; gap: 10px; }
.sidebar__logo {
    width: 28px; height: 28px; border-radius: 8px; background: var(--navy);
    display: flex; align-items: center; justify-content: center;
    color: var(--blue-light); font-size: 12.5px; font-weight: 700;
}
.sidebar__logo-image { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.sidebar__name { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }

.sidebar__nav { padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px;
    color: var(--text-muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.nav-item:hover { background: var(--canvas); color: var(--navy); }
.nav-item__dot { width: 6px; height: 6px; border-radius: 50%; background: #D3D7E6; }
.nav-item.is-active { background: var(--active-bg); color: var(--blue); font-weight: 600; }
.nav-item.is-active .nav-item__dot { background: var(--blue); }

.sidebar__section {
    padding: 26px 22px 10px; display: flex; align-items: baseline; justify-content: space-between;
}
.sidebar__section-title {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text-subtle);
}
.sidebar__section-count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.sidebar__sites { padding: 0 12px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.site-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.site-item:hover { background: var(--canvas); }
.site-item.is-active { background: var(--active-bg); }
.site-item__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.site-item__name {
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-item.is-active .site-item__name { font-weight: 600; color: var(--navy); }
.site-item__value { margin-left: auto; font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }
.site-item.is-active .site-item__value { color: var(--blue); }
.sidebar__empty { padding: 4px 12px; font-size: 12.5px; color: var(--text-subtle); }
.site-item--add { margin-top: 4px; color: var(--blue); }
.site-item--add .site-item__name { color: var(--blue); font-weight: 600; }
.site-item--add:hover { background: var(--active-bg); }
.site-item__plus {
    width: 8px; height: 8px; flex: 0 0 8px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1; color: var(--blue);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Header */
.header {
    position: sticky; top: 0; z-index: 5;
    background: rgba(246, 247, 251, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    display: flex; align-items: flex-end; gap: 24px;
}
.header__titles { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-subtle); }
.breadcrumb__sep { color: #CDD2E2; }
.breadcrumb__leaf { color: var(--text-muted); font-weight: 500; }
.header__title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.dropdown { position: relative; }
.chevron { color: var(--blue-soft); font-size: 10px; }

.workspace-trigger, .profile-trigger {
    display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px 0 6px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer;
}
.profile-trigger { border-radius: 999px; }
.workspace-trigger:hover, .profile-trigger:hover { border-color: var(--blue-soft); }
.workspace-trigger__badge {
    width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: var(--blue-light);
    display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}
.workspace-trigger__labels { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.workspace-trigger__caption {
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-subtle);
}
.workspace-trigger__name { font-size: 13px; font-weight: 600; color: var(--navy); }
.profile-trigger__avatar {
    width: 26px; height: 26px; border-radius: 50%; background: var(--blue-light); color: var(--navy);
    display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}
.profile-trigger__name { font-size: 13px; font-weight: 500; color: var(--navy); }

.menu {
    position: absolute; right: 0; top: 46px; width: 250px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
    box-shadow: 0 16px 40px -12px rgba(9, 21, 64, 0.22);
    padding: 6px; z-index: 20;
}
.menu--period { left: 0; right: auto; width: 216px; top: 44px; }
.menu--profile { width: 236px; }
.menu__current {
    display: flex; align-items: center; gap: 10px; padding: 10px 11px 12px;
    border-bottom: 1px solid var(--border-soft);
}
.menu__badge--lg { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; color: var(--surface); font-size: 11px; }
.menu__current-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.menu__current-caption {
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text-subtle);
}
.menu__current-name {
    font-size: 13.5px; font-weight: 600; color: var(--navy);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu__divider { height: 1px; margin: 4px 0; background: var(--border-soft); }

.menu__caption {
    padding: 8px 11px 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text-subtle);
}
.menu__item {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px;
    border: 0; border-radius: 8px; background: transparent; text-align: left;
    font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.menu__item:hover { background: var(--canvas); color: var(--navy); }
.menu__item.is-active { background: var(--active-bg); color: var(--blue); font-weight: 600; }
.menu__item--period { justify-content: space-between; }
.menu__item--plain { cursor: default; }
.menu__badge {
    width: 22px; height: 22px; border-radius: 6px; background: #EDF0FA; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.menu__item.is-active .menu__badge { background: var(--blue); color: var(--surface); }
.menu__label { font-size: 13px; }
.menu__meta { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.menu__item.is-active .menu__meta { color: var(--blue-soft); }
.menu__check { font-size: 11px; }
.menu__profile {
    display: flex; align-items: center; gap: 10px; padding: 10px 11px 12px;
    border-bottom: 1px solid var(--border-soft);
}
.menu__avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; background: var(--blue-light); color: var(--navy);
    display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
}
.menu__profile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.menu__profile-name { font-size: 13px; font-weight: 600; }
.menu__profile-email {
    font-size: 11.5px; color: var(--text-subtle);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu__group { padding: 6px 0 2px; display: flex; flex-direction: column; }
.menu__footer { border-top: 1px solid var(--border-soft); margin-top: 4px; padding-top: 4px; }
.menu__signout {
    width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent;
    text-align: left; font-size: 13px; font-weight: 600; color: var(--negative); cursor: pointer;
}
.menu__signout:hover { background: var(--negative-bg); }

.overlay { position: fixed; inset: 0; z-index: 4; border: 0; background: transparent; cursor: default; }

/* Content */
.content { padding: 26px 32px 56px; display: flex; flex-direction: column; gap: 22px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.card__head--bordered { padding: 18px 22px; margin: 0; border-bottom: 1px solid var(--border-soft); }
.card__titles { display: flex; flex-direction: column; gap: 3px; }
.card__title { font-size: 14px; font-weight: 600; }
.card__subtitle { font-size: 11.5px; color: var(--text-subtle); }
.card__meta { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.card__link { font-size: 12.5px; font-weight: 600; }

/* Filter bar */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-trigger {
    display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 13px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 13px; font-weight: 500; color: var(--navy); cursor: pointer;
}
.filter-trigger:hover { border-color: var(--blue-soft); }
.filter-trigger__caption { color: var(--text-subtle); }
.filter-add {
    display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px;
    border: 1px dashed #D3D7E6; border-radius: 10px; background: transparent;
    font-size: 13px; font-weight: 500; color: var(--text-subtle); cursor: pointer;
}
.filter-add:hover { border-color: var(--blue-soft); color: var(--blue); }
.filter-add__icon { font-size: 14px; line-height: 1; }
.filter-bar__range { margin-left: 4px; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.custom-range { display: flex; align-items: center; gap: 8px; }
.custom-range__input {
    height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); font-size: 13px; color: var(--navy);
}
.custom-range__sep { color: var(--text-faint); }

.notice {
    border-radius: 12px; padding: 14px 18px; font-size: 13px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.notice--warning { background: var(--negative-bg); color: var(--negative); flex-direction: column; align-items: flex-start; gap: 4px; }
.notice--warning p { margin: 0; }
.notice--connect { background: var(--active-bg); color: var(--navy); border: 1px solid #DCE3FF; }
.notice--info { background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); }
.notice--info p { margin: 0; }
.notice__title { margin: 0 0 2px; font-weight: 600; }
.notice__body { margin: 0; color: var(--text-muted); }
.notice__action {
    flex: 0 0 auto; height: 34px; display: inline-flex; align-items: center; padding: 0 14px;
    background: var(--blue); color: var(--surface); border-radius: 9px; font-size: 12.5px; font-weight: 600;
}
.notice__action:hover { background: var(--navy); color: var(--surface); }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 14px;
}
.kpi__head { display: flex; align-items: center; gap: 8px; }
.kpi__marker { width: 7px; height: 7px; border-radius: 2px; }
.kpi__label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-muted); }
.kpi__value-row { display: flex; align-items: flex-end; gap: 10px; }
.kpi__trend { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 600; }
.kpi__trend.is-up { color: var(--positive); }
.kpi__trend.is-down { color: var(--negative); }
.kpi__trend-caption { font-size: 10.5px; font-weight: 500; color: var(--text-faint); }
.chart-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--canvas); }
.chart-tabs__item {
    padding: 5px 11px; border: 0; border-radius: 7px; background: transparent;
    font-size: 12px; font-weight: 600; color: var(--text-subtle); cursor: pointer;
}
.chart-tabs__item:hover { color: var(--navy); }
.chart-tabs__item.is-active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 2px rgba(9, 21, 64, 0.12); }
.legend__meta { color: var(--text-faint); font-variant-numeric: tabular-nums; }
[data-chart-view][hidden] { display: none; }
.kpi__value {
    font-size: 34px; font-weight: 600; letter-spacing: -0.035em; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.kpi__delta { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 3px 7px; }
.kpi__delta.is-up { color: var(--positive); background: var(--positive-bg); }
.kpi__delta.is-down { color: var(--negative); background: var(--negative-bg); }
.kpi__spark { display: block; overflow: visible; }
.kpi__chart { position: relative; }
/* The sparkline is 40 pixels tall, so its guide line is too. */
.kpi__chart .chart__cursor-line { height: 40px; }
.kpi__chart .chart__tooltip { min-width: 118px; z-index: 30; }
.kpi__footer {
    display: flex; justify-content: space-between; font-size: 11px;
    color: var(--text-faint); font-variant-numeric: tabular-nums;
}

/* Charts */
/* One chart per row: side by side the lines were too cramped to read. */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.chart-card { padding: 20px 22px 16px; }
.chart-card__figures { display: flex; align-items: baseline; gap: 10px; }
.chart-card__total {
    font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1;
    color: var(--navy); font-variant-numeric: tabular-nums;
}
.chart { position: relative; display: flex; gap: 10px; }
.chart__svg { display: block; overflow: visible; }
.chart__axis { display: flex; justify-content: space-between; margin-top: 10px; }
.chart__axis span { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.chart__scale {
    display: flex; justify-content: space-between; margin-bottom: 6px;
    font-size: 10.5px; letter-spacing: 0.04em; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.chart__scale-clicks { color: var(--blue-soft); }
.chart__footnote { margin: 8px 0 0; font-size: 10.5px; color: var(--text-ghost); }
.legend { display: flex; gap: 14px; }
.legend__item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.legend__line { width: 14px; height: 2px; }

/* Site hero */
.site-hero { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.site-hero__dot { width: 12px; height: 12px; border-radius: 50%; }
.site-hero__titles { display: flex; flex-direction: column; gap: 2px; }
.site-hero__name { font-size: 15px; font-weight: 600; }
.site-hero__meta { font-size: 12px; color: var(--text-subtle); }
.site-hero__stats { margin-left: auto; display: flex; gap: 28px; }
.site-stat { display: flex; flex-direction: column; gap: 2px; }
.site-stat__label {
    font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle);
}
.site-stat__value { font-size: 15px; font-weight: 600; font-family: var(--mono); }

/* Tables */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-row { display: grid; align-items: center; padding: 13px 22px; border-bottom: 1px solid var(--row-border); }
.table-row--top { grid-template-columns: 46px minmax(220px, 1fr) 110px 130px 100px 84px; min-width: 800px; }
.table-row--pages { grid-template-columns: minmax(240px, 1fr) 128px 110px 130px 100px 84px; min-width: 880px; padding: 12px 22px; }
.table-row--head {
    padding-top: 10px; padding-bottom: 10px; background: var(--surface-muted);
    border-bottom: 1px solid var(--border-soft);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle);
}
.table-row:not(.table-row--head):hover { background: var(--surface-muted); }
.table-sort {
    border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left;
    font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.table-sort:hover { color: var(--blue); }
.is-right { text-align: right; justify-self: stretch; }
.is-strong { font-size: 13px; font-weight: 600; font-family: var(--mono); }
.is-mono { font-size: 13px; color: var(--text-secondary); font-family: var(--mono); }
.is-muted { font-size: 12.5px; color: var(--text-subtle); font-family: var(--mono); }
.table-rank { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.table-page { display: flex; align-items: center; gap: 9px; min-width: 0; }
.table-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.table-path { font-size: 13px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-site { font-size: 11px; color: var(--text-faint); flex: 0 0 auto; }
.table-empty { padding: 46px; text-align: center; font-size: 13px; color: var(--text-subtle); }

.table-toolbar {
    padding: 16px 22px; display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.table-search {
    flex: 1; max-width: 320px; height: 36px; padding: 0 13px;
    border: 1px solid var(--border-strong); border-radius: 9px;
    font-size: 13px; color: var(--navy); outline: none; background: var(--surface-muted);
}
.table-search:focus { border-color: var(--blue-soft); background: var(--surface); }
.table-toolbar__count { margin-left: auto; font-size: 12px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.chip-group { display: flex; gap: 6px; }
.chip {
    height: 30px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: transparent;
    color: var(--text-muted); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: var(--blue-soft); color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: var(--surface); font-weight: 600; }

.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; }
.pill--indexed { background: var(--active-bg); color: var(--blue); }
.pill--indexed .pill__dot { background: var(--blue); }
.pill--not-indexed { background: var(--row-border); color: var(--text-muted); }
.pill--not-indexed .pill__dot { background: var(--text-ghost); }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 22px; }
.pagination__button {
    height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px;
    background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--text-secondary); cursor: pointer;
}
.pagination__button:disabled { opacity: 0.45; cursor: default; }
.pagination__status { font-size: 12px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }

/* Indexing */
.index-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.index-card { padding: 20px 22px; }
.index-donut { display: flex; align-items: center; gap: 22px; margin-top: 18px; }
.index-donut svg { display: block; flex: 0 0 118px; }
.index-donut__legend { display: flex; flex-direction: column; gap: 12px; }
.index-donut__ratio { display: flex; flex-direction: column; gap: 2px; }
.index-donut__value { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.index-donut__caption { font-size: 11.5px; color: var(--text-subtle); }
.index-donut__rows { display: flex; flex-direction: column; gap: 5px; }
.index-legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.index-legend__marker { width: 8px; height: 8px; border-radius: 2px; }
.reasons { display: flex; flex-direction: column; gap: 14px; }
.reason { display: flex; align-items: center; gap: 16px; }
.reason__label {
    flex: 1 1 auto; min-width: 150px; font-size: 13px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reason__bar {
    flex: 0 1 190px; min-width: 60px; height: 6px; border-radius: 999px;
    background: #F0F2F8; display: block; overflow: hidden;
}
.reason__fill { display: block; height: 6px; border-radius: 999px; }
.reason__count { flex: 0 0 46px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Empty state */
.empty-state { padding: 52px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state__title { margin: 0; font-size: 16px; font-weight: 600; }
.empty-state__body { margin: 0; font-size: 13px; color: var(--text-subtle); max-width: 420px; }
.empty-state__action {
    margin-top: 8px; height: 36px; display: inline-flex; align-items: center; padding: 0 16px;
    background: var(--blue); color: var(--surface); border-radius: 9px; font-size: 13px; font-weight: 600;
}
.empty-state__action:hover { background: var(--navy); color: var(--surface); }

/* Forms and auth */
.form-page { max-width: 460px; margin: 0 auto; padding: 64px 24px; display: flex; flex-direction: column; gap: 18px; }
.form-card { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-input {
    height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px;
    background: var(--surface-muted); font-size: 13px; color: var(--navy); outline: none;
}
.form-input:focus { border-color: var(--blue-soft); background: var(--surface); }
.form-input--color { padding: 4px; height: 38px; }
.form-error { font-size: 12px; color: var(--negative); }
.form-submit {
    height: 38px; border: 0; border-radius: 9px; background: var(--blue); color: var(--surface);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.form-submit:hover { background: var(--navy); }
.form-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.form-subtitle { margin: 0; font-size: 13px; color: var(--text-subtle); }

@media (max-width: 1180px) {
    .index-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .sidebar { display: none; }
    .header, .content { padding-left: 20px; padding-right: 20px; }
    .site-hero { flex-wrap: wrap; }
    .site-hero__stats { margin-left: 0; gap: 20px; }
}

/* Connections and administration */
.notice--success { background: var(--positive-bg); color: var(--positive); }
.connection-card, .admin-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.connection-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.connection-row .form-field { flex: 1 1 280px; }
.connection-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill {
    display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
}
.status-pill--ok { background: var(--active-bg); color: var(--blue); }
.status-pill--idle { background: var(--row-border); color: var(--text-muted); }
.button-ghost {
    height: 34px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 9px;
    background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; display: inline-flex; align-items: center;
}
.button-ghost:hover { border-color: var(--blue-soft); color: var(--blue); }
.button-danger {
    height: 34px; padding: 0 13px; border: 1px solid #F0D6D7; border-radius: 9px;
    background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--negative); cursor: pointer;
}
.button-danger:hover { background: var(--negative-bg); }
.form-submit--inline { align-self: flex-start; padding: 0 16px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.notice__action.is-disabled { pointer-events: none; opacity: 0.5; }

.admin-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.table-row--admin { grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.4fr) 90px 190px; min-width: 820px; }
.admin-name { display: block; font-size: 13px; font-weight: 600; }
.admin-sub { display: block; font-size: 11.5px; color: var(--text-subtle); }
.admin-actions { display: flex; gap: 8px; justify-content: flex-end; }
.member-list { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
    background: var(--active-bg); color: var(--blue); font-size: 11.5px; font-weight: 600;
}
.member-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; }
.admin-logo { display: flex; align-items: center; gap: 12px; }
.admin-logo img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.connection-card .notice__action { align-self: flex-start; }

/* Site creation */
.swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--border-strong);
}
.swatch.is-active { border-color: var(--surface); box-shadow: 0 0 0 2px var(--navy); }
.swatch-input { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.site-preview { display: flex; align-items: center; gap: 14px; }
.site-preview__label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.site-preview .site-item { background: var(--canvas); padding: 8px 12px; }
.menu__item--link { text-decoration: none; }

/* Impersonation */
.impersonation-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 10px 20px; background: var(--navy); color: var(--blue-light);
    font-size: 12.5px; font-weight: 600;
}
.impersonation-bar__action {
    color: var(--surface); text-decoration: underline; text-underline-offset: 2px;
}
.impersonation-bar__action:hover { color: var(--blue-light); }

/* Sidebar site groups */
.site-group { border-radius: 9px; }
.site-group > summary { list-style: none; }
.site-group > summary::-webkit-details-marker { display: none; }
.site-group[open] > summary { background: var(--canvas); }
.site-group[open] > summary.is-active { background: var(--active-bg); }
.site-item__warning {
    width: 15px; height: 15px; flex: 0 0 15px; border-radius: 50%;
    background: var(--negative-bg); color: var(--negative);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
}
.site-sub {
    display: block; padding: 7px 12px 7px 32px; border-radius: 8px;
    font-size: 12.5px; color: var(--text-subtle);
}
.site-sub:hover { background: var(--canvas); color: var(--navy); }
.site-sub.is-active { color: var(--blue); font-weight: 600; }
.notice--soft { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.notice__link { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; }

/* Searchable property picker */
.picker { position: relative; }
.picker__trigger {
    width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px;
    padding: 7px 12px; background: var(--surface-muted);
    border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; text-align: left;
}
.picker__trigger:hover { border-color: var(--blue-soft); }
.picker__trigger.is-open { border-color: var(--blue-soft); background: var(--surface); }
.picker__value { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.picker__label { font-size: 13px; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__detail { font-size: 11.5px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__placeholder { font-size: 13px; color: var(--text-subtle); }

.picker__panel {
    position: absolute; left: 0; right: 0; top: 46px; z-index: 25;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
    box-shadow: 0 16px 40px -12px rgba(9, 21, 64, 0.22); overflow: hidden;
}
.picker__search {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-bottom: 1px solid var(--border-soft);
}
.picker__input {
    flex: 1 1 auto; height: 34px; padding: 0 11px;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: var(--surface-muted); font-size: 13px; color: var(--navy); outline: none;
}
.picker__input:focus { border-color: var(--blue-soft); background: var(--surface); }
.picker__count { flex: 0 0 auto; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.picker__list { max-height: 260px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.picker__option {
    display: flex; flex-direction: column; gap: 1px; width: 100%;
    padding: 8px 11px; border: 0; border-radius: 8px; background: transparent;
    text-align: left; cursor: pointer;
}
.picker__option:hover { background: var(--canvas); }
.picker__option.is-active { background: var(--active-bg); }
.picker__option.is-active .picker__label { color: var(--blue); }
.picker__empty { margin: 0; padding: 22px 12px; text-align: center; font-size: 12.5px; color: var(--text-subtle); }
.picker__clear {
    width: 100%; padding: 9px 11px; border: 0; border-top: 1px solid var(--border-soft);
    background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.picker__clear:hover { color: var(--negative); background: var(--negative-bg); }
.picker__trigger .chevron { flex: 0 0 auto; font-size: 12px; color: var(--blue-soft); line-height: 1; }
.picker__trigger.is-open .chevron { color: var(--blue); transform: rotate(180deg); }
.pill--unknown { background: var(--row-border); color: var(--text-faint); }
.pill--unknown .pill__dot { background: var(--text-ghost); }

/* Chart axis and hover readout */
.chart__yaxis { position: relative; flex: 0 0 46px; height: 200px; }
.chart__tick {
    position: absolute; right: 0; transform: translateY(-50%);
    font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chart__plot { position: relative; flex: 1 1 auto; min-width: 0; }

.chart__cursor { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; }
.chart__cursor-line { position: absolute; top: 0; height: 200px; border-left: 1px dashed #C6CEEA; }
.chart__cursor-dot {
    position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--blue);
}

.chart__tooltip {
    position: absolute; z-index: 6; transform: translate(12px, -50%);
    min-width: 132px; padding: 9px 11px; pointer-events: none;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: 0 12px 28px -10px rgba(9, 21, 64, 0.28);
    display: flex; flex-direction: column; gap: 3px;
}
.chart__tooltip.is-flipped { transform: translate(-100%, -50%) translateX(-12px); }
.chart__tooltip-date { font-size: 11px; font-weight: 600; color: var(--text-subtle); }
.chart__tooltip-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--text-muted); }
.chart__tooltip-row b { font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }
.chart__tooltip-row > span { display: inline-flex; align-items: center; gap: 6px; }
.chart__tooltip-swatch { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 7px; }
.chart__cursor-dot[hidden] { display: none; }
.legend--sites { flex-wrap: wrap; row-gap: 6px; margin: -8px 0 14px; }

/* Chart annotations */
.chart__note {
    position: absolute; top: 0; height: 200px; width: 18px; margin-left: -9px;
    padding: 0; border: 0; background: transparent; cursor: pointer; z-index: 5;
}
.chart__note-line {
    position: absolute; left: 50%; top: 0; bottom: 0; width: 0;
    border-left: 1px dashed #A4363B; opacity: 0.55;
}
.chart__note-flag {
    position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 4px; max-width: 200px;
    height: 18px; padding: 0 6px; border-radius: 5px;
    background: #A4363B; color: var(--surface);
    font-size: 10px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.chart__note-flag-text { overflow: hidden; text-overflow: ellipsis; }
.chart__note-flag-count { font-weight: 700; opacity: 0.75; }
.chart__note--start .chart__note-flag { transform: translateX(-7px); }
.chart__note--end .chart__note-flag { transform: translateX(-100%) translateX(7px); }
.chart__note:hover, .chart__note.is-open { z-index: 7; }
.chart__note:hover .chart__note-flag, .chart__note.is-open .chart__note-flag { filter: brightness(0.82); }
.chart__note:hover .chart__note-line, .chart__note.is-open .chart__note-line { opacity: 1; }

.chart__note-panel {
    position: absolute; top: 14px; z-index: 8; width: 240px;
    transform: translateX(10px);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: 0 12px 28px -10px rgba(9, 21, 64, 0.28);
    padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.chart__note-panel.is-flipped { transform: translateX(-100%) translateX(-10px); }
.chart__note-date { font-size: 11px; font-weight: 600; color: var(--text-subtle); }
.chart__note-item { display: flex; flex-direction: column; gap: 2px; }
.chart__note-title { font-size: 13px; font-weight: 600; color: var(--navy); }
.chart__note-meta { font-size: 11px; color: var(--text-faint); }
.chart__note-text { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.chart__note-link { font-size: 11.5px; font-weight: 600; color: var(--blue); text-decoration: none; }
.chart__note-link:hover { text-decoration: underline; }
/* A general note is lighter than any site note. */
.chart__note--general .chart__note-line { opacity: 0.4; }
.chart__note--general .chart__note-flag { color: var(--navy); font-weight: 500; }
.chart__note-item.is-general .chart__note-title { color: var(--text-muted); }
.note-tag {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
    background: var(--canvas); color: var(--text-subtle);
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em; vertical-align: middle;
}

/* Notes */
.form-input--area { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.note-row {
    display: grid; grid-template-columns: 150px 1fr 170px; gap: 16px; align-items: start;
    padding: 14px 22px; border-bottom: 1px solid var(--row-border);
}
.note-row:hover { background: var(--surface-muted); }
.note-row__date { display: flex; flex-direction: column; gap: 1px; }
.note-row__day { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.note-row__time { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }
.note-row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.note-row__title { font-size: 13.5px; font-weight: 600; }
.note-row__text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.note-row__author { font-size: 11px; color: var(--text-faint); }
.note-row__actions { display: flex; gap: 8px; justify-content: flex-end; }
.chart__note-panel[hidden], .chart__tooltip[hidden], .chart__cursor[hidden], .menu[hidden] { display: none; }

/* Dialogs */
.dialog { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.dialog[hidden] { display: none; }
.dialog__backdrop { position: absolute; inset: 0; background: rgba(9, 21, 64, 0.32); }
.dialog__panel {
    position: relative; width: min(460px, 100%); max-height: 88vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px;
    box-shadow: 0 26px 60px -20px rgba(9, 21, 64, 0.45); padding: 20px 22px 18px;
    display: flex; flex-direction: column; gap: 18px;
}
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.button-primary {
    height: 34px; padding: 0 14px; border: 0; border-radius: 9px;
    background: var(--blue); color: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.button-primary:hover { background: var(--navy); }

/* Workspace settings */
.workspace-preview { display: flex; align-items: center; gap: 10px; }
.workspace-preview__badge {
    width: 26px; height: 26px; border-radius: 7px; color: var(--surface);
    display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}
.workspace-preview__name { font-size: 13px; font-weight: 600; color: var(--navy); }
.order-row {
    display: grid; grid-template-columns: 26px 30px 1fr auto; gap: 12px; align-items: center;
    padding: 12px 22px; border-bottom: 1px solid var(--row-border); background: var(--surface);
}
.order-row.is-dragging { opacity: 0.45; }
.order-row__handle {
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent;
    color: var(--text-ghost); font-size: 14px; line-height: 1; cursor: grab;
}
.order-row__handle:hover:not(:disabled) { background: var(--canvas); color: var(--text-muted); }
.order-row__handle:active:not(:disabled) { cursor: grabbing; }
.order-row__handle:disabled { opacity: 0.3; cursor: default; }
.order-row:hover { background: var(--surface-muted); }
.order-row__position { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.order-row__site { display: flex; align-items: center; gap: 10px; min-width: 0; }
.order-row__name { font-size: 13.5px; font-weight: 600; color: var(--navy); text-decoration: none; }
.order-row__name:hover { color: var(--blue); }
.order-row__url { font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row__actions { display: flex; align-items: center; gap: 6px; }
.icon-button {
    width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 8px;
    background: var(--surface); color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer;
}
.icon-button:hover:not(:disabled) { border-color: var(--blue-soft); color: var(--blue); }
.icon-button:disabled { opacity: 0.35; cursor: default; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs__item {
    padding: 9px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
    font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.tabs__item:hover { color: var(--navy); }
.tabs__item.is-active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }

/* Workspace picker ------------------------------------------------------- */
.picker { max-width: 720px; margin: 0 auto; padding: 64px 24px; display: flex; flex-direction: column; gap: 20px; }
.picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.picker__card {
    display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.picker__card:hover { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(9, 21, 64, 0.08); }
.picker__badge {
    display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    margin-bottom: 6px; border-radius: 9px; color: var(--surface); font-size: 12.5px; font-weight: 600;
}
.picker__name { font-size: 14.5px; font-weight: 600; color: var(--navy); }
.picker__meta { font-size: 12.5px; color: var(--text-muted); }
.picker__sign-out { display: flex; justify-content: center; }
.picker__sign-out-button {
    border: 0; background: none; padding: 4px; font-size: 12.5px; color: var(--text-muted);
    cursor: pointer; font-family: inherit;
}
.picker__sign-out-button:hover { color: var(--navy); text-decoration: underline; }

/* Demographics ----------------------------------------------------------- */
.audience-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.audience-card { padding: 18px 18px 12px; }
.audience-row {
    display: grid; grid-template-columns: 120px 1fr 64px 56px; align-items: center; gap: 10px;
    padding: 5px 0; font-size: 12.5px; color: var(--navy);
}
.audience-row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audience-row__bar { height: 7px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.audience-row__fill { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.audience-row__value { text-align: right; }
.audience-row__share { text-align: right; color: var(--text-muted); }

/* Site state toggles ----------------------------------------------------- */
.toggle { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; cursor: pointer; }
.toggle__input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--blue); cursor: pointer; }
.toggle__text { display: flex; flex-direction: column; gap: 2px; }
.toggle__title { font-size: 13px; font-weight: 500; color: var(--navy); }
.toggle__hint { font-size: 12px; color: var(--text-muted); }
.state-badge {
    padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border-strong);
    background: var(--surface-muted); font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.site-item__state { margin-left: auto; }

/* Core Web Vitals -------------------------------------------------------- */
.vital-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.vital-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.vital-card__name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--navy); }
.vital-card__value { font-size: 20px; font-weight: 700; }
.vital--good { color: #1F7A4C; }
.vital--improve { color: #B8860B; }
.vital--poor { color: var(--negative); }
.vital--none { color: var(--text-muted); }
.vital-card__hint { font-size: 12px; color: var(--text-muted); }
.vital-card__meta { display: flex; align-items: center; gap: 8px; }
.vital-card__source { font-size: 11.5px; color: var(--text-muted); }
.vital-bar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--surface-muted); }
.vital-bar__part--good { background: #1F7A4C; }
.vital-bar__part--improve { background: #E0A32E; }
.vital-bar__part--poor { background: var(--negative); }
.vital-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.pill--good .pill__dot { background: #1F7A4C; }
.pill--improve .pill__dot { background: #E0A32E; }
.pill--poor .pill__dot { background: var(--negative); }
.score-badge {
    display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
    border-radius: 50%; font-size: 15px; font-weight: 700; color: #FFFFFF;
}
.score-badge--good { background: #1F7A4C; }
.score-badge--improve { background: #E0A32E; }
.score-badge--poor { background: var(--negative); }
