/*
 * Client panel look (docs/ux/layouts/*.html, docs/ux/ux_spec.pl.md §2.3): design tokens, the shell (left menu, top
 * bar) and the components shared by the sections. Loaded with Bootstrap 5.3 from assets/client_panel.js; the logged-in
 * pages (templates/client_panel/layout.html.twig) carry body.cp-app, the pages before the login keep the website theme.
 */
:root {
    --cp-blue: #195ce5;
    --cp-navy: #182a43;
    --cp-text: #1d2d45;
    --cp-muted: #697991;
    --cp-faint: #8290a4;
    --cp-line: #e5eaf3;
    --cp-paper: #fff;
    --cp-bg: #f6f8fc;
    --cp-soft: #eff5ff;
    --cp-green: #14865c;
    --cp-amber: #ac6d11;
    --cp-red: #cf4d5b;
    --cp-shadow: 0 8px 28px rgba(38, 63, 109, .043);
    /* Importance of a change: one colour per level, the same in bars, matrices, legends and badges. */
    --cp-minor: #9ab9ed;
    --cp-medium: #e5a75b;
    --cp-major: #d86a79;
    --cp-minor-soft: #a9c5f5;
    --cp-medium-soft: #f3c989;
    --cp-major-soft: #e6818c;
    --cp-anomaly: #7a5cc4;
    --cp-anomaly-soft: #b9a7e6;
    --cp-sidebar-width: 240px;
    --cp-topbar-height: 62px;
}

body.cp-app {
    margin: 0;
    background: var(--cp-bg);
    color: var(--cp-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    --bs-body-font-size: 14px;
    --bs-body-color: var(--cp-text);
    --bs-link-color-rgb: 25, 92, 229;
    --bs-primary: var(--cp-blue);
    --bs-primary-rgb: 25, 92, 229;
}

.cp-app h1, .cp-app h2, .cp-app h3, .cp-app h4, .cp-app h5, .cp-app h6 { color: var(--cp-text); font-family: inherit; }
.cp-app a { color: var(--cp-blue); text-decoration: none; }
.cp-app a:hover { text-decoration: underline; }
.cp-app button:focus-visible, .cp-app select:focus-visible, .cp-app input:focus-visible, .cp-app a:focus-visible {
    outline: 3px solid #a9c5ff;
    outline-offset: 2px;
}
.cp-app .btn-primary { --bs-btn-bg: var(--cp-blue); --bs-btn-border-color: var(--cp-blue); --bs-btn-hover-bg: #144dc2; --bs-btn-hover-border-color: #144dc2; }
.cp-app .btn-outline-primary { --bs-btn-color: var(--cp-blue); --bs-btn-border-color: #cfdcf0; --bs-btn-hover-bg: var(--cp-blue); --bs-btn-hover-border-color: var(--cp-blue); }
.cp-app .text-primary { color: var(--cp-blue) !important; }
.cp-app .text-secondary { color: var(--cp-muted) !important; }

/* Shell: left menu, top bar, content. */
.cp-shell { display: grid; grid-template-columns: var(--cp-sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.cp-sidebar { background: #fff; border-right: 1px solid var(--cp-line); }
@media (min-width: 992px) {
    .cp-sidebar { position: sticky; top: 0; height: 100vh; z-index: 5; }
    .cp-sidebar .offcanvas-body { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .cp-shell { grid-template-columns: minmax(0, 1fr); }
    .cp-sidebar { width: min(300px, 86vw) !important; }
}
.cp-logo { display: flex; align-items: center; gap: 7px; padding: 18px 14px 14px 18px; color: #142f61; text-decoration: none; }
.cp-app .cp-logo:hover { text-decoration: none; }
.cp-logo img { height: 24px; width: auto; flex-shrink: 0; }
.cp-logo-name { font-size: 14px; font-weight: 790; letter-spacing: -.45px; white-space: nowrap; }
.cp-logo .cp-beta { margin-left: auto; }
.cp-beta { padding: 2px 5px; border-radius: 4px; background: #e9f1ff; color: #2463d1; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cp-nav { list-style: none; margin: 0; padding: 6px 12px 20px; width: 100%; }
.cp-nav-divider { border-top: 1px solid #e8edf5; margin: 9px 10px; }
.cp-nav a { display: flex; align-items: center; gap: 10px; min-height: 37px; padding: 9px 13px; margin-bottom: 2px; border-radius: 9px;
    color: #53647d; font-size: 12.5px; font-weight: 610; text-decoration: none; }
.cp-nav a i { width: 19px; text-align: center; font-size: 14px; color: #8090a8; }
.cp-app .cp-nav a:hover { background: #f5f7fb; text-decoration: none; }
.cp-app .cp-nav a.active { background: #e9f1ff; color: #1b5bd5; font-weight: 780; }
.cp-nav a.active i { color: var(--cp-blue); }
.cp-nav a.is-planned:not(.active) { opacity: .55; }
.cp-nav .cp-nav-badge { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #95a1b3; }
.cp-nav .cp-nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--cp-blue); color: #fff; font-size: 10.5px; font-weight: 700; text-align: center; }
.cp-nav-planned-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 13px; border: 0; border-radius: 9px;
    background: none; color: #95a1b3; font-size: 12.5px; font-weight: 610; text-align: left; }
.cp-nav-planned-toggle i:first-child { width: 19px; text-align: center; }
.cp-nav-planned-toggle:not(.collapsed) .fa-chevron-down { transform: rotate(180deg); }

.cp-stage { min-width: 0; display: flex; flex-direction: column; }
.cp-topbar { position: relative; z-index: 4; display: flex; align-items: center; gap: 12px; min-height: var(--cp-topbar-height);
    padding: 8px 29px; background: #fff; border-bottom: 1px solid var(--cp-line); }
.cp-breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: #78879b; }
.cp-breadcrumb .cp-breadcrumb-sep { color: #bbc6d7; }
.cp-breadcrumb strong { color: #46607f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 13px; font-size: 12px; }
.cp-menu-toggle { border: 1px solid #dfe6f2; background: #fff; color: #344461; width: 36px; height: 36px; border-radius: 8px; font-size: 15px; }
.cp-topbar-logo img { height: 26px; }
.cp-market-toggle, .cp-user { border: 1px solid #dfe6f2; background: #fff; color: #344461; border-radius: 8px; padding: 6px 10px;
    font-size: 11.5px; font-weight: 650; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cp-market-toggle:hover, .cp-user:hover { border-color: #b6cffc; }
.cp-market-label { color: #8491a4; font-weight: 500; }
.cp-market .dropdown-item.active, .cp-organization .dropdown-item.active { background: var(--cp-blue); }
.cp-link { color: #344461 !important; font-weight: 650; white-space: nowrap; }
.cp-free-access { color: var(--cp-green); font-weight: 650; white-space: nowrap; }
.cp-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%;
    background: #dce8ff; color: #1657c8; font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.locale-switcher { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; border: 1px solid #dce5f3; background: #fff; }
.locale-switcher a { padding: 3px 8px; border-radius: 6px; color: #69809f; font-size: 11px; font-weight: 750; text-transform: uppercase; line-height: 1.4; }
.cp-app .locale-switcher a:hover { text-decoration: none; background: #f5f7fb; }
.cp-app .locale-switcher a.active { background: var(--cp-blue); color: #fff; }
@media (max-width: 991.98px) {
    .cp-topbar { padding: 8px 16px; }
    .cp-breadcrumb { display: none; }
}
@media (max-width: 575.98px) {
    .cp-topbar-right { gap: 6px; }
    .cp-market-label { display: none; }
    .cp-topbar { gap: 6px; padding: 8px 12px; }
    .cp-topbar-logo { display: none; }
    .cp-market-toggle { max-width: 120px; }
    .cp-user { padding: 4px 6px; }
    .cp-user .cp-avatar { margin-right: 0; }
    .cp-user-email { display: none; }
}

.cp-content { width: 100%; max-width: 1520px; margin: 0 auto; padding: 31px 36px 60px; }
@media (max-width: 1200px) { .cp-content { padding: 25px; } }
@media (max-width: 991.98px) { .cp-content { padding: 22px 15px 48px; } }

/* Page head: eyebrow, title, one-line lead, optional note on the right. */
.cp-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 20px; }
.cp-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6b82a5; }
.cp-app .cp-page-title { margin: 5px 0 7px; font-size: 30px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.2; color: var(--cp-text); }
.cp-page-title > i { font-size: .8em; color: var(--cp-blue); }
.cp-app .cp-page-lead { margin: 0; max-width: 820px; color: var(--cp-muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 600px) { .cp-app .cp-page-title { font-size: 24px; } }

/* Cards. */
.cp-panel, .cp-panel-card { background: var(--cp-paper); border: 1px solid var(--cp-line); border-radius: 16px; box-shadow: var(--cp-shadow); }
.cp-panel-card { padding: 21px 22px; }
a.cp-panel-card { color: inherit; transition: border-color .15s, transform .15s; }
.cp-app a.cp-panel-card:hover { border-color: #b9d0f7; transform: translateY(-2px); text-decoration: none; }
.cp-panel-card h2 { color: var(--cp-text); }
.cp-card-title { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.cp-card-sub { margin-top: 3px; font-size: 10.8px; color: #8995a7; }
.cp-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cp-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.cp-section-head h2 { margin: 0 0 5px; font-size: 21px; font-weight: 800; letter-spacing: -.6px; }
.cp-section-head p { margin: 0; font-size: 12px; color: #76869d; }
.cp-micro { font-size: 11.5px; color: #76869b; }
.cp-coming-soon-icon { flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: var(--cp-soft); color: var(--cp-blue); font-size: 22px; }
.cp-stat { font-size: 29px; font-weight: 800; letter-spacing: -1px; color: var(--cp-text); line-height: 1.1; }

/* Pills: small labels; one variant per meaning. */
.cp-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid #dde8f9; border-radius: 999px;
    background: #f5f9ff; color: #587294; font-size: 10.5px; font-weight: 650; line-height: 1.3; white-space: nowrap; }
.cp-pill-light { background: #f3f5f9; border-color: #e6eaf1; color: #66768a; }
.cp-pill-blue { background: #e8f0ff; border-color: #c9dcff; color: #155cdb; }
.cp-pill-green { background: #ecf8f0; border-color: #cfebdc; color: #15794c; }
.cp-pill-red { background: #fdecf0; border-color: #f4cfdb; color: #b04454; }
.cp-pill-amber { background: #fff5e7; border-color: #f5e6c9; color: #93600c; }
.cp-pill-violet { background: #f3effc; border-color: #e0d6f6; color: #5d43a5; }
.cp-severity.cp-severity-major { background: #fdecf0; border-color: #f4cfdb; color: #b04454; }
.cp-severity.cp-severity-medium { background: #fff5e7; border-color: #f5e6c9; color: #93600c; }
.cp-severity.cp-severity-minor { background: #e8f0ff; border-color: #c9dcff; color: #155cdb; }
.cp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: #7d8da3; font-size: 10.5px; }
.cp-legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; vertical-align: baseline; }
.cp-dot-major { background: var(--cp-major); }
.cp-dot-medium { background: var(--cp-medium); }
.cp-dot-minor { background: var(--cp-minor); }
.cp-dot-anomaly { background: var(--cp-anomaly); }

/* Segmented switch (periods, views): links, buttons or Bootstrap tabs in a .cp-seg box. */
.cp-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid #dce5f3; border-radius: 9px; background: #fff; }
.cp-seg > a, .cp-seg > button, .cp-seg > label { border: 0; border-radius: 6px; background: none; padding: 7px 13px; color: #69809f;
    font-size: 11.5px; font-weight: 750; line-height: 1.2; cursor: pointer; }
.cp-app .cp-seg > a:hover { text-decoration: none; background: #f5f7fb; }
.cp-seg > .active, .cp-seg > .is-active, .cp-seg > input:checked + label { background: var(--cp-blue) !important; color: #fff !important; box-shadow: 0 2px 6px #195ce52c; }
.cp-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #e1e8f2; border-radius: 8px; background: #f8faff; }
.cp-tabs > a, .cp-tabs > button { border: 0; border-radius: 6px; background: transparent; padding: 7px 12px; color: #738298; font-size: 11px; font-weight: 740; }
.cp-app .cp-tabs > a:hover { text-decoration: none; color: #1a58c7; }
.cp-tabs > .active { background: #fff; color: #1a58c7; box-shadow: 0 1px 4px #5978a014; }

/* Filters (BrandSelector, DateRangeSelector and the like inside a .cp-filters form). */
.cp-filters .cp-filter-label, .cp-filter-label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--cp-faint); }
.cp-filters .btn-check + .btn { border: 1px solid #dbe3ef; border-radius: 999px; background: #fff; color: #536987; padding: 6px 11px; font-size: 11px; font-weight: 700; }
.cp-filters .btn-check + .btn:hover { border-color: #b6cffc; background: #f5f9ff; color: #165cda; }
.cp-filters .btn-check:checked + .btn { background: #eaf2ff; border-color: #b6cffc; color: #165cda; }
.cp-filters .btn-check:checked + .btn::before { content: '✓ '; font-weight: 800; }
.cp-filters .btn-check:focus-visible + .btn { outline: 3px solid #a9c5ff; outline-offset: 2px; box-shadow: none; }
.cp-filters .btn-group { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid #dce5f3; border-radius: 9px; background: #fff; }
.cp-filters .btn-group > .btn-check + .btn { border: 0; border-radius: 6px !important; margin: 0 !important; padding: 7px 13px; color: #69809f; font-size: 11.5px; font-weight: 750; }
.cp-filters .btn-group > .btn-check:checked + .btn { background: var(--cp-blue); color: #fff; box-shadow: 0 2px 6px #195ce52c; }
.cp-filters .btn-group > .btn-check:checked + .btn::before { content: none; }
.cp-filters .btn-link { color: var(--cp-blue); font-size: 11px; text-decoration: underline; text-underline-offset: 2px; }
.cp-filters .form-control, .cp-filters .form-select { min-height: 34px; border-color: #dce4f0; border-radius: 7px; color: #435b7e; font-size: 11.5px; }
.cp-filters output { font-weight: 600; color: var(--cp-text); }
.cp-filter-divider { margin-top: 17px; padding-top: 17px; border-top: 1px solid #edf1f7; }
/* Filters of the sections built from page snapshots (technology, SEO). */
.cp-snapshot-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.cp-snapshot-grid .form-select { min-width: 210px; font-size: 12.5px; }
.cp-snapshot-grid .form-control { font-size: 12.5px; }
/* Legend of the activity matrix's colours. */
.cp-matrix-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; color: #66768a; }
.cp-matrix-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; background: #edf1f7; }
.cp-matrix-legend i.is-minor { background: var(--cp-minor-soft); }
.cp-matrix-legend i.is-medium { background: var(--cp-medium-soft); }
.cp-matrix-legend i.is-major { background: var(--cp-major-soft); }
.cp-matrix-legend i.is-anomaly { background: linear-gradient(135deg, var(--cp-anomaly) 0 45%, var(--cp-anomaly-soft) 45%); }
.cp-scope-note { max-width: 300px; margin-left: auto; color: #7283a0; font-size: 11px; line-height: 1.5; }
.cp-info-dot { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 3px; border-radius: 50%;
    background: #eaf2ff; color: #6984ab; font-size: 11px; font-weight: 800; vertical-align: middle; }

/* KPI tiles. */
.cp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cp-metric { display: block; min-height: 111px; padding: 19px 20px; color: inherit; transition: transform .15s, border-color .15s; }
.cp-app a.cp-metric:hover { transform: translateY(-2px); border-color: #b9d0f7; text-decoration: none; }
.cp-metric-name { font-size: 11.5px; font-weight: 750; color: #5e6f86; }
.cp-metric-number { margin: 4px 0; font-size: 29px; font-weight: 800; letter-spacing: -1px; color: var(--cp-text); }
.cp-metric-foot { font-size: 10.5px; color: #8290a6; }
.cp-metric-foot span { color: #336dc5; font-weight: 700; }
@media (max-width: 991.98px) { .cp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Horizontal bars: a ranking split by importance, a plain count per row. */
.cp-bar { display: flex; height: 11px; border-radius: 99px; background: #f0f3f8; overflow: hidden; }
.cp-bar > span { display: block; height: 100%; }
.cp-bar-major { background: var(--cp-major); }
.cp-bar-medium { background: var(--cp-medium); }
.cp-bar-minor { background: var(--cp-minor); }
.cp-bar-plain { height: 10px; background: #edf3fc; }
.cp-bar-plain > span { background: #85afea; border-radius: 99px; }

/* Brand × day matrix (ActivityMatrix): one cell per day, coloured by its most important change. */
.cp-matrix-scroll { overflow-x: auto; padding-bottom: 8px; }
.cp-matrix-row { display: grid; grid-template-columns: 120px repeat(var(--cp-cols), minmax(12px, 1fr)); gap: 4px; min-width: 660px; align-items: center; margin-bottom: 6px; }
.cp-matrix-head { font-size: 9.5px; color: #9aa6b6; text-align: center; }
.cp-matrix-brand { overflow: hidden; font-size: 11px; font-weight: 700; color: #536985; white-space: nowrap; text-overflow: ellipsis; }
.cp-matrix-cell { display: block; height: 17px; padding: 0; border: 1px solid transparent; border-radius: 3px; background: #edf1f7; }
.cp-matrix-cell.is-minor { background: var(--cp-minor-soft); }
.cp-matrix-cell.is-medium { background: var(--cp-medium-soft); }
.cp-matrix-cell.is-major { background: var(--cp-major-soft); }
/* A day with an anomaly: a violet corner over the changes' colour, the whole cell violet without changes. */
.cp-matrix-cell.has-anomaly { background-image: linear-gradient(135deg, var(--cp-anomaly) 0 45%, transparent 45%); }
.cp-matrix-cell.has-anomaly:not(.is-minor, .is-medium, .is-major) { background-color: var(--cp-anomaly-soft); }
a.cp-matrix-cell { transition: transform .1s; }
a.cp-matrix-cell:hover, a.cp-matrix-cell:focus-visible { border-color: #335fb8; transform: scale(1.15); }
.cp-matrix-cell.is-focused { box-shadow: 0 0 0 2px #4076d4 inset; }
.cp-matrix-help { margin-top: 9px; font-size: 10.5px; color: #8a96a9; }

/* Lists of events and changes. */
.cp-event-row { display: grid; grid-template-columns: 74px 105px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 14px 0; border-top: 1px solid #edf1f6; }
.cp-event-date { padding-top: 2px; font-size: 11px; color: #8490a4; }
.cp-event-brand { font-size: 12px; font-weight: 780; }
.cp-event-title { margin-bottom: 5px; font-size: 12.5px; font-weight: 800; letter-spacing: -.1px; }
.cp-event-desc { margin-bottom: 6px; font-size: 11.4px; line-height: 1.55; color: #6f7f93; }
.cp-event-desc p { margin: 0 0 4px; font-size: inherit; line-height: inherit; color: inherit; }
.cp-event-desc .cp-change-details { margin-top: 4px; font-size: inherit; color: inherit; }
.cp-event-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.cp-linkbtn { border: 0; background: none; padding: 3px 0; color: #2064d9; font-size: 11px; font-weight: 760; white-space: nowrap; }
.cp-event-empty { margin-top: 15px; padding: 24px; border-top: 1px solid #e9eef6; color: #8290a5; text-align: center; }
@media (max-width: 991.98px) {
    .cp-event-row { grid-template-columns: 70px minmax(0, 1fr) auto; }
    .cp-event-row .cp-event-brand, .cp-event-row .cp-event-body { grid-column: 2; }
    .cp-event-row .cp-linkbtn { grid-column: 3; grid-row: 1; }
}
@media (max-width: 600px) {
    .cp-event-row { grid-template-columns: 1fr auto; gap: 6px; }
    .cp-event-row .cp-event-date, .cp-event-row .cp-event-brand { grid-column: auto; }
    .cp-event-row .cp-event-body { grid-column: 1 / 3; }
    .cp-event-row .cp-linkbtn { grid-column: 1 / 3; grid-row: auto; justify-self: start; }
}

/* Methodology ("Metodyka"): folded at the end of a section. */
.cp-method { padding: 18px 21px; }
.cp-method summary { cursor: pointer; font-size: 12px; font-weight: 760; color: #516783; }
.cp-method details[open] summary { margin-bottom: 10px; }
.cp-method p, .cp-method li { color: #75869d; font-size: 11.5px; line-height: 1.7; margin-bottom: 6px; }

/* Details drawer (ChangeStoryDrawer): a wide off-canvas on the right, full width on a phone. */
.cp-drawer.offcanvas-end { width: min(790px, 94vw); border-left: 0; box-shadow: -15px 0 50px #10264124; }
@media (max-width: 600px) { .cp-drawer.offcanvas-end { width: 100vw; } }
.cp-drawer .offcanvas-header { padding: 16px 23px; border-bottom: 1px solid #e9eef5; }
.cp-drawer .offcanvas-body { padding: 27px 32px 45px; }
@media (max-width: 600px) { .cp-drawer .offcanvas-body { padding: 20px 17px; } }
.cp-drawer-title { margin: 10px 0; font-size: 24px; font-weight: 800; letter-spacing: -.65px; line-height: 1.27; }
.cp-drawer-sub { color: #6b7d94; font-size: 12px; line-height: 1.65; }
.cp-change-summary { font-size: 13px; line-height: 1.7; color: #455a76; }
.cp-drawer-section { margin-top: 23px; padding-top: 21px; border-top: 1px solid #ecf0f6; }
.cp-drawer-section h3 { margin-bottom: 12px; font-size: 14px; font-weight: 800; }
.cp-drawer-foot { margin-top: 23px; padding: 14px; border-radius: 10px; background: #f7f9fc; color: #728299; font-size: 11.5px; line-height: 1.65; }
.cp-drawer-loading { padding: 40px 0; color: var(--cp-faint); text-align: center; }
.cp-evidence-box { margin-top: 11px; padding: 15px; border: 1px solid #dce7f6; border-radius: 11px; background: #f7faff; font-size: 12.5px; }
.cp-outline-action { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 1px solid #cfdcf0; border-radius: 7px;
    background: #fff; color: #2861c0; font-size: 11.5px; font-weight: 750; }
.cp-app .cp-outline-action:hover { background: #f0f5ff; text-decoration: none; }
.cp-toast { position: fixed; bottom: 24px; left: 50%; z-index: 1090; transform: translateX(-50%); padding: 11px 17px; border-radius: 9px;
    background: #1c2f4a; color: #fff; font-size: 12px; box-shadow: 0 9px 30px #142a4b29; }

/* Existing shared components (_components/*), in the same look. */
.cp-offers-table th, .cp-documents-table th { font-size: 11px; color: var(--cp-faint); font-weight: 700; white-space: nowrap; }
.cp-offers-table td { white-space: nowrap; }
.cp-change-up { color: #c0392b; }
.cp-change-down { color: #1e8449; }
.cp-change-details { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: #3c4466; list-style: disc; }
.cp-external-link { font-size: .78em; margin-left: .35em; color: #8a90a8; opacity: .7; }
.cp-external-link:hover, .cp-external-link:focus { color: var(--cp-blue); opacity: 1; }
.cp-shots { display: flex; gap: 12px; align-items: flex-start; }
.cp-timeline { display: grid; gap: 2px; min-width: 240px; }
.cp-timeline-brand { width: 220px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; }
.cp-timeline-cell { display: inline-block; height: 14px; min-width: 6px; border-radius: 3px; background: #edf1f7; }
.cp-timeline-cell.is-minor { background: var(--cp-minor-soft); }
.cp-timeline-cell.is-medium { background: var(--cp-medium-soft); }
.cp-timeline-cell.is-major { background: var(--cp-major-soft); }
.cp-timeline-legend .cp-timeline-cell { width: 12px; }
.cp-calculator-shot img { display: block; max-width: 260px; max-height: 320px; border: 1px solid var(--cp-line); border-radius: 8px; }
.cp-shot { display: block; border: 1px solid var(--cp-line); border-radius: 8px; overflow: hidden; background: var(--cp-bg); }
.cp-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cp-shot-desktop { flex: 1; aspect-ratio: 16 / 10; }
.cp-shot-mobile { width: 26%; aspect-ratio: 9 / 19; }
.cp-shot-missing { display: flex; align-items: center; justify-content: center; color: #8a90a8; font-size: 13px; text-align: center; padding: 8px; }
.cp-shot-label { font-size: 12px; color: var(--cp-muted); margin-top: 4px; }
.cp-doc-title { max-width: 420px; }

/* Brand monogram (brand catalog and profile). */
.cp-monogram { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #eaf2ff; color: #1857d0; font-size: 13px; font-weight: 800; }
.cp-monogram.is-lg { width: 54px; height: 54px; border-radius: 14px; font-size: 18px; }
.cp-brand-logo { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid #e6ebf2; padding: 3px; }
.cp-brand-logo.is-lg { width: 54px; height: 54px; border-radius: 14px; padding: 5px; }

/* Label · bar · value rows (brand profile, offers) and label · value detail rows (profile, drawers). */
.cp-chart-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 92px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 11.5px; }
.cp-chart-row label { overflow: hidden; color: #536985; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.cp-chart-row strong { text-align: right; white-space: nowrap; }
.cp-chart-row .cp-bar-plain > span { display: block; height: 100%; }
.cp-detail-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid #edf1f6; font-size: 12px; }
.cp-detail-row:first-of-type { border-top: 0; }
.cp-detail-row span { color: #66768a; }
.cp-detail-row strong { text-align: right; font-weight: 750; }

/* Page comparison viewer (pages, a page change; page_compare_controller.js). */
.cp-compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
.cp-compare-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.cp-compare-brand { display: flex; align-items: center; gap: 8px; }
.cp-compare-brand .form-select { min-width: 150px; font-size: 12px; }
.cp-compare-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-compare-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cp-compare-btn { padding: 6px 11px; border: 1px solid #d7e1ef; border-radius: 7px; background: #fff; color: #536987; font-size: 11.5px; font-weight: 700; }
.cp-compare-btn:hover:not(:disabled) { background: #f0f5ff; }
.cp-compare-btn.active { border-color: #b6cffc; background: #eaf2ff; color: #165cda; }
.cp-compare-btn:disabled { opacity: .45; cursor: not-allowed; }
.cp-compare-range { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; color: #66768a; }
.cp-compare-range[hidden], .cp-compare-settings[hidden], [data-page-compare-target][hidden] { display: none !important; }
.cp-compare-single { overflow: hidden; border: 1px solid #dfe7f2; border-radius: 10px; background: #fff; }
.cp-compare-chrome { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border-bottom: 1px solid #e8eef6; background: #f7f9fc; }
.cp-compare-chrome i { width: 7px; height: 7px; border-radius: 50%; background: #d5dde9; }
.cp-compare-chrome span { flex: 1; margin-left: 8px; padding: 3px 10px; border-radius: 6px; background: #fff; color: #7b8aa0; font-size: 10.5px; }
.cp-compare-scroll { max-height: 70vh; overflow: auto; background: #f4f6fb; }
.cp-compare-stack { position: relative; overflow: hidden; cursor: crosshair; }
.cp-compare-stack img { display: block; width: 100%; user-select: none; }
.cp-compare-before { position: absolute; top: 0; left: 0; visibility: hidden; }
.cp-compare-heat { position: absolute; top: 0; left: 0; image-rendering: pixelated; pointer-events: none; }
.cp-compare-zone { position: absolute; padding: 1px 5px; border: 2px solid #165cda; border-radius: 4px; background: #165cda14; color: #165cda; font-size: 10px; font-weight: 800; pointer-events: none; }
.cp-compare-split { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #165cda; pointer-events: none; }
.cp-compare-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp-compare-side .cp-compare-scroll { border: 1px solid #dfe7f2; border-radius: 10px; }
.cp-compare-side img { display: block; width: 100%; }
.cp-compare-caption { margin-bottom: 5px; font-size: 11px; font-weight: 700; color: #66768a; }
.cp-compare-frame.is-phone .cp-compare-single { max-width: 340px; margin: 0 auto; border: 9px solid #1f2a3b; border-radius: 30px; }
.cp-compare-frame.is-phone .cp-compare-chrome { display: none; }
.cp-compare-frame.is-phone .cp-compare-side { max-width: 640px; margin: 0 auto; }
.cp-compare-frame.is-phone .cp-compare-side .cp-compare-scroll { border: 7px solid #1f2a3b; border-radius: 24px; }
.cp-compare-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 10px; font-size: 11px; color: #66768a; }
.cp-compare-settings label { display: flex; align-items: center; gap: 8px; margin: 0; }
.cp-compare-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.cp-compare-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; }
.cp-compare-aside-title { font-size: 13.5px; }
.cp-compare-regions { display: grid; gap: 7px; max-height: 360px; margin-top: 10px; overflow: auto; }
.cp-compare-region { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid #e4ebf5; border-radius: 9px; background: #fff; text-align: left; font-size: 11.5px; }
.cp-compare-region:hover, .cp-compare-region.is-selected { border-color: #b6cffc; background: #f3f7ff; }
.cp-compare-region strong { display: block; color: var(--cp-text); }
.cp-compare-region small { color: #7b8aa0; }
.cp-compare-number { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #eaf2ff; color: #165cda; font-size: 10px; font-weight: 800; }
.cp-compare-detail { margin-top: 10px; padding: 11px 12px; border: 1px solid #e4ebf5; border-radius: 9px; background: #f8faff; font-size: 11.5px; }
.cp-compare-detail p { color: #66768a; }
.cp-compare-overlay { position: fixed; inset: 0; z-index: 1080; display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; background: #fff; }
.cp-compare-overlay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cp-compare-holder { flex: 1; min-height: 0; overflow: auto; }
.cp-compare-overlay .cp-compare-scroll { max-height: calc(100vh - 190px); }
.cp-compare-overlay .cp-compare-full { display: none; }
body.cp-overlay-open { overflow: hidden; }
@media (max-width: 1199.98px) { .cp-compare-grid { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) {
    .cp-compare-actions { margin-left: 0; }
    .cp-compare-side { grid-template-columns: 1fr; }
}

/* Change Story (ux spec §3.2): key values before / after, and the topic's changes as blocks that open. */
.cp-story-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cp-story-fact { padding: 12px 13px; border: 1px solid #dce7f6; border-radius: 10px; background: #f7faff; }
.cp-story-fact-values { margin-top: 5px; font-size: 13.5px; color: #253b61; overflow-wrap: anywhere; }
.cp-story-before { color: #6c778e; }
.cp-story-member { border: 1px solid #e6ecf5; border-radius: 10px; margin-bottom: 9px; background: #fff; }
.cp-story-member > summary { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; cursor: pointer; }
.cp-story-member-title { font-size: 13.5px; font-weight: 700; color: #1d2d4b; }
.cp-story-member-body { padding: 0 13px 13px; font-size: 13px; }
.cp-story-method { font-size: 11px; color: #8592a8; }
.cp-story-link { font-size: 12px; }

/* Anomaly (ux spec §5.3): drawer and own page. */
.cp-anomaly-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cp-anomaly-shot { margin: 0; min-width: 0; }
.cp-anomaly-shot img { display: block; width: 100%; max-height: 420px; object-fit: cover; object-position: top; margin-top: 6px; border: 1px solid #e3e8f1; border-radius: 10px; }
.cp-anomaly-noshot { margin-top: 6px; padding: 28px 12px; border: 1px dashed #d8dfeb; border-radius: 10px; color: #8d99ab; font-size: 12px; text-align: center; }
.cp-anomaly-history { margin: 0; padding-left: 18px; font-size: 12.5px; color: #4d5f78; }
@media (max-width: 575.98px) { .cp-anomaly-pair { grid-template-columns: 1fr; } }

/* Image viewer (_components/lightbox.html.twig, lightbox_controller.js): full screen on a dark background, the bar on
   top, the image fitted to the width and scrolled; zoomed, at its real size. */
.cp-lightbox { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
    background: rgba(9, 18, 33, .97); color: #fff; overflow: hidden; }
.cp-lightbox[open] { display: flex; flex-direction: column; }
.cp-lightbox::backdrop { background: rgba(9, 18, 33, .6); }
.cp-lightbox-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(9, 18, 33, .7); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.cp-lightbox-caption { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-lightbox .cp-lightbox-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; height: 44px; padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; background: rgba(255, 255, 255, .06); color: #fff; font-size: 14px;
    font-weight: 600; text-decoration: none; cursor: pointer; }
.cp-lightbox .cp-lightbox-btn:hover, .cp-lightbox .cp-lightbox-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.cp-lightbox .cp-lightbox-btn[hidden] { display: none; }
.cp-lightbox .cp-lightbox-close { padding: 0; font-size: 20px; }
.cp-lightbox-stage { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 24px; text-align: center; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.cp-lightbox-stage img { display: inline-block; max-width: 100%; height: auto; border-radius: 6px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); cursor: zoom-in; }
.cp-lightbox-stage img.is-zoomed { max-width: none; cursor: zoom-out; }
.cp-lightbox.is-loading .cp-lightbox-stage { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='16' fill='none' stroke='%23ffffff55' stroke-width='4' stroke-dasharray='60 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 20 20' to='360 20 20' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center 30vh no-repeat; }
.cp-lightbox.is-loading .cp-lightbox-stage img { visibility: hidden; }
a[data-action~="lightbox#open"] img { cursor: zoom-in; }
@media (max-width: 575.98px) {
    .cp-lightbox-bar { padding-left: 14px; }
    .cp-lightbox-label { display: none; }
    .cp-lightbox .cp-lightbox-btn { padding: 0; }
    .cp-lightbox-stage { padding: 0 0 env(safe-area-inset-bottom); }
    .cp-lightbox-stage img { border-radius: 0; box-shadow: none; }
}

/* Dashboard: a section still planned is clearly faded, back to full colour on hover. */
.cp-section-tile.is-planned { opacity: .45; filter: grayscale(1); transition: opacity .15s, filter .15s; }
.cp-section-tile.is-planned:hover, .cp-section-tile.is-planned:focus-visible { opacity: .8; filter: none; }
