.background-white {
    background-color: transparent;
}

#page-background {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 30%),
        color-mix(in srgb, var(--background) 88%, transparent);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-index-dropdown);
    border-bottom: 1px solid color-mix(in srgb, var(--light) 85%, transparent);
    box-shadow: var(--shadow-sm);
    background: color-mix(in srgb, var(--white) 84%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

/* Underline tabs. Nine links no longer fit on one line as pills, and pills gave the active page
   no marker anyway. The tab that is lit is the one you are on -- see the nav loop in base.html. */
.app-nav {
    width: min(1200px, calc(100vw - (2 * var(--space-lg))));
    margin: 0 auto;
    display: flex;
    gap: var(--space-md);

    a {
        /* The active underline has to sit on the header's own bottom border, so the padding
           lives here rather than on .app-nav -- otherwise the two lines never meet. */
        padding: var(--space-sm) 2px;
        border-bottom: 3px solid transparent;
        color: var(--dark);
        font-size: var(--font-size-sm);
        font-weight: 600;
        white-space: nowrap;
        text-decoration: none;
        transition: color var(--transition-fast), border-color var(--transition-fast);

        &:hover {
            color: var(--primary);
            border-bottom-color: color-mix(in srgb, var(--secondary) 40%, transparent);
        }

        &.is-active {
            color: var(--secondary);
            border-bottom-color: var(--secondary);
        }
    }
}

.dashboard-shell {
    width: min(1200px, calc(100vw - (2 * var(--space-lg))));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.dashboard-hero {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--secondary) 28%, transparent), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--white)), color-mix(in srgb, var(--white) 88%, transparent));
}

.dashboard-stamp {
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-controls {
    > main {
        display: flex;
    }
}

.dashboard-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
    width: 100%;

    select {
        width: 100%;
        min-height: 44px;
        padding: 0 var(--space-sm);
        border: 2px solid var(--light);
        border-radius: var(--radius-sm);
        background-color: var(--white);
        color: var(--black);
        font: inherit;
    }
}

.dashboard-button {
    min-height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--primary);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);

    &:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
        background-color: color-mix(in srgb, var(--primary) 88%, var(--secondary));
    }
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.metric-card {
    min-height: 154px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: var(--space-lg);
}

.chart-panel {
    min-height: 320px;

    canvas {
        width: 100%;
        min-height: 240px;
    }
}

.site-status-list,
.recent-check-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.site-status-card,
.recent-check-row {
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    background-color: color-mix(in srgb, var(--background) 92%, var(--white));
}

/* Keep a long URL (e.g. a raw CloudFront host) from stretching the card and
   shoving the status badge off-edge: let the text column shrink and ellipsize. */
.site-status-card > header > div {
    min-width: 0;
}

.site-status-card > header > div > p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-badge {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.text-right {
    text-align: right;
}

/* Billing "Cost by service" table: full-width, hairline row dividers, click-to-sort headers. */
.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.billing-table th,
.billing-table td {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid color-mix(in srgb, var(--light) 55%, transparent);
}

.billing-table thead th {
    text-align: left;
    color: var(--dark);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.billing-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.billing-table th[data-sort]:hover {
    color: var(--secondary);
}

/* Sort-direction caret on the active column. */
.billing-table th[data-sort][data-dir='asc']::after { content: ' \25B2'; }
.billing-table th[data-sort][data-dir='desc']::after { content: ' \25BC'; }

.billing-table tbody tr:hover {
    background: color-mix(in srgb, var(--light) 18%, transparent);
}

/* Shared list-row treatment: tidy inbox-style rows with hover highlight and hairline
   dividers. Used by Meeting Minutes "Recent chats" (with a per-user avatar) and by the
   test/meta/history lists across the Tests, Transfers, Ingestion and Database pages. */
.mm-chat-list {
    display: flex;
    flex-direction: column;
}

.mm-chat-row,
.test-meta-row,
.test-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    margin-inline: calc(-1 * var(--space-xs));
    border-radius: var(--radius-xs);
    color: inherit;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.mm-chat-row + .mm-chat-row,
.test-meta-row + .test-meta-row,
.test-history-row + .test-history-row {
    border-top: 1px solid color-mix(in srgb, var(--light) 65%, transparent);
}

.mm-chat-row:hover,
.test-meta-row:hover,
.test-history-row:hover {
    background: color-mix(in srgb, var(--light) 22%, transparent);
}

/* Let a long left-hand cell shrink/ellipsize instead of shoving the right-hand value off-row. */
.test-meta-row > :first-child,
.test-history-row > :first-child {
    min-width: 0;
}

.mm-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-circle);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: var(--font-size-sm);
    color: var(--background);
}

.mm-chat-mid {
    flex: 1;
    min-width: 0;
}

.mm-chat-title {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.mm-chat-title strong {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-chat-email {
    color: var(--secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-chat-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.mm-chat-when {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
    .mm-chat-when { display: none; }
}

@container (max-width: 900px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-form {
        grid-template-columns: 1fr;
    }
}

@container (max-width: 600px) {
    .app-nav {
        width: min(100vw, calc(100vw - (2 * var(--space-sm))));
        /* Scroll rather than wrap: a wrapped second row would break the underline baseline. */
        overflow-x: auto;
        scrollbar-width: none;
    }

    .dashboard-shell {
        width: min(100vw, calc(100vw - (2 * var(--space-sm))));
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }
}

.tests-shell {
    width: min(1200px, calc(100vw - (2 * var(--space-lg))));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.test-case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.test-case-card {
    min-height: 220px;
}

.test-meta-list,
.test-history-list {
    display: flex;
    flex-direction: column;
}

.test-step-preview-list,
.test-step-progress-list,
.database-prune-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.test-step-preview-row,
.test-step-progress-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    background-color: color-mix(in srgb, var(--background) 84%, var(--white));
}

.test-run-panel {
    min-height: 180px;
}

.dashboard-step-indicator {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-circle);
    margin-top: 2px;
    flex-shrink: 0;
    border: 2px solid var(--light);
    background-color: transparent;

    &.pending {
        border-color: var(--dark);
        background-color: color-mix(in srgb, var(--dark) 10%, transparent);
    }

    &.running {
        border-color: var(--info);
        background-color: color-mix(in srgb, var(--info) 22%, transparent);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 30%, transparent);
        animation: step-pulse 1.1s infinite;
    }

    &.passed {
        border-color: var(--success);
        background-color: var(--success);
    }

    &.failed {
        border-color: var(--error);
        background-color: var(--error);
    }

    &.skipped {
        border-color: var(--dark);
        background-color: color-mix(in srgb, var(--dark) 35%, var(--white));
    }
}

.status-running {
    color: var(--info);
    background-color: color-mix(in srgb, var(--info) 10%, var(--white));
    border: 2px solid var(--info);
}

.status-passed {
    color: var(--success);
    background-color: color-mix(in srgb, var(--success) 10%, var(--white));
    border: 2px solid var(--success);
}

.status-failed {
    color: var(--error);
    background-color: color-mix(in srgb, var(--error) 10%, var(--white));
    border: 2px solid var(--error);
}

.status-skipped {
    color: var(--dark);
    background-color: color-mix(in srgb, var(--dark) 10%, var(--white));
    border: 2px solid var(--dark);
}

.database-prune-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);

    input[type='number'] {
        width: 100%;
        min-height: 44px;
        padding: 0 var(--space-sm);
        border: 2px solid var(--light);
        border-radius: var(--radius-sm);
        background-color: color-mix(in srgb, var(--white) 88%, transparent);
        color: var(--black);
        font: inherit;
    }
}

.transfer-group + .transfer-group,
.transfer-group + .test-history-row,
.test-history-row + .transfer-group {
    border-top: 1px solid color-mix(in srgb, var(--light) 65%, transparent);
}

.transfer-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Kill the built-in disclosure triangle; it cannot be positioned inside a flex row,
       so we draw our own below. list-style covers Chrome/Firefox, the pseudo covers Safari. */
    list-style: none;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    margin-inline: calc(-1 * var(--space-xs));
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background var(--transition-fast);

    &:hover {
        background: color-mix(in srgb, var(--light) 22%, transparent);
    }

    > :first-child {
        min-width: 0;
    }
}

.transfer-group-summary::-webkit-details-marker {
    display: none;
}

.transfer-group-summary > :first-child::before {
    content: '\25B8';
    display: inline-block;
    width: 1em;
    margin-right: var(--space-xs);
    color: var(--secondary);
    transition: transform var(--transition-fast);
}

.transfer-group[open] > .transfer-group-summary > :first-child::before {
    transform: rotate(90deg);
}

.transfer-group-items {
    padding-left: var(--space-md);
    border-left: 2px solid color-mix(in srgb, var(--light) 65%, transparent);
    margin-left: var(--space-xs);
}

.alerts-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    max-width: 26rem;

    label {
        width: 100%;
    }

    input[type='email'] {
        width: 100%;
        min-height: 44px;
        padding: 0 var(--space-sm);
        border: 2px solid var(--light);
        border-radius: var(--radius-sm);
        background-color: var(--white);
        color: var(--black);
        font: inherit;
        transition: border-color var(--transition-fast);

        &::placeholder {
            color: color-mix(in srgb, var(--black) 45%, transparent);
        }

        &:focus-visible {
            outline: none;
            border-color: var(--primary);
        }

        &:invalid:not(:placeholder-shown) {
            border-color: var(--error, var(--secondary));
        }
    }
}

.alerts-prefs label {
    cursor: pointer;
}

.alerts-prefs input[type='checkbox'] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

@keyframes step-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 32%, transparent);
    }
    70% {
        transform: scale(1.06);
        box-shadow: 0 0 0 10px color-mix(in srgb, var(--info) 0%, transparent);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 0%, transparent);
    }
}

@container (max-width: 900px) {
    .test-case-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   Analytics page. A plain flex column rather than .card, because these panels are a
   <header> followed by loose children, not the header/main/footer grid .card expects.
   --------------------------------------------------------------------------- */
.analytics-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.analytics-lede {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--secondary) 28%, transparent), transparent 32%),
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--white)), color-mix(in srgb, var(--white) 88%, transparent));
}

/* Site picker and range tabs share one row and one baseline. */
.analytics-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.analytics-site {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: var(--space-xs);

    > span {
        font-size: var(--font-size-xs);
        font-weight: 600;
        color: var(--dark);
        text-transform: uppercase;
        letter-spacing: 0.07em;
    }

    select {
        min-height: 38px;
        padding: 0 var(--space-sm);
        border: 2px solid color-mix(in srgb, var(--primary) 22%, transparent);
        border-radius: var(--radius-sm);
        background-color: var(--white);
        color: var(--black);
        font: inherit;
        font-size: var(--font-size-sm);
        font-weight: 600;
    }
}

.analytics-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-left: auto;

    button {
        /* -1px pulls the underline onto the control row's own border, same trick as .app-nav. */
        margin-bottom: -1px;
        padding: 0 2px var(--space-xs);
        border: 0;
        border-bottom: 3px solid transparent;
        background: transparent;
        color: var(--dark);
        font: inherit;
        font-size: var(--font-size-sm);
        font-weight: 600;
        cursor: pointer;
        transition: color var(--transition-fast), border-color var(--transition-fast);

        &:hover { color: var(--primary); }

        &[aria-pressed="true"] {
            color: var(--secondary);
            border-bottom-color: var(--secondary);
        }
    }
}

.analytics-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.analytics-big {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: clamp(56px, 7vw, 104px);
    line-height: 0.95;
    color: var(--primary);
}

.analytics-rule {
    width: 1px;
    align-self: stretch;
    background-color: color-mix(in srgb, var(--primary) 18%, transparent);
}

.analytics-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.analytics-mid {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: var(--header-size-md);
    line-height: 1;
    color: var(--primary);
}

/* Change vs the previous period. The title attribute carries what it is actually being
   compared against -- a bare percentage with no stated baseline invites a wrong reading. */
.analytics-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-family: 'Poppins', sans-serif;
    font-size: var(--font-size-xs);
    font-weight: 700;
    white-space: nowrap;
    cursor: help;

    /* An explicit display rule outranks the UA sheet's [hidden], so restate it here --
       'All time' has no previous period and must render nothing at all. */
    &[hidden] { display: none; }

    &.small {
        margin-bottom: 0;
        padding: 3px 9px;
        font-size: 11px;
    }

    &.up    { background-color: color-mix(in srgb, var(--success) 18%, var(--white)); color: light-dark(#12603A, #5FD89E); }
    &.down  { background-color: color-mix(in srgb, var(--error) 15%, var(--white)); color: light-dark(#96151E, #FF6E7B); }
    &.flat  { background-color: color-mix(in srgb, var(--light) 55%, var(--white)); color: var(--dark); }
}

/* Views per day. CSS columns -- no chart library for fourteen bars. */
.analytics-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    margin-top: var(--space-xs);

    > div {
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        cursor: help;
    }

    > div:hover .analytics-bar { filter: brightness(1.15); }
}

.analytics-bar {
    width: 100%;
    /* A zero-view day still draws a sliver, so the day reads as empty rather than missing. */
    min-height: 2px;
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    background: linear-gradient(180deg, var(--secondary), color-mix(in srgb, var(--secondary) 45%, var(--white)));
    transition: filter var(--transition-fast);
}

.analytics-bar-label {
    font-size: 10px;
    color: var(--dark);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.analytics-ribbon {
    display: flex;
    height: 26px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: var(--shadow-sm);

    > span {
        cursor: help;
        transition: filter var(--transition-fast);
        &:hover { filter: brightness(1.15); }
    }
}

.analytics-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);

    > div {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: var(--font-size-xs);
        color: var(--dark);
    }

    i {
        width: 11px;
        height: 11px;
        border-radius: 3px;
        display: inline-block;
        flex-shrink: 0;
    }

    strong { color: var(--primary); }
}

/* Two columns of dotted leaders, scrolling once the list outgrows the panel.
   Grid, not `columns: 2`: a height-capped multicol container overflows sideways into extra
   columns, which silently put half the countries out of reach with no scrollbar to find them. */
.analytics-leaders {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-xl);
    max-height: 22rem;
    overflow-y: auto;
}

.analytics-leader {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 9px 0;
    break-inside: avoid;
    border-bottom: 1px solid color-mix(in srgb, var(--light) 55%, transparent);
}

.analytics-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* An empty span on a baseline-aligned row has no baseline of its own, so the rule
   collapses. align-self takes it out of baseline alignment and gives it a box. */
.analytics-dots {
    flex: 1;
    align-self: center;
    min-height: 1px;
    border-bottom: 2px dotted color-mix(in srgb, var(--dark) 60%, transparent);
}

.analytics-count {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--primary);
}

.analytics-uniq {
    width: 68px;
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--dark);
}

.analytics-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--dark);

    strong {
        font-family: 'Barlow', sans-serif;
        font-size: var(--font-size-lg);
        color: var(--primary);
    }
}

.analytics-privacy {
    margin-left: auto;
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--dark);

    &::before { content: '\1F512'; margin-right: var(--space-xs); }
}

/* Every figure on this page gets compared to another one, so line the digits up. */
.num { font-variant-numeric: tabular-nums; }

@container (max-width: 800px) {
    .analytics-leaders { grid-template-columns: minmax(0, 1fr); }
    .analytics-rule { display: none; }
    .analytics-tabs { margin-left: 0; }
    .analytics-privacy { margin-left: 0; }
}
/* ---------------------------------------------------------------------------------------------
   AutoCarbon tab (/autocarbon). .theme-carbon swaps the accent tokens to AutoCarbon's own greens
   (IAOB-carbon-demo/app/static/styles.css: --primary #205F4B, --accent #4F8F73) for that page's
   <main> only, so the shared nav stays IAOB blue.
   --------------------------------------------------------------------------------------------- */
.theme-carbon {
    --primary:   light-dark(#205F4B, #8FD0B4);
    --secondary: light-dark(#4F8F73, #7FC3A3);
}

.theme-carbon .analytics-privacy::before { content: none; } /* no emoji on this page */
.ac-section-label { margin: var(--space-xs) 0 calc(-1 * var(--space-xs)); }
.ac-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

/* Views per day, with a y axis. The plot is a fixed 180px and the ticks sit on its gridlines;
   bar colours come from app/utils/carbon.py:bar_colour. */
.ac-chart {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 180px auto;
    column-gap: 10px;
    row-gap: 6px;
    margin-top: var(--space-sm);
    padding-top: 8px; /* room for the top tick label */
}
.ac-yaxis { position: relative; min-width: 28px; }
.ac-yaxis span {
    position: absolute;
    right: 0;
    transform: translateY(50%);
    font-size: 11px;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
}
.ac-plot {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    border-left: 1px solid color-mix(in srgb, var(--dark) 40%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--dark) 40%, transparent);

    .grid {
        position: absolute;
        left: 0;
        right: 0;
        border-top: 1px dashed color-mix(in srgb, var(--dark) 25%, transparent);
        pointer-events: none;
    }
    .col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: help; position: relative; z-index: 1; }
    .bar { width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; transition: filter var(--transition-fast); }
    .col:hover .bar { filter: brightness(1.15); }
}
.ac-xlabels { display: flex; gap: 6px; }
.ac-xlabels span { flex: 1; text-align: center; font-size: 10px; color: var(--dark); font-variant-numeric: tabular-nums; }
.ac-key { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--dark); }
.ac-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Horizontal count bars (audits by stage, nonconformities). */
.ac-rows { display: flex; flex-direction: column; gap: 10px; margin-top: var(--space-sm); }
.ac-row {
    display: grid;
    grid-template-columns: 150px 1fr 48px;
    align-items: center;
    gap: 12px;
    font-size: var(--font-size-sm);
    strong { text-align: right; font-variant-numeric: tabular-nums; }
}
.ac-track { height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--secondary) 14%, var(--white)); overflow: hidden; }
.ac-fill { height: 100%; border-radius: 6px; background: var(--secondary); }
.ac-fill.done { background: var(--primary); }
.ac-fill.warn { background: var(--warning); }
.ac-fill.bad  { background: var(--error); }
.ac-note { font-size: 13px; color: var(--dark); margin-top: var(--space-sm); }

/* Feedback inbox. */
.ac-type { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.t-bug      { background: color-mix(in srgb, var(--error) 12%, transparent);     color: light-dark(#B51C25, #FF8A94); }
.t-idea     { background: color-mix(in srgb, var(--success) 14%, transparent);   color: light-dark(#1F8A50, #5FD89E); }
.t-question { background: color-mix(in srgb, var(--secondary) 14%, transparent); color: var(--primary); }
.t-other    { background: color-mix(in srgb, var(--dark) 14%, transparent);      color: var(--dark); }
.ac-feed {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);

    th { text-align: left; font-size: 12px; color: var(--dark); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--light); }
    td { padding: 10px 8px; border-bottom: 1px solid color-mix(in srgb, var(--light) 60%, transparent); vertical-align: top; }
    td.msg { max-width: 520px; white-space: pre-wrap; overflow-wrap: anywhere; }
    small { color: var(--dark); display: block; }
}
@media (max-width: 700px) {
    .ac-feed .hide-sm { display: none; }
    .ac-row { grid-template-columns: 110px 1fr 40px; }
    .ac-split { grid-template-columns: 1fr; }
}
